query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Register the custom post type to store the ads. | public function registerAdsPostType()
{
$post_type = self::POST_TYPE_SLUG;
register_post_type($post_type, [
'label' => __('Ads', 'bam-ads-system'),
'public' => false,
'show_ui' => true,
'show_in_menu' => true,
'supports' => ['title', 'author'],
'register_meta_box_cb' => function($post) {
add_meta_box('bam-ads-meta-box', __('Ads Attributes', 'bam-ads-system'), [$this, 'createMetaBoxCustomFields'], $post_type);
}
]);
} | [
"public static function register_post_type() {\n\t\tregister_post_type( 'drsa_ad', self::arguments() );\n\t}",
"public function register_post_type() {\n\t\t\t\n\t\t\tregister_post_type($this->slug, $this->options);\n\t\t}",
"public function register_post_type() {\n register_post_type($this->postType, $this->args);\n }",
"public function registerCustomPostType()\n {\n if (!post_type_exists($this->slug)) {\n register_post_type($this->slug, $this->arguments);\n }\n }",
"public function register_post_type() {\n\t\tregister_post_type(\n\t\t\t$this->get_name(),\n\t\t\t$this->get_options()\n\t\t);\n\t}",
"public static function register_post_type() {\n static::$_post_args['labels'] = static::$_post_labels;\n register_post_type( static::$_post_type, static::$_post_args );\n }",
"function register_post_type(){\n\t\tadd_action( 'init', array(&$this,'init_register_post_type') );\n\t}",
"public function custom_post_type() {\n register_post_type( 'dynavic', ['public' => true, 'label' => 'Dynavic Pages'] );\n }",
"function register_post_type(){\n\t\tadd_action( 'init', array( $this,'init_register_post_type') );\n\t}",
"public function register()\n {\n $postType = register_post_type($this->name, $this->args);\n }",
"public function registerPostType() {\n // Hooking the method which calls the actual \"register_post_type\" into the init action of wordpress\n add_action('init', array($this, 'configurePostType'));\n }",
"public function register_post_types() {}",
"public function register_post_types() {\n\n }",
"public function register_post_types()\n {\n\n }",
"public function add_post_type_ads () {\r\n $args = array(\r\n 'labels' => $this->create_post_type_labels( 'interads', $this->labels['interads']['singular'], $this->labels['interads']['plural'], $this->labels['interads']['menu'] ),\r\n 'public' => false,\r\n 'publicly_queryable' => true,\r\n 'show_ui' => true, \r\n 'show_in_menu' => true, \r\n 'query_var' => true,\r\n 'rewrite' => array( 'slug' => 'interads', 'with_front' => false, 'feeds' => false, 'pages' => false ),\r\n 'capability_type' => 'post',\r\n 'has_archive' => false, \r\n 'hierarchical' => false,\r\n 'menu_position' => 100, // Below \"Pages\"\r\n 'menu_icon' => esc_url( self::$plugin_url . 'images/icon_interads.png' ), \r\n 'supports' => array( 'title' )\r\n );\r\n\r\n register_post_type( 'interads', $args );\r\n }",
"public function register()\n {\n register_post_type( $this->getName(), $this->getArgs() );\n }",
"public function register_post_types() {\n }",
"public function register_post_types()\n {\n }",
"protected function register_post_types(){ /* NOP - To be overridden by implementing plugin */ }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Formats order number to be Redsys compliant | protected function formatOrderNumber($orderNumber)
{
//Falta comprobar que empieza por 4 numericos y que como mucho tiene 12 de longitud
$length = strlen($orderNumber);
$minLength = 4;
if ($length < $minLength) {
$orderNumber = str_pad($orderNumber, $minLength, '0', STR_PAD_LEFT);
}
return $orderNumber;
} | [
"function get_order_number() {\r\n\t\treturn apply_filters( 'learn_press_get_order_number', '#' . sprintf( \"%'.010d\", $this->id ), $this );\r\n\t}",
"public function getnerate_order_number() {\n\t\t$id = (string) $this->db->select('id')->order_by('id','desc')->limit(1)->get('sale')->row('id') + 1;\n\t\t$num_of_zero = 7 - strlen($id);\n\t\t$order_number = 'SO-';\n\t\tfor ($i=0; $i < $num_of_zero; $i++) { \n\t\t\t$order_number .= '0';\n\t\t}\n\t\t$order_number .= $id;\n\t\treturn $order_number;\n\t}",
"private function formatOrderNumber($year, $prefix, $number, $length, $charFormat){\n return $year . $prefix . str_pad($number, $length, $charFormat, STR_PAD_LEFT);\n }",
"public function format()\n {\n return sprintf('%s-%s-%s', substr($this->number, 0, 2), ltrim(substr($this->number, 2, 6), '0'), substr($this->number, 8));\n }",
"public function getOrderNo()\n {\n $value = $this->get(self::order_no);\n return $value === null ? (string)$value : $value;\n }",
"function formatInvoiceNumber($num, $addon, $year) {\n\t\t$num = $addon . '/' . $year . '/' . $num;\n\t\treturn $num;\n\t}",
"private static function getDeliveryNumber(Order $order)\n {\n //====================================================================//\n // GET COMPUTED INFOS\n $slipNumber = Configuration::get('PS_DELIVERY_PREFIX', SLM::getDefaultLangId(), null, $order->id_shop);\n $slipNumber .= sprintf(\"%06d\", $order->delivery_number);\n\n return $slipNumber;\n }",
"function formatted_number(){\n $phone_number = \"({$this->area_code}) \" . substr_replace($this->number, '-', 3, 0);\n return $phone_number;\n }",
"public function getOrderNumber();",
"function getOrderNumber($orderUid)\t{\r\n\t\treturn substr($this->conf[\"orderNumberPrefix\"],0,10).$orderUid;\r\n\t}",
"function format_accountnumber ($n){\n $y = \"*******\";\n $x = substr($n, -4);\n return $y . $x;\n }",
"public function get_order_number() {\n\t\treturn apply_filters( 'woocommerce_order_number', $this->id, $this );\n\t}",
"public function format()\n {\n if ($this->getDecimals() > 0) {\n $sign = ($this->cents < 0 ? '-' : '');\n $base = pow(10, $this->getDecimals());\n $minor = abs($this->cents) % $base;\n $major = (abs($this->cents) - $minor) / $base;\n\n return sprintf('%s%d.%0'.$this->getDecimals().'d', $sign, $major, $minor);\n } else {\n return sprintf('%d', $this->cents);\n }\n }",
"public static function formatOrderId($orderId, int $padLength = null)\n {\n if (null === $padLength) {\n $padLength = self::ORDER_ID_LENGTH;\n }\n\n return str_pad($orderId, $padLength, '0', STR_PAD_LEFT);\n }",
"function generate_order_number($id,$update=FALSE) {\r\n $order_number = date('ymd').str_pad($id%10000,4,'0',STR_PAD_LEFT);\r\n\r\n if ($update) {\r\n $this->update_transaction($id,array('ordernumber'=>$order_number));\r\n }\r\n\r\n return $order_number; \r\n }",
"public function get_order_number( $order_number, $order ) {\n\n\t\t// maintain the hash?\n\t\t$maybe_hash = $this->get_has_hash_before_order_number() ? _x( '#', 'hash before order number', self::TEXT_DOMAIN ) : '';\n\n\t\t// can't trust $order->order_custom_fields object\n\t\t$order_number_formatted = get_post_meta( $order->id, '_order_number_formatted', true );\n\t\tif ( $order_number_formatted ) {\n\t\t\treturn $maybe_hash . $order_number_formatted;\n\t\t}\n\n\t\t// return a 'draft' order number that will not be saved to the db (this\n\t\t// means that when adding an order from the admin, the order number you\n\t\t// first see may not be the one you end up with, but it's better than the\n\t\t// alternative of showing the underlying post id)\n\t\t$post_status = isset( $order->post_status ) ? $order->post_status : get_post_status( $order->id );\n\t\tif ( 'auto-draft' == $post_status ) {\n\t\t\tglobal $wpdb;\n\t\t\t$order_number_start = get_option( 'woocommerce_order_number_start' );\n\t\t\t$order_number = $wpdb->get_var( $wpdb->prepare( \"\n\t\t\t\tSELECT IF(MAX(CAST(meta_value AS SIGNED)) IS NULL OR MAX(CAST(meta_value AS SIGNED)) < %d, %d, MAX(CAST(meta_value AS SIGNED))+1)\n\t\t\t\tFROM {$wpdb->postmeta}\n\t\t\t\tWHERE meta_key='_order_number'\",\n\t\t\t\t$order_number_start, $order_number_start ) );\n\t\t\treturn $maybe_hash . $this->format_order_number( $order_number, $this->get_order_number_prefix(), $this->get_order_number_suffix(), $this->get_order_number_length() ) . ' (' . __( 'Draft', self::TEXT_DOMAIN ) . ')';\n\t\t}\n\t\treturn $order_number;\n\t}",
"public function getOrderFormular() {\n\t}",
"protected function BestPurchaseOrderNumber() {\n\t$out = $this->OurPurchaseOrderNumber();\n\tif (empty($out)) {\n\t $out = $this->SupplierPurchaseOrderNumber();\n\t if (empty($out)) {\n\t\t$out = 'so '\n\t\t .$this->SupplierOrderNumber()\n\t\t .'ID '.$this->GetKeyValue();\n\t } else {\n\t\t$out = 'spo '.$out;\n\t }\n\t} else {\n\t $out = 'po '.$out;\n\t}\n\treturn $out;\n }",
"public function save_number_format_field() {\n\n\t\tforeach ( [ 'prefix', 'start', 'suffix' ] as $field ) {\n\n\t\t\t$value = sanitize_text_field( Framework\\SV_WC_Helper::get_posted_value( 'woocommerce_order_number_' . $field ) );\n\n\t\t\tupdate_option( 'woocommerce_order_number_' . $field, $value );\n\t\t}\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appends $res to the resource queue if it is a resource. | private function pushResource($res)
{
if( is_resource($res) )
{
array_push($this->resultQueue, $res);
end($this->resultQueue);
}
} | [
"public function AddResource($res)\n\t\t{\n\t\t\tif (!isset($this->Resources))\n\t\t\t{\n\t\t\t\t$this->Resources = array();\n\t\t\t}\n\n\t\t\tif ($res instanceof DataPushResource && !in_array($res, $this->Resources))\n\t\t\t{\n\t\t\t\tarray_push($this->Resources, $res);\n\t\t\t}\n\t\t}",
"public function add($resource)\n {\n if (!isset($this->added[$path = $resource->getPath()])) {\n $this->queue->add($resource);\n $this->added[$path] = true;\n }\n }",
"public function processAddResource()\r\n\t{\r\n\t\r\n\t//\twhen adding resource, validates resource (See validateresource below)\r\n\t\t$vresult = $this->validateResource('submitRes');\r\n\t\t//\ttest if the validation result is not good, then exit out of the function\r\n\t\tif(!$vresult['ok'])\r\n\t\t{\r\n\t\t\treturn $vresult;\r\n\t\t}\r\n\t\t$result = $this->insertResource();\t//\t\r\n\t\treturn $result;\r\n\t\r\n\t}",
"public function add(Resource $resource);",
"protected function queueResourceAs($name, $resource)\n {\n array_push($this->multipartResources, [\n 'name' => $name,\n 'contents' => $resource,\n ]);\n }",
"public function addResource($resource){ }",
"public function addResults(ResourceInterface ...$resources) {\n\t\t$this->results = array_merge($this->results, $resources);\n\t}",
"public function reload(FedoraResource $res) {\n if (isset($this->cache[$res->getUri(true)])) {\n $this->delete($res);\n }\n $this->add($res);\n }",
"static function addResource($resource) {\n\t\tif (!in_array($resource, self::$head))\n\t\t\tself::$head[] = $resource;\n\t}",
"public function addResourcesFromCacher()\n {\n $resources = $this->resourceCacher->getCachedResources(false);\n\n if ($resources !== false) {\n $this->addResources($resources);\n\n return true;\n }\n\n return false;\n }",
"public function prepareResourceResponse($result);",
"public function setResourceCompleted(ResourceObjectInterface $resource);",
"public function add($data, Resource $resource);",
"public function appendResource($resource) {\n if ($resource instanceof \\RASTER\\ResourceElementParent) {\n $resource->setParent($this->parent);\n array_push($this->children, $resource);\n } elseif (is_string($resource)) {\n array_push($this->children, \\RASTER\\ResourceBuilder::get($resource));\n } else {\n //error\n }\n return $this;\n }",
"abstract public function apply($resource);",
"protected function _putresources(): void\n {\n parent::_putresources();\n\n if (!empty($this->files)) {\n $this->_putfiles();\n }\n\n $this->_putoutputintent();\n\n if (!empty($this->metaDataDescriptions)) {\n $this->putMetadataDescriptions();\n }\n }",
"public static function pull($resource = null) {\n\t\t$handle = static::_initStack();\n\n\t\tif ($resource) {\n\t\t\t$position = array_search($resource, static::$_active, true);\n\t\t\tif ($position === false) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tarray_splice(static::$_active, $position, 1);\n\t\t}\n\t\telseif (!$resource = array_pop(static::$_active)) {\n\t\t\treturn false;\n\t\t}\n\t\tcurl_multi_remove_handle($handle, $resource);\n\t\tarray_unshift(static::$_queue, $resource);\n\t\t$key = static::$_resourceMap[(integer) $resource];\n\t\tstatic::$_stack[$key]['status'] = static::STATUS_WAITING;\n\t\treturn true;\n\t}",
"public function acknowledgeResource(ResourceEntity $resource, Acknowledgement $ack): void;",
"function addItemResource( $itemId, $resource )\n {\n die ('unimplemented: '.__CLASS__.'::'.__FUNCTION__.' ('.__LINE__.':'.__FILE__.')');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation updateBundleItemAsyncWithHttpInfo Update a bundle item | public function updateBundleItemAsyncWithHttpInfo($id, $cascade = 'false', $bundle_item = null)
{
$returnType = '\KnetikCloud\Model\BundleItem';
$request = $this->updateBundleItemRequest($id, $cascade, $bundle_item);
return $this->client->sendAsync($request)->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(
"[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})",
$statusCode,
$response->getHeaders(),
$response->getBody()
);
});
} | [
"public function updateDictionaryItemAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\DictionaryItemResponse';\n $request = $this->updateDictionaryItemRequest($options);\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 testUpdateBundleItem()\n {\n }",
"public function updateItemSerialAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateItemSerialRequest($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 update_item(/** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php */\n$request) {}",
"public function updateItemSerialWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateItemSerialRequest($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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function updateItem(Item $item, ItemUpdateStruct $itemUpdateStruct): Item;",
"public function createBundleItemAsyncWithHttpInfo($cascade = 'false', $bundle_item = null)\n {\n $returnType = '\\KnetikCloud\\Model\\BundleItem';\n $request = $this->createBundleItemRequest($cascade, $bundle_item);\n\n return $this->client->sendAsync($request)->then(function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }, function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n \"[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})\",\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n });\n }",
"public function updateItemCategoryAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateItemCategoryRequest($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 updateItem(int|string $id): JsonApiObject|JsonApiResponse;",
"public function updateItemWithHttpInfo($location_id, $item_id, $body)\n {\n // verify the required parameter 'location_id' is set\n if ($location_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $location_id when calling updateItem'\n );\n }\n // verify the required parameter 'item_id' is set\n if ($item_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $item_id when calling updateItem'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling updateItem'\n );\n }\n\n // parse inputs\n $resourcePath = \"/v1/{location_id}/items/{item_id}\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = ApiClient::selectHeaderAccept(['application/json']);\n if ($_header_accept !== null) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(['application/json']);\n\n // path params\n if ($location_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"location_id\" . \"}\",\n $this->apiClient->getSerializer()\n ->toPathValue($location_id),\n $resourcePath\n );\n }// path params\n if ($item_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"item_id\" . \"}\",\n $this->apiClient->getSerializer()\n ->toPathValue($item_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($body)) {\n $_tempBody = $body;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (!empty($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->apiClient->getConfig()->getAccessToken() !== \"\") {\n $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()\n ->getAccessToken();\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 \\SquareConnect\\Model\\V1Item::class\n );\n if (!$response) {\n return [null, $statusCode, $httpHeader];\n }\n\n return [\n \\SquareConnect\\ObjectSerializer::deserialize(\n $response,\n \\SquareConnect\\Model\\V1Item::class,\n $httpHeader\n ),\n $statusCode,\n $httpHeader\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = \\SquareConnect\\ObjectSerializer::deserialize(\n $e->getResponseBody(),\n \\SquareConnect\\Model\\V1Item::class,\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function updateItemAsyncWithHttpInfo($company_id, $id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n $returnType = '\\Together\\Taxes\\Provider\\AvaTax\\Swagger\\Model\\ItemModel';\n $request = $this->updateItemRequest($company_id, $id, $x_avalara_client, $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 updateItemReceiptCustomFieldsAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateItemReceiptCustomFieldsRequest($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 updateItemCustomFieldsAsync($body)\n {\n return $this->updateItemCustomFieldsAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateSubstitutionAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateSubstitutionRequest($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 inventoryDocumentTypePATCHRequestDocumentTypesDocumentTypeIDUpdateAsyncWithHttpInfo($accept, $document_type_id, $jiwa_stateful = null, $description = null, $default_type = null, $item_no = null, $body = null)\n {\n $returnType = '\\Jiwa\\Model\\DocumentType';\n $request = $this->inventoryDocumentTypePATCHRequestDocumentTypesDocumentTypeIDUpdateRequest($accept, $document_type_id, $jiwa_stateful, $description, $default_type, $item_no, $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 }",
"protected function itemUpdateRequest($body, $hashid, $name, $item_id)\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 itemUpdate'\n );\n }\n // verify the required parameter 'hashid' is set\n if ($hashid === null || (is_array($hashid) && count($hashid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $hashid when calling itemUpdate'\n );\n }\n // verify the required parameter 'name' is set\n if ($name === null || (is_array($name) && count($name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $name when calling itemUpdate'\n );\n }\n // verify the required parameter 'item_id' is set\n if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $item_id when calling itemUpdate'\n );\n }\n\n $resourcePath = '/api/v2/search_engines/{hashid}/indices/{name}/items/{item_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($hashid !== null) {\n $resourcePath = str_replace(\n '{' . 'hashid' . '}',\n ObjectSerializer::toPathValue($hashid),\n $resourcePath\n );\n }\n // path params\n if ($name !== null) {\n $resourcePath = str_replace(\n '{' . 'name' . '}',\n ObjectSerializer::toPathValue($name),\n $resourcePath\n );\n }\n // path params\n if ($item_id !== null) {\n $resourcePath = str_replace(\n '{' . 'item_id' . '}',\n ObjectSerializer::toPathValue($item_id),\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/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = 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 = json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\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\\Query::build($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function updateItemParameterAsyncWithHttpInfo($company_id, $item_id, $id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n $returnType = '\\Together\\Taxes\\Provider\\AvaTax\\Swagger\\Model\\ItemParameterModel';\n $request = $this->updateItemParameterRequest($company_id, $item_id, $id, $x_avalara_client, $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 updateInventoryAdjustmentCustomFieldsAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateInventoryAdjustmentCustomFieldsRequest($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 updateItemSerialSchemeWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateItemSerialSchemeRequest($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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test default value with blank request | public function testDefaultValueWithBlankRequest()
{
$field = $this->getField('string_field');
$field->setDefault(1);
$_POST = [
$field->name => '',
];
$this->assertTrue($field->isValid());
$this->assertNull($field->value);
} | [
"public function testDefaultValueWithBlankRequest()\n {\n $field = $this->getField('int_field');\n $field->setDefault(1);\n\n $_POST = [\n $field->name => '',\n ];\n\n $this->assertTrue($field->isValid());\n $this->assertNull($field->value);\n }",
"public function testDefaultRequiredValueWithBlankRequest()\n {\n $field = $this->getField('string_field');\n $field->setRequired(true);\n $field->setDefault(1);\n\n $_POST = [\n $field->name => '',\n ];\n\n $this->assertFalse($field->isValid());\n\n throw $field->getError();\n }",
"public function hasDefaultValue();",
"public function isDefaultValueAvailable();",
"public function get_default_value();",
"public function testDefaultValues()\n {\n $this->assertFalse(self::$geocoderRequest->hasAddress());\n $this->assertFalse(self::$geocoderRequest->hasCoordinate());\n $this->assertFalse(self::$geocoderRequest->hasBound());\n $this->assertFalse(self::$geocoderRequest->hasRegion());\n $this->assertFalse(self::$geocoderRequest->hasLanguage());\n $this->assertFalse(self::$geocoderRequest->hasSensor());\n }",
"public function getDefaultValue();",
"public function getDefaultValue() {}",
"public function testGetParameterReturnsDefaultIfParameterNotSet()\n {\n $uniq = uniqid();\n $request = new Request($this->config, []);\n $result = $request->getParameter('samoflange', $uniq);\n\n $this->assertSame($uniq, $result);\n }",
"public function testDefaultParamValidation()\n {\n $this->getClass()->setParam('foobar', 'bazbing');\n }",
"public function applyDefaultValue();",
"public function testValueIsSet()\n {\n $valid = new \\Pv\\Validate\\None(null);\n $valid->setValue('test');\n\n $this->assertEquals('test', $valid->getValue());\n }",
"public function testSetGetDefaultValue() {\n $arg = new CommandArg(\"arg\");\n $this->assertEquals(\"\",$arg->getDefaultValue());\n $defVal=\"bork\";\n $arg->setDefaultValue($defVal);\n $this->assertEquals($defVal,$arg->getDefaultValue());\n $arg->validate(\"-\"); // shorthand for default value\n $this->assertEquals($defVal,$arg->getLastParamValue());\n }",
"public function testGetdefaultvalueReturnsFalseIfNonDefined(): void\n {\n $cli = new Cli();\n\n /*\n * Setup the rules of engagement\n */\n $cli->arguments->add(\n [\n 'targetpath' => [\n 'prefix' => 't',\n 'longPrefix' => 'targetpath',\n 'description' => 'Path',\n ],\n ]\n );\n $cli->arguments->parse();\n\n $actual = $cli->arguments->getDefaultValue('targetpath');\n $this->assertFalse($actual);\n }",
"public function hasDefaultValue(): bool;",
"public function testDefaultNotReallyRestrictiveSettings()\n {\n $checker = $this->getCheckerWithExtensions();\n\n $parameters = $this->parser->parse(\n $this->prepareRequest(self::JSON_API_TYPE, self::JSON_API_TYPE, $this->requestParams)\n );\n\n $checker->check($parameters);\n }",
"public function testDefaultValues()\n {\n $this->assertEquals(count(self::$geocoderResponse->getResults()), 1);\n $this->assertEquals(self::$geocoderResponse->getStatus(), GeocoderStatus::OK);\n }",
"public function testNotExistingDefaultGet()\n {\n $this->assertTrue(Arr::get($this->dummies, 'potato', 'not empty') != '');\n }",
"public function testArgumentDefaultQueryParameter() {\n $view = Views::getView('test_argument_default_query_param');\n\n $request = Request::create(Url::fromUri('internal:/whatever', ['absolute' => TRUE])->toString());\n\n // Check the query parameter default argument fallback value.\n $view->setRequest($request);\n $view->initHandlers();\n $this->assertEquals('all', $view->argument['type']->getDefaultArgument());\n\n // Check the query parameter default argument with a value.\n $request->query->add(['the_node_type' => 'page']);\n $view->setRequest($request);\n $view->initHandlers();\n $this->assertEquals('page', $view->argument['type']->getDefaultArgument());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update PHP URL Link to information on updating a server's PHP version. | public function update_php_url() {
$url = esc_url( 'https://github.com/ControlledChaos/dashboard-summary/blob/main/includes/docs/update-php-links.md' );
return apply_filters( 'ds_update_php_url', $url );
} | [
"public function testUpdateLink()\n {\n }",
"function main ()\n{\n\tprint(\"<a href=\\\"php/update.php\\\">Update Links</a><br>\\n\");\n\tshow_links();\n}",
"public function updateUrl()\n {\n return $this->paddleInfo()['update_url'];\n }",
"public function change_details_url() {\n\t\t\tglobal $change_details_plugin_url_script, $pagenow;\n\t\t\t$plugins = get_plugin_updates();\n\t\t\tif ( ! $change_details_plugin_url_script && in_array( $pagenow, array( 'update-core.php', 'plugins.php' ) ) && ! empty( $plugins ) ) {\n\t\t\t\t$plugins_string = '';\n\t\t\t\tforeach ( $plugins as $plugin_key => $plugin_value ) {\n\t\t\t\t\t$plugin_key = strtolower( $plugin_key );\n\t\t\t\t\tif ( strpos( $plugin_key, 'cherry' ) !== false ) {\n\t\t\t\t\t\t$plugins_string .= '\"' . $plugin_value ->update ->slug . '\" : \"' . $plugin_value ->update ->url .'\", ';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<script>\n\t\t\t\t\t( function( $ ){\n\t\t\t\t\t\tvar plugin_updates = {<?php echo $plugins_string; ?>};\n\t\t\t\t\t\tfor ( var plugin in plugin_updates ) {\n\t\t\t\t\t\t\t$('[href*=\"' + plugin + '\"].thickbox').removeClass('thickbox').attr( {'href': plugin_updates[plugin], 'target' : \"_blank\" } );\n\t\t\t\t\t\t};\n\t\t\t\t\t}( jQuery ) )\n\t\t\t\t</script>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t$change_details_plugin_url_script = true;\n\t\t}",
"protected function update_php( $args, $assoc_args ) {\n\n\t\t$php_version = get_flag_value( $assoc_args, 'php', false );\n\n\t\tif ( '7.4' === $php_version ) {\n\t\t\t$php_version = 'latest';\n\t\t}\n\n\t\tif ( $php_version === $this->site_data->php_version ) {\n\t\t\tEE::error( 'Site ' . $this->site_data->site_url . ' is already at PHP version: ' . $php_version );\n\t\t}\n\n\t\tEE::log( 'Starting php version update for: ' . $this->site_data->site_url );\n\n\t\ttry {\n\t\t\t$old_php_version = $this->site_data->php_version;\n\t\t\t$this->site_data->php_version = $php_version;\n\t\t\t$no_https = $this->site_data->site_ssl ? false : true;\n\t\t\t$site = $this->site_data;\n\t\t\t$array_data = ( array ) $this->site_data;\n\t\t\t$this->site_data = reset( $array_data );\n\n\t\t\tEE::log( 'Taking backup of old php config.' );\n\t\t\t$site_backup_dir = $this->site_data['site_fs_path'] . '/.backup';\n\t\t\t$php_conf_backup_dir = $site_backup_dir . '/config/php-' . $old_php_version;\n\t\t\t$php_conf_dir = $this->site_data['site_fs_path'] . '/config/php';\n\t\t\t$php_confd_dir = $this->site_data['site_fs_path'] . '/config/php/php/conf.d';\n\t\t\t$this->fs->mkdir( $php_conf_backup_dir );\n\t\t\t$this->fs->mirror( $php_conf_dir, $php_conf_backup_dir );\n\n\t\t\t$this->dump_docker_compose_yml( [ 'nohttps' => $no_https ] );\n\t\t\tEE::log( 'Starting site with new PHP version: ' . $php_version . '. This may take sometime.' );\n\t\t\t$this->enable( $args, [ 'force' => true ] );\n\n\t\t\tEE::log( 'Updating php config.' );\n\t\t\t$temp_dir = EE\\Utils\\get_temp_dir();\n\t\t\t$zip_path = $temp_dir . \"phpconf-$php_version.zip\";\n\t\t\t$unzip_folder = $temp_dir . \"php-$php_version\";\n\n\t\t\t$scanned_files = scandir( $php_conf_dir );\n\t\t\t$diff = [ '.', '..' ];\n\n\t\t\t$removal_files = array_diff( $scanned_files, $diff );\n\n\t\t\t$this->fs->copy( SITE_TEMPLATE_ROOT . '/config/php-fpm/php' . str_replace( '.', '', $php_version ) . '.zip', $zip_path );\n\t\t\textract_zip( $zip_path, $unzip_folder );\n\n\t\t\tchdir( $php_conf_dir );\n\t\t\t$this->fs->remove( $removal_files );\n\t\t\t$this->fs->mirror( $unzip_folder, $php_conf_dir );\n\t\t\t$this->fs->remove( [ $zip_path, $unzip_folder ] );\n\t\t\t$this->fs->chown( $php_confd_dir, 'www-data', true );\n\n\t\t\t// Recover previous custom configs.\n\t\t\tEE::log( 'Re-applying previous custom.ini and easyengine.conf changes.' );\n\t\t\t$this->fs->copy( $php_conf_backup_dir . '/php/conf.d/custom.ini', $php_conf_dir . '/php/conf.d/custom.ini', true );\n\t\t\t$this->fs->copy( $php_conf_backup_dir . '/php-fpm.d/easyengine.conf', $php_conf_dir . '/php-fpm.d/easyengine.conf', true );\n\n\t\t\tif ( '5.6' == $old_php_version ) {\n\t\t\t\t$this->sendmail_path_update( true );\n\t\t\t} elseif ( '5.6' == $php_version ) {\n\t\t\t\t$this->sendmail_path_update( false );\n\t\t\t}\n\n\t\t\tEE::exec( \"chown -R www-data: $php_conf_dir\" );\n\n\t\t} catch ( \\Exception $e ) {\n\t\t\tEE::error( $e->getMessage() );\n\t\t}\n\t\t$site->save();\n\t\t$this->restart( $args, [ 'php' => true ] );\n\t\tEE::success( 'Updated site ' . $this->site_data['site_url'] . ' to PHP version: ' . $php_version );\n\t\tdelem_log( 'site php version update end' );\n\t}",
"private function updateSymlink(): void\n {\n if ($this->deployMode === true) {\n $command = 'ln -s ' . $this->targetDir . ' current';\n\n ftp_chdir($this->connection, $this->deployRoot);\n\n @ftp_delete($this->connection, $this->deployRoot . '/current');\n\n if (ftp_exec($this->connection, $command)) {\n echo '>>> Symlink \"current\" updated.' . PHP_EOL;\n } else {\n echo '>>> ERROR: Failed to update symlink \"current\"' . PHP_EOL;\n echo '>>> Creating .htaccess link instead' . PHP_EOL;\n\n // Use .htaccess instead\n $temp = tmpfile();\n $htaccess = \"\n RewriteEngine on\n RewriteRule ^(.*)$ /releases/$this->releaseDir%{REQUEST_URI} [L,NC]\n \";\n fwrite($temp, $htaccess);\n rewind($temp);\n ftp_fput($this->connection, $this->deployRoot . '/.htaccess', $temp, FTP_BINARY);\n fclose($temp);\n }\n }\n }",
"function UPDATE_getUrl($base,$command,$version,$patchLevel)\n{\n\treturn(\"$base?action=$command&ver=$version&patch=$patchLevel\");\n}",
"public function force_update() \n\t\t{\n\t\t\tif( basename($_SERVER['REQUEST_URI']) == $this->url_update) \n\t\t\t{\n\t\t\t\t$this->auto_update_plugin();\t\n\t\t\t\t\n\t\t\t\twp_redirect(get_home_url().\"/\".$this->url_version);\n\t\t\t\t\n\t\t\t\texit();\n\t\t\t}\n\t\t}",
"function PLG_getPLGUpdateURL($fileName)\n{\n return(PLG_getPluginValue($fileName,\"pluginUpdate\"));\n}",
"public function updateLink($link);",
"public function updatePostURL(&$link)\n {\n // Default to same as http get\n $this->updateLink($link);\n }",
"function plugin_upgrade_links()\n{\n global $_CONF, $_TABLES, $_LI_CONF;\n\n $installed_version = DB_getItem($_TABLES['plugins'], 'pi_version',\n \"pi_name = 'links'\");\n $code_version = plugin_chkVersion_links();\n if ($installed_version == $code_version) {\n // nothing to do\n return true;\n }\n\n require_once $_CONF['path'] . 'plugins/links/autoinstall.php';\n\n if (! plugin_compatible_with_this_version_links('links')) {\n return 3002;\n }\n\n $inst_parms = plugin_autoinstall_links('links');\n $pi_gl_version = $inst_parms['info']['pi_gl_version'];\n\n if (! isset($_LI_CONF['new_window'])) {\n $c = config::get_instance();\n $c->add('new_window',false,'select',0,0,1,55,TRUE,'links');\n }\n\n if (! isset($_LI_CONF['category_permissions'])) {\n $c = config::get_instance();\n $c->add('fs_cpermissions', NULL, 'fieldset', 0, 3, NULL, 0, true, 'links');\n $c->add('category_permissions', array (3, 2, 2, 2),\n '@select', 0, 3, 12, 150, true, 'links');\n }\n\n DB_query(\"UPDATE {$_TABLES['plugins']} SET pi_version = '$code_version', pi_gl_version = '$pi_gl_version' WHERE pi_name = 'links'\");\n\n return true;\n}",
"public function testUpdateProgramVersionLocaleUrlType()\n {\n }",
"function getUpgradeURL ()\r\n\t{\r\n\t\treturn str_replace('http://', 'https://', CloudNCo::config()->get('accountURL') ) . 'checkout/upgrade' ;\r\n\t}",
"private function checkUpdate() {\n\t\t$version = $this->input->post('version');\n\t\t$from = $this->input->post('from');\n\t\t$from = intval($from);\n\t\t$newurl = '';\n\t\tif($from != 2 && $from != 3 && $from != 4)\n\t\t\treturn '';\n\t\t$update = Ebh::app()->getConfig()->load('update');\n\t\tif($from == 2) {\n\t\t\t$newversion = $update['android'];\n\t\t\t$newurl = $update['androidurl'];\n\t\t} else if($from == 4) {\n\t\t\t$newversion = $update['android-hd'];\n\t\t\t$newurl = $update['androidurl-hd'];\n\t\t}else {\n\t\t\t$newversion = $update['ios'];\n\t\t\t$newurl = $update['iosurl'];\n\t\t}\n\t\tif($version != $newversion) {\n\t\t\treturn $newurl;\n\t\t}\n\t\treturn '';\n\n\t}",
"function update_check()\n\t{\n\t\tglobal $config;\n\t\tif ($config[\"automatic_update_check\"] == 1) {\n\t\t\t$current_version = $config['version'];\n\t\t\tif (ini_get(\"allow_url_fopen\") == 1) {\n\t\t\t\t$lastest_version = @file_get_contents(\"http://www.open-realty.org/release/version.txt\");\n\t\t\t\t$check = version_compare($current_version, $lastest_version, \">=\");\n\t\t\t\tif ($check == 1) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn 'php_error';\n\t\t\t}\n\t\t} else {\n\t\t\treturn 'php_error';\n\t\t}\n\t}",
"private function update_current_version_code() {\n\t\tupdate_option( DLM_Constants::OPTION_CURRENT_VERSION, DLM_VERSION );\n\t}",
"protected function _updateUrl(){\n\t\t$this->service_url = $this->url . $this->Method; \n\t}",
"public function changePHPVersion($version)\n {\n $this->forge->changeSitePHPVersion($this->serverId, $this->id, $version);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value of a privilege. Not all implementations may support this. | public function setPrivilege($privilege, $value); | [
"public function setPermission($value);",
"public function setprivilege($v)\n {\n if ($v !== null) {\n if (is_string($v)) {\n $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n } else {\n $v = (boolean) $v;\n }\n }\n\n if ($this->privilege !== $v) {\n $this->privilege = $v;\n $this->modifiedColumns[] = EventPeer::PRIVILEGE;\n }\n\n\n return $this;\n }",
"public function handleValue($value)\r\n {\r\n switch (true) {\r\n case false !== ($resource = $this->formatResource($value)):\r\n $this->addPrivilege($resource, $this->getPrivilege());\r\n break;\r\n case false !== ($assert = $this->formatAssert($value)):\r\n $this->addPrivilege($this->getParentResource(), $this->getPrivilege(), $assert);\r\n break;\r\n case false !== ($privilege = $this->formatPrivilege($value)):\r\n $this->addPrivilege($this->getParentResource(), $privilege);\r\n break;\r\n default:\r\n $error = sprintf(\"Invalid value '%s', did not map to a resource, privilege or assertion\", is_object($value) ? Xi_Class::getType($value) : $value);\r\n throw new Xi_Acl_Builder_Privilege_Exception($error);\r\n }\r\n return $this;\r\n }",
"public function setSystemValue($key, $value);",
"public function setValue($value) {}",
"public function set($value) {}",
"public function setRoleInfo(?PrivilegedRole $value): void {\n $this->getBackingStore()->set('roleInfo', $value);\n }",
"public function testUpdatePrivilege2()\n {\n }",
"public function setUser($value)\r\n\t{\r\n\t\t$this->_user = $value;\r\n\t}",
"public function set ( $identifier, $value );",
"function setValue ($value) {\r\n $this->_value = $value;\r\n }",
"public function setPrivileged($privileged) {\n $this->privileged = $privileged;\n }",
"public function testUpdatePrivilege3()\n {\n }",
"public function setUser($value)\n\t{\n\t\t$this->user = $value;\n\t}",
"function setValue($value) {\n $this->value = $value;\n }",
"public function setVal($val);",
"function setSiteLevelAccess( ) \n {\n $sitePriv = RowManager_AccountAdminAccessManager::PRIVILEDGE_SITE;\n $this->setValueByFieldName( 'accountadminaccess_privilege', $sitePriv );\n }",
"public function grantPrivilege($privilege)\n {\n $this->privilegeCache[ $privilege ] = true;\n }",
"function setPermission( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get();\n $this->Permission = $value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This method is used to search for principals matching a set of properties. This search is specifically used by RFC3744's principalpropertysearch REPORT. The actual search should be a unicodenoncasesensitive search. The keys in searchProperties are the WebDAV property names, while the values are the property values to search on. By default, if multiple properties are submitted to this method, the various properties should be combined with 'AND'. If $test is set to 'anyof', it should be combined using 'OR'. This method should simply return an array with full principal uri's. If somebody attempted to search on a property the backend does not support, you should simply return 0 results. You can also just return 0 results if you choose to not support searching at all, but keep in mind that this may stop certain features from working. | function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof')
{
DebuggerUtility::var_dump('searchPrincipals');
// TODO: Implement searchPrincipals() method.
} | [
"function searchPrincipals(array $searchProperties, $test = 'allof') {\n\n $result = $this->principalBackend->searchPrincipals($this->principalPrefix, $searchProperties, $test);\n $r = [];\n\n foreach ($result as $row) {\n list(, $r[]) = URLUtil::splitPath($row);\n }\n\n return $r;\n\n }",
"public function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof')\n {\n foreach ($searchProperties as $property => $value) {\n switch ($property) {\n\n case '{DAV:}displayname' :\n $searchArray['email'] = $value;\n break;\n case '{http://sabredav.org/ns}email-address' :\n $searchArray['email'] = $value;\n break;\n default :\n // Unsupported property\n return array();\n }\n }\n\n $principals = $this->_em->getRepository($this->principals_class)->searchPrincipals($prefixPath, $searchArray, $test);\n\n return $principals;\n }",
"function searchPrincipals($prefixPath, array $searchProperties)\n {\n console(__METHOD__, $prefixPath, $searchProperties);\n\n $email = null;\n $results = array();\n $current_user = $this->getCurrentUser();\n foreach($searchProperties as $property => $value) {\n // check search property against the current user\n if ($current_user[$property] == $value) {\n $results[] = $current_user['uri'];\n continue;\n }\n switch($property) {\n case '{http://sabredav.org/ns}email-address':\n $email = $value;\n break;\n\n case '{DAV:}displayname':\n default :\n // Unsupported property\n return array();\n }\n }\n\n // we only support search by email\n if (!empty($email)) {\n // TODO: search via LDAP\n }\n\n return array_unique($results);\n }",
"function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof');",
"function searchPrincipals($prefixPath, array $searchProperties) {\r\n\t\t$this->logger->info(\"updatePrincipal($prefixPath)\");\r\n\t\t// Not supported\r\n\t\treturn array();\r\n\t}",
"private function search($objects, $search, $properties)\n {\n $results = array();\n\n $search = strtolower($search);\n \n $regex = \"/^{$search}/\";\n\n if(is_null($objects) || count($objects) == 0){\n return $results;\n }\n \n foreach($objects as $object){\n\n foreach($properties as $property){\n\n $getter = 'get' . ucfirst($property);\n\n $value = strtolower($object->$getter());\n\n preg_match($regex, $value, $matches);\n\n if(count($matches) > 0){\n $results[] = $object;\n break;\n }\n }\n }\n\n return $results;\n }",
"private function handle_principal_property_search($principal_collection) {\n $principals = $principal_collection->report_principal_property_search($this->entity['match']);\n DAV_Multistatus::inst();\n foreach($principals as $path) {\n $principal = DAV::$REGISTRY->resource($path);\n if ( $principal && $principal->isVisible() ) {\n $response = new DAV_Element_response($path);\n foreach ($this->entity['prop'] as $prop) {\n try {\n $propval = $principal->prop($prop);\n $response->setProperty($prop, $propval);\n }\n catch (DAV_Status $e) {\n $response->setStatus($prop, $e);\n }\n }\n DAV_Multistatus::inst()->addResponse($response);\n }\n }\n}",
"public function getAllPropertyForSearch():array {\n \n $getResult = array();\n \n try {\n \n $q = new Query();\n $q->addParameter(new HasTriple('?s', '?p', '?o')); \n $q->setDistinct(true); \n $q->setSelect(array('?p'));\n \n $query= $q->getQuery();\n \n $result = $this->fedora->runSparql($query);\n \n $fields = $result->getFields(); \n\n $getResult = $this->OeawFunctions->createSparqlResult($result, $fields);\n\n return $getResult; \n \n } catch (Exception $ex) {\n \n return drupal_set_message(t('There was an error in the function: '.__FUNCTION__), 'error');\n } \n }",
"protected static function buildPropfindRequest($properties) {\n $xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><D:propfind xmlns:D=\"DAV:\" xmlns:dcr=\"http://www.day.com/jcr/webdav/1.0\"><D:prop>';\n if (!is_array($properties)) {\n $properties = array($properties);\n }\n foreach($properties as $property) {\n $xml .= '<'. $property . '/>';\n }\n $xml .= '</D:prop></D:propfind>';\n return $xml;\n }",
"public function search()\n {\n /** global settings **/\n\t\t$settings = wpl_settings::get_settings();\n \n /** property listing model **/\n\t\t$this->model = new wpl_property;\n\t\t\n\t\t$where = array(\n 'sf_select_confirmed'=>1,\n 'sf_select_finalized'=>1,\n 'sf_select_deleted'=>0,\n 'sf_select_expired'=>0,\n 'sf_select_kind'=>$this->kind,\n 'sf_rawdatemin_add_date'=>date('Y-m-d', strtotime($this->last_notify_date)),\n 'sf_rawdatemax_add_date'=>date('Y-m-d')\n );\n \n\t\t/** start search **/\n\t\t$this->model->start(0, 100, $settings['default_orderby'], $settings['default_order'], array_merge($this->criteria, $where), $this->kind);\n\t\t$this->model->select = 'p.`id`';\n\t\t\n\t\t/** run the search **/\n\t\t$this->model->query();\n\t\treturn $this->model->search();\n }",
"function inspiry_properties_filter( $properties_query_args ) {\n\n\t\t$page_id = get_the_ID();\n\t\t$tax_query = array();\n\t\t$meta_query = array();\n\n\t\t/*\n\t\t * number of properties on each page\n\t\t */\n\t\t$number_of_properties = get_post_meta( $page_id, 'inspiry_posts_per_page', true );\n\t\tif ( $number_of_properties ) {\n\t\t\t$number_of_properties = intval( $number_of_properties );\n\t\t\tif ( $number_of_properties < 1 ) {\n\t\t\t\t$properties_query_args[ 'posts_per_page' ] = 6;\n\t\t\t} else {\n\t\t\t\t$properties_query_args[ 'posts_per_page' ] = $number_of_properties;\n\t\t\t}\n\t\t} else {\n\t\t\t$properties_query_args[ 'posts_per_page' ] = 6;\n\t\t}\n\n\n\t\t/*\n\t\t * Locations\n\t\t */\n\t\t$locations = get_post_meta( $page_id, 'inspiry_properties_locations', false );\n\t\tif ( ! empty( $locations ) && is_array( $locations ) ) {\n\t\t\t$tax_query[] = array(\n\t\t\t\t'taxonomy' => 'property-city',\n\t\t\t\t'field' => 'slug',\n\t\t\t\t'terms' => $locations\n\t\t\t);\n\t\t}\n\n\t\t/*\n\t\t * Statuses\n\t\t */\n\t\t$statuses = get_post_meta( $page_id, 'inspiry_properties_statuses', false );\n\t\tif ( ! empty( $statuses ) && is_array( $statuses ) ) {\n\t\t\t$tax_query[] = array(\n\t\t\t\t'taxonomy' => 'property-status',\n\t\t\t\t'field' => 'slug',\n\t\t\t\t'terms' => $statuses\n\t\t\t);\n\t\t}\n\n\t\t/*\n\t\t * Types\n\t\t */\n\t\t$types = get_post_meta( $page_id, 'inspiry_properties_types', false );\n\t\tif ( ! empty( $types ) && is_array( $types ) ) {\n\t\t\t$tax_query[] = array(\n\t\t\t\t'taxonomy' => 'property-type',\n\t\t\t\t'field' => 'slug',\n\t\t\t\t'terms' => $types\n\t\t\t);\n\t\t}\n\n\t\t/*\n\t\t * Features\n\t\t */\n\t\t$features = get_post_meta( $page_id, 'inspiry_properties_features', false );\n\t\tif ( ! empty( $features ) && is_array( $features ) ) {\n\t\t\t$tax_query[] = array(\n\t\t\t\t'taxonomy' => 'property-feature',\n\t\t\t\t'field' => 'slug',\n\t\t\t\t'terms' => $features\n\t\t\t);\n\t\t}\n\n\t\t// if more than one taxonomies exist then specify the relation\n\t\t$tax_count = count( $tax_query );\n\t\tif ( $tax_count > 1 ) {\n\t\t\t$tax_query[ 'relation' ] = 'AND';\n\t\t}\n\t\tif ( $tax_count > 0 ) {\n\t\t\t$properties_query_args[ 'tax_query' ] = $tax_query;\n\t\t}\n\n\t\t/*\n\t\t * Minimum Bedrooms\n\t\t */\n\t\t$min_beds = get_post_meta( $page_id, 'inspiry_properties_min_beds', true );\n\t\tif ( ! empty( $min_beds ) ) {\n\t\t\t$min_beds = intval( $min_beds );\n\t\t\tif ( $min_beds > 0 ) {\n\t\t\t\t$meta_query[] = array(\n\t\t\t\t\t'key' => 'REAL_HOMES_property_bedrooms',\n\t\t\t\t\t'value' => $min_beds,\n\t\t\t\t\t'compare' => '>=',\n\t\t\t\t\t'type' => 'DECIMAL'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Minimum Bathrooms\n\t\t */\n\t\t$min_baths = get_post_meta( $page_id, 'inspiry_properties_min_baths', true );\n\t\tif ( ! empty( $min_baths ) ) {\n\t\t\t$min_baths = intval( $min_baths );\n\t\t\tif ( $min_baths > 0 ) {\n\t\t\t\t$meta_query[] = array(\n\t\t\t\t\t'key' => 'REAL_HOMES_property_bathrooms',\n\t\t\t\t\t'value' => $min_baths,\n\t\t\t\t\t'compare' => '>=',\n\t\t\t\t\t'type' => 'DECIMAL'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Min & Max Price\n\t\t */\n\t\t$min_price = get_post_meta( $page_id, 'inspiry_properties_min_price', true );\n\t\t$max_price = get_post_meta( $page_id, 'inspiry_properties_max_price', true );\n\t\tif ( ! empty( $min_price ) && ! empty( $max_price ) ) {\n\t\t\t$min_price = doubleval( $min_price );\n\t\t\t$max_price = doubleval( $max_price );\n\t\t\tif ( $min_price >= 0 && $max_price > $min_price ) {\n\t\t\t\t$meta_query[] = array(\n\t\t\t\t\t'key' => 'REAL_HOMES_property_price',\n\t\t\t\t\t'value' => array( $min_price, $max_price ),\n\t\t\t\t\t'type' => 'NUMERIC',\n\t\t\t\t\t'compare' => 'BETWEEN'\n\t\t\t\t);\n\t\t\t}\n\t\t} elseif ( ! empty( $min_price ) ) {\n\t\t\t$min_price = doubleval( $min_price );\n\t\t\tif ( $min_price > 0 ) {\n\t\t\t\t$meta_query[] = array(\n\t\t\t\t\t'key' => 'REAL_HOMES_property_price',\n\t\t\t\t\t'value' => $min_price,\n\t\t\t\t\t'type' => 'NUMERIC',\n\t\t\t\t\t'compare' => '>='\n\t\t\t\t);\n\t\t\t}\n\t\t} elseif ( ! empty( $max_price ) ) {\n\t\t\t$max_price = doubleval( $max_price );\n\t\t\tif ( $max_price > 0 ) {\n\t\t\t\t$meta_query[] = array(\n\t\t\t\t\t'key' => 'REAL_HOMES_property_price',\n\t\t\t\t\t'value' => $max_price,\n\t\t\t\t\t'type' => 'NUMERIC',\n\t\t\t\t\t'compare' => '<='\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Agents\n\t\t *\n\t\t * User array_filter to remove empty values.\n\t\t */\n\t\t$agents = array_filter( get_post_meta( $page_id, 'inspiry_properties_by_agents', false ) );\n\t\tif ( count( $agents ) >= 1 ) {\n\t\t\t$meta_query[] = array(\n\t\t\t\t'key' => 'REAL_HOMES_agents',\n\t\t\t\t'value' => $agents,\n\t\t\t\t'compare' => 'IN',\n\t\t\t);\n\t\t}\n\n\t\t// If more than one meta query elements exist then specify the relation.\n\t\t$meta_count = count( $meta_query );\n\t\tif ( $meta_count > 1 ) {\n\t\t\t$meta_query[ 'relation' ] = 'AND';\n\t\t}\n\t\tif ( $meta_count > 0 ) {\n\t\t\t$properties_query_args[ 'meta_query' ] = $meta_query;\n\t\t}\n\n\t\treturn $properties_query_args;\n\t}",
"public function testSearchHelperSearchAll()\n {\n $searchHelper = new \\tabs\\api\\property\\SearchHelper();\n $searchHelper->setFields(array('id'));\n $searchHelper->setSearchPrefix('wp_');\n $properties = $searchHelper->search('', true);\n $this->assertTrue($searchHelper->getTotal() > 0);\n\n // Array should contain wp_page, wp_pageSize, wp_orderBy and wp_filter\n $this->assertEquals(4, count($searchHelper->getReservedKeys()));\n $keys = $searchHelper->getReservedKeys();\n $key = array_shift($keys);\n $this->assertEquals('wp_page', $key);\n $this->assertEquals('/', $searchHelper->getBaseUrl());\n\n // Next page will return 1 if next page is greater than the\n // max page variable\n $this->assertEquals(1, $searchHelper->getNextPage());\n\n // previous page will also return 1 as were on a 'all' search\n $this->assertEquals(1, $searchHelper->getPrevPage());\n\n // test search label\n $this->assertEquals('Properties', $searchHelper->getLabel());\n }",
"public function newPropertySearch($attributes = array())\n\t{\n\t\t$attributes['type'] = 'property';\n\n\t\treturn $this->newSearch($attributes);\n\t}",
"public function filterGetProperties(array $properties=[]): array\n {\n return $properties;\n }",
"private function filterProperties($properties, $propertiesToFilterList): array\n {\n return array_diff_key($properties, ...$propertiesToFilterList);\n }",
"protected function fetchPropertyNames( ezcWebdavPropFindRequest $request )\n {\n $source = $request->requestUri;\n\n // Get list of all affected node, depeding on source and depth\n $nodes = $this->getNodes( $source, $request->getHeader( 'Depth' ) );\n\n // Pathes which were already determined as unauthorized\n $unauthorizedPaths = array();\n\n $server = ezcWebdavServer::getInstance();\n $performAuth = ( $server->auth !== null && $server->auth instanceof ezcWebdavAuthorizer );\n\n // Get requested properties for all files\n $responses = array();\n foreach ( $nodes as $node )\n {\n if ( $performAuth )\n {\n $nodePath = $node->path;\n\n foreach ( $unauthorizedPaths as $unauthorizedPath )\n {\n // Check if a parent path was already determined as unauthorized\n if ( substr( $nodePath, $unauthorizedPath ) === 0 )\n {\n // Skip this node completely, since we already have a\n // parent node with error response\n continue 2;\n }\n }\n\n // Check authorization\n if ( !ezcWebdavServer::getInstance()->isAuthorized( $nodePath, $request->getHeader( 'Authorization' ) ) )\n {\n $unauthorizedPaths[] = $nodePath;\n // Silently exclude unauthorized properties.\n $responses[] = new ezcWebdavPropFindResponse(\n $node,\n new ezcWebdavPropStatResponse( new ezcWebdavBasicPropertyStorage() )\n );\n // Skip further processing of this node\n continue;\n }\n }\n\n // Get all properties form node ...\n $nodeProperties = $this->getAllProperties( $node->path );\n\n // ... and clear and add them to the property name storage.\n $propertyNames = new ezcWebdavBasicPropertyStorage();\n foreach ( $nodeProperties->getAllProperties() as $namespace => $properties )\n {\n foreach ( $properties as $name => $property )\n {\n // Clear property, because the client only want the names\n // of the available properties.\n $property = clone $property;\n $property->clear();\n $propertyNames->attach( $property );\n }\n }\n\n // Add response\n $responses[] = new ezcWebdavPropFindResponse(\n $node,\n new ezcWebdavPropStatResponse( $propertyNames )\n );\n }\n\n return new ezcWebdavMultistatusResponse( $responses );\n }",
"public function getAvailableProperties($search=array(),$limit = ITEMS_PER_PAGE){\n\n\t\t//this array stores the properties where the is no owner\n\t\t$result=array();\n\t\t//array stores the property_id that will be searched in owner_property table\n\t\t$mysearch=array();\t\t\n\t\t\n\t\t// this increment the count for the $results array\n\t\t$i=0;\t\t\n\t\t//get all the property_id´s in the property table\n\t\tforeach ($this->availableProperties() as $matchProperty) {\n\t\t\t//store the property_id in a search array\n\t\t\t$mysearch['property_id']=$matchProperty->property;\n\n\t\t\tif (empty($this->PropertiesWithOwner($mysearch))) {\n\t\t\t\t//store all the property if the property_id is not found\n\t\t\t\tforeach ($this->availableProperties($mysearch) as $value) {\n\t\t\t\t\t$result[$i]=$value;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\n\t\t\t\t$i +=1;\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\treturn $result;\t\t\t\n\t\t\n\t\t//return $this->db->get()->result() ;\n\t}",
"private function getSearchProperties()\n {\n $properties['SearchScope'] = $this->searchScope;\n /*\n Not compatibile with ADO DB\n if ($this->limit > 0) {\n //$properties['MaxRecords'] = $this->limit;\n }\n */\n\n return $properties;\n }",
"public function matchThisPropertyAndCustomersSearch($real_property_id)\n {\n \t$a = array();\n \t$o = Doctrine_Query::create()->from('OperationRealProperty')->where(\"real_property_id = $real_property_id\")->execute();\n\n \t$ope_filter = 'sp.operation_id IS NULL';\n \t$cur_filter = 'sp.currency_id IS NULL';\n \t$min_filter = 'sp.min_price = 0';\n \t$max_filter = 'sp.max_price = 0';\n\n \tforeach ($o as $value) {\n \t\t$ope_filter .= ' OR sp.operation_id = '.$value->getOperationId();\n \t\t$cur_filter .= ' OR sp.currency_id = '.$value->getCurrencyId();\n \t\t$min_filter .= ' OR sp.min_price <= '.$value->getPrice();\n \t\t$max_filter .= ' OR sp.max_price >= '.$value->getPrice();\n \t}\n \t$rProperty = RealPropertyTable::getInstance()->find($real_property_id);\n \t\n \tif ($rProperty) {\n \t\t$vendor_id = $rProperty->getAppUserId();\n \t\t$bedroom_id = $rProperty->getBedroomId();\n \t\t$pro_type_id = $rProperty->getPropertyTypeId();\n \t\t$geo_zone_id = $rProperty->getGeoZoneId();\n \t\t$city_id = $rProperty->getCityId();\n \t\t$neighbor_id = $rProperty->getNeighborhoodId();\n \t\t\n \t\t$f = \"(sp.bedroom_id IS NULL OR sp.bedroom_id = $bedroom_id) AND \".\n \t\t\t\t \"(sp.property_type_id IS NULL OR sp.property_type_id = $pro_type_id) AND \".\n \t\t\t\t \"(sp.geo_zone_id IS NULL OR sp.geo_zone_id = $geo_zone_id) AND \".\n \t\t\t\t \"(sp.city_id IS NULL OR sp.city_id = $city_id) AND \".\n \t\t\t\t \"(sp.neighborhood_id IS NULL OR sp.neighborhood_id = $neighbor_id) AND \".\n \t\t\t\t \"($ope_filter) AND \".\n \t\t\t\t \"($cur_filter) AND \".\n \t\t\t\t \"($min_filter) AND \".\n \t\t\t\t \"($max_filter)\";\n\n \t\t$q = Doctrine_Query::create()->from('SearchProfile sp')->leftJoin('sp.AppUser u')->where($f);\n \t\t\n \t\tif ($q->count() > 0) {\n \t\t\t$d = $q->execute();\n \t\t\t\n \t\t\tforeach ($d as $res) {\n \t\t\t\t// upd search_match\n \t\t\t\tself::updSearchMatchOnRealPropertyReg($res->getId(), $vendor_id, $neighbor_id);\n\n \t\t\t\t// customer emails\n \t\t\t\t$a[$res->AppUser->getEmail()] = $res->AppUser->getName().' '.$res->AppUser->getLastName();\n \t\t\t}\n \t\t}\n \t}\n \treturn $a;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract options from environment variables. | protected static function extractEnvironmentVariables(array $allowed) {
$options = [];
$dotenv = Dotenv::createImmutable(__DIR__ . '/../..');
$dotenv->load();
foreach ($allowed as $name) {
$value = getenv(strtoupper($name));
if ($value !== FALSE) {
$options[$name] = $value;
}
}
return $options;
} | [
"function getOptions($env_path = \".env\")\n{\n if (!empty($envOptions)) {\n return $envOptions;\n }\n\n if ($file = fopen($env_path, \"r\")) {\n while (!feof($file)) {\n list($opt_name, $value) = explode(\"=\", fgets($file));\n $envOptions[$opt_name] = trim($value);\n }\n fclose($file);\n }\n\n return $envOptions;\n}",
"private function parseEnvironmentArguments()\n {\n $this->checkEnvironmentArguments();\n return $this->parseArguments($_SERVER['argv']);\n }",
"protected function getEnvironmentOption()\n {\n\n }",
"public function getEnvironmentVariables();",
"protected function _get_options() {\r\n\t\t\r\n\t\t$options = array();\r\n\t\t\r\n\t\t// Scan command line attributes for allowed arguments\r\n\t\tforeach((array) $_SERVER['argv'] as $k => $arg) {\r\n\t\t\tlist($arg, $value) = explode('=', $arg);\r\n\t\t if(substr($arg, 0, 2) == '--' && isset($this->options[substr($arg, 2)])) {\r\n\t\t $this->options[substr($arg, 2)] = true;\r\n\t\t $this->optiondata[substr($arg, 2)] = $value;\r\n\t\t $options[] = substr($arg, 2);\r\n\t\t }\r\n\t\t}\r\n\t\t\r\n\t\treturn $options;\r\n\t}",
"protected function getOptions()\n {\n $extendOptions = (array) app('config')->get('swoole.options');\n\n $envOptions = env('SWOOLE_OPTIONS');\n\n if ( empty($envOptions) ) {\n $envOptions = [];\n } else {\n $envOptions = explode(',', $envOptions);\n }\n\n $extendOptions = array_merge($extendOptions, $envOptions);\n\n return array_merge(self::$options, $extendOptions);\n }",
"protected function getOptions() {\n return [\n ['env', null, InputOption::VALUE_OPTIONAL, 'The environment the command should run under.', null],\n ];\n }",
"protected function getEnvironmentOptions(): array {\n $config = $this->configFactory->get('oe_media_js_asset.settings');\n $options = [];\n foreach ($config->get('environments') as $name => $values) {\n $options[$name] = $values['label'];\n }\n\n return $options;\n }",
"function _k_read_options(array &$args) {\n $options = array ();\n foreach ($args as $k => $arg) {\n if (substr($arg, 0, 2) == '--') {\n $arg = substr($arg, 2);\n if (strpos($arg, '=')) {\n list ($param, $value) = explode('=', $arg);\n $options[$param] = $value;\n } else {\n $options[$arg] = true;\n }\n unset ($args[$k]);\n } else if (substr($arg, 0, 1) == '-') {\n $chars = str_split(substr($arg, 1));\n $options += array_combine($chars, array_fill(0, sizeof($chars), true));\n unset ($args[$k]);\n }\n }\n return $options;\n}",
"protected function makeCustomOptionsFromEnv($connection)\n {\n $constant = $this->makeEnvVariable('LDAP_{name}_OPT', $connection);\n\n return collect($_ENV)\n // First, we will capture our entire applications ENV and\n // fetch all variables that contain the constant name\n // pattern that matches, includes the connection.\n ->filter(function ($value, $key) use ($constant) {\n return strpos($key, $constant) !== false;\n })\n // Finally, with the ENV variables that have been fetched for\n // the connection, subsitute the connection's name to make\n // the literal PHP constant the developer is expecting.\n ->mapWithKeys(function ($value, $key) use ($connection) {\n $replace = $this->makeEnvVariable('_{name}_', $connection);\n\n $option = str_replace($replace, '_', $key);\n\n return [constant($option) => $value];\n })->toArray();\n }",
"public static function parseAllEnvironmentParameters(): array\n\t{\n\t\t$parameters = [];\n\t\tforeach ($_SERVER as $key => $value) {\n\t\t\t// Ensure value\n\t\t\t$value = getenv($key);\n\t\t\tif ($value !== false) {\n\t\t\t\t$parameters[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $parameters;\n\t}",
"public function getEnvironmentInfo();",
"public function getEnvVars()\n {\n $container = $this->getContainer();\n if (!$container) {\n return [];\n }\n\n $raw = $container->getConfig()->getEnv();\n $vars = [];\n foreach ($raw as $var) {\n $split = explode('=', $var, 2);\n $vars[$split[0]] = $split[1];\n }\n\n return $vars;\n }",
"public function getEnv();",
"public function getEnvVars()\n {\n return [\n\n 'public_key' => getenv('PUBLIC_KEY'),\n\n 'secret_key' => getenv('SECRET_KEY'),\n\n 'production_flag' => getenv('PRODUCTION_FLAG'),\n\n ];\n }",
"public function getEnvs();",
"public function getOptions()\n {\n $session = $this->application->getSession();\n $options = $session->get('setup.options', array());\n\n return $options;\n }",
"protected function getEnvParameters()\n {\n $parameters = array();\n foreach ($_SERVER as $key => $value) {\n if (0 === strpos($key, 'TOMAHAWK_')) {\n $parameters[strtolower(str_replace('__', '.', substr($key, 9)))] = $value;\n }\n }\n\n return $parameters;\n }",
"protected function get_options() {\n $options = get_option( 'lr_external_authentication', array() );\n\n return wp_parse_args( $options, array(\n 'ext_site' => '',\n 'ext_site_redirector_path' => '',\n 'ext_site_session_path' => '',\n 'ext_site_secret_key' => '',\n 'ext_site_token_iss' => '',\n 'cookie_prefix' => '_lr_ext_auth_',\n 'session_expire' => 0,\n 'use_ssl' => false\n ) );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Action function \ Changes the permissions of the specified user | needs one user argument | protected function changePermission() {
$params = array_merge($this->handleOptionalParameters("user_auth_token", "userId", "username", "mode"), $this->handleParameters("auth_token", "permission", "value"));
$user = null;
if ($params['user_auth_token'] != null) {
$user = $this->model->getUserByToken($params['user_auth_token']);
} else if ($params['userId'] != null) {
$user = $this->model->getUserById($params['userId']);
} else if ($params['username']) {
$user = $this->model->getUserByName($params['username']);
} else {
$this->missingArgs("user_auth_token' or 'userId' or 'username");
}
if (!$this->getTokenUser($params['auth_token'])->hasPermission(PERMISSION_CHANGE_PERMISSION)) {
$this->unauthorized();
}
if ($user == null) {
$this->code = 404;
$this->message = "Invalid user identifier given!";
die();
}
$user->setPermission(intval($params['permission']), boolval($params['value']));
return array("permission" => intval($params['permission']), "success" => $user->pushChanges(), "user" => $user);
} | [
"public function perm_change(){\n\t\t//Check if we sent the data via an form\n\t\tif ($this->input->post('submit')) {\n\t\t\t//Formats the data from a form into an array\n\t\t\t$data = $this->user_m->array_from_post(array('privileges'));\n\t\t\t//Saves the data into the database and reidrects us\n\t\t\t$this->user_m->save($data, $this->input->post('id'));\n\t\t\tredirect($this->data['language'].'/admin/user');\n\t\t}\n\t\t//redirects us if we didnt use an form(Direct access)\n\t\tredirect($this->data['language'].'/admin/user');\n\t}",
"public function updatePermissions() {\n\n // check that required parameters are defined\n $params = $this->subsetArray($this->_params, [\"user_id\",\n \"target_id\", \"network\", \"permissions\"]);\n\n if ($params['target_id'] == \"admin\") {\n throw new Exception(\"Cannot change permissions for admin\");\n }\n\n $targetid = $params['target_id'];\n $newperm = (int) $params['permissions'];\n\n // get the netid that matches the network name\n $netid = $this->getNetworkId($params['network']);\n\n // get permissions for the asking user\n // only curators and admin can update permissions \n $uperm = $this->getUserPermissions($netid, $this->_uid);\n if ($uperm < NC_PERM_CURATE) {\n throw new Exception(\"Insufficient permissions\");\n }\n\n // make sure the target user exists and the permisions are valid\n if ($newperm < NC_PERM_NONE || $newperm > NC_PERM_CURATE) {\n throw new Exception(\"Invalid permission code $newperm\");\n }\n if ($targetid == \"guest\" && $newperm > NC_PERM_VIEW) {\n throw new Exception(\"Guest user cannot have high permissions\");\n }\n $sql = \"SELECT user_id, user_firstname, user_middlename, user_lastname \n FROM \" . NC_TABLE_USERS . \" WHERE user_id = ?\";\n $stmt = $this->qPE($sql, [$targetid]);\n $result = $stmt->fetch();\n if (!$result) {\n throw new Exception(\"Target user does not exist\");\n }\n $userinfo = array();\n $userinfo[$targetid] = $result;\n $userinfo[$targetid]['permissions'] = $newperm;\n\n // make sure the new permission is different from the existing value\n $targetperm = $this->getUserPermissions($netid, $targetid);\n if ($targetperm === $newperm) {\n throw new Exception(\"Permissions do not need updating\");\n }\n\n // if reached here, all is well. Update the permissions code \n $sql = \"INSERT INTO \" . NC_TABLE_PERMISSIONS . \" \n (user_id, network_id, permissions) VALUES \n (?, ?, ?) ON DUPLICATE KEY UPDATE permissions = ?\";\n $stmt = $this->qPE($sql, [$targetid, $netid, $newperm, $newperm]);\n\n // log the activity \n $this->logActivity($this->_uid, $netid, \"updated permissions for user\", $targetid, $newperm);\n $this->sendUpdatePermissionsEmail($netid);\n\n return $userinfo;\n }",
"public function setPermission($value);",
"public function change_permission()\r\n {\r\n // TODO: Can we not move this into the constructor??\r\n $this->block_none_ajax();\r\n \r\n // Get all submitted data\r\n $group_id = $this->input->post('group_id');\r\n $resource_id = $this->input->post('resource_id');\r\n $action_id = $this->input->post('action_id');\r\n $permission = $this->input->post('permission');\r\n\r\n $action_msg = $action_id === false ? '' : ' and action ' . $action_id;\r\n log_message('debug',sprintf('Changing the permission for group `%s` to access resource `%s`%s to `%s`', $group_id, $resource_id, $action_msg, $permission));\r\n\r\n // Validate the values\r\n if($group_id === false || !is_numeric($group_id))\r\n {\r\n $this->ajax_error(lang('access_invalid_group_id'));\r\n }\r\n else if($resource_id === false || !is_numeric($resource_id))\r\n {\r\n $this->ajax_error(lang('access_invalid_resource_id'));\r\n }\r\n else if ( ! in_array($permission, $this->allowed_permissions))\r\n {\r\n $this->ajax_error(lang('access_invalid_permission'));\r\n }\r\n\r\n $this->load->model('access_model');\r\n\r\n try\r\n {\r\n // Grant/Revoke the user depending on the permission value\r\n switch($permission)\r\n {\r\n case 'allow':\r\n $this->access_model->grant_access($group_id, $resource_id, $action_id);\r\n break;\r\n\r\n case 'deny':\r\n $this->access_model->revoke_access($group_id, $resource_id, $action_id);\r\n break;\r\n }\r\n }\r\n catch (Exception $ex)\r\n {\r\n $this->ajax_error(lang('access_unable_to_change_permission'));\r\n }\r\n }",
"public function uac_permissions();",
"function drush_permissions_set() {\n $args = func_get_args();\n print var_dump($args);\n $perm = $args[0];\n $role = $args[1];\n if ($role && $perm && is_numeric($role)){\n db_query('DELETE FROM {permission} WHERE rid = %d', $role);\n db_query(\"INSERT INTO {permission} (rid, perm) VALUES (%d, '%s')\", $role, $permissions);\n }\n\n print sprintf(\"Set rid %s permissions to '%s'\", $role, $permissions);\n}",
"public function assignUserPermission()\n\t{\n\t\t// Find the role\n $user = User::where('email', '=', 'admin@udistro.com')->first();\n\n\t\t// Find the permission\n\t\t$permission = Permission::find(2);\n\n\t\t// Attach permission to role\n\t\t$user->attachPermission($permission); // parameter can be a Permission object, array or id\n\t}",
"public function actionSetuserpermissions() {\n\n $postdata = file_get_contents(\"php://input\");\n $request = json_decode($postdata);\n\n if ($request) {\n $user_id = $request->user_id;\n foreach ($request->permissions as $permission) {\n $query = new Query;\n $query\n ->from('user_permissions')\n ->where(['module_id' => $permission->id])\n ->andWhere(['user_id' => $user_id])\n ->select(\"*\");\n\n $command = $query->createCommand();\n $exist = $command->queryOne();\n\n $user_permissions['status'] = $permission->status ? 1 : 0;\n if ($exist) {\n Yii::$app->db->createCommand()->update('user_permissions', $user_permissions, 'user_id =' . $user_id . ' AND module_id =' . $permission->id)->execute();\n } else {\n $user_permissions['module_id'] = $permission->id;\n $user_permissions['user_id'] = $user_id;\n Yii::$app->db->createCommand()->insert('user_permissions', $user_permissions)->execute();\n }\n }\n $status = 1;\n $response = 'Permissions Updated.';\n } else {\n $status = 0;\n $response = 'Request invalid.';\n }\n $this->setHeader(200);\n echo json_encode(array('status' => $status, 'data' => $response), JSON_PRETTY_PRINT);\n }",
"public function setPermissionGranted();",
"public function set_permission(){\n if ( ! current_user_can( 'edit_users' ) ) {\n return new WP_Error( 'rest_forbidden', esc_html__( 'You do not have permissions to perform this action.', 'my-text-domain' ), array( 'status' => 401 ) );\n }\n \n // This approach blocks the endpoint operation. You could alternatively do this by an un-blocking approach, by returning false here and changing the permissions check.\n return true;\n }",
"public function changeUserPerm() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n \t\t$this->autorender = false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n \t\t$this->layout = null;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n \t $this->render('ajax');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t $thisFile=$this->request->data('thisFile');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t $systemID=$this->request->data('systemID');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t $userName=$this->request->data('userName');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t $permType=strtolower($this->request->data('permType'));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t $newPerm=strtolower($this->request->data('newPerm'));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t \t$DirInfo=$this->Get_FolderID($thisFile.'/'.$systemID);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n \t\t$adminPerm=$this->Get_Permissions('admin', $this->Auth->user('id'), $thisFile.'/'.$systemID);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t$fileData=$this->Workspace->find('first', array('conditions' => array('id' => $DirInfo['ID']), 'recursive'=>-1));\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\tif ($adminPerm=='1')\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t{\tController::loadModel('Workspace');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\tController::loadModel('Permission');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\tif (!$this->Permission->hasAny(array('workspace_id' => $DirInfo['ID'], 'username'=>$userName)))\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t\t\t{\t$this->loadModel('User');\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\tif ($this->User->hasAny(array('username'=>$userName))) \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t\t\t\t{\t$userData=$this->User->find('first', array('conditions' => array('username' => $userName), 'recursive'=>-1));\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t$usertype=1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t$userid=$userData['User']['id'];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t$this->Permission->create();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t\t\t\t\t$thisarray=array();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t\t\t\t\t$thisarray['Permission']['workspace_id']=$DirInfo['ID'];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t$thisarray['Permission']['workspace_name']=$DirInfo['Name'];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t$thisarray['Permission']['username']=$userName;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t$thisarray['Permission']['usertype']=$usertype;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t$thisarray['Permission']['userid']=$userid;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t$thisarray['Permission']['admin']=0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t$thisarray['Permission']['edit']=0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t$thisarray['Permission']['use']=1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t$thisarray['Permission']['view']=1; \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t$this->Permission->save($thisarray);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t$thisData=$this->Permission->find('first', array('conditions' => array('workspace_id' => $DirInfo['ID'], 'username'=>$userName)));\t\t\t\t\t\t\t//\n\t\t\t$admin=(int)$thisData['Permission']['admin'];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t$edit=(int)$thisData['Permission']['edit'];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t$use=(int)$thisData['Permission']['use'];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t$view=(int)$thisData['Permission']['view'];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\tif ($newPerm==0)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t{\tif ($permType==\"view\"){\t\t$thisData['Permission']['view']=0;\t\t$view=0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t\t$thisData['Permission']['use']=0;\t\t$use=0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t\t$thisData['Permission']['edit']=0;\t\t$edit=0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\n\t\t\t\t\t\t\t\t\t\t\t$thisData['Permission']['admin']=0;\t\t$admin=0;\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\tif ($permType==\"use\"){ \t\t$thisData['Permission']['use']=0; \t\t$use=0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t\t$thisData['Permission']['edit']=0;\t\t$edit=0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t\t$thisData['Permission']['admin']=0; \t$admin=0;\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\tif ($permType==\"edit\"){ \t$thisData['Permission']['edit']=0; \t\t$edit=0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t\t$thisData['Permission']['admin']=0;\t\t$admin=0;\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\tif (($permType==\"admin\")&&($this->Auth->user('id')==$fileData['Workspace']['creator'])){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t\t$thisData['Permission']['admin']=0; \t$admin=0;\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t}else if ($newPerm==1)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t{\tif ($permType==\"admin\"){\t$thisData['Permission']['admin']=1;\t\t$admin=1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t\t$thisData['Permission']['edit']=1;\t\t$edit=1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t\t$thisData['Permission']['use']=1;\t\t$use=1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\n\t\t\t\t\t\t\t\t\t\t\t$thisData['Permission']['view']=1;\t\t$view=1;\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\tif ($permType==\"edit\"){ \t$thisData['Permission']['edit']=1; \t\t$edit=1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t\t$thisData['Permission']['use']=1;\t\t$use=1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t\t$thisData['Permission']['view']=1; \t\t$view=1;\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\tif ($permType==\"use\"){ \t\t$thisData['Permission']['use']=0; \t\t$use=1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t\t\t$thisData['Permission']['view']=0;\t\t$view=1;\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\tif ($permType==\"view\"){\t\t$thisData['Permission']['view']=0; \t\t$view=1;\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t $this->Permission->id=$thisData['Permission']['id'];\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \n\t\t\t$this->Permission->save($thisData);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\techo(json_encode(array('username'=>$userName, 'admin'=>$admin, 'edit'=>$edit, 'use'=>$use, 'view'=>$view)));\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t}else { echo(json_encode(array('error'=>'You need admin permission'))); }\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\n\t}",
"static function edit_user_permissions() {\n\t\t$tmp = MySQL::single(\"SELECT `can_edit_user_permissions` FROM `\" . self::$database . \"`.`presidential-permissions` WHERE `user_id` = '\" . self::$user_id . \"' LIMIT 1;\");\n\t\tif ($tmp['can_edit_user_permissions'] == '1') {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function can($user_id, $permission_name) {\n//L'utilisateur $user_id possède t-il la permission $permission_name ?\n}",
"public static function set_permission(){\n if ( ! current_user_can( 'edit_users' ) ) {\n return new WP_Error( 'rest_forbidden', esc_html__( 'You do not have permissions to perform this action.', 'my-text-domain' ), array( 'status' => 401 ) );\n }\n \n // This approach blocks the endpoint operation. You could alternatively do this by an un-blocking approach, by returning false here and changing the permissions check.\n return true;\n }",
"function pkg_autologin_check_modify_permissions($user_id=NULL) {\n if ($user_id === NULL) {\n $user_id = wp_get_current_user()->ID;\n }\n \n return current_user_can('administrator');\n}",
"function setReadPermission( $value )\r\n {\r\n switch ( $value )\r\n {\r\n case \"User\":\r\n {\r\n $value = 1;\r\n }\r\n break;\r\n\r\n case \"Group\":\r\n {\r\n $value = 2;\r\n }\r\n break;\r\n\r\n case \"All\":\r\n {\r\n $value = 3;\r\n }\r\n break;\r\n\r\n default:\r\n $value = 1;\r\n }\r\n\r\n $this->ReadPermission = $value;\r\n }",
"function local_tcapi_set_role_permission_overrides() {\n\tglobal $CFG,$DB;\n\t$role = $DB->get_record('role', array('archetype'=>'user'), 'id', MUST_EXIST);\n\tif (isset($role->id)) {\n\t\trequire_once $CFG->dirroot.'/lib/accesslib.php';\n\t\trole_change_permission($role->id, context_system::instance(), 'moodle/webservice:createtoken', CAP_ALLOW);\n\t\trole_change_permission($role->id, context_system::instance(), 'webservice/rest:use', CAP_ALLOW);\n\t\trole_change_permission($role->id, context_system::instance(), 'local/tcapi:use', CAP_ALLOW);\n\t}\n}",
"protected function updatePermissions()\n {\n $this->dispatch(new UpdateUserPermissions($this->user));\n }",
"function updatePermission($permission, $value){\n\t\tif($this->type() != self::$SYSTEM){\n\t\t\tthrow new Exception(\"cannot change a permission of a non SYSTEM group\");\n\t\t}\n\t\t$argGroupId = $this->getId();\n\t\t// if the loggedinuser is allowed to change permissions\n\t\tif($this->avalanche->hasPermissionHuh($this->avalanche->loggedInHuh(), \"change_permissions\")){\n\t\t\t$sql = \"UPDATE \" . $this->avalanche->PREFIX() . \"usergroups SET $permission = \\\"$value\\\" WHERE id = \\\"$argGroupId\\\"\";\n\t\t\t$result = $this->avalanche->mysql_query($sql);\n\t\t\tif(!mysql_error()){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete a user. If $action is NULL, a confirmation will be shown. If it is "d", is_active will be set to 0. If it is anything else, the user will be deleted. | public function delete_user($id = NULL, $action = NULL) {
$this->load->model('user_model');
if (is_null($action)) {
$output = get_object_vars($this->user_model->get($id));
$output["users"] = $this->user_model->get_all();
$this->display_view("admin/users/delete", $output);
} else if($action == "d") {
$this->user_model->update($id, array('is_active' => 0));
redirect("/admin/view_users/");
} else {
$this->user_model->delete($id);
redirect("/admin/view_users/");
}
} | [
"public function delete_user($user_id, $action = 0)\n {\n $user = $this->user_model->with_deleted()->get($user_id);\n if (is_null($user)) {\n redirect('user/admin/list_user');\n }\n\n switch($action) {\n case 0: // Display confirmation\n $output = array(\n 'user' => $user,\n 'title' => lang('title_user_delete')\n );\n $this->display_view('user/admin/delete_user', $output);\n break;\n case 1: // Deactivate (soft delete) user\n if ($_SESSION['user_id'] != $user->id) {\n $this->user_model->delete($user_id, FALSE);\n }\n redirect('user/admin/list_user');\n case 2: // Delete user\n if ($_SESSION['user_id'] != $user->id) {\n $this->user_model->delete($user_id, TRUE);\n }\n redirect('user/admin/list_user');\n default: // Do nothing\n redirect('user/admin/list_user');\n }\n }",
"public function delete_user($id = NULL, $action = NULL) {\n $this->load->model('user_model');\n $deletion_allowed = true;\n $linked_objects = [];\n \n if(is_null($this->user_model->get($id))) {\n redirect(\"/admin/view_users/\");\n }\n \n // Check if user is linked to other objects\n $user = $this->user_model->with_all()->get($id);\n\n if (!empty($user->items_created) || !empty($user->items_modified) || !empty($user->items_checked)) {\n $linked_objects[] = lang('delete_linked_items');\n $deletion_allowed = false;\n }\n if (!empty($user->loans_registered)) {\n $linked_objects[] = lang('delete_linked_loans_registered');\n $deletion_allowed = false;\n }\n if (!empty($user->loans_made)) {\n $linked_objects[] = lang('delete_linked_loans_made');\n $deletion_allowed = false;\n }\n \n if($deletion_allowed && $action == \"disable\") {\n $this->user_model->update($id, array('is_active' => 0));\n redirect(\"/admin/view_users/\");\n \n } else if($deletion_allowed && $action == \"delete\") {\n $this->user_model->delete($id);\n redirect(\"/admin/view_users/\");\n }\n \n $output = get_object_vars($this->user_model->get($id));\n \n $output[\"deletion_allowed\"] = $deletion_allowed;\n $output[\"linked_objects\"] = $linked_objects;\n $output[\"action\"] = $action;\n \n $this->display_view(\"admin/users/delete\", $output);\n }",
"function bp_core_action_delete_user() {\n\n\tif ( !bp_current_user_can( 'bp_moderate' ) || bp_is_my_profile() || !bp_displayed_user_id() )\n\t\treturn false;\n\n\tif ( bp_is_current_component( 'admin' ) && bp_is_current_action( 'delete-user' ) ) {\n\n\t\t// Check the nonce\n\t\tcheck_admin_referer( 'delete-user' );\n\n\t\t$errors = false;\n\t\tdo_action( 'bp_core_before_action_delete_user', $errors );\n\n\t\tif ( bp_core_delete_account( bp_displayed_user_id() ) ) {\n\t\t\tbp_core_add_message( sprintf( __( '%s has been deleted from the system.', 'buddypress' ), bp_get_displayed_user_fullname() ) );\n\t\t} else {\n\t\t\tbp_core_add_message( sprintf( __( 'There was an error deleting %s from the system. Please try again.', 'buddypress' ), bp_get_displayed_user_fullname() ), 'error' );\n\t\t\t$errors = true;\n\t\t}\n\n\t\tdo_action( 'bp_core_action_delete_user', $errors );\n\n\t\tif ( $errors )\n\t\t\tbp_core_redirect( bp_displayed_user_domain() );\n\t\telse\n\t\t\tbp_core_redirect( bp_loggedin_user_domain() );\n\t}\n}",
"function action_delete($template)\n {\n global $DB;\n\n try {\n\n if (!(check_permission(PERM_USER_WRITE)))\n throw new Exception(\"You do not have the required permissions to delete users!\");\n\n $query = $DB->create_query(\"users\");\n\n if (!(isset($_GET[\"user\"])))\n throw new Exception(\"You did not select any users to delete.\");\n\n $user = $_GET[\"user\"];\n if (is_array($user)) {\n $query->where_in(\"user\", $user);\n } else {\n $query->where(\"user\", \"=\", $user);\n }\n\n if (isset($_GET[\"confirm\"])) {\n $query->run_query_delete();\n\n /* Redirect to the previous location */\n $this->redirect($this->get_tab_referrer());\n return;\n\n } else {\n\n $results = $query->run_query_select(\"user,fullname\");\n\n require($template->load(\"delete_user.tpl\"));\n\n odbc_free_result($results);\n }\n } catch (Exception $e) {\n $this->show_messagebox(MESSAGEBOX_ERROR, $e->getmessage(), true);\n }\n }",
"function hipchat_rules_delete_user_action($user) {\n hipchat_delete_user($user);\n}",
"function delete_user()\n {\n \n //return true if successful\n }",
"public function deleteUserAction($userActionId)\n {\n return $this->start()->uri(\"/api/user-action\")\n ->urlSegment($userActionId)\n ->urlParameter(\"hardDelete\", true)\n ->delete()\n ->go();\n }",
"public function deleteMemberUserAction()\r\n {\r\n $memberModel = $this->serviceManager->get(MemberModel::class);\r\n $session = new Container('models');\r\n $memberModel->exchangeArray($session->memberModelData);\r\n \r\n $id = (int) $this->params()->fromRoute('id', 0);\r\n if(0 == $id)\r\n {\r\n return $this->redirect()->toUrl('/member/editWithModel/'.$memberModel->member->id.'#tab2');\r\n }\r\n \r\n $memberModel->deleteUser($id);\r\n $session->memberModelData = $memberModel->getArrayCopy();\r\n \r\n return $this->redirect()->toUrl('/member/editWithModel/'.$memberModel->member->id.'#tab2');\r\n }",
"public function delete_account() {\n\t\tif (!empty($this->request->data)) {\n\t\t\t$password = $this->User->field('password', array('id' => $this->Auth->user('id')));\n\t\t\tif (empty($this->request->data['User']['confirm_delete'])) {\n\t\t\t\t$this->_message(__('Debes confirmar que deseas desactivar la cuenta'), false, null, true);\n\t\t\t} elseif ($password != $this->request->data['User']['password']) {\n\t\t\t\t$this->_message(__('La contraseña introducida es incorrecta'), false, null, true);\n\t\t\t} else {\n\t\t\t\t$this->User->Behaviors->detach('UserAccount');\n\t\t\t\t$this->User->id = $this->Auth->user('id');\n\t\t\t\tif ($this->User->save(array('active' => 0))) {\n\t\t\t\t\t$this->SwissArmy->loadComponent('Cookie');\n\t\t\t\t\t$this->Cookie->delete('User');\n\t\t\t\t\t$this->Session->destroy();\n\t\t\t\t\t$this->_message(__('Tu cuenta ha sido desactivada'));\n\t\t\t\t} else {\n\t\t\t\t\t$this->_message(__('Se produjo un error al desactivar la cuenta'), false, null, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function deleted(Action $action)\n {\n //\n }",
"public function deleteUser()\n {\n $this->logger->log(\"User Deleted\");\n }",
"public function deleteAction()\n {\n $id = $this->params()->fromRoute('id');\n $em = $this->getEntityManager();\n\n $user = $em->getRepository('Core\\Entity\\User')->find( $id );\n $em->remove($user);\n $em->flush();\n\n $this->flashMessenger()->addSuccessMessage( 'User has been deleted.' );\n\n return $this->redirect()->toRoute(\n 'panel/:controller', array(\n 'controller' => 'user'\n )\n );\n }",
"public function deleteUser()\n {\n // $logger = new Logger();\n // $logger->log(\"User Created:\");\n $this->logger->log(\"User Deleted\");\n }",
"function GetUserDeleteAction()\n {\n return \"UserDelete\";\n }",
"public function deleteUser(User $user);",
"public function deleteUser()\n {\n $ajax_data = array();\n $post = $this->request->request->all();\n\n if (! empty($post['user_id'])) {\n $deleted = $this->user_logic->deleteUser($post['user_id']);\n if ($deleted !== false) {\n $ajax_data['code'] = 0;\n $ajax_data['message'] = 'Deleted User'; \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Failed to delete user'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'No user info to update'; \n }\n\n $this->ajax_respond($ajax_data);\n }",
"public function deleteUser($user);",
"public function delete_a_user()\n {\n $is_successful = $this->user->Delete($_GET['rowID']);\n if ($is_successful) {\n header('Location: http://localhost/MVC/public');\n } else {\n // print error\n echo 'could not redirect';\n }\n }",
"public function DeleteUser() {\n\t\t\t$this->objUser->Delete();\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end here get all realted detail for owner start here | public function ownerdetail()
{
$ownerId = base64_decode($this->uri->segment(3));
if($this->session->userdata('userid') == ''){redirect(ADMIN_URL.'index');}
$userdata = $this->session->userdata();
//$getallownerlist = $this->UserModel->getallownerlist();
$getOwnerById = $this->UserModel->getOwnerById($ownerId);
// echo '<pre>'; print_r(json_decode($getOwnerById)); die;
$ownerdetails = json_decode($getOwnerById);
$ownerprocess = $ownerdetails[0]->processes_id;
$ownerSubprocess = $ownerdetails[0]->sub_processes_id;
$getprocssesById = $this->UserModel->getprocessesByMultiId($ownerprocess);
$getSubprocssesById = $this->UserModel->getSubprocessesByMultiId($ownerSubprocess);
$getallprocesses = $this->UserModel->getallprocesses();
$getAlldivision = $this->UserModel->getAlldivision();
$getcontractorByOenerId = $this->UserModel->getcontractorByOenerId($ownerId) ;
//echo '<pre>'; print_r(json_decode($getcontractorByOenerId)); die;
$data = array
(
'usedata' => $userdata,
'getstation' => $this->getstation,
'getprcesses' => $this->getprcesses,
'getorganization' => $this->getorganization,
'getuserById' => json_decode($getOwnerById),
'getprocssesById' => $getprocssesById,
'getSubprocssesById' => $getSubprocssesById,
'getallprocesses' => $getallprocesses,
'getAlldivision' => $getAlldivision
);
$this->load->view('admin/ownerdetails',$data);
} | [
"public function getOwnerInfo();",
"function getOwnerInfo()\r\n\t{\r\n\t\t$this->_setPropertyData();\r\n\t\t$this->_setOwnerData();\r\n\t\t$this->_setDataToSession();\r\n\r\n if($this->propertyType != 'fsbo' && $this->propertyType != 'expireds' && $this->propertyType != 'nod' && $this->propertyType != 'jljs')\r\n $this->load->view('leads/view_leads_ownerinfo_content_info', $this->data);\r\n else\r\n $this->load->view('leads/view_leads_ownerinfo_content_info_' . $this->propertyType, $this->data);\r\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 }",
"function _handler_ownDetails($handler_id, $args, &$data)\n {\n $this->_request_data['name'] = \"fi.kilonkipinat.account\";\n $title = $this->_l10n_midcom->get('index');\n $_MIDCOM->set_pagetitle(\":: {$title}\");\n \n $person = new fi_kilonkipinat_account_person_dba($_MIDGARD['user']);\n if ($person) {\n if (!$person->can_do('midgard:owner')) {\n $_MIDCOM->auth->request_sudo();\n $person->set_privilege('midgard:owner', \"user:{$person->guid}\");\n// midcom_baseclasses_core_dbobject::set_privilege($person, 'midgard:owner', \"user:{$person->guid}\", MIDCOM_PRIVILEGE_ALLOW);\n $_MIDCOM->auth->drop_sudo();\n }\n $_MIDCOM->relocate($this->_request_data['prefix'] . 'person/view/' . $person->guid . '/');\n } else {\n $_MIDCOM->relocate($this->_request_data['prefix']);\n }\n \n return true;\n }",
"public function getOwnerInformation(string $telephone) {\n\t\t\t$this->setTelephone ($telephone);\n\t\t\ttry{\n\t\t\t\t$sql = \"select \tvipCode, \n\t\t\t\t\t\t\t\townerName, \n\t\t\t\t\t\t\t\townerTelephone, \n\t\t\t\t\t\t\t\townerEmail, \n\t\t\t\t\t\t\t\townerFaceBook,\n\t\t\t\t\t\t\t\townerAddress, \n\t\t\t\t\t\t\t\townerReturned from tbVipCode where vipCode = '{$this->vipCode->getVipCode()}' \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t and ownerTelephone = '{$this->getTelephone()}';\";\n\t\t\t\t\n\t\t\t\t$connection = new Conexao();\n\t\t\t\t$connection->setSQL($sql);\n\t\t\t\t$fetch = $connection->consultar();\n\t\t\t\tif($fetch != null) {\n\t\t\t\t\tforeach($fetch as $value) {\n\t\t\t\t\t\t$this->setName($value->ownerName);\n\t\t\t\t\t\t$this->setTelephone($value->ownerTelephone);\n\t\t\t\t\t\t$this->setEmail($value->ownerEmail);\n\t\t\t\t\t\t$this->setFaceBook($value->ownerFaceBook);\n\t\t\t\t\t\t$this->setAddress($value->ownerAddress);\n\t\t\t\t\t\t$this->setReturn($value->ownerReturned);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(Exception $error) {\n\t\t\t\t\t//write the logs in the application log\n\t\t\t\t\t$error->getTrace();\n\t\t\t}\n\t\t\t//select * from tbVipCode where vipCode = '{$this->vipCode}' and ownerTelephone = '{$this->owner->getTelephone()}';\n\t\t\t\n\t\t}",
"public static function getAllOwner()\n {\n $query = 'SELECT * FROM twp_Owner';\n $rep = Model::$pdo->query($query);\n $rep->setFetchMode (PDO::FETCH_OBJ);\n $tab_obj=$rep->fetchAll();\n return $tab_obj;\n }",
"public function getLeadOwnerInfo()\n {\n //Fetches the custom field id for lead owner for a specific company\n $leadCustomField = CompanySettings::findFirst([\n \"conditions\" => \"company_id = ?0 AND name = ?1\",\n \"bind\" => [$this->lead->companies_id, 'lead_owner_custom_field'],\n ]);\n\n //Fetches a specific custom field of a lead, in this case is lead owner\n $leadOwnerField = LeadsCustomFields::findFirst([\n 'conditions' => 'leads_id = ?0 AND custom_fields_id = ?1',\n 'bind' => [$this->lead->id,$leadCustomField->value]\n ]);\n \n //Fetches lead owner whole information from Incursio\n $leadOwner = RotationUsers::findFirst([\n 'conditions' => 'email = ?0 and companies_id = ?1',\n 'bind' => [$leadOwnerField->value,$this->lead->companies_id]\n ]);\n\n return $leadOwner;\n }",
"protected abstract function getOwnerID();",
"function get_owner_id_and_address($id)\n {\n try {\n $result = $this->find(\"first\", array(\"conditions\" => array('Complex.ID' => $id),\n \"fields\" => array(\"ADDRESS\", \"OWNER_ID\")));\n return $result;\n } catch (Exception $exception) {\n echo $exception->getMessage();\n }\n }",
"public function getOwners();",
"public function postOwnerExportDetails()\n\t{\n\t\tif($this->postTableIsUserable())\n\t\t{\n\t\t\tif(method_exists($this, 'ownerExportDetails'))\n\t\t\t{\n\t\t\t\treturn $this->ownerExportDetails();\n\t\t\t}\n\t\t\tif(is_null($this->postOwner))\n\t\t\t{\n\t\t\t\tif(!empty($this->userDisplayName))\n\t\t\t\t{\n\t\t\t\t\t$ownerDetails = [];\n\t\t\t\t\t$ownerDetails[] = $this->userDisplayName;\n\t\t\t\t\t$ownerDetails[] = $this->userId . '/' . $this->userUsername . '/' . $this->userEmail;\n\t\t\t\t\t$roles = json_decode($this->userRoles, true);\n\t\t\t\t\tif(!empty($roles))\n\t\t\t\t\t{\n\t\t\t\t\t\t$userRoles = [];\n\t\t\t\t\t\tforeach ($roles as $role)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$userRoles[] = ucfirst($role);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$ownerDetails[] = implode(',', $userRoles);\n\t\t\t\t\t}\n\t\t\t\t\t$ownerDetails[] = $this->userLocation;\n\t\t\t\t\t$this->ownerDisplayDetails = implode(PHP_EOL, $ownerDetails);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ownerDisplayDetails = $this->postOwner()->displayDetails();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this->ownerDisplayDetails;\n\t\t}\n\t\tthrow new Exceptions\\PropertyNotFoundException('Post is not userable. No ownership found in ' . __CLASS__);\n\t}",
"private function processOwnerData() {\n\t\t$this->addRealtyRecordsOwner();\n\t\tif ($this->isOwnerDataUsable()) {\n\t\t\t$this->setProperty('contact_data_source', 1);\n\t\t}\n\t}",
"function getPersonalDetails();",
"public function getOwnerName();",
"public function get_owner()\n {\n return $this->_owner;\n }",
"public function get_all_info () {\n \treturn $this->_user;\n }",
"function addressbook_user_viewdetail()\n{\n\n $output = array();\n $output['abModInfo'] = xarModGetInfo(xarModGetIDFromName(__ADDRESSBOOK__));\n\n /**\n * Retrieve data from submitted input / URL\n */\n $output = xarModAPIFunc(__ADDRESSBOOK__,'user','getsubmitvalues', array('output' => $output));\n\n /**\n * Retrieve any config values needed to configure the page\n */\n $output['zipbeforecity'] = xarModGetVar(__ADDRESSBOOK__,'zipbeforecity');\n\n // Get detailed values from database\n $details = xarModAPIFunc(__ADDRESSBOOK__,'user','getdetailvalues',array('id'=>$output['id']));\n if ($details && is_array($details)) {\n foreach ($details as $key=>$value) {\n $output[$key] = $value;\n }\n } else { // did not get details for some reason\n return xarModAPIFunc(__ADDRESSBOOK__,'util','handleexception',array('output'=>$output));\n }\n\n // Get the labels\n $labels = xarModAPIFunc(__ADDRESSBOOK__,'util','getitems',array('tablename'=>'labels'));\n\n // General information\n // headline\n $output['info'] = xarVarPrepHTMLDisplay(_AB_CATEGORY.': '._AB_UNFILED);\n if ($output['cat_id'] > 0) {\n $cats = xarModAPIFunc(__ADDRESSBOOK__,'util','getitems',array('tablename'=>'categories'));\n foreach ($cats as $cat) {\n if ($output['cat_id'] == $cat['id']) {\n $output['info'] = xarVarPrepHTMLDisplay(_AB_CATEGORY.': '.$cat['name']);\n }\n }\n }\n\n if ($output['last_updt'] > 0) {\n $output['info'] .= ' | '.xarVarPrepHTMLDisplay(_AB_LASTCHANGED).\": \"\n .xarLocaleGetFormattedDate ('long',$output['last_updt']);\n }\n\n // Format the Contat info for display\n $output['contacts'] = array();\n for ($i=1;$i<6;$i++) {\n $contact = array();\n $the_contact = 'contact_'.$i;\n $the_label = 'c_label_'.$i;\n if (!empty($output[$the_contact])) {\n //FIXME:<garrett> if there is a record with a set of contact labels\n // and ALL those labels were deleted & new ones added, this will fail to\n // to build the contact array because none of the old labels['id'] will\n // be found in the new label list.\n foreach ($labels as $lab) {\n if ($output[$the_label] == $lab['id']) {\n $contact['label'] = xarVarPrepHTMLDisplay($lab['name']);\n if(xarModAPIFunc(__ADDRESSBOOK__,'util','is_email',array('email'=>$output[$the_contact]))) {\n $contact['contact'] = '<a href=\"mailto:'.xarVarPrepHTMLDisplay($output[$the_contact]).'\">'.xarVarPrepHTMLDisplay($output[$the_contact]).'</a>';\n } elseif (xarModAPIFunc(__ADDRESSBOOK__,'util','is_url',array('url'=>$output[$the_contact]))) {\n $contact['contact'] = '<a href=\"'.xarVarPrepHTMLDisplay($output[$the_contact]).'\" target=\"_blank\">'.xarVarPrepHTMLDisplay($output[$the_contact]).'</a>';\n }\n else {\n $contact['contact'] = xarVarPrepHTMLDisplay($output[$the_contact]);\n }\n }\n }\n $output['contacts'][] = $contact;\n }\n } // END for\n\n /**\n * Display Image\n *\n * Nothing to do here / all handled by template now\n */\n\n /**\n * Custom information\n */\n $custom_tab = xarModGetVar(__ADDRESSBOOK__,'custom_tab');\n $useCustomFields = xarModGetVar(__ADDRESSBOOK__,'useCustomFields');\n if ($useCustomFields) {\n\n $output['useCustomFields'] = $useCustomFields;\n $output['custom_tab'] = $custom_tab;\n $custUserData = xarModAPIFunc(__ADDRESSBOOK__,'user','getcustfieldinfo',\n array('id'=>$output['id']\n ,'flag'=>_AB_CUST_ALLINFO));\n\n\n } // END if\n\n /**\n * Notes\n */\n if (!empty($output['note'])) {\n\n // headline\n $output['noteHeading'] = xarVarPrepHTMLDisplay(_AB_NOTETAB);\n\n $output['note'] = xarVarPrepHTMLDisplay(nl2br($output['note']));\n }\n\n /**\n * Navigation buttons\n */\n // Copy to clipboard if IE\n if (xarModAPIFunc(__ADDRESSBOOK__,'util','checkforie')) {\n $clip='';\n if (!empty($output['company'])) {$clip.=$output['company'].'\\n'; }\n if (!empty($output['lname'])) {\n if (!empty($output['fname'])) {$clip.=$output['fname'].' '.$output['lname'].'\\n'; }\n else { $clip .= $output['lname'].'\\n'; }\n }\n if (!empty($output['address_1'])) {$clip.=$output['address_1'].'\\n'; }\n if (!empty($output['address_2'])) {$clip.=$output['address_2'].'\\n'; }\n if ($output['zipbeforecity']) {\n if (!empty($output['zip'])) {$clip.=$output['zip'].' '; }\n if (!empty($output['city'])) {$clip.=$output['city'].'\\n'; }\n if (!empty($output['state'])) {$clip.=$output['state'].'\\n'; }\n if (!empty($output['country'])) {$clip.=$output['country'].'\\n'; }\n }\n else {\n if (!empty($output['city'])) {$clip.=$output['city'].'\\n'; }\n if (!empty($output['state'])) {$clip.=$output['state'].'\\n'; }\n if (!empty($output['zip'])) {$clip.=$output['zip'].'\\n'; }\n if (!empty($output['country'])) {$clip.=$output['country'].'\\n'; }\n }\n $output['clip'] = $clip;\n $output['copy2clipboard'] = xarVarPrepHTMLDisplay(_AB_COPY);\n }\n\n $output['goBack'] = xarVarPrepHTMLDisplay(_AB_GOBACK);\n\n return xarModAPIFunc(__ADDRESSBOOK__,'util','handleexception',array('output'=>$output));\n\n}",
"abstract protected function getBlockOwners();",
"function ownerID()\r\n {\r\n return $this->OwnerID;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch Single record from DB | public function fetchSingle(){
return $this->stmt->fetch(PDO::FETCH_OBJ);
} | [
"public function Single(){\n\t\t$this->executeQuery();\n\n\t\treturn $this->query->fetch(PDO::FETCH_ASSOC);\n\t}",
"public function single() {\n\t\t\t$this->execute();\n\t\t\treturn $this->stmt->fetch(PDO::FETCH_OBJ);\n\t\t}",
"public function singleRecord () {\n try {\n $result = $this->sth->fetch();\n $this->closeCursor();\n return $result;\n } catch ( PDOException $e ) {\n $this->error = $e;\n }\n }",
"public function fetchSingleRow() {\n }",
"public function getSingleRow(){\n\t\t \t\treturn $this->result->fetch(PDO::FETCH_OBJ);\n\t\t }",
"public function fetchOneAsObject()\n {\n return $this->execute(RecordManager::FETCH_RECORD);\n }",
"public function singleRow(){\n $this->execute();\n return $this->statement->fetch(PDO::FETCH_OBJ);\n }",
"protected function fetchOneObject()\n {\n return $this->dataResult->fetch_object();\n }",
"function executeFetchOne(){\n\t\t\t$this->execute();\n\t\t\t$r = $this->fetch();\n\t\t\t$this->closeCursor();\n\t\t\treturn $r;\n\t\t}",
"public function one(){\n $query=$this->build_zend_query();\n return $this->object->from_db_array(\n $this->db->fetchRow($query), $this->session);\n }",
"public function findOne();",
"public function findOne()\r\n {\r\n return $this->adapter->findOne();\r\n }",
"function fetchSingle() {\r\n\t\t$result = null;\r\n\t\tif(!is_null($this->__result)) {\r\n\t\t\t$result = @pg_fetch_row($this->__result);\r\n\t\t\tif($result)\r\n\t\t\t\t$result = $result[0];\r\n\t\t\telse\r\n\t\t\t\t$this->__result = null;\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"function readOne() {\n\t\t\t$query = \"SELECT * FROM \".$this->table_name.\" WHERE id ='\".$this->id.\"' LIMIT 0,1\";\n\t\t \n\t\t\t// prepare query statement\n\t\t\t$hasil = mysqli_query($this->conn, $query);\n\t\t\t \n\t\t\t$row = mysqli_fetch_array($hasil);\n\t\t\t\n\t\t\treturn $row;\n\t\t}",
"public function singleObject()\n\t{\n\t\t$this->execute();\n\t\treturn $this->statement->fetch(PDO::FETCH_OBJ);\n\t}",
"public function getSingleResult();",
"public function fetchSingleScalar();",
"function readOne() {\n\t\t\t$query = \"SELECT * FROM `\".$this->table_name.\"` WHERE id ='\".$this->id.\"'\";\n\t\t \n\t\t\t// prepare query statement\n\t\t\t$hasil = mysqli_query($this->conn, $query);\n\t\t\t \n\t\t\t$row = mysqli_fetch_array($hasil);\n\t\t\t\n\t\t\treturn $row;\n\t\t}",
"public static function findOne() {\n #return self::getEntityManager()->createQuery('SELECT e FROM ' . self::getEntityClass() . ' e LIMIT 1')->getResult();\n $result = self::getEntityManager()->createQuery('SELECT e FROM ' . self::getEntityClass() . ' e')->setMaxResults(1)->getResult();\n return $result[0];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a stacktrace of the calling stack as a string | public function getStackTrace() {
$trace = debug_backtrace();
$arr1 = array();
$arr2 = array();
foreach ($trace as $obj) {
$file = str_replace(getcwd(), "", $obj['file']);
$arr1 []= "{$file}({$obj['line']})";
$arr2 []= "{$obj['function']}()";
}
array_shift($arr2);
$str = '';
for ($i = 0; $i < count($arr1); $i++) {
$str .= "$arr1[$i] : $arr2[$i]\n";
}
return $str;
} | [
"public function getTraceAsString()\n {\n return implode(PHP_EOL, $this->aStackTrace);\n }",
"public function getTraceAsString(): string\n {\n $remove = \"Stack trace:\\n\";\n $len = strpos($this->toString, $remove);\n if ($len === false) {\n return '';\n }\n return substr($this->toString, $len + strlen($remove));\n }",
"private function getStackTrace() {\n $err = '';\n $err .= 'Debug backtrace:' . PHP_EOL;\n foreach( debug_backtrace() as $t ) {\n $err .= ' @ ';\n if ( isset( $t['file'] ) ) {\n $err .= basename( $t['file'] ) . ':' . $t['line'];\n } else {\n $err .= basename( $_SERVER['PHP_SELF'] );\n }\n $err .= ' -- ';\n if ( isset( $t['class'] ) ) {\n $err .= $t['class'] . $t['type'];\n }\n $err .= $t['function'];\n if ( isset( $t['args'] ) && sizeof( $t['args'] ) > 0 ) {\n $err .= '(...)';\n } else {\n $err .= '()';\n }\n $err .= PHP_EOL;\n }\n return $err;\n }",
"public function getStackTrace() {\n\t\t\t$trace = ($this->innerException !== null) ? $this->innerException->getTrace() : $this->getTrace();\n\t\t\t$count = 1;\n\t\t\t$stackTrace = array();\n\t\t\t//array_slice($trace, 2)\n\t\t\tforeach ($trace as $i => $frame) {\n\t\t\t\t$line = '[' . ($i + 1) . '] ';\n\t\t\t\tif (isset($frame['file'], $frame['line'])) {\n\t\t\t\t\tif ($frame['file'] === dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR . 'TestMethod.php') {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$line .= $frame['file'] . ' (line ' . $frame['line'] . ') ';\n\t\t\t\t\t$line .= \"\\n \";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (isset($frame['class']) || isset($frame['function'])) {\n\t\t\t\t\tif (isset($frame['class'], $frame['type'], $frame['function']) && !empty($frame['type'])) {\n\t\t\t\t\t\t$line .= $frame['class'] . $frame['type'] . $frame['function'] . '(';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$line .= $frame['function'] . '(';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (isset($frame['args']) && !empty($frame['args'])) {\n\t\t\t\t\t\t$line .= implode(', ', array_map('Util::export', $frame['args']));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$line .= ')';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$stackTrace[] = $line;\n\t\t\t}\n\t\t\t\n\t\t\treturn implode(\"\\n\", $stackTrace);\n\t\t}",
"public function __getTraceAsString();",
"private function GetBackTrace() {\n $arr_backtrace = debug_backtrace();\n $trace = '';\n\n //echo \"<pre> \"; print_r($arr_backtrace); echo \"</pre>\";\n\n for ($x = 0; $x < count($arr_backtrace); $x++) {\n foreach ($arr_backtrace[$x] as $key => $value) {\n if (is_array($value)) { //arguments array (append)\n for ($y = 0; $y < count($value); $y++) {\n $arg = print_r($value[$y], true);\n $trace .= \"Function argument $y: $value[$y]\\n\\n\";\n }\n }\n\n if (!is_array($value))\n $trace .= \"$key: $value\";\n $trace .=\"\\n\\n\";\n }\n $trace .= \"---------------------------------------------------------------------------\\n\\n\";\n }\n\n return $trace;\n }",
"protected function _get_backtrace_string( )\n\t{\n\t\t$trace = debug_backtrace(false);\n\n\t\t$root_dir = (defined('ROOT_DIR')) ? ROOT_DIR : '';\n\n\t\t// ignore the first two entries of the backtrace array\n\t\t// (this method, and the self::write method)\n\t\t$output = '';\n\t\tfor ($i = 2, $count = count($trace); $i < $count; ++$i) {\n\t\t\t$index = $i - 2;\n\t\t\t$cur = $trace[$i];\n\n\t\t\t$file = '';\n\t\t\tif ( ! empty($cur['file'])) {\n\t\t\t\t$file = ' '.DIRECTORY_SEPARATOR.str_replace($root_dir, '', $cur['file']);\n\t\t\t}\n\n\t\t\t$line = '';\n\t\t\tif ( ! empty($cur['line'])) {\n\t\t\t\t$line = ' ('.$cur['line'].')';\n\t\t\t}\n\n\t\t\t$func = $cur['function'];\n\t\t\tif ( ! empty($cur['class'])) {\n\t\t\t\t$func = $cur['class'].$cur['type'].$func;\n\t\t\t}\n\n\t\t\t$args = ' ';\n\t\t\tif ( ! empty($cur['args'])) {\n\t\t\t\t$args = var_export($cur['args'], true);\n\t\t\t\t$args = preg_replace('/\\r?\\n/', \"\\n\\t\\t\\t\\t\", $args);\n\t\t\t}\n\n\t\t\t$output .= \"\\t\\t\\t#{$index}{$file}{$line}: {$func}({$args})\\n\";\n\t\t}\n\n\t\treturn substr($output, 0, -1);\n\t}",
"public function stackTrace($e)\n {\n $entries = explode(\"\\n\", $e->getTraceAsString());\n\n $output = \"\";\n foreach ($entries as $entry) {\n preg_match(\"/\\#([0-9]+) ([^:\\(]+)(?:\\(([0-9]+)\\))?(?:\\: )?(.*)/\", $entry, $matches);\n\n $depth = isset($matches[1]) ? $matches[1] : null;\n $line = isset($matches[3]) && $matches[3] ? \"(\" . $matches[3] . \")\" : null;\n $call = isset($matches[4]) ? $matches[4] : null;\n\n // skip entries without call information (e.g. '{main}').\n if (!$call) {\n continue;\n }\n\n $output .= str_pad($this->view->escape($depth), 3, ' ', STR_PAD_LEFT) . \": \";\n $output .= str_pad($this->view->escape($line), 5, ' ', STR_PAD_LEFT) . \" \";\n $output .= $this->view->escape($call);\n $output .= \"\\n\";\n }\n\n return $output;\n }",
"public function getTraceAsString();",
"function stacktrace()\n{\n $output = array();\n \n $trace = debug_backtrace();\n // first line is this function, so start at 2nd line ($i=1)\n\tfor ($i=1; $i<count($trace); $i++)\n {\n $line = $trace[$i];\n $function = ! empty($line['class']) ? $line['class'].$line['type'].$line['function'] : $line['function'];\n $pars = array();\n foreach ($line['args'] as $arg) {\n if (is_object($arg))\n $pars[] = get_class($arg);\n elseif (is_array($arg))\n \t$pars[] = trim(getVarName($arg).' Array('.count($arg).')');\n elseif (is_string($arg) && strlen($arg) > 30)\n \t$pars[] = trim(getVarName($arg).' <i>long string</i> '.substr(xsschars($arg), 0, 20));\n else\n $pars[] = trim(getVarName($arg).' '.xsschars($arg));\n }\n $output[] = str_pad(\"[$i]\", 4, \" \", STR_PAD_LEFT). \" => \".(! empty($line['file']) ? $line['file'] : '').' at line '.(! empty($line['line']) ? $line['line'] : '').' using function <strong>'.$function.'('.implode(', ', $pars).')</strong>';\n }\n \n return '<pre><strong>stacktrace: </strong>'.\"\\n\".implode(\"\\n\", $output).'</pre>'.\"\\n\";\n}",
"function get_call_stack() {}",
"public function getBacktrace();",
"function minimized_backtrace_as_string(): string\n {\n $backtrace = explode(\"\\n\", backtrace_as_string());\n\n return collect($backtrace)\n ->map(function (string $line) {\n return preg_match('/(#\\d+) .*? called at \\[(.*?)]/', $line, $matches) || preg_match('/(#\\d+) (.*?):/', $line, $matches)\n ? \"{$matches[1]} {$matches[2]}\"\n : false;\n })\n ->filter()\n ->implode(\"\\n\");\n }",
"protected function generateCallTrace()\n {\n $e = new \\Exception();\n $trace = explode(\"\\n\", $this->getExceptionTraceAsString($e));\n // reverse array to make steps line up chronologically\n $trace = array_reverse($trace);\n array_shift($trace); // remove {main}\n array_pop($trace); // remove call to this method\n array_pop($trace); // remove call to log_debug_result method\n $length = count($trace);\n $result = [];\n for ($i = 0; $i < $length; $i++) {\n // replace '#someNum' with '$i)', set the right ordering\n $result[] = ($i + 1) . ')' . substr($trace[$i], strpos($trace[$i], ' '));\n }\n\n return \"\\t\" . implode(\"\\n\\t\", $result) . \"\\n\\n\";\n }",
"function backtrace()\n{\n\t$out = \"Method/Function\\t\\t\\tCaller\\n\";\n\t$out .= \"---------------\\t\\t\\t------\\n\";\n\t$bt = debug_backtrace();\n\tarray_shift($bt);\n\tforeach($bt as $tp) {\n\t\t$fn = $caller = '';\n\t\tif($tp['object']) {\n\t\t\t$fn .= get_class($tp['object']).'::';\n\t\t} else if($tp['class']) {\n\t\t\t$fn .= \"{$tp['class']}::\";\n\t\t}\n\t\tif($tp['function']) $fn .= \"{$tp['function']}()\";\n\t\tif($tp['file']) $caller .= \"{$tp['file']}:{$tp['line']}\";\n\t\t$out .= \"$fn\\t\\t\\t$caller\\n\";\n\t}\n\treturn $out;\n}",
"function getExceptionTraceAsString(Exception $exception) {\n $rtn = \"\";\n $count = 0;\n foreach ($exception->getTrace() as $frame) {\n $args = \"\";\n if (isset($frame['args'])) {\n $args = array();\n foreach ($frame['args'] as $arg) {\n if (is_string($arg)) {\n $args[] = \"'\" . $arg . \"'\";\n } elseif (is_array($arg)) {\n $args[] = \"Array\";\n } elseif (is_null($arg)) {\n $args[] = 'NULL';\n } elseif (is_bool($arg)) {\n $args[] = ($arg) ? \"true\" : \"false\";\n } elseif (is_object($arg)) {\n $args[] = get_class($arg);\n } elseif (is_resource($arg)) {\n $args[] = get_resource_type($arg);\n } else {\n $args[] = $arg;\n } \n } \n $args = join(\", \", $args);\n }\n $rtn .= sprintf( \"#%s %s(%s): %s(%s)\\n\",\n $count,\n $frame['file'],\n $frame['line'],\n $frame['function'],\n $args );\n $count++;\n }\n return $rtn;\n}",
"function showBacktrace(){\n $aBacktrace = debug_backtrace(0);\n array_shift( $aBacktrace );\n $rtn = \"<p><strong>Backtrace:</strong></p><ol class=\\\"backtrace\\\">\";\n foreach( $aBacktrace as $bt ){\n $rtn .= \"<li>\";\n if( isset( $bt[\"class\"] ) ){\n $rtn .= \"<p class=\\\"method\\\">\".$bt[\"class\"].$bt[\"type\"];\n }\n $rtn .= $bt[\"function\"].\"(\";\n $c = \"\";\n foreach( $bt[\"args\"] as $arg ){\n if( is_string( $arg ) ) $rtn .= $c.'\"'.$arg.'\"';\n elseif( is_array( $arg ) ) $rtn .= $c.\"Array\";\n elseif( is_object( $arg ) ) $rtn .= $c.get_class( $arg );\n else $rtn .= $c.$arg;\n $c = \", \";\n }\n $rtn .= \")</p>\";\n $rtn .= \"<p class=\\\"file\\\">\".$bt[\"file\"].\":\".$bt[\"line\"].\"</p>\";\n $rtn .= \"</li>\\n\";\n }\n $rtn .= \"</ol>\";\n return $rtn;\n }",
"public function toString() {\n $s = sprintf(\n \"Exception %s (%s)\\n\",\n $this->getClassName(),\n $this->message\n );\n for ($i= 0, $t= sizeof($this->trace); $i < $t; $i++) {\n $s.= $this->trace[$i]->toString(); \n }\n return $s;\n\t}",
"protected function getCaller() : string\n {\n $strCaller = '';\n $aBacktrace = debug_backtrace();\n while (($aCaller = array_shift($aBacktrace)) !== null) {\n // just get latest call outside of the logger interface\n // if ($aCaller['class'] != get_class() ) {\n if (!is_subclass_of($aCaller['class'], 'Psr\\Log\\AbstractLogger')) {\n break;\n }\n }\n if ($aCaller) {\n // the base path on server isn't from interest.. \n $strFile = str_replace($_SERVER['DOCUMENT_ROOT'], '', $aCaller['file']);\n $strCaller = $strFile . ' (' . $aCaller['line'] . ')';\n }\n return $strCaller;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'spawnDeleteCategoriesJob' | public function spawnDeleteCategoriesJobRequest($catalog_category_delete_job_create_query, $apiKey = null)
{
// verify the required parameter 'catalog_category_delete_job_create_query' is set
if ($catalog_category_delete_job_create_query === null || (is_array($catalog_category_delete_job_create_query) && count($catalog_category_delete_job_create_query) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $catalog_category_delete_job_create_query when calling spawnDeleteCategoriesJob'
);
}
$resourcePath = '/api/catalog-category-bulk-delete-jobs/';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($catalog_category_delete_job_create_query)) {
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_delete_job_create_query));
} else {
$httpBody = $catalog_category_delete_job_create_query;
}
} elseif (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 = ObjectSerializer::buildQuery($formParams);
}
}
// this endpoint requires API key authentication
if ($apiKey == null) {
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
} else {
$apiKey = 'Klaviyo-API-Key '.$apiKey;
}
$headers['Authorization'] = $apiKey;
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$defaultHeaders['revision'] = ['2022-10-17'];
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function getDeleteCategoriesJobsRequest($fields_catalog_category_bulk_delete_job = null, $filter = null, $page_cursor = null, $apiKey = null)\n {\n\n $resourcePath = '/api/catalog-category-bulk-delete-jobs/';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $fields_catalog_category_bulk_delete_job,\n 'fields[catalog-category-bulk-delete-job]', // param base name\n 'array', // openApiType\n 'form', // style\n false, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $filter,\n 'filter', // param base name\n 'string', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $page_cursor,\n 'page[cursor]', // param base name\n 'string', // openApiType\n 'form', // style\n true, // explode\n false // required\n ) ?? []);\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n if ($apiKey == null) {\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n } else {\n $apiKey = 'Klaviyo-API-Key '.$apiKey;\n }\n\n $headers['Authorization'] = $apiKey;\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $defaultHeaders['revision'] = ['2022-10-17'];\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function spawnCreateCategoriesJobRequest($catalog_category_create_job_create_query, $apiKey = null)\n {\n // verify the required parameter 'catalog_category_create_job_create_query' is set\n if ($catalog_category_create_job_create_query === null || (is_array($catalog_category_create_job_create_query) && count($catalog_category_create_job_create_query) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $catalog_category_create_job_create_query when calling spawnCreateCategoriesJob'\n );\n }\n\n $resourcePath = '/api/catalog-category-bulk-create-jobs/';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($catalog_category_create_job_create_query)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_create_job_create_query));\n } else {\n $httpBody = $catalog_category_create_job_create_query;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n if ($apiKey == null) {\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n } else {\n $apiKey = 'Klaviyo-API-Key '.$apiKey;\n }\n\n $headers['Authorization'] = $apiKey;\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $defaultHeaders['revision'] = ['2022-10-17'];\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getCreateCategoriesJobRequest($job_id, $fields_catalog_category_bulk_create_job = null, $fields_catalog_category = null, $include = null, $apiKey = null)\n {\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling getCreateCategoriesJob'\n );\n }\n\n $resourcePath = '/api/catalog-category-bulk-create-jobs/{job_id}/';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $fields_catalog_category_bulk_create_job,\n 'fields[catalog-category-bulk-create-job]', // param base name\n 'array', // openApiType\n 'form', // style\n false, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $fields_catalog_category,\n 'fields[catalog-category]', // param base name\n 'array', // openApiType\n 'form', // style\n false, // explode\n false // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $include,\n 'include', // param base name\n 'array', // openApiType\n 'form', // style\n false, // explode\n false // required\n ) ?? []);\n\n\n // path params\n if ($job_id !== null) {\n $resourcePath = str_replace(\n '{' . 'job_id' . '}',\n ObjectSerializer::toPathValue($job_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n if ($apiKey == null) {\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n } else {\n $apiKey = 'Klaviyo-API-Key '.$apiKey;\n }\n\n $headers['Authorization'] = $apiKey;\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $defaultHeaders['revision'] = ['2022-10-17'];\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function spawnUpdateCategoriesJobRequest($catalog_category_update_job_create_query, $apiKey = null)\n {\n // verify the required parameter 'catalog_category_update_job_create_query' is set\n if ($catalog_category_update_job_create_query === null || (is_array($catalog_category_update_job_create_query) && count($catalog_category_update_job_create_query) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $catalog_category_update_job_create_query when calling spawnUpdateCategoriesJob'\n );\n }\n\n $resourcePath = '/api/catalog-category-bulk-update-jobs/';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($catalog_category_update_job_create_query)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($catalog_category_update_job_create_query));\n } else {\n $httpBody = $catalog_category_update_job_create_query;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n if ($apiKey == null) {\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n } else {\n $apiKey = 'Klaviyo-API-Key '.$apiKey;\n }\n\n $headers['Authorization'] = $apiKey;\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $defaultHeaders['revision'] = ['2022-10-17'];\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function build(): BatchDeleteCatalogObjectsRequest\n {\n return CoreHelper::clone($this->instance);\n }",
"public function findCleanupJobsRequest()\n {\n\n $resourcePath = '/history/cleanup/jobs';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testDELETEResourceCategoryRequest()\n\t{\n\t\t$request = new ERestTestRequestHelper();\n\n\t\t$request['config'] = [\n\t\t\t'url'\t\t\t=> 'http://api/category/4',\n\t\t\t'type'\t\t=> 'DELETE',\n\t\t\t'data'\t\t=> null,\n\t\t\t'headers' => [\n\t\t\t\t'X_REST_USERNAME' => 'admin@restuser',\n\t\t\t\t'X_REST_PASSWORD' => 'admin@Access',\n\t\t\t],\n\t\t];\n\t\t\n\t\t$request_response = $request->send();\n\t\t$expected_response = '{\"success\":\"true\",\"message\":\"Record Deleted\",\"data\":{\"totalCount\":\"1\",\"category\":{\"id\":\"4\",\"name\":\"cat4\"}}}';\n\t\t$this->assertJsonStringEqualsJsonString($request_response, $expected_response);\n\t}",
"public function cdeleteAction(Request $request)\n {\n $idsData = $request->get('ids');\n $ids = \\explode(',', $idsData);\n\n if (!\\count($ids)) {\n throw new MissingParameterException('TargetGroupController', 'ids');\n }\n\n $targetGroups = $this->targetGroupRepository->findById($ids);\n\n foreach ($targetGroups as $targetGroup) {\n $this->entityManager->remove($targetGroup);\n }\n\n $this->entityManager->flush();\n\n return $this->handleView($this->view(null, 204));\n }",
"protected function getDeleteRequest()\n\t{\n\t\t$url = $this->url();\n\t\t\n\t\t$url->getQuery()->setParameter('code', 204);\n\t\t\n\t\treturn new Api\\Request\\Create((string) $url);\n\t}",
"public function testCreateJobWithWrongCategory()\n {\n $requestBody = [\n \"category\" => 123,\n \"title\" => \"Umzug\",\n \"zip\" => \"10711\",\n \"description\" => \"Lorem ipsum dolor sit amet.\",\n \"dueDate\" => \"2018-12-12\"\n ];\n\n $this->client->request('POST', '/job/create', $requestBody);\n\n $this->assertEquals(\n Response::HTTP_UNPROCESSABLE_ENTITY,\n $this->client->getResponse()->getStatusCode(),\n $this->client->getResponse()->getContent()\n );\n }",
"public function spawnDeleteCategoriesJobWithHttpInfo($catalog_category_delete_job_create_query, $apiKey = null)\n {\n $request = $this->spawnDeleteCategoriesJobRequest($catalog_category_delete_job_create_query, $apiKey);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 202:\n if ('array<string,mixed>' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('array<string,mixed>' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n\n $parsed_content = json_decode(json_encode($content), TRUE);\n if (json_last_error() != JSON_ERROR_NONE) {\n $parsed_content = $content;\n }\n\n return [\n $parsed_content,\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 400:\n if ('\\KlaviyoAPI\\Model\\GetCatalogItems400Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\KlaviyoAPI\\Model\\GetCatalogItems400Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n\n $parsed_content = json_decode(json_encode($content), TRUE);\n if (json_last_error() != JSON_ERROR_NONE) {\n $parsed_content = $content;\n }\n\n return [\n $parsed_content,\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 500:\n if ('\\KlaviyoAPI\\Model\\GetCatalogItems400Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\KlaviyoAPI\\Model\\GetCatalogItems400Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n\n $parsed_content = json_decode(json_encode($content), TRUE);\n if (json_last_error() != JSON_ERROR_NONE) {\n $parsed_content = $content;\n }\n\n return [\n $parsed_content,\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = 'array<string,mixed>';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n $parsed_content = json_decode(json_encode($content), TRUE);\n if (json_last_error() != JSON_ERROR_NONE) {\n $parsed_content = $content;\n }\n\n return [\n $parsed_content,\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n 'array<string,mixed>',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\KlaviyoAPI\\Model\\GetCatalogItems400Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\KlaviyoAPI\\Model\\GetCatalogItems400Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function bulkDestroy(Request $request)\n {\n $this->validate($request, ['action' => 'in:delete,permadelete']);\n\n $parameters = $request->all();\n\n $parameters['force'] = 0;\n if (!config('forum.preferences.soft_deletes') || ($request->input('action') == 'permadelete')) {\n $parameters['force'] = 1;\n }\n\n $threads = $this->api('bulk.thread.delete')->parameters($parameters)->delete();\n\n return $this->bulkActionResponse($threads, 'threads.deleted');\n }",
"public function testDeleteCategories()\n {\n $client = static::createClient();\n \n $crawler = $client->request('POST', '/api/category.json', ['name' => 'Category 1']);\n \n $content = json_decode($client->getResponse()->getContent());\n\n $this->assertEquals(201, $client->getResponse()->getStatusCode());\n \n $crawler = $client->request('DELETE', '/api/categories.json', ['id' => $content->id]);\n\n $this->assertEquals(204, $client->getResponse()->getStatusCode());\n }",
"protected function createUpdateBatchCategoryRequest($createUpdateBatchCategory)\n {\n // verify the required parameter 'createUpdateBatchCategory' is set\n if ($createUpdateBatchCategory === null || (is_array($createUpdateBatchCategory) && count($createUpdateBatchCategory) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $createUpdateBatchCategory when calling createUpdateBatchCategory'\n );\n }\n\n $resourcePath = '/categories/batch';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($createUpdateBatchCategory)) {\n $_tempBody = $createUpdateBatchCategory;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('api-key');\n if ($apiKey !== null) {\n $headers['api-key'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('partner-key');\n if ($apiKey !== null) {\n $headers['partner-key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function deleteMultipleJobsAction()\n {\n \t$params=$this->getRequest()->getParams();\n \t$jobIdsArr=explode(\",\", $params['jobIDs']);\n \t// delete saved jobs\n// \tZend_Debug::dump($jobIdsArr);\n// \tdie;\n \t\n \tfor($i=0;$i<count($jobIdsArr);$i++)\n \t{\n \t\t$deleteSavedJob = \\Extended\\saved_jobs::deleteSavedJobByID($jobIdsArr[$i]);\n \t}\n \tif($deleteSavedJob)\n \t{\n \t\t// delete job applications\n \t\tfor($i=0;$i<count($jobIdsArr);$i++)\n \t\t{\n\t \t\t$resutl=\\Extended\\job_applications::deleteApplicants($jobIdsArr[$i]);\n \t\t}\n\t \tif($resutl)\n\t \t{\n\t \t\t// delete jobs\n\t \t\tfor($i=0;$i<count($jobIdsArr);$i++)\n\t \t\t{\n\t \t\t\t$result=\\Extended\\job::deleteJob($jobIdsArr[$i]);\n\t \t\t}\n\t \t\tif($result)\n\t \t\t{\n\t \t\t\techo Zend_Json::encode(array(\"msg\"=>\"success\"));\n\t \t\t\t$messages = new Zend_Session_Namespace('messages');\n\t \t\t\t$messages->successMsg = \"Job Removed.\";\n\t \t\t}\n\t \t\telse\n\t \t\t{\n\n\t \t\t\techo Zend_Json::encode(array(\"msg\"=>\"error\"));\n\t \t\t\t$messages = new Zend_Session_Namespace('messages');\n\t \t\t\t$messages->successMsg = \"Server Error.\";\n\t \t\t}\n\t \t}\n\t \telse\n\t \t{\n\n\t \t\techo Zend_Json::encode(array(\"msg\"=>\"error\"));\n\t \t\t$messages = new Zend_Session_Namespace('messages');\n\t \t\t$messages->successMsg = \"Server Error.\";\n\t \t}\n \t}\n \telse\n \t{\n \t\techo Zend_Json::encode(array(\"msg\"=>\"error\"));\n \t\t$messages = new Zend_Session_Namespace('messages');\n \t\t$messages->successMsg = \"Server Error.\";\n \t}\n \tdie;\n }",
"public function categoryDeleteAjax()\n\t{\n\t\t$requestData = Request::all();\n\t\treturn DB::table('categories')\n\t\t\t\t\t->where('id', '=', $requestData['id'])\n\t\t\t\t\t->delete();\n\t}",
"public function delete($params) {\n $this->autoRender = false;\n $params = $this->request->data;\n $this->BullhornConnection->BHConnect();\n $url = $_SESSION['BH']['restURL'] . '/entity/JobSubmission/' . $params['id'] . '?BhRestToken=' . $_SESSION['BH']['restToken'];\n $params['isDeleted'] = 'true';\n $post_params = json_encode($params);\n $req_method = 'POST';\n $response = $this->BullhornCurl->curlFunction($url, $post_params, $req_method);\n echo json_encode($response);\n }",
"public function executeDeleteStdInputCategory(sfWebRequest $request) {\n\n if (count($request->getParameter('chkLocID')) >0) {\n \n $stdCategory = new StdInputCategory();\n $stdCategory->deleteStdInputCategory($request->getParameter('chkLocID'));\n $this->getUser()->setFlash('notice', 'Successfully deleted the record');\n \n } else {\n \n $this->getUser()->setFlash('error', 'Select at least lne record to delete');\n }\n \n $this->redirect('consultancy/showStdInputCategoryList');\n }",
"public function massDestroy(Request $request)\n {\n if (! Gate::allows('jobtype_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Jobtype::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns ShippingDelivery object for provided quote. | public function getDeliveryForQuote($quote)
{
return $this->getShippingDeliveryForItems(
$quote->getAllItems(),
$quote->getCityRef(),
$quote->getWarehouseRef()
);
} | [
"public function getCheckoutQuoteObject($quote)\n {\n $shippingAddress = $quote->getShippingAddress();\n $shipping = null;\n if ($shippingAddress) {\n $shipping = array(\n 'name' => array('full' => $shippingAddress->getName()),\n 'phone_number' => $shippingAddress->getTelephone(),\n 'phone_number_alternative' => $shippingAddress->getAltTelephone(),\n 'address' => array(\n 'line1' => $shippingAddress->getStreet(1),\n 'line2' => $shippingAddress->getStreet(2),\n 'city' => $shippingAddress->getCity(),\n 'state' => $shippingAddress->getRegion(),\n 'country' => $shippingAddress->getCountryModel()->getIso2Code(),\n 'zipcode' => $shippingAddress->getPostcode(),\n ));\n }\n\n $billingAddress = $quote->getBillingAddress();\n $billing = array(\n 'name' => array('full' => $billingAddress->getName()),\n 'email' => $quote->getCustomerEmail(),\n 'phone_number' => $billingAddress->getTelephone(),\n 'phone_number_alternative' => $billingAddress->getAltTelephone(),\n 'address' => array(\n 'line1' => $billingAddress->getStreet(1),\n 'line2' => $billingAddress->getStreet(2),\n 'city' => $billingAddress->getCity(),\n 'state' => $billingAddress->getRegion(),\n 'country' => $billingAddress->getCountryModel()->getIso2Code(),\n 'zipcode' => $billingAddress->getPostcode(),\n ));\n\n $items = array();\n $productIds = array();\n $productItemsMFP = array();\n $categoryItemsIds = array();\n foreach ($quote->getAllVisibleItems() as $orderItem) {\n $productIds[] = $orderItem->getProductId();\n }\n $products = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect(\n array('affirm_product_mfp', 'affirm_product_mfp_type', 'affirm_product_mfp_priority')\n )\n ->addAttributeToFilter('entity_id', array('in' => $productIds));\n $productItems = $products->getItems();\n foreach ($quote->getAllVisibleItems() as $orderItem) {\n $product = $productItems[$orderItem->getProductId()];\n if (Mage::helper('affirm')->isPreOrder() && $orderItem->getParentItem() &&\n ($orderItem->getParentItem()->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE)\n ) {\n continue;\n }\n $items[] = array(\n 'sku' => $orderItem->getSku(),\n 'display_name' => $orderItem->getName(),\n 'item_url' => $product->getProductUrl(),\n 'item_image_url' => Mage::getModel('catalog/product')->load($orderItem->getProductId())->getImageUrl(),\n 'qty' => intval($orderItem->getQty()),\n 'unit_price' => Mage::helper('affirm/util')->formatCents($orderItem->getPrice())\n );\n\n $start_date = $product->getAffirmProductMfpStartDate();\n $end_date = $product->getAffirmProductMfpEndDate();\n if(empty($start_date) || empty($end_date)) {\n $mfpValue = $product->getAffirmProductMfp();\n } else {\n if(Mage::app()->getLocale()->isStoreDateInInterval(null, $start_date, $end_date)) {\n $mfpValue = $product->getAffirmProductMfp();\n } else {\n $mfpValue = \"\";\n }\n }\n\n $productItemsMFP[] = array(\n 'value' => $mfpValue,\n 'type' => $product->getAffirmProductMfpType(),\n 'priority' => $product->getAffirmProductMfpPriority() ?\n $product->getAffirmProductMfpPriority() : 0\n );\n\n $categoryIds = $product->getCategoryIds();\n if (!empty($categoryIds)) {\n $categoryItemsIds = array_merge($categoryItemsIds, $categoryIds);\n }\n }\n\n $checkout = array(\n 'checkout_id' => $quote->getId(),\n 'currency' => $quote->getQuoteCurrencyCode(),\n 'shipping_amount' => Mage::helper('affirm/util')->formatCents($quote->getShippingAddress()->getShippingAmount()),\n 'shipping_type' => $quote->getShippingAddress()->getShippingMethod(),\n 'tax_amount' => Mage::helper('affirm/util')->formatCents($quote->getShippingAddress()->getTaxAmount()),\n 'merchant' => array(\n 'public_api_key' => Mage::helper('affirm')->getApiKey(),\n 'user_confirmation_url' => Mage::getUrl('affirm/payment/confirm', array('_secure' => true)),\n 'user_cancel_url' => Mage::helper('checkout/url')->getCheckoutUrl(),\n 'user_confirmation_url_action' => 'POST',\n 'charge_declined_url' => Mage::helper('checkout/url')->getCheckoutUrl()\n ),\n 'config' => array('required_billing_fields' => 'name,address,email'),\n 'items' => $items,\n 'billing' => $billing\n );\n // By convention, Affirm expects positive value for discount amount. Magento provides negative.\n $discountAmtAffirm = (-1) * $quote->getDiscountAmount();\n if ($discountAmtAffirm > 0.001) {\n $discountCode = $this->_getDiscountCode($quote);\n $checkout['discounts'] = array(\n $discountCode => array(\n 'discount_amount' => Mage::helper('affirm/util')->formatCents($discountAmtAffirm)\n )\n );\n }\n\n if ($shipping) {\n $checkout['shipping'] = $shipping;\n }\n $checkout['total'] = Mage::helper('affirm/util')->formatCents($quote->getGrandTotal());\n if (method_exists('Mage', 'getEdition')){\n $platform_edition = Mage::getEdition();\n }\n $platform_version = Mage::getVersion();\n $platform_version_edition = isset($platform_edition) ? $platform_version.' '.$platform_edition : $platform_version;\n $checkout['metadata'] = array(\n 'shipping_type' => $quote->getShippingAddress()->getShippingDescription(),\n 'platform_type' => 'Magento',\n 'platform_version' => $platform_version_edition,\n 'platform_affirm' => Mage::helper('affirm')->getExtensionVersion(),\n 'mode' => 'modal'\n );\n $affirmMFPValue = Mage::helper('affirm/mfp')->getAffirmMFPValue($productItemsMFP, $categoryItemsIds, $quote->getBaseGrandTotal());\n if ($affirmMFPValue) {\n $checkout['financing_program'] = $affirmMFPValue;\n }\n\n $checkoutObject = new Varien_Object($checkout);\n Mage::dispatchEvent('affirm_get_checkout_object_after', array('checkout_object' => $checkoutObject));\n $checkout = $checkoutObject->getData();\n return $checkout;\n }",
"public function createDeliveryNoteFromQuote (Quote $quote) {\n if ($quote->getStatus() != 1) {\n throw new Exception('Only quotes with status pending could be ordered');\n }\n $deliveryNote = new DeliveryNote();\n $common = clone ($quote->getCommon());\n $deliveryNote->setCommon($common);\n\n return $deliveryNote;\n }",
"private function buildOrderShipping(CartInterface $quote): OrderItemInterface\n {\n $shipping = $quote->getShippingAddress();\n $shippingTotal = $shipping->getShippingInclTax() - $shipping->getShippingDiscountAmount();\n\n return $this->orderItemFactory->create()\n ->setItemId($quote->getId() . '-shipping')\n ->setType('shipping')\n ->setDescription($shipping->getShippingDescription() ?? '')\n ->setReference($shipping->getShippingMethod() ?? '')\n ->setQuantity('1')\n ->setUnitPrice((int) ($shippingTotal * 100))\n ->setTaxRate('0')\n ->setTaxAmount(0)\n ->setTotalAmount((int) ($shippingTotal * 100));\n }",
"public function getFromQuote(Quote $quote): ?DataObject\n {\n $extShippingInfo = $quote->getExtShippingInfo();\n if (!$extShippingInfo) {\n return null;\n }\n\n try {\n $extShipInfoArray = $this->jsonSerializer->unserialize($extShippingInfo);\n } catch (\\Exception $e) {\n return null;\n }\n\n $sveaArray = $extShipInfoArray['svea_shipping_info'] ?? [];\n if (count($sveaArray) < 1) {\n return null;\n }\n return $this->dataObjectFactory->create()->setData($sveaArray);\n }",
"public function getDelivery()\n {\n if (is_null($this->delivery)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_DELIVERY);\n if (is_null($data)) {\n return null;\n }\n\n $this->delivery = DeliveryModel::of($data);\n }\n\n return $this->delivery;\n }",
"public function getShippingAddress()\n\t{\n\t\tforeach ($this->addresses as $address) {\n\t\t\tif ($address->getType() == ISC_QUOTE_ADDRESS::TYPE_SHIPPING) {\n\t\t\t\treturn $address;\n\t\t\t}\n\t\t}\n\n\t\t// Still here? Create an address siliently\n\t\t$address = new ISC_QUOTE_ADDRESS_SHIPPING;\n\t\t$this->addShippingAddress($address);\n\t\treturn $address;\n\t}",
"private function populate_quote( $quote ): Quote {\n\t\treturn $this->quote_factory->from_stdclass( $quote );\n\t}",
"public function createFromQuote(Quote $quote)\n {\n $invoice = new Invoice;\n\n $em = $this->container->get('doctrine')->getManager();\n\n $metadata = $em->getClassMetadata(get_class($quote));\n\n $invoiceMetadata = $em->getClassMetadata(get_class($invoice));\n\n $this->copyFieldValues($quote, $invoice);\n\n foreach ($metadata->getAssociationNames() as $mappingField) {\n if ('status' === $mappingField) {\n continue;\n }\n\n if ('items' === $mappingField) {\n $items = $metadata->getFieldValue($quote, $mappingField);\n\n foreach ($items as $item) {\n $invoiceItem = new Item;\n $this->copyFieldValues($item, $invoiceItem);\n $invoice->addItem($invoiceItem);\n }\n } else {\n $invoiceMetadata->setFieldValue(\n $invoice,\n $mappingField,\n $metadata->getFieldValue($quote, $mappingField)\n );\n }\n }\n\n $status = $em->getRepository('CSBillInvoiceBundle:Status')->findOneByName('pending');\n $invoice->setStatus($status);\n\n return $invoice;\n }",
"protected function _getShippingObject()\n {\n $shipping = $this->_order->getShippingAddress();\n $shippingAddressObj = new WirecardCEE_Client_QPay_Request_Initiation_ConsumerData_Address(WirecardCEE_Client_QPay_Request_Initiation_ConsumerData_Address::TYPE_SHIPPING);\n\n $shippingAddressObj->setFirstname($shipping->getFirstname());\n $shippingAddressObj->setLastname($shipping->getLastname());\n $shippingAddressObj->setAddress1($shipping->getStreet1());\n $shippingAddressObj->setAddress2($shipping->getStreet2());\n $shippingAddressObj->setCity($shipping->getCity());\n $shippingAddressObj->setCountry($shipping->getCountry());\n $shippingAddressObj->setState($shipping->getRegionCode());\n $shippingAddressObj->setZipCode($shipping->getPostcode());\n $shippingAddressObj->setFax($shipping->getFax());\n $shippingAddressObj->setPhone($shipping->getTelephone());\n\n return $shippingAddressObj;\n }",
"public function getDelivery()\n {\n return $this->delivery;\n }",
"public function prepareQuoteBillingAddress(Cdev_XPaymentsConnector_Model_Quote $quote)\n {\n return $this->prepareAddress($quote, null, self::BILLING_ADDRESS);\n }",
"private function getQuote()\n {\n if (!$this->quote) {\n $quoteId = $this->getOrder()->getQuoteId();\n\n if ($quoteId) {\n try {\n $this->quote = $this->quoteRepository->get($quoteId, ['*']);\n } catch (NoSuchEntityException $e) {\n $this->quote = null;\n }\n }\n }\n\n return $this->quote;\n }",
"protected function getQueueItem($quote)\n {\n $queueItem = $this->queueModel->getByQuoteId($quote->getId());\n\n if (!$queueItem->getId()) {\n $queueItem = $this->createQueueItem($quote);\n }\n\n return $queueItem;\n }",
"public function getShipping()\n {\n $shipping = $this->shipping->getShipping($this->orderWeight);\n\n return $shipping;\n }",
"public function getShipping()\n\t{\n\t\t$Shipping = new Shipping();\n\t\t$Shipping = $Shipping->findItem( array( 'Id = '.$this->shipping ) );\n\t\tif ( !$Shipping->Id )\n\t\t{\n\t\t\tforeach ( $Shipping->findList( array( 'IsActive = 1' ), 'Position asc', 0, 1 ) as $Shipping )\n\t\t\t{\n\t\t\t\treturn $Shipping;\n\t\t\t}\n\t\t}\n\t\treturn $Shipping;\n\t}",
"public function buildDelivery()\n {\n $address = $this->_shippingAddress;\n\n $this->_delivery = new stdClass();\n\n $this->_delivery->email = $address->getEmail();\n \t// @todo: Street line?\n $this->_delivery->address_line = $address->getStreet(1);\n\n // $this->_delivery->city = $address->getCity();\n $this->_delivery->postal_code = $address->getPostcode();\n $this->_delivery->country_code = strtolower($address->getCountryId());\n $this->_delivery->phone_number = $address->getTelephone();\n\n $this->_delivery->name = $address->getFirstname().' '.$address->getLastname();\n\n if ($address->getCompany()) {\n $this->_delivery->name = $address->getCompany().' / '.$this->_delivery->name;\n }\n\n $this->_delivery->after = $this->_timeWindow->getDeliveryFrom();\n $this->_delivery->before = $this->_timeWindow->getDeliveryTo();\n\n return $this->_delivery;\n }",
"protected function _getDeliveryAddress()\n\t{\n\t\t/** @var AddressBookService $addressBookService */\n\t\t$addressBookService = StaticGXCoreLoader::getService('AddressBook');\n\t\t\n\t\t$addressBookId = new IdType($_SESSION['sendto']);\n\t\t$deliveryAddress = $addressBookService->findAddressById($addressBookId);\n\t\t\n\t\treturn $deliveryAddress;\n\t}",
"public function getConfigPaymentByQuote(Mage_Sales_Model_Quote $quote)\n {\n return $this->getConfigPayment($quote->getStoreId());\n }",
"private function convertQuoteBillingAddress(Quote $quote)\n {\n if (! $quote->getBillingAddress()) {\n return null;\n }\n $address = $this->convertAddress($quote->getBillingAddress());\n\n $gdprEnabled = $this->scopeConfig->getValue('wallee_payment/gdpr/gdpr_enabled',\n ScopeInterface::SCOPE_STORE, $quote->getStoreId());\n\n if ($gdprEnabled == 'enabled') {\n // removing GDPR sensitive information\n $address->setDateOfBirth('');\n $address->setFamilyName('');\n $address->setGivenName('');\n $address->setStreet('');\n }\n $address->setDateOfBirth($this->getDateOfBirth($quote->getCustomerDob(), $quote->getCustomerId()));\n $address->setEmailAddress($this->getCustomerEmailAddress($quote->getCustomerEmail(), $quote->getCustomerId()));\n $address->setGender($this->getGender($quote->getCustomerGender(), $quote->getCustomerId()));\n $address->setSalesTaxNumber($this->getTaxNumber($quote->getCustomerTaxvat(), $quote->getCustomerId()));\n return $address;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set default rule of parameterize route. | protected function setDefaultRule()
{
if (Yii::$app->authManager->getRule(RouteRule::RULE_NAME) === null) {
Yii::$app->authManager->add(Yii::createObject([
'class' => RouteRule::className(),
'name' => RouteRule::RULE_NAME]
));
}
} | [
"private static function initDefaultParameterPatterns() {\n self::$route->pattern('id','[0-9]+');\n self::$route->pattern('view_name','[A-Za-z_]+');\n }",
"public function getDefaultRouteParameterName();",
"public function defaultRule();",
"function SetDefaultRoute($param)\n{\n\tglobal $router;\n\t$router->SetDefaultRoute($param);\n}",
"public function __construct($defaultRule = [])\n {\n if (!empty($defaultRule)) {\n $this->rules['*'] = $defaultRule;\n }\n }",
"protected function setDefaultParameters()\n {\n\n }",
"public function setDefaultParams()\n {\n }",
"function setDefaultRoute($route) {\r\n\t\t\t$this->default_route = $route;\r\n\t\t}",
"public function setDefaultParams($params){ }",
"public function setDefaultParamRegex($regex)\n {\n $this->default_param_regex = $regex;\n }",
"public function setRule() {\n }",
"public function setDefaultRule(string $rule): self\n\t{\n\t\t$rule = strtolower($rule);\n\n\t\tif (!in_array($rule, ['accept', 'reject'])) {\n\t\t\tthrow new InvalidArgumentException(sprintf(\n\t\t\t\t'Default rule must be one of \"accept\" or \"reject\"'\n\t\t\t));\n\t\t}\n\n\t\t$this->defaultRule = $rule;\n\n\t\treturn $this;\n\t}",
"public function set()\n {\n $args = func_get_args();\n $name = $args[0];\n $args[0] = null;\n\n if (isset($this->namedRoutes[$name])) {\n $this->namedRoutes[$name]['rules'] = $args;\n return $this->mapNamedRoute($name);\n }\n\n $route = $this->buildNamedRoute();\n $route['name'] = $name;\n $route['rules'] = $args;\n $this->namedRoutes[$name] = $route;\n\n return $this;\n }",
"public function testDefaultParamValidation()\n {\n $this->getClass()->setParam('foobar', 'bazbing');\n }",
"protected function setSefDefaultParams()\n {\n $this->defaultUrlTemplates404 = [\n 'list' => '',\n 'detail' => '#ELEMENT_ID#/'\n ];\n\n $this->componentVariables = ['ELEMENT_ID'];\n }",
"private function set_default_rewrite() {\n\t\t$this->rewrite = [\n\t\t\t// Customize the permalink structure slug. Should be translatable.\n\t\t\t'slug' => $this->interpolate( '%s', $this->slug ),\n\n\t\t\t/*\n\t\t\t * Do not prepend the front base to the permalink structure.\n\t\t\t *\n\t\t\t * For example, if your permalink structure is /blog/, then your links will be:\n\t\t\t * false->/news/, true->/blog/news/\n\t\t\t */\n\t\t\t'with_front' => false,\n\t\t];\n\t}",
"#[@test]\n public function paramsDefaultValue() {\n $params= XPClass::forName('net.xp_framework.unittest.rest.server.mock.MockArgs')\n ->newInstance()->getClass()->getMethod('methodWithOptionalArguments')->getParameters();\n $restArgs= new RestRoutingArgs($params);\n $this->assertEquals('default', $restArgs->getArgumentDefaultValue('arg2'));\n }",
"function route_parameter($name, $default = null)\n {\n $routeInfo = app('request')->route();\n return array_get($routeInfo[2], $name, $default);\n }",
"function url_default_parameters__enable()\n{\n global $URL_DEFAULT_PARAMETERS_ENABLED;\n $URL_DEFAULT_PARAMETERS_ENABLED = true;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if block is registered. | private function check_block_is_registered( WP_Block_Parser_Block $block, $type, $package ) {
$block_name = isset( $block->blockName ) ? $block->blockName : '';
$blocks_that_should_be_registered = array( 'normal block', 'columns block', 'inner block' );
$times = 1;
if ( $type ) {
$times = in_array( $type, $blocks_that_should_be_registered, true ) ? 1 : 0;
}
$this->expectAction(
'wpml_register_string',
array(
$block->innerHTML,
md5( $block_name . $block->innerHTML ),
$package,
$block_name,
'VISUAL',
),
$times
);
if ( isset( $block->innerBlocks ) ) {
foreach ( $block->innerBlocks as $type => $block ) {
$this->check_block_is_registered( $block, $type, $package );
}
}
} | [
"public function is_registered( $name ) {\n\t\treturn isset( $this->registered_block_types[ $name ] );\n\t}",
"public function hasBlock(string $name): bool;",
"public function is_registered( $block_name, $block_style_name ) {\n\t\treturn isset( $this->registered_block_styles[ $block_name ][ $block_style_name ] );\n\t}",
"public function register() {\n\t\t$registered = register_block_type( $this->type, $this->args );\n\t\tif ( false === $registered ) {\n\t\t\tLogger::log(\n\t\t\t\t'error',\n\t\t\t\t'block_not_registered',\n\t\t\t\t'The provided block failed to register. Register block type provides a __doing_it_wrong warning explaining more.',\n\t\t\t\t[ 'ref' => $this->type, 'expects' => 'string' ]\n\t\t\t);\n\t\t} else {\n\t\t\tLogger::log(\n\t\t\t\t'notice',\n\t\t\t\t'block_registered',\n\t\t\t\t'The provided block was registered successfully.',\n\t\t\t\t[ 'ref' => $this->type, 'args' => $this->args ]\n\t\t\t);\n\t\t}\n\t}",
"protected function has_blocks_support()\n {\n }",
"function checkTemplateBlockExists($block_name = '') {\n \n if (array_key_exists($block_name, $this->tpl->blocks)) return true;\n else return false;\n \n }",
"function check_block()\n {\n $sql = \"SHOW TABLES LIKE '\" . $GLOBALS['xoopsDB']->prefix(\"block_instance\") . \"'\";\n $result = $GLOBALS['xoopsDB']->queryF($sql);\n if (!$result) return true;\n if ($GLOBALS['xoopsDB']->getRowsNum($result) > 0) return false;\n return true;\n }",
"function blockExists ($blockName) {\n if (!$this->templateValid) {$this->triggerError (\"Template not valid.\"); return false; }\n return $this->lookupBlockName($blockName,$blockNo); }",
"function has_block_type( $name ) {\n\t\treturn isset( $this->blocks[ $name ] );\n\t}",
"public function isRegisteredBlockType( $id ) {\n\t\tif ( isset( $this->registered_block_types[ $id ] ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"function bimber_is_registered_injection_slot( $id ) {\n\tglobal $bimber_registered_injection_slots;\n\n\treturn isset( $bimber_registered_injection_slots[ $id ] );\n}",
"private function register_block($block_name)\n {\n }",
"function acf_has_block_type( $name ) {\n\treturn acf_get_store( 'block-types' )->has( $name );\n}",
"private function validBlock()\n {\n if (is_array($this->context) && !array_key_exists('block', $this->context)) {\n $this->setBlock();\n }\n }",
"private static function has_block_template($template_name)\n {\n }",
"function check_for_block_json() {\n\t\tforeach ( $this->blocks as $block_name => $block_info ) {\n\t\t\tif ( ! empty( $this->block_json_files[ $block_name ] ) ) {\n\t\t\t\t$this->record_result(\n\t\t\t\t\t__FUNCTION__,\n\t\t\t\t\t'info',\n\t\t\t\t\t// translators: %s is the block name.\n\t\t\t\t\tsprintf( __( 'Found a block.json file for block %s.', 'wporg-plugins' ), '<code>' . $block_name . '</code>' ),\n\t\t\t\t\t$this->block_json_files[ $block_name ]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $this->block_json_files ) ) {\n\t\t\t$this->record_result(\n\t\t\t\t__FUNCTION__,\n\t\t\t\t'warning',\n\t\t\t\t__( 'No block.json files were found.', 'wporg-plugins' )\n\t\t\t);\n\t\t}\n\t}",
"public function doesUserBlockUseAssembly(string $blockName): bool;",
"public function hasUserBlock(string $name): bool\n {\n return isset($this->userBlocks[$name]);\n }",
"public static function has_block_in_page($page, $block_name)\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Split controller name into module and controller name | private function split_controller_name( $controller )
{
$match = array();
if(!@preg_match("/^([A-Z]{1}[a-z0-9]+)([a-zA-Z0-9]+)/", $controller, $match))
{
throw new JapaPageControllerException('Wrong controller call name: ' . $controller);
}
// we push controller names in stack to retrieve later the views in a nested controller concept
// which is the case for modul applications.
array_push($this->controller_match, $match);
return $match;
} | [
"protected function getModuleFromControllerName() \r\n {\r\n $controller_name = get_class($this);\r\n return strtolower(preg_replace('/_(.*?)$/i', '', $controller_name));\r\n }",
"public function GetControllerName ();",
"public function getControllerName();",
"public function getControllerName() {}",
"public function getControllerName(){}",
"public function getControllerName()\n\t{\n\t\treturn str_replace('Controller' , '' , $this->controller);\n\t}",
"public function getControllerName() {\n\t\tif (empty($this->controllerName)) {\n\t\t\t$parts = t3lib_div::trimExplode('_', get_class($this));\n\t\t\t$this->controllerName = implode('_', array_slice($parts, 3)); // throw away \"tx\", \"<condensedExtKey>\", \"controller\"\n\t\t}\n\t\treturn $this->controllerName;\n\t}",
"public function getBaseControllerName();",
"protected function getControllerName()\n {\n return preg_replace(\"/(.*)[\\\\\\\\](.*)(Controller)/\", '$2', get_class($this));\n }",
"protected function getControllerName()\n {\n return strtolower(\n preg_replace('/([a-z\\d])([A-Z])/', '\\1_\\2', \n preg_replace('/([A-Z]+)([A-Z][a-z])/', '\\1_\\2', str_replace('Controller', '', get_class($this)))\n )\n );\n }",
"public static function getController(){\n return str_replace('Controller', \"\", self::$controller);\n }",
"public function getControllerModule();",
"public function getControllerObjectName();",
"public function getControllerNameParts()\n {\n $controller_name = strtolower(str_replace('Controller', '', $this->params('controller')));\n $action_name = $this->params('action');\n \n return [\n 'controller' => $controller_name,\n 'action' => $action_name,\n ];\n }",
"function _controllerName($name) {\n\t\treturn Inflector::pluralize ( Inflector::camelize ( $name ) );\n\t}",
"protected function getControllerName()\r\n {\r\n $route = $this->getRoute();\r\n return $this->formatControllerName($route['controller']);\r\n }",
"function getControllerObjectName() ;",
"function _controllerName($name) {\n\t\treturn Inflector::pluralize(Inflector::camelize($name));\n\t}",
"public function getControllerName()\n {\n return AppHelper::getControllerName();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add Sigma Events Administration Help Tabs Add help tabs describing options available during various administrative tasks in WordPress backend. | function add_help_tabs(){
global $post_type;
global $action;
if('events' == $post_type || 'products' == $post_type && 'edit' == $action ):
include SIGMA_PATH . 'admin/help/help-events.php';
$screen = get_current_screen();
$screen->add_help_tab( sigma_email_template_help() );
$screen->set_help_sidebar( sigma_events_help_sidebar() );
endif;
} | [
"public function add_help_tab()\n {\n }",
"function tutsplus_add_help_tab() {\n\t\n\t$screen = get_current_screen();\n\t$screen->add_help_tab( array (\n\t\t'id' => 'tutsplus_admin_help_tab',\n\t\t'title' => 'Help with your site',\n\t\t'callback' => 'tutsplus_admin_help_callback'\n\t\n\t));\n\t\n}",
"public function add_help_tabs() {\n\t\t\t\n\t\t\t// Bail if hook not defined\n\t\t\tif ( ! isset( $this->plugin_screen_hook_suffix ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$screen = get_current_screen();\n\n\t\t\t// Check that this is the easy custom sidebars admin page\n\t\t\tif ( $this->plugin_screen_hook_suffix == $screen->id ) {\n\t\t\t\t\n\t\t\t\t// Add overview tab\n\t\t\t\t$screen->add_help_tab( array(\n\t\t\t\t\t'id' => 'overview',\n\t\t\t\t\t'title' => __( 'Overview', 'easy-custom-sidebars' ),\n\t\t\t\t\t'content' => $this->get_overview_tab_content(),\n\t\t\t\t) );\n\n\t\t\t\t/**\n\t\t\t\t * Hook into this action to add more tabs to the admin page\n\t\t\t\t * or remove any tabs defined above, if you wish to change\n\t\t\t\t * the tab content based on the theme that is activated.\n\t\t\t\t */\n\t\t\t\tdo_action( 'cps-help-tabs', $screen );\n\n\t\t\t\t$screen->set_help_sidebar(\n\t\t\t\t\t'<p><strong>' . __( 'For more information:', 'easy-custom-sidebars' ) . '</strong></p>' .\n\t\t\t\t\t'<p><a href=\"http://codex.wordpress.org/Function_Reference/register_sidebar\" target=\"_blank\">' . __( 'Documentation on Registering Sidebars', 'easy-custom-sidebars' ) . '</a></p>' .\n\t\t\t\t\t'<p><a href=\"http://wordpress.org/support/\" target=\"_blank\">' . __('Support Forums') . '</a></p>'\n\t\t\t\t);\t\n\t\t\t}\n\t\t}",
"public function add_plugin_options_help_tab() {\n\n\t\t// Backwards compatability.\n\t\tif ( get_bloginfo( 'version' ) < 3.3 ) {\n\n\t\t\t$text = $this->get_plugin_options_help_tab_getting_started();\n\t\t\t$text .= $this->get_plugin_options_help_tab_managing_editing_your_cpt_settings();\n\t\t\t$text .= $this->get_plugin_options_help_tab_custom_cpt_onomy_archive_pages();\n\t\t\t$text .= $this->get_plugin_options_help_tab_troubleshooting();\n\t\t\tadd_contextual_help( $this->options_page, $text );\n\n\t\t} else {\n\n\t\t\t// Get info for the current screen.\n\t\t $screen = get_current_screen();\n\n\t\t // Only add help tab on my options page.\n\t\t\tif ( $this->is_network_admin ) {\n\n\t\t\t\tif ( $screen->id != $this->options_page . '-network' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} elseif ( $screen->id != $this->options_page ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$screen->add_help_tab( array(\n\t\t 'id'\t => 'custom_post_type_onomies_help_getting_started',\n\t\t 'title'\t => __( 'Getting Started', 'cpt-onomies' ),\n\t\t 'callback'\t=> array( $this, 'get_plugin_options_help_tab_getting_started' ),\n\t\t ));\n\n\t\t\t$screen->add_help_tab( array(\n\t\t 'id'\t => 'custom_post_type_onomies_help_managing_editing_your_cpt_settings',\n\t\t 'title'\t => __( 'Managing/Editing Your Custom Post Type Settings', 'cpt-onomies' ),\n\t\t 'callback'\t=> array( $this, 'get_plugin_options_help_tab_managing_editing_your_cpt_settings' ),\n\t\t ));\n\n\t\t\t$screen->add_help_tab( array(\n\t\t 'id'\t => 'custom_post_type_onomies_help_custom_cpt_onomy_archive_pages',\n\t\t 'title'\t => sprintf( __( 'Custom %s Archive Pages', 'cpt-onomies' ), 'CPT-onomy' ),\n\t\t 'callback'\t=> array( $this, 'get_plugin_options_help_tab_custom_cpt_onomy_archive_pages' ),\n\t\t ));\n\n\t\t\t$screen->add_help_tab( array(\n\t\t 'id'\t => 'custom_post_type_onomies_help_troubleshooting',\n\t\t 'title'\t => __( 'Troubleshooting', 'cpt-onomies' ),\n\t\t 'callback'\t=> array( $this, 'get_plugin_options_help_tab_troubleshooting' ),\n\t\t ));\n\n\t\t}\n\t}",
"public function setHelpTabs() {\n // $this->args['help_tabs'][] = array(\n // 'id' => 'redux-help-tab-1',\n // 'title' => __( 'Theme Information 1', 'business-review' ),\n // 'content' => __( '<p>This is the tab content, HTML is allowed.</p>', 'business-review' )\n // );\n\n // $this->args['help_tabs'][] = array(\n // 'id' => 'redux-help-tab-2',\n // 'title' => __( 'Theme Information 2', 'business-review' ),\n // 'content' => __( '<p>This is the tab content, HTML is allowed.</p>', 'business-review' )\n // );\n\n // Set the help sidebar\n // $this->args['help_sidebar'] = __( '<p>This is the sidebar content, HTML is allowed.</p>', 'business-review' );\n }",
"public function add_help_tabs() {\n if (!function_exists('get_current_screen')) {\n return;\n }\n\n $screen = get_current_screen();\n\n $screen->set_help_sidebar($this->get_help_text('sidebar'));\n\n $screen->add_help_tab(array(\n 'id' => 'quickstart',\n 'title' => __('Quick Start', EMAIL_ENCODER_BUNDLE_DOMAIN),\n 'content' => $this->get_help_text('quickstart'),\n ));\n $screen->add_help_tab(array(\n 'id' => 'shortcodes',\n 'title' => __('Shortcodes', EMAIL_ENCODER_BUNDLE_DOMAIN),\n 'content' => $this->get_help_text('shortcodes'),\n ));\n $screen->add_help_tab(array(\n 'id' => 'templatefunctions',\n 'title' => __('Template Functions', EMAIL_ENCODER_BUNDLE_DOMAIN),\n 'content' => $this->get_help_text('templatefunctions'),\n ));\n $screen->add_help_tab(array(\n 'id' => 'actions',\n 'title' => __('Action Hook', EMAIL_ENCODER_BUNDLE_DOMAIN),\n 'content' => $this->get_help_text('actions'),\n ));\n $screen->add_help_tab(array(\n 'id' => 'filters',\n 'title' => __('Filter Hooks', EMAIL_ENCODER_BUNDLE_DOMAIN),\n 'content' => $this->get_help_text('filters'),\n ));\n $screen->add_help_tab(array(\n 'id' => 'faq',\n 'title' => __('FAQ', EMAIL_ENCODER_BUNDLE_DOMAIN),\n 'content' => $this->get_help_text('faq'),\n ));\n }",
"public function help_tab() {\n\n\t\t\t// Get current screen\n\t\t\t$screen = get_current_screen();\n\n\t\t\t// Define content\n\t\t\t$content = '<p><h3>'. __( 'Useful Links', 'wpex' ) .'</h3><ul>';\n\t\t\t\t$content .= '<li><a href=\"http://wpexplorer-themes.com/total/changelog/\" target=\"_blank\">'. __( 'Changelog', 'wpex' ) .'</a></li>';\n\t\t\t\t$content .= '<li><a href=\"http://wpexplorer-themes.com/total/docs/\" target=\"_blank\">'. __( 'Documentation', 'wpex' ) .'</a></li>';\n\t\t\t\t$content .= '<li><a href=\"http://wpexplorer-themes.com/total/docs-category/sample-data/\" target=\"_blank\">'. __( 'Sample Data', 'wpex' ) .'</a></li>';\n\t\t\t\t$content .= '<li><a href=\"http://wpexplorer-themes.com/total/snippets/\" target=\"_blank\">'. __( 'Snippets', 'wpex' ) .'</a></li>';\n\t\t\t\t$content .= '<li><a href=\"http://themeforest.net/item/total-responsive-multipurpose-wordpress-theme/6339019/comments?ref=WPExplorer\" target=\"_blank\">'. __( 'Support', 'wpex' ) .'</a></li>';\n\t\t\t$content .= '</ul></p>';\n\n\t\t\t// Add wpex_footer_builder help tab if current screen is My Admin Page\n\t\t\t$screen->add_help_tab( array(\n\t\t\t\t'id' => 'wpex_theme_panel',\n\t\t\t\t'title' => __( 'Useful Links', 'wpex' ),\n\t\t\t\t'content' => $content,\n\t\t\t) );\n\n\t\t}",
"public function help() {\n\n\t\t$screen = get_current_screen();\n\t\t$help_tabs = $this->define_tabs();\n\t\tif ( ! $help_tabs ) {\n\t\t\treturn;\n\t\t}\n\t\tforeach ( $help_tabs as $tab ) {\n\t\t\t$screen->add_help_tab( $tab );\n\t\t}\n\t}",
"public function help_tabs() {\n\t\tget_current_screen()->add_help_tab( array(\n\t\t\t'id' => 'wp_term_color_help_tab',\n\t\t\t'title' => __( 'Calendar Color', 'sugar-calendar' ),\n\t\t\t'content' => '<p>' . __( 'Calendars can have unique colors to help separate them from each other.', 'sugar-calendar' ) . '</p>',\n\t\t) );\n\t}",
"public function setup_help_tab()\n {\n }",
"public function add_contextual_help()\n {\n $screen = get_current_screen();\n\n $screen->add_help_tab(array(\n 'id' => 'getting-started',\n 'title' => __('Getting Started'),\n 'content' => '<p>'.__('To use this plugin, you require an <a href=\"https://www.instamojo.com/accounts/register/\" target=\"_new\">Instamojo account</a>.').'</p><p>'.__('If you already have an account with Instamojo and have created offers there, then you can authenticate you account by filling up the credentials. Enter your Instamojo Username and Password, and then click the <b>Authenticate</b> button.').'</p>'\n ));\n $screen->add_help_tab(array(\n 'id' => 'usage',\n 'title' => __('Usage'),\n 'content' => '<p>'.__('After authenticating your account, you can now use the Instamojo Widget which is available from <b>Appearance > Widgets</b>.').'</p><p>You can also use the shortcode generator available in the options page. This shortcode can be used to embed buttons into posts and pages.</p>'\n ));\n $screen->add_help_tab(array(\n 'id' => 'revoke',\n 'title' => __('Revoking your token'),\n 'content' => '<p>'.__('If you do not wish to use the plugin anymore and wish to revoke your token associated with this application, you can click the <b>Revoke Token</b> button.').'</p>'\n ));\n\n $screen->set_help_sidebar('<ul><li><a href=\"https://www.instamojo.com\" target=\"_new\">Instamojo Website</a><li><li><a href=\"https://www.instamojo.com/developers\" target=\"_new\">Instamojo API</a><li></ul>');\n }",
"public function do_help_tab() {\n\t\tinclude_once Tribe__Main::instance()->plugin_path . 'src/admin-views/tribe-options-help.php';\n\t}",
"public function adminHelpTab()\n {\n $screen = get_current_screen();\n $Loader = new \\RdDownloads\\App\\Libraries\\Loader();\n $wp_upload_dir = wp_upload_dir();\n\n $output = [];\n $output['basedir'] = (isset($wp_upload_dir['basedir']) ? $wp_upload_dir['basedir'] : '');\n unset($wp_upload_dir);\n\n ob_start();\n $Loader->loadView('admin/Downloads/Editing/helpTab/tab1_v', $output);\n $content = ob_get_contents();\n unset($output);\n $screen->add_help_tab([\n 'id' => 'rd-downloads-editing-helptab-1',\n 'title' => __('Basic guide', 'rd-downloads'),\n 'content' => $content,\n ]);\n unset($content);\n ob_clean();\n\n global $rd_downloads_options;\n $output['rd_downloads_options'] = $rd_downloads_options;\n $Loader->loadView('admin/Downloads/Editing/helpTab/tab2_v', $output);\n $content = ob_get_contents();\n $screen->add_help_tab([\n 'id' => 'rd-downloads-editing-helptab-2',\n 'title' => __('Force download', 'rd-downloads'),\n 'content' => $content,\n ]);\n unset($content);\n\n if (ob_get_length() > 0) {\n ob_end_clean();\n }\n unset($Loader);\n }",
"function audiotheme_venue_list_help() {\n\tget_current_screen()->add_help_tab( array(\n\t\t'id' => 'overview',\n\t\t'title' => __( 'Overview', 'audiotheme' ),\n\t\t'content' =>\n\t\t\t'<p>' . __( 'This screen provides access to all of your venues. Think of it as a database or address book for all the venues where you have performed, will perform, or may potentially perform in the future.', 'audiotheme' ) . '</p>' .\n\t\t\t'<p>' . __( 'You can customize the display of this screen to suit your workflow. Hide or display columns based on your needs and decide how many venues to list per screen using the Screen Options tab.', 'audiotheme' ) . '</p>',\n\t) );\n}",
"public function add_help_tab() {\n\t\t$screen = get_current_screen();\n\t\tforeach ( $this->places as $place ) {\n\t\t\tif ( $place['screen'] == $screen->base ) {\n\t\t\t\twp_enqueue_style( 'wptv' );\n\t\t\t\t$screen->add_help_tab( array(\n\t\t\t\t\t\t'id' => 'videos',\n\t\t\t\t\t\t'title' => 'Videos',\n\t\t\t\t\t\t'content' => '',\n\t\t\t\t\t\t'callback' => array( $this, 'display' ),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"function ce_add_search_help() {\n\n global $ce_search_hook;\n $screen = get_current_screen();\n\n if ( $screen->id != $ce_search_hook ) { return; }\n\n $screen -> add_help_tab( array( 'id' => 'ce-search-help-tab', 'title' => __( 'Help', 'simple-embed-code' ), 'content' => ce_search_help() ) );\n}",
"function siteorigin_panels_add_help_tab($prefix) {\n\t$screen = get_current_screen();\n\tif(\n\t\t( $screen->base == 'post' && ( in_array( $screen->id, siteorigin_panels_setting( 'post-types' ) ) || $screen->id == '') )\n\t\t|| ($screen->id == 'appearance_page_so_panels_home_page')\n\t) {\n\t\t$screen->add_help_tab( array(\n\t\t\t'id' => 'panels-help-tab', //unique id for the tab\n\t\t\t'title' => __( 'Page Builder', 'positive-panels' ), //unique visible title for the tab\n\t\t\t'callback' => 'siteorigin_panels_add_help_tab_content'\n\t\t) );\n\t}\n}",
"function screen_help() {\r\n global $current_screen;\r\n\r\n // If it's not Courseware Screen\r\n if( !stristr( $current_screen->id, 'courseware' ) )\r\n return;\r\n\r\n $content = self::load_template( array( 'name' => 'contextual_help' ) );\r\n $current_screen->add_help_tab( array(\r\n 'id'=> 'default',\r\n 'title'=> __( 'Help', 'bpsp' ),\r\n 'content' => $content\r\n ) );\r\n }",
"private function define_admin_hooks(){\n\t\t$admin = new WPHelp_Admin ( $this->get_version() );\n\t\t$this->loader->add_action('admin_enqueue_scripts', $admin, 'enqueue_styles'); // load stylesheets\n\t\t$this->loader->add_action( 'admin_menu', $admin, 'load_options'); // add Help Page & Menu item\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
End the current session and clear local session | public function endSession() {
$session = CheckfrontModule::session();
if ($sessionID = $session->getID()) {
CheckfrontModule::api()->post(
new CheckfrontAPIRequest(
'session/end',
array(
'session_id' => $sessionID
)
)
);
}
$session->clear(null);
} | [
"private function end() {\n if ($this->isSessionStarted()) {\n session_commit();\n $this->clear();\n }\n }",
"public function finish() {\n session_destroy();\n Util::redis()->delete(\"session_\" . $this->sessionId);\n Util::noSessionRedirect();\n }",
"private function endSession()\n\t{\n\t\t$this->api_obj->Session_End($this->session_id);\n\t}",
"private function sessionStop(){\n session_unset();\n session_destroy();\n }",
"public static function end () {\n\t\t\tunset ($_SESSION);\n\t\t\tsession_unset ();\n\t\t\tif (ini_get(\"session.use_cookies\")) {\n\t\t\t\t$params = session_get_cookie_params ();\n\t\t\t\tsetcookie (session_name (), \"\", time () - (365 * 24 * 60 * 60), $params[\"path\"], $params[\"domain\"], $params[\"secure\"], $params[\"httponly\"]);\n\t\t\t}\n\t\t\tsession_destroy ();\n\t\t}",
"public static function endSession(){\n\t\t$id = static::getID();\n\t\tself::$_redis->delete($id);\n\t}",
"public static function end()\r\n\t{\r\n\t\tif (isset($_SESSION['token']))\r\n\t\t\tSession::where(\"token\", \"=\", $_SESSION['token'])->delete()->get();\r\n\t\tsetcookie('friender', '', time(), '/');\r\n\t\tsession_destroy();\r\n\t}",
"public static function end(){\r\n\t\tsession_write_close();\r\n\t}",
"function end_session()\n\t{\n\t\t$this->session->unset_userdata('login');\n\t\t$this->session->unset_userdata('logged');\n\t}",
"public function close()\n {\n session_unset();\n session_destroy();\n }",
"public function endApplicationSession() {\n unset($_SESSION[self::$application]);\n session_destroy(); \n }",
"public function clearSession();",
"public function sessions_end()\n\t{\n\t}",
"public function stop()\n {\n session_stop();\n }",
"public static function exit_session(){\n\n // Clear the current session objects\n unset($_SESSION['GAME']);\n\n // Start a new session with default variables\n self::start_session();\n\n }",
"public function logout() {\n\t\t$this->user->session_kill();\n\t}",
"public function logout()\n {\n $this->auth = false;\n $this->cfg = [];\n $this->closeSession();\n }",
"function logout() {\n if ($this->_socket) {\n $this->send_cmd( array(\n 'action' => 'quit',\n 'object' => 'session' )\n );\n $this->close_socket();\n }\n }",
"public static function destroy(){\n self::open();\n session_destroy();\n $_SESSION = null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if a file should be created | public function createFileCheck() {
if (file_exists($this->path . $this->getClassFilename())) {
return $this->overwrite;
}
return true;
} | [
"public function testCreateFile()\n {\n $this->assertTrue( $this->fs->createFile( OUTPUT_DIR . $this->_testFile ) );\n\n $this->assertTrue( file_exists( OUTPUT_DIR . $this->_testFile ) );\n }",
"function createFile($filename){\n if(file_exists($filename)){\n return false;\n } else {\n $fp = fopen($filename, 'w');\n fclose($fp);\n return true;\n }\n}",
"public function create(): bool\n {\n // Everybody can create files\n return true;\n }",
"private function missingFileCheck($file){\n\t if (!file_exists($file)){\n\t\t\t$succ = touch($file);\n\t\t\tif($succ == false){\n\t\t\t\tfprintf(STDERR, \"Error: couldn`t create \".$file.\" file\\n\");\n\t\t\t\tthrow new Exception(\"Error: couldn`t create \".$file.\" file\\n\",Errors::ERROR_OUTPUT);\n\t\t\t}\n\t\t\treturn true;\n\t }\n\t return false;\n\t}",
"protected function isFile() {}",
"public function filesMustExist();",
"protected function createFile() {}",
"public function isFile () {}",
"public function isFile(){}",
"private function fileAlreadyExists(): bool\n {\n if ('resize' === $this->getMode()) {\n $this->setMissingParams();\n }\n\n return file_exists($this->getDestination().$this->getFileName(true));\n }",
"private function checkFile($filename){\n\t\tif(!file_exists($this->_path . $filename)){\n\t\t\t$handle = fopen($this->_path . $filename, 'w') or die(\"Can't create log file: \" . $filename);\n\t\t\tfclose($handle);\n\t\t\treturn;\n\t\t}\n\t}",
"function create($file=NULL, $content=NULL) {\n\t\t$file = fra_var[\"files_path\"].\"\".$file;\n\t\tif(file_exists($file)) {\n\t\t\tunlink($file);\n\t\t}\t\n\t\tif(file_put_contents($file, $content)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function createXmlFile()\r\n\t{\r\n\t\t// nothing to do here\r\n\t\treturn true;\r\n\t}",
"public function fileExists();",
"public function create() {\n if (!$this->getExists()) {\n if ($this->open('w')) {\n $this->close();\n return $this->set($this->_realpath);\n }\n\n $this->addLog('Unable to create empty file');\n return False;\n }\n\n $this->addLog('File creation failed. File already exists');\n return False;\n }",
"public function createNewFile() {\n\t\tif ($this->exists()) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tif ($this->getParentFile() != NULL && !$this->getParentFile()->canWrite()) {\n\t\t\tthrow new IOException(\"The file can not be created.\", self::ERROR_SECURITY);\n\t\t}\n\t\t// Create a new file\n\t\tTools::tryError();\n\t\t$file = fopen($this->getPath(), \"w+\");\n\t\tif (Tools::catchError($msg)) {\n\t\t\tthrow new IOException($msg, self::ERROR_OPEN);\n\t\t}\n\t\t// Close the file\n\t\tTools::tryError();\n\t\tfclose($file);\n\t\tif (Tools::catchError($msg)) {\n\t\t\tthrow new IOException($msg, self::ERROR_OPEN);\n\t\t}\n\t}",
"public static function needNewFile($name)\n {\n // should we triger an error here?\n if (!self::_issetFile($name)) {\n return false;\n }\n\n if (!is_file(self::_filepathFile($name)) || self::_hasFileExpired($name)) {\n return true;\n }\n \n return false;\n }",
"function check_files()\n{\n global $lock_file, $wb_dir;\n // The lock file is used as a signal that server files have\n // been built (this function has been already successfully\n // executed)\n if (file_exists($lock_file))\n return true;\n else\n // create files (suppress exceptions but consider the return state\n return touch($lock_file) && mkdir($wb_dir, 0700);\n}",
"public function hasFilePath() : bool;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the answer "created" event. | public function created(Answer $answer)
{
$subject = config('settings.sns.subjects.ANSWER_CREATE');
app(SendNotification::class)->handle($subject, $this->getNotificationData($answer));
} | [
"public function created(Answer $answer)\n {\n //\n }",
"public function created(AnswerOption $answerOption)\n {\n //\n }",
"public function handleOfferCreated(OfferCreated $event)\n { \n $event->tender->user->notify(new OfferWasCreated($event->tender, $event->offer)); \n }",
"public function onPostCreated($event)\n {\n //\n }",
"public function after_create() {}",
"function on_create_handler()\n{\n\tglobal $g_obj_course_manager;\n\t\n\t// create a new course\n\t$str_course_name = PageHandler::get_post_value( 'CourseName' );\n\t$str_course_description = PageHandler::get_post_value( 'CourseDescription' );\n\t\n\t// verify the input\n\tif ( !isset( $str_course_name ) || !isset( $str_course_description ) )\n\t{\n\t\tMessageHandler::add_message( MSG_FAIL, 'Please enter the necessary information' );\n\t\treturn;\n\t}\n\t \n\t// process the input\n\tif ( $g_obj_course_manager->add_course( $str_course_name, $str_course_description ) )\n\t{\n\t\tMessageHandler::add_message( MSG_SUCCESS, 'Successfully created Course \"' . $str_course_name . '\"' );\n\t}\n\t\n\telse\n\t{\n\t\tMessageHandler::add_message( MSG_FAIL, 'Failed to create Course \"' . $str_course_name . '\"' );\n\t}\n}",
"private function onAnswer()\n {\n if (!$this->checkAuth()) {\n return;\n }\n\n $payload = $this->clientEvent->getPayload();\n\n $checkAnswer = $this->getService('quest.quest_manager')->checkAnswer(\n $this->getUserId(),\n $payload['chapterId'] ?? null,\n $payload['answer'] ?? null\n );\n\n $this->send(new AnswerEvent($this->clientEvent, $checkAnswer));\n\n if ($checkAnswer) {\n $newData = $this\n ->getService('quest.quest_manager')\n ->getNewData($payload['chapterId'], $this->getUserId(), true);\n\n if ($newData) {\n $this->send(\n new NewContentEvent($newData)\n );\n }\n\n }\n }",
"public function created(Reply $reply)\n {\n // 命令行运行迁移时不做这些操作!\n if ( ! app()->runningInConsole()) {\n $reply->topic->reply_count = $reply->topic->replies->count();\n $reply->topic->save();\n $reply->topic->user->topicReplyNotify(new TopicReplied($reply));\n }\n\n }",
"public function createQuestionWithAnswer(): void\n {\n $question = $this->ask('What is your question?');\n $answer = $this->ask('Answer the following question, '.$question);\n\n\n Question::create([\n 'question'=>$question,\n 'answer'=>$answer\n ]);\n\n $this->info(\"Question has been created successfully!\");\n\n $this->mainMenu();\n\n }",
"public function handle(NewAnswer $event)\n {\n\n //Get the list of followers on this question\n $followers = DB::table('topics_follow')\n ->join('users','topics_follow.uuid','=','users.uuid')\n ->join('topics','topics_follow.topic_id','=','topics.uuid')\n ->where('topic_id',$event->answer->topic_uuid)\n ->select('users.firstname','users.lastname','users.displayname','users.email',\n 'topics.topic')\n ->get();\n\n $latestAnswer = DB::table('topics_answers')->where('topic_uuid',$event->answer->topic_uuid)\n ->orderby('created_at','DESC')\n ->first();\n\n foreach($followers as $follower)\n {\n Mail::send('emails.new_answer', ['follower' => $follower , 'topic' => $latestAnswer], function ($m) use ($follower,$latestAnswer) {\n $m->from('no-reply@qanya.com', 'Qanya?');\n $m->to($follower->email, \"$follower->firstname $follower->lastname\")\n ->subject('มีคำตอบใหม่ใน '.strip_tags($follower->topic));\n });\n }\n }",
"public function created(Reply $reply)\n {\n //\n // $reply->topic->increment('reply_count',1);\n $reply->topic->updateReplyCount();\n $reply->topic->save();\n\n //通知话题作者有新的评论\n $reply->topic->user->notify(new TopicReplied($reply));\n }",
"public function newAnswerReplyNotification(){\n\n \t}",
"public function created_event(){\n return true;\n }",
"protected function post_eventos() {}",
"public function onCreatedAdEvent (AdCreatedEvent $event)\n {\n // since there are multiple social network posts and we don't know how quick they will be, it is best to store\n // them in the que and run them separately\n }",
"public static function createAnswer(\\Elgg\\Event $event): void {\n\t\t$object = $event->getObject();\n\t\tif (!$object instanceof \\ElggAnswer) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* @var $owner \\ElggUser */\n\t\t$owner = $object->getOwnerEntity();\n\t\t$question = $object->getContainerEntity();\n\t\tif (!$question instanceof \\ElggQuestion) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ($question->hasMutedNotifications($owner->guid)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// subscribe to the question\n\t\t$content_preferences = $owner->getNotificationSettings('create_comment');\n\t\t$enabled_methods = array_keys(array_filter($content_preferences));\n\t\tif (empty($enabled_methods)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$question->addSubscription($owner->guid, $enabled_methods);\n\t}",
"public function created($context)\n { \n if(!$this->filter('created')) return;\n\n $context->morphMany(Record::class, 'context')->create([\n 'message' => trans('tracker::tracker.created', ['context' => $this->getContextTypeName($context), 'name' => $context->getContextLabel()]),\n 'agent_id' => $this->getCurrentAgentID(),\n 'agent_type' => $this->getCurrentAgentType(),\n 'performed_at' => time(),\n ]);\n }",
"public function created(Output $output)\n {\n Log::alert('Output created : ' . $output->id);\n ProcessAbstract::dispatch($output);\n }",
"public function created(Figure $figure)\n {\n //\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
\brief Retrieves and sends the requested version file for the document \param[in] docId The document ID passed in \param[in] strVersion The string version number passed in \return true if the file was sent successfully false with set message to output to the client | function SendFile($docId, $strVersion)
{
global $documentUploadPath;
$file = $this->GetFile($docId, $strVersion);
if(sizeof($file) == 0)
{
return $this->results->Set('false', "No file record found.");
}
$file= $documentUploadPath.$file;
/*
Send it out to the client
*/
header("Content-type: application/force-download");
header("Content-Transfer-Encoding: Binary");
header("Content-length: ".filesize($file));
header("Content-disposition: attachment; filename=\"".basename($file)."\"");
readfile("$file");
return true;
} | [
"function downloadVersionedPhysicalDocument($iDocumentID, $sVersion) {\n //get the document\n $oDocument = & Document::get($iDocumentID);\n //get the path to the document on the server\n $sDocumentFileSystemPath = $oDocument->getPath() . \"-$sVersion\";\n if (file_exists($sDocumentFileSystemPath)) {\n //set the correct headers\n header(\"Content-Type: \" .\n KTMime::getMimeTypeName($oDocument->getMimeTypeID()));\n header(\"Content-Length: \". filesize($sDocumentFileSystemPath));\n // prefix the filename presented to the browser to preserve the document extension\n header('Content-Disposition: attachment; filename=\"' . \"$sVersion-\" . $oDocument->getFileName() . '\"');\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n header(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n header(\"Cache-Control: must-revalidate\");\n header(\"Content-Location: \".$oDocument->getFileName());\n readfile($sDocumentFileSystemPath);\n } else {\n return false;\n }\n }",
"function downloadVersionedPhysicalDocument($iDocumentID, $sVersion) {\n //get the document\n $oDocument = & Document::get($iDocumentID);\n //get the path to the document on the server\n $sDocumentFileSystemPath = $oDocument->getPath() . \"-$sVersion\";\n if (file_exists($sDocumentFileSystemPath)) {\n //set the correct headers\n header(\"Content-Type: \" .\n PhysicalDocumentManager::getMimeTypeName($oDocument->getMimeTypeID()));\n header(\"Content-Length: \". filesize($sDocumentFileSystemPath));\n // prefix the filename presented to the browser to preserve the document extension\n header('Content-Disposition: attachment; filename=\"' . \"$sVersion-\" . $oDocument->getFileName() . '\"');\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n header(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n header(\"Cache-Control: must-revalidate\");\n header(\"Content-Location: \".$oDocument->getFileName());\n readfile($sDocumentFileSystemPath);\n } else {\n return false;\n }\n }",
"public static function create_version(DMSDocument $doc)\n {\n $success = false;\n\n $existingPath = $doc->getFullPath();\n if (is_file($existingPath)) {\n $docData = $doc->toMap();\n unset($docData['ID']);\n $version = new DMSDocument_versions($docData); //create a copy of the current DMSDocument as a version\n\n $previousVersionCounter = 0;\n $newestExistingVersion = self::get_versions($doc)->sort(array('Created'=>'DESC', 'ID'=>'DESC'))->limit(1);\n if ($newestExistingVersion && $newestExistingVersion->Count() > 0) {\n $previousVersionCounter = $newestExistingVersion->first()->VersionCounter;\n }\n\n //change the filename field to a field containing the new soon-to-be versioned file\n $version->VersionCounter = $previousVersionCounter + 1; //start versions at 1\n $newFilename = $version->generateVersionedFilename($doc, $version->VersionCounter);\n $version->Filename = $newFilename;\n\n //add a relation back to the origin ID;\n $version->DocumentID = $doc->ID;\n $id = $version->write();\n\n if (!empty($id)) {\n rename($existingPath, $version->getFullPath());\n $success = true;\n }\n }\n\n return $success;\n }",
"public function isVersionRecieved();",
"public function isVersionSent();",
"function SetFileName($versionId, $strFilename)\r\n\t{\r\n\t\t$db = dmsData::GetInstance();\r\n\t\t$strFullFileName = $this->BuildFileName($strFilename, $versionId);\r\n\t\tif(strlen($strFullFileName) < 1)\r\n\t\t{\r\n\t\t\treturn $this->results->Set('false', \"Invalid full file name.\");\r\n\t\t}\r\n\t\t\r\n\t\t$updateValues = array();\r\n\t\t$updateValues[$this->field_File] = $strFullFileName;\r\n\t\t\r\n\t\t$updateFilter = array();\r\n\t\t$updateFilter[$this->field_Id] = $versionId;\r\n\t\t\r\n\t\tif(!$db->update($this->table_Name, $updateValues, $updateFilter))\r\n\t\t{\r\n\t\t\treturn $this->results->Set('false', \"Unable to update document version file information.\");\r\n\t\t}\r\n\t\r\n\t\treturn $this->results->Set('true', \"Document version file name updated.\");\r\n\t}",
"private function respondToVersion(File $file, Response $response, $version)\n {\n if (!$this->filelib->getFileOperator()->hasVersion($file, $version)) {\n $response->setHttpResponseCode(404);\n return;\n }\n\n $res = $this->getStorage()->retrieveVersion($file->getResource(), $version);\n return $res;\n }",
"function OutputUploadVersionResults()\r\n\t{\r\n\t\t$strValue = $this->results->GetResult();\r\n\t\t$strMsg = $this->results->GetMessage();\r\n\t\t\r\n\t\techo \"<html><head><script>window.onload = function ()\r\n\t\t\t{\r\n\t\t\t\tif(parent.oAddDocumentVersion)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent.oAddDocumentVersion.DisplayMessage(\\\"$strValue||$strMsg\\\");\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tdocument.write(\\\"$strMsg\\\");\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\t</script></Head>\r\n\t\t\t<body>$strMsg</body>\r\n\t\t\t</html>\r\n\t\t\t\";\r\n\t\t\t\r\n\t\treturn $strValue == 'true';\r\n\t}",
"public function get_version () {\n $this->error = '';\n $fields = array( \"action\" => \"get_version\", \"auth\" => \"{$this->auth}\" );\n $response = $this->_sendRequest ( $fields );\n if ( $response ) {\n if ( $response[ \"status\" ] == \"success\" ) {\n return isset ( $response[ \"data\" ] ) ? $response[ \"data\" ] : false;\n } else {\n $this->error = $response[ 'errmsg' ];\n }\n }\n return false;\n }",
"public function actionSendDocumentByEmail()\n {\n if (Yii::app()->request->isAjaxRequest && isset($_POST['email']) && isset($_POST['client_id'])) {\n $client_id = intval($_POST['client_id']);\n $email = trim($_POST['email']);\n if ($client_id > 0 && $email != '') {\n $client = Clients::model()->with('company')->findByPk($client_id);\n\n $lastDocument = W9::getCompanyW9Doc($client_id);\n\n if (Documents::hasAccess($lastDocument->Document_ID)) {\n $condition = new CDbCriteria();\n $condition->condition = \"Document_ID='\" . $lastDocument->Document_ID . \"'\";\n $file = Images::model()->find($condition);\n\n $filePath = 'protected/data/docs_to_email/' . $file->File_Name;\n file_put_contents($filePath, stripslashes($file->Img));\n\n //send document\n Mail::sendDocument($email, $file->File_Name, $filePath, $client->company->Company_Name);\n\n //delete file\n unlink($filePath);\n\n echo 1;\n } else {\n echo 0;\n }\n } else {\n echo 0;\n }\n }\n }",
"public function setVersionRecieved();",
"function admin_check_version()\n{\n global $app, $globalSettings;\n $versionAnswer = [];\n $contents = file_get_contents(VERSION_URL);\n if ($contents == false) {\n $versionClass = 'error';\n $versionAnswer = sprintf(getMessageString('admin_new_version_error'), $globalSettings['version']);\n } else {\n $versionInfo = json_decode($contents);\n $version = $globalSettings['version'];\n if (strpos($globalSettings['version'], '-') === false) {\n $v = preg_split('/-/', $globalSettings['version']);\n $version = $v[0];\n }\n $result = version_compare($version, $versionInfo->{'version'});\n if ($result === -1) {\n $versionClass = 'success';\n $msg1 = sprintf(getMessageString('admin_new_version'), $versionInfo->{'version'}, $globalSettings['version']);\n $msg2 = sprintf(\"<a href=\\\"%s\\\">%s</a>\", $versionInfo->{'url'}, $versionInfo->{'url'});\n $msg3 = sprintf(getMessageString('admin_check_url'), $msg2);\n $versionAnswer = $msg1 . '. ' . $msg3;\n } else {\n $versionClass = '';\n $versionAnswer = sprintf(getMessageString('admin_no_new_version'), $globalSettings['version']);\n }\n }\n $app->render('admin_version.html', [\n 'page' => mkPage(getMessageString('admin_check_version'), 0, 2),\n 'versionClass' => $versionClass,\n 'versionAnswer' => $versionAnswer,\n 'isadmin' => true,\n ]);\n}",
"function document_fichier_revision($id, $data, $type, $ref) {\n\n\tif (!$t = sql_fetsel('*', 'spip_documents', 'id_document=' . intval($id))) {\n\t\treturn false;\n\t}\n\n\t/*\n\t// Envoi d'une URL de document distant ?\n\t// TODO: verifier l'extension distante, sinon tout explose\n\tif ($data['fichier']\n\tAND preg_match(',^(https?|ftp)://.+,', $data['fichier'])) {\n\t\tinclude_spip('inc/modifier');\n\t\tmodifier_contenu('document', $id,\n\t\t\tarray('champs' => array('fichier', 'distant')),\n\t\t\tarray('fichier' => $data['fichier'], 'distant' => 'oui')\n\t\t);\n\t\treturn true;\n\t}\n\telse\n\t*/\n\n\t// Chargement d'un nouveau doc ?\n\tif ($data['document']){\n\t\t$arg = $data['document'];\n\t\t/**\n\t\t * Méthode >= SPIP 3.0\n\t\t * ou SPIP 2.x + Mediathèque\n\t\t */\n\t\t$ajouter_documents = charger_fonction('ajouter_documents', 'action');\n\t\t$actifs = $ajouter_documents($id, array($arg), '', 0, $t['mode']);\n\t\t$x = reset($actifs);\n\t\tif (is_numeric($x)){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n}",
"public function page_check_version()\n\t{\n\t\tif (!$content = Http::get_file_on_server(FSB_REQUEST_SERVER, FSB_REQUEST_VERSION, 10))\n\t\t{\n\t\t\tDisplay::message('adm_unable_check_version');\n\t\t}\n\n\t\t$content = explode(\"\\n\", $content);\n\n\t\tif (count($content) < 3)\n\t\t{\n\t\t\tDisplay::message('adm_unable_check_version');\n\t\t}\n\n\t\tif (strpos('http', $content[2]) === false)\n\t\t{\n\t\t\tarray_shift($content);\n\t\t}\n\n\t\t@list($last_version, $url, $level) = $content;\n\t\t$last_version = trim($last_version);\n\n\t\t// Aucune redirection\n\t\tFsb::$session->data['u_activate_redirection'] = 2;\n\n\t\tif (!is_last_version(Fsb::$cfg->get('fsb_version'), $last_version))\n\t\t{\n\t\t\tDisplay::message(sprintf(Fsb::$session->lang('adm_old_version'), $last_version, Fsb::$cfg->get('fsb_version'), $url, $url, Fsb::$session->lang('adm_version_' . trim($level))) . '<br /><br />' . sprintf(Fsb::$session->lang('adm_click_view_newer'), $url));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDisplay::message('adm_version_ok', 'index.' . PHPEXT, 'index_adm');\n\t\t}\n\t}",
"public function actionSendDocumentByEmail()\n {\n if (Yii::app()->request->isAjaxRequest && isset($_POST['email']) && isset($_POST['docId'])) {\n $docId = intval($_POST['docId']);\n $email = trim($_POST['email']);\n $email_array = Helper::splitEmails($email) ;\n if ($docId > 0 && $email != '' && Documents::hasAccess($docId)) {\n $document = Documents::model()->findByPk($docId);\n $condition = new CDbCriteria();\n $condition->condition = \"Document_ID='\" . $document->Document_ID . \"'\";\n $user = Users::model()->findByPk(Yii::app()->user->userID);\n $file = Images::model()->find($condition);\n\n $payment = Payments::model()->with('vendor', 'document', 'aps')->findByAttributes(array(\n 'Document_ID' => $docId,\n ));\n\n $vendor = $payment->vendor;\n $client = $vendor->client;\n\n $filePath = 'protected/data/docs_to_email/' . $file->File_Name;\n file_put_contents($filePath, stripslashes($file->Img));\n\n //send document(s)\n foreach ($email_array as $email_item) {\n Emails::logEmailSending(Yii::app()->user->clientID,Yii::app()->user->userID,Yii::app()->user->projectID,$email_item);\n Mail::sendDocument($email, $file->File_Name, $filePath, $client->company->Company_Name,$user);\n }\n\n //delete file\n unlink($filePath);\n\n echo 1;\n } else {\n echo 0;\n }\n }\n }",
"public function refreshFile($fileName, $version, $timestamp, $noSync){\n\t\t$result = ['status' => 'not found'];\n\n\t\t$filePath = $this->fileManager->getFilePath($fileName, $version);\n\t\tif( file_exists($filePath) ){\n\t\t\t$this->fileManager->updateTimestamp($fileName, $version, $timestamp);\n\t\t\tif( !$noSync ){\n\t\t\t\t$syncResult = $this->clusterManager->syncFile($fileName, $filePath, $retention = Ric_Server_Definition::RETENTION__ALL);\n\t\t\t\tif( $syncResult!='' ){\n\t\t\t\t\t$msg = 'sync file failed: '.$syncResult;\n\t\t\t\t\t$this->logger->error(__METHOD__.':'.$msg);\n\t\t\t\t\tthrow new RuntimeException($msg);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$result['status'] = 'OK';\n\t\t}\n\t\t$response = new Ric_Server_Response();\n\t\t$response->setResult($result);\n\t\treturn $response;\n\t}",
"function downloadUpdate($modId, $version)\n{\n\tglobal $langPatcher, $fs, $config;\n\n\tif (!$fs->isWritable(MODS_DIR))\n\t\tmessage(sprintf($langPatcher['Directory not writable'], 'mods'));\n\n\tif (!$fs->isWritable(MODS_DIR.$modId))\n\t\tmessage(sprintf($langPatcher['Directory not writable'], 'mods/'.pun_htmlspecialchars($modId)));\n\n//\t$modId = preg_replace('/-+v[\\d\\.]+$/', '', str_replace('_', '-', $modId)); // strip version number\n\t$filename = basename($modId.'_v'.$version.'.zip');\n\t$tmpname = $fs->tmpname();\n\tdownloadFile(sprintf(PATCHER_REPO_RELEASE_URL, urldecode($modId), urldecode($version), urldecode($filename)), $tmpname);\n\n\t// Clean modification directory\n\tif (is_dir(MODS_DIR.$modId))\n\t\t$fs->rmDir(MODS_DIR.$modId);\n\n\tif (!$fs->mkdir(MODS_DIR.$modId))\n\t\tmessage(sprintf($langPatcher['Can\\'t create mod directory'], pun_htmlspecialchars($modId)));\n\n\t$zip = Patcher_Zip::load($config['zip']['type'], $config['zip']['options']);\n\t$zip->open($tmpname);\n\n\tif (!$zip->extract(MODS_DIR.$modId))\n\t\tmessage($langPatcher['Failed to extract file']);\n\n\t$zip->close();\n\n\t$redirect_url = (isset($_GET['update'])) ? '&mod_id='.$modId.'&action=update' : '';\n\n\tredirect(PLUGIN_URL.$redirect_url, $langPatcher['Modification updated redirect']);\n}",
"private function _getVersionFile() {\n\t\t$file = new RemoteFileReader($this->_versionURL);\n\t\t\n\t\t// Save any error\n\t\t$error = $file->getError();\n\t\t$this->_errorNumber = $error['number'];\n\t\t$this->_errorMessage = $error['message'];\n\n\t\tif ($this->_errorNumber == 0) {\n\t\t\t$this->_getJsonArray($file->getContent());\n\t\t}\n\t}",
"function check_docserver($collId) {\n\n if (isset($_SESSION['indexing']['path_template'])\n && ! empty($_SESSION['indexing']['path_template'])\n && isset($_SESSION['indexing']['destination_dir'])\n && ! empty($_SESSION['indexing']['destination_dir'])\n && isset($_SESSION['indexing']['docserver_id'])\n && ! empty($_SESSION['indexing']['docserver_id'])\n && isset($_SESSION['indexing']['file_destination_name'])\n && ! empty($_SESSION['indexing']['file_destination_name'])\n ) {\n $_SESSION['action_error'] = _CHECK_FORM_OK;\n return true;\n }\n $core = new core_tools();\n if ($core->is_module_loaded('templates')\n && $_SESSION['upfile']['format'] == \"maarch\"\n ) {\n if (!isset($_SESSION['template_content'])\n || empty($_SESSION['template_content'])\n ) {\n $_SESSION['action_error'] = _TEMPLATE . ' ' . _IS_EMPTY;\n return false;\n }\n if (\n !isset($_SESSION['upfile']['name'])\n && $_SESSION['upfile']['name'] == ''\n ) {\n $_SESSION['upfile']['name'] = 'tmp_file_'\n . $_SESSION['user']['UserId'] . '_' . rand() . '.maarch';\n $tmpPath = $_SESSION['config']['tmppath'] . DIRECTORY_SEPARATOR\n . $_SESSION['upfile']['name'];\n $myfile = fopen($tmpPath, \"w\");\n if (!$myfile) {\n $_SESSION['action_error'] .= _FILE_OPEN_ERROR . '.<br/>';\n return false;\n }\n fwrite($myfile, $_SESSION['template_content']);\n fclose($myfile);\n $_SESSION['upfile']['size'] = filesize($tmpPath);\n }\n }\n if ($_SESSION['origin'] == \"scan\") {\n $newFileName = \"tmp_file_\" . $_SESSION['upfile']['md5'] . '.'\n . strtolower($_SESSION['upfile']['format']);\n } else {\n //$newFileName = \"tmp_file_\" . $_SESSION['user']['UserId'] . '.'\n // . strtolower($_SESSION['upfile']['format']);\n $newFileName = $_SESSION['upfile']['name'];\n }\n\n $docserverControler = new docservers_controler();\n $fileInfos = array(\n \"tmpDir\" => $_SESSION['config']['tmppath'],\n \"size\" => $_SESSION['upfile']['size'],\n \"format\" => $_SESSION['upfile']['format'],\n \"tmpFileName\" => $newFileName,\n );\n //print_r($fileInfos);\n $storeResult = array();\n $storeResult = $docserverControler->storeResourceOnDocserver(\n $collId, $fileInfos\n );\n //print_r($storeResult);\n if (isset($storeResult['error']) && $storeResult['error'] <> \"\") {\n $_SESSION['action_error'] = $storeResult['error'];\n return false;\n } else {\n $_SESSION['indexing']['path_template'] = $storeResult['path_template'];\n $_SESSION['indexing']['destination_dir'] = $storeResult['destination_dir'];\n $_SESSION['indexing']['docserver_id'] = $storeResult['docserver_id'];\n $_SESSION['indexing']['file_destination_name'] = $storeResult['file_destination_name'];\n $_SESSION['action_error'] = _CHECK_FORM_OK;\n return true;\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets query for [[Apparaat]]. | public function getApparaat()
{
//hier zijn de joins die ik in de database hebt gemmaakt.
return $this->hasOne(Apparaten::className(), ['id' => 'apparaatID']);
} | [
"public function alipayQuery()\r\n {\r\n $alipayQueryBuilder = new AlipayContentBuilder();\r\n $alipayQueryBuilder->setOutTradeNo(1503545268);\r\n $query = new AlipayService();\r\n $result = $query->queryResult($alipayQueryBuilder);\r\n halt($result);\r\n // return $alipayQuery->loopQuery(1503545268);\r\n }",
"public function getAnnonceQuery() {\r\n\t\t$annonce = new Annonce();\r\n\t\t$annonce->competences = $this->competences;\r\n\t\t// $annonce->typeMission = $this->missions;\r\n\t\t$annonce->quartier = $this->mobilite;\n\t\treturn $annonce;\n\t}",
"public function getQuery();",
"function getQuery() {\n\t\treturn $this->getAuthorizedContextObject(ASSOC_TYPE_QUERY);\n\t}",
"public function getQuery()\n\t\t{\n\t\t\t// Offense selected and maybe race\n\t\t\tif($this->arrests_offense != \"\")\n\t\t\t{\n\t\t\t\t// Set the fields\n\t\t\t\t$this->setFields();\n\n\t\t\t\t// Check if race was chosen\n\t\t\t\tif(sizeof($this->columns) == 3)\n\t\t\t\t{\n\t\t\t\t\t$this->columns = array();\n\t\t\t\t\tarray_push($this->columns, \"*\");\n\t\t\t\t}\n\n\t\t\t\t// Build the query\n\t\t\t\t$this->build();\n\t\t\t}\n\t\t\t// Offense not selected and maybe race\n\t\t\telse if($this->arrests_offense == \"\" && $this->arrests_race != \"\")\n\t\t\t{\n\t\t\t\t$this->setFields();\n\t\t\t\t$this->build();\n\t\t\t}\n\n\t\t\treturn $this->query;\n\t\t}",
"public function query()\n {\n return Attribute::query();\n }",
"public abstract function get_query();",
"public function getSparql() {\n return 'a';\n }",
"public function getAqi() {\n return $this->get(self::AQI);\n }",
"public function getApiQueryURL()\n {\n return $this->apiQuery;\n }",
"private function _buildQueryForAppointments()\n {\n $client_diff = get_option( 'gmt_offset' ) * MINUTE_IN_SECONDS;\n\n return Appointment::query( 'a' )\n ->select( 'ca.id AS ca_id,\n c.name AS category,\n COALESCE(s.title, a.custom_service_name) AS service,\n st.full_name AS staff,\n a.staff_id,\n a.staff_any,\n a.service_id,\n s.category_id,\n ca.status AS appointment_status,\n ca.extras,\n ca.compound_token,\n ca.number_of_persons,\n ca.custom_fields,\n ca.appointment_id,\n IF (ca.compound_service_id IS NULL, COALESCE(ss.price, a.custom_service_price), s.price) AS price,\n IF (ca.time_zone_offset IS NULL,\n a.start_date,\n DATE_SUB(a.start_date, INTERVAL ' . $client_diff . ' + ca.time_zone_offset MINUTE)\n ) AS start_date,\n ca.token' )\n ->leftJoin( 'Staff', 'st', 'st.id = a.staff_id' )\n ->leftJoin( 'Customer', 'customer', 'customer.wp_user_id = ' . $this->getWpUserId() )\n ->innerJoin( 'CustomerAppointment', 'ca', 'ca.appointment_id = a.id AND ca.customer_id = customer.id' )\n ->leftJoin( 'Service', 's', 's.id = COALESCE(ca.compound_service_id, a.service_id)' )\n ->leftJoin( 'Category', 'c', 'c.id = s.category_id' )\n ->leftJoin( 'StaffService', 'ss', 'ss.staff_id = a.staff_id AND ss.service_id = a.service_id' )\n ->leftJoin( 'Payment', 'p', 'p.id = ca.payment_id' )\n ->sortBy( 'start_date' )\n ->order( 'DESC' );\n }",
"public static function getAllApuntes()\n {\n $database = DatabaseFactory::getFactory()->getConnection();\n\n $sql = \"SELECT apunte_id, apunte_date, apunte_hour, apunte_minute, apunte_participante, apunte_activity, apunte_location, apunte_cancellation, apunte_fcancellation, apunte_cost, apunte_text, apunte_keywords, apunte_nombre FROM apuntes WHERE user_id = :user_id ORDER BY apunte_nombre\";\n $query = $database->prepare($sql);\n $query->execute(array(':user_id' => Session::get('user_id')));\n\n // fetchAll() is the PDO method that gets all result rows\n return $query->fetchAll();\n }",
"protected function getQuery() {\n return $this->container\n ->get('entity_type.manager')\n ->getStorage('sparql_test')\n ->getQuery();\n }",
"public function getAplicacao()\n {\n return $this->aplicacao;\n }",
"private function getDefaultQuery()\n {\n return [\n 'v' => $this->apiVersion,\n 'lang' => $this->apiLanguage,\n ];\n }",
"public function getQuase_Amigos() {\n\t\t$criteria = Criteria::create()->where(Criteria::expr()->eq(\"ativo\", false));\n\t\t$criteria->andWhere(Criteria::expr()->eq(\"usuario\", $this));\n\t\treturn $this->getAmigos()->matching($criteria);\n\t}",
"public function buildQuery();",
"function rechercheApp($ville,$nbPiece,$surf,$loyer){\n require_once(\"Modele_ConnexionBDD.php\");\n $connexion = connexionBD();\n $req = $connexion->prepare('SELECT * FROM Appartement NATURAL JOIN Annonce\n WHERE idStatutAnnonce=2 AND loyer<:loyer AND lower(villeAppartement)=lower(:ville) AND nbPiece>=:nbPiece AND surfaceAppartement>=:surf');\n $req->bindParam(':loyer', $loyer);\n $req->bindParam(':ville',$ville);\n $req->bindParam(':nbPiece',$nbPiece);\n $req->bindParam(':surf',$surf);\n $req->execute();\n $data=$req->fetchAll();\n return $data;}",
"function consultarNotaAprobatoria() {\n\n $variables=array('codProyectoEstudiante'=> $this->datosEstudiante['codProyectoEstudiante'] \n );\n $cadena_sql = $this->sql->cadena_sql(\"nota_aprobatoria\", $variables);\n $resultado = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\n return $resultado[0][0];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test load Xlsx file without cell reference. | public function testLoadXlsxWithoutCellReference()
{
$filename = './data/Reader/XLSX/without_cell_reference.xlsx';
$reader = new Xlsx();
$reader->load($filename);
} | [
"public function testLoadXlsxWithEmptyStyles(): void\n {\n $filename = 'tests/data/Reader/XLSX/issue.2246b.xlsx';\n $reader = new Xlsx();\n $spreadsheet = $reader->load($filename);\n\n $tempFilename = File::temporaryFilename();\n $writer = IOFactory::createWriter($spreadsheet, 'Xlsx');\n $writer->save($tempFilename);\n\n $reader = new Xlsx();\n $reloadedSpreadsheet = $reader->load($tempFilename);\n unlink($tempFilename);\n\n $reloadedWorksheet = $reloadedSpreadsheet->getActiveSheet();\n self::assertEquals('TipoDato', $reloadedWorksheet->getCell('A1')->getValue());\n }",
"public function testLoadXlsSample(): void\n {\n $filename = 'tests/data/Reader/XLS/sample.xls';\n $reader = new Xls();\n $spreadsheet = $reader->load($filename);\n self::assertEquals('Title', $spreadsheet->getSheet(0)->getCell('A1')->getValue());\n $spreadsheet->disconnectWorksheets();\n }",
"function loadXlsxData() {\n\t\tif ( $xlsx = SimpleXLSX::parse(XLSX_FILE) ) {\n\t\t\t$data = $xlsx->rows();\n\t\t\t$headers = array_shift($data); \t//removing first line of headers\n\t\t\treturn $data;\n\t\t}\n\t\techo \"Could not parse xlsx file:\\n\" . SimpleXLSX::parseError();\n\t\treturn false;\n\t}",
"public function testEditDocumentXlsxCreateBlankSpreadsheet()\n {\n }",
"public function testLoadXlsBug1592(): void\n {\n $filename = 'tests/data/Reader/XLS/bug1592.xls';\n $reader = new Xls();\n // When no fix applied, spreadsheet is not loaded\n $spreadsheet = $reader->load($filename);\n $sheet = $spreadsheet->getActiveSheet();\n $col = $sheet->getHighestColumn();\n $row = $sheet->getHighestRow();\n\n $newspreadsheet = $this->writeAndReload($spreadsheet, 'Xlsx');\n $newsheet = $newspreadsheet->getActiveSheet();\n $newcol = $newsheet->getHighestColumn();\n $newrow = $newsheet->getHighestRow();\n\n self::assertEquals($spreadsheet->getSheetCount(), $newspreadsheet->getSheetCount());\n self::assertEquals($sheet->getTitle(), $newsheet->getTitle());\n self::assertEquals($sheet->getColumnDimensions(), $newsheet->getColumnDimensions());\n self::assertEquals($col, $newcol);\n self::assertEquals($row, $newrow);\n\n $rowIterator = $sheet->getRowIterator();\n\n foreach ($rowIterator as $row) {\n foreach ($row->getCellIterator() as $cellx) {\n /** @var Cell */\n $cell = $cellx;\n $valOld = $cell->getFormattedValue();\n $valNew = $newsheet->getCell($cell->getCoordinate())->getFormattedValue();\n self::assertEquals($valOld, $valNew);\n }\n }\n $spreadsheet->disconnectWorksheets();\n $newspreadsheet->disconnectWorksheets();\n }",
"public function testIfReadingNonexistingXlsxThrows() : void\n {\n\n // Expect.\n $this->expectException(ClassFopException::class);\n\n // Read Xlsx.\n $xlsx = new Reader(dirname(__DIR__) . '/examples/NonExistingReaderTest.xlsx');\n }",
"public function testDataSourceIsValidWithXls() {\n $datasource = new \\codename\\core\\io\\datasource\\spreadsheet(\n __DIR__ . \"/\" . 'testSpreadsheet1.xls',\n [\n 'custom_sheet_index' => 0,\n 'multisheet' => 0,\n 'skip_rows' => 3,\n 'header_row' => 2,\n ]\n );\n\n $datasource->next();\n\n $data = $datasource->current();\n $this->assertEquals($data['A'], 'Value2-1');\n $this->assertEquals($data['B'], 'Value2-2');\n $this->assertEquals($data['C'], 'Value2-3');\n\n }",
"public function testIfAvoidingReadinginXlsxThrows1() : void\n {\n\n // Expect.\n $this->expectException(ObjectDonoexException::class);\n\n // Read Xlsx.\n $xlsx = new Reader(dirname(__DIR__) . '/examples/ReaderTest.xlsx');\n\n // Get what is not present.\n $xlsx->getXlSharedStrings();\n }",
"public function testIfCreatingCellsWorks() : void\n {\n\n // Create Xlsx.\n $xlsx = new Xlsx();\n $book = $xlsx->getBook();\n $sheet = $book->addSheet('Tables Test');\n\n // Test if getting nonexisting Column throws.\n try {\n $sheet->getCell(0, 0);\n } catch (RefWrosynException $exc) {\n $this->assertTrue(true);\n }\n\n // Test.\n $this->assertEquals('A1', $sheet->getFirstCellRef());\n $this->assertEquals('A1', $sheet->getLastCellRef());\n\n // Add cell 1.\n $cell1 = $sheet->getCell(1, 1);\n $cell1->setValue('aaa');\n $cell1->setColWidth(10.0);\n $cell1->setRowHeight(20.0);\n\n // Add cell 2.\n $cell2 = $sheet->getCell(2, 3);\n $cell2->setValueParts([ [ 'aaa' ], [ 'bbb' ] ]);\n $cell2->setColWidth(null);\n $cell2->setRowHeight(null);\n\n // Add cell 3.\n $cell3 = $sheet->getCell(3, 1);\n $cell3->setValue(null);\n\n // Test.\n $this->assertInstanceOf(Cell::class, $cell1);\n $this->assertEquals('aaa', $cell1->getValue()[0]->getContentsAsScalar());\n $this->assertEquals('bbb', $cell2->getValue()[1]->getContentsAsScalar());\n $this->assertEquals('', $cell3->getValue()[0]->getContentsAsScalar());\n $this->assertEquals('aaa', $cell1->getSimpleValue());\n $this->assertEquals('aaabbb', $cell2->getSimpleValue());\n $this->assertEquals('string', $cell1->getValueType());\n $this->assertEquals('string', $cell2->getValueType());\n $this->assertEquals('string', $cell3->getValueType());\n $this->assertInstanceOf(Sheet::class, $cell1->getSheet());\n $this->assertEquals(1, $cell1->getRow());\n $this->assertEquals(1, $cell1->getCol());\n $this->assertEquals('A', $cell1->getColRef());\n $this->assertEquals('A1', $cell1->getRef());\n $this->assertEquals(2, $cell2->getRow());\n $this->assertEquals(3, $cell2->getCol());\n $this->assertEquals('C', $cell2->getColRef());\n $this->assertEquals('C2', $cell2->getRef());\n $this->assertFalse($cell2->isMerged());\n $this->assertFalse($cell2->isMerging());\n $this->assertFalse($cell2->hasStyle());\n $this->assertEquals(10.0, $cell1->getColWidth());\n $this->assertEquals(20.0, $cell1->getRowHeight());\n $this->assertEquals(null, $cell2->getColWidth());\n $this->assertEquals(null, $cell2->getRowHeight());\n\n // Try to get numeric value of non-numeric cell.\n try {\n $cell1->getNumericValue();\n } catch (CellValueWrotypeException $exc) {\n $this->assertTrue(true);\n }\n }",
"public function testSaveLoadWithDrawingWithSamePath(): void\n {\n // Read spreadsheet from file\n $originalFileName = 'tests/data/Writer/XLSX/saving_drawing_with_same_path.xlsx';\n\n $originalFile = file_get_contents($originalFileName);\n\n $tempFileName = File::sysGetTempDir() . '/saving_drawing_with_same_path';\n\n file_put_contents($tempFileName, $originalFile);\n\n $reader = new Xlsx();\n $spreadsheet = $reader->load($tempFileName);\n\n $spreadsheet->getActiveSheet()->setCellValue('D5', 'foo');\n // Save spreadsheet to file to the same path. Success test case won't\n // throw exception here\n $writer = IOFactory::createWriter($spreadsheet, 'Xlsx');\n $writer->save($tempFileName);\n\n $reloadedSpreadsheet = $reader->load($tempFileName);\n\n unlink($tempFileName);\n\n // Fake assert. The only thing we need is to ensure the file is loaded without exception\n self::assertNotNull($reloadedSpreadsheet);\n $spreadsheet->disconnectWorksheets();\n $reloadedSpreadsheet->disconnectWorksheets();\n }",
"public function testLoadXlsxWithDoubleAttrDrawing(): void\n {\n $filename = 'tests/data/Reader/XLSX/double_attr_drawing.xlsx';\n $reader = new Xlsx();\n $reader->load($filename);\n }",
"public function testEditDocumentXlsxDeleteWorksheet()\n {\n }",
"function load_sheet_data(){\r\n\t\tif (!$this->loaded_workbook) return FALSE;\r\n\r\n\t\t$ini=$this->xsl_out($this->cellList_xslt(), $this->get_workbook());\r\n\t\tif ($ini != '') {\r\n\t\t\t$this->loaded_workbook_data=parse_ini_string($ini, TRUE);\r\n\t\t\tif(array_key_exists('sheet', $this->loaded_workbook_data)) {\r\n\t\t\t\tif(array_key_exists('dimension', $this->loaded_workbook_data['sheet'])) {\r\n\t\t\t\t\t$this->col_start = $this->get_col($this->loaded_workbook_data['sheet']['dimension'][0]);\r\n\t\t\t\t\t$this->col_end = $this->get_col($this->loaded_workbook_data['sheet']['dimension'][1]);\r\n\t\t\t\t\t$this->row_start = $this->get_row($this->loaded_workbook_data['sheet']['dimension'][0]);\r\n\t\t\t\t\t$this->row_end = $this->get_row($this->loaded_workbook_data['sheet']['dimension'][1]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tarray_shift($this->loaded_workbook_data);\r\n\t\t\t//setup excel cell filter\r\n\r\n\r\n\r\n\t\t\tforeach($this->loaded_workbook_data as $k => $v) {\r\n\t\t\t\tif (array_key_exists($k, $this->ini[$this->sheet])) {\r\n\t\t\t\t\t$label=$this->ini[$this->sheet][$k];\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$label=FALSE;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (array_key_exists('val', $v)) {\r\n\t\t\t\t\tif (array_key_exists('t', $v) && $v['t'] == 's') {\r\n\t\t\t\t\t\t$val=$v['val']+1; //add 1 so search matches value in excel_strings\r\n\t\t\t\t\t\t$s=$this->xsl_out($this->StringLookup_xslt( $val), $this->get_excel_strings());\r\n\r\n\t\t\t\t\t\tif ($label) $this->new_loaded_workbook_data[$label]['val']=$s;\r\n\r\n\t\t\t\t\t\t$this->loaded_workbook_data[$k]['val']=$s;\r\n\r\n\t\t\t\t\t\t$this->loaded_workbook_cells[$k]=$s;\r\n\r\n\t\t\t\t\t\t$this->loaded_workbook_rows[$this->get_row($k)][$this->get_col($k)]=$s;\r\n\r\n\t\t\t\t\t\t$this->loaded_workbook_cols[$this->get_col($k)][$this->get_row($k)]=$s;\r\n\r\n\t\t\t\t\t\t// drop the 't' key off of the array, it's only needed for text look up\r\n\t\t\t\t\t\tarray_pop($this->loaded_workbook_data[$k]);\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\tif ($label) $this->loaded_workbook_cells[$label]=$v['val'];\r\n\r\n\t\t\t\t\t\t$this->loaded_workbook_rows[$this->get_row($k)][$this->get_col($k)]=$v['val'];\r\n\r\n\t\t\t\t\t\t$this->loaded_workbook_cols[$this->get_col($k)][$this->get_row($k)]=$v['val'];\r\n\t\t\t\t\t}\r\n\r\n\r\n\r\n\t\t\t\t\t// new workbook data with custom label\r\n\t\t\t\t\tif ($label){\r\n\t\t\t\t\t\t$this->new_loaded_workbook_data[$label]['col']=$this->get_col($k);\r\n\t\t\t\t\t\t$this->new_loaded_workbook_data[$label]['row']=$this->get_row($k);\r\n\t\t\t\t\t\t$this->new_loaded_workbook_data[$label]['cell']=$k;\r\n\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t//updated workbook data\r\n\t\t\t\t\t$this->loaded_workbook_data[$k]['col']=$this->get_col($k);\r\n\t\t\t\t\t$this->loaded_workbook_data[$k]['row']=$this->get_row($k);\r\n\t\t\t\t\t$this->loaded_workbook_data[$k]['cell']=$k;\r\n\t\t\t\t\tif ($label) $this->loaded_workbook_data[$k]['label']=$label;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($this->ini[$this->sheet] as $k => $v) {\r\n\t\t\t\t$this->add_cell_list($k);\r\n\t\t\t}\r\n\r\n\t\t\t//\techo '<pre>';print_r($this->ini[$this->sheet]); echo '</pre>'; exit();\r\n\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}",
"public function testAddReceivingWorksheetFileByURL()\n {\n }",
"public function readProgrammeExcel() {\n\t\t$this->markTestIncomplete(\"Yet to write this test\");\n\t}",
"public function importExcel($path);",
"public function testReadCSVImportWithNotExistingType() {\n $path = dirname(__FILE__) . '/imports/course5.csv';\n $result = $this->getReadCSVImport($path);\n $this->assertFalse($result);\n }",
"public function testSaveLoadWithDrawingOn2ndWorksheet(): void\n {\n // Read spreadsheet from file\n $inputFilename = 'tests/data/Writer/XLSX/drawing_on_2nd_page.xlsx';\n $reader = new Xlsx();\n $spreadsheet = $reader->load($inputFilename);\n\n // Save spreadsheet to file and read it back\n $reloadedSpreadsheet = $this->writeAndReload($spreadsheet, 'Xlsx');\n\n // Fake assert. The only thing we need is to ensure the file is loaded without exception\n self::assertNotNull($reloadedSpreadsheet);\n $spreadsheet->disconnectWorksheets();\n $reloadedSpreadsheet->disconnectWorksheets();\n }",
"function tpps_xlsx_generator($location, array $options = array()) {\n $dir = drupal_realpath(TPPS_TEMP_XLSX);\n $no_header = $options['no_header'] ?? FALSE;\n $columns = $options['columns'] ?? NULL;\n $max_rows = $options['max_rows'] ?? NULL;\n\n if (!empty($columns)) {\n $new_columns = array();\n foreach ($columns as $col) {\n $new_columns[$col] = $col;\n }\n $columns = $new_columns;\n }\n\n $zip = new ZipArchive();\n $zip->open($location);\n $zip->extractTo($dir);\n\n $strings_location = $dir . '/xl/sharedStrings.xml';\n\n // Find all worksheets.\n $sheets = scandir($dir . '/xl/worksheets');\n unset($sheets[array_search('.', $sheets)]);\n unset($sheets[array_search('..', $sheets)]);\n\n $strings = tpps_xlsx_get_strings($strings_location);\n\n // Get dimensions, readers.\n $first_left = NULL;\n $last_right = NULL;\n $dims = array();\n $readers = array();\n foreach ($sheets as $sheet) {\n // dpm('SHEET location: ' . $dir . '/xl/worksheets/' . $sheet);\n if (tpps_get_path_extension($dir . '/xl/worksheets/' . $sheet) !== 'xml') {\n continue;\n }\n $loc = $dir . '/xl/worksheets/' . $sheet;\n $dimension = tpps_xlsx_get_dimension($loc);\n // dpm($loc);\n // dpm($dimension);\n preg_match('/([A-Z]+)[0-9]+:([A-Z]+)[0-9]+/', $dimension, $matches);\n // dpm($matches);\n if(count($matches) < 3) {\n // The dimensions are invalid (probably an empty worksheet)\n }\n else {\n // Matches found dimensions, continue processing this as a valid sheet\n $left_hex = unpack('H*', $matches[1]);\n $hex = $left_hex[1];\n $right_hex = unpack('H*', $matches[2]);\n if ($first_left == NULL) {\n $first_left = $left_hex[1];\n $last_right = $left_hex[1] - 1;\n }\n while (base_convert($hex, 16, 10) <= base_convert($right_hex[1], 16, 10)) {\n $hex = tpps_increment_hex($hex);\n $last_right = tpps_increment_hex($last_right);\n }\n $dims[] = array($left_hex[1], $right_hex[1]);\n $reader = new XMLReader();\n $reader->open($loc);\n $readers[] = $reader;\n }\n }\n\n // If the file has a header row, skip it.\n if (!$no_header) {\n tpps_xlsx_get_rows($readers, $strings);\n }\n\n // Iterate through file.\n $count = 0;\n while (($rows = tpps_xlsx_get_rows($readers, $strings, TRUE, $columns))) {\n if (!empty($max_rows) and $count >= $max_rows) {\n break;\n }\n $count++;\n\n $values = array();\n $key_hex = $first_left;\n foreach ($readers as $idx => $read) {\n $row = $rows[$idx];\n if (!empty($row)) {\n ksort($row);\n }\n $hex = $dims[$idx][0];\n while (base_convert($hex, 16, 10) <= base_convert($dims[$idx][1], 16, 10)) {\n $key = pack('H*', $key_hex);\n $row_key = pack('H*', $hex);\n if (empty($columns) or array_search($key, $columns) !== FALSE) {\n $values[$key] = isset($row[$row_key]) ? trim($row[$row_key]) : NULL;\n }\n $hex = tpps_increment_hex($hex);\n $key_hex = tpps_increment_hex($key_hex);\n }\n }\n yield $values;\n }\n\n // Close readers.\n foreach ($readers as $reader) {\n $reader->close();\n }\n tpps_rmdir($dir);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns array of active dot separated tags | public static function getActiveTags(){
return self::$activeTags;
} | [
"public function getTagsarray() {\n\t\t$tags = $this->getTags();\n\t\t$tags = str_replace(array(' ', ';', '.'), ',', $tags);\n\t\treturn t3lib_div::trimExplode(',', $tags, 1);\n\t}",
"protected function getTags() : array\n {\n $tags = $this->{static::$tagsField};\n \n\t\treturn Strings::explode($tags);\n }",
"protected function tags()\n {\n return array_filter(explode(',', $this->option('tags') ?? ''));\n }",
"public function getTagsForDisplay() {\n\t\t$tags = $this->getTags();\n\t\t$list = array();\n\t\tforeach($tags as $group => $values) {\n\t\t\tforeach($values as $key => $value) {\n\t\t\t\t$list[ucfirst($group)][ $this->tagPrefix. ($group.'.'.$key) .$this->tagSuffix ] = $value;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $list;\n\t}",
"function get_tags() {\n\t\t$out = array();\n\t\tforeach ( $this->events as $e ) {\n\t\t\t$out[] = $e['tag'];\n\t\t}\n\n\t\treturn $out;\n\t}",
"public function generateTags(): array;",
"public function getTags()\n {\n return array(\n 'text',\n 'number',\n 'textarea',\n 'checkbox',\n 'subform',\n 'password'\n );\n }",
"public function getTags();",
"public function getTags()\n\t{\n\t\t$list = array();\n\t\tforeach ($this->chunks as $chunk)\n\t\t{\n\t\t\tif ($chunk instanceof Cotpl_var)\n\t\t\t{\n\t\t\t\t$list[$chunk->name] = true;\n\t\t\t}\n\t\t}\n\t\treturn $list;\n\t}",
"protected function getParsedTags()\n {\n return array('a', 'base', 'title', 'form', 'input', 'button', 'textarea', 'select',\n 'option', 'frameset', 'frame', 'label');\n }",
"public static function getClassTags()\n {\n return array(\n self::generateClassKey(\"tag.ping\"),\n self::generateClassKey(\"tag.source\"),\n self::generateClassKey(\"tag.workflow\"),\n self::generateClassKey(\"tag.task\")\n );\n }",
"function GetTags () {\n return $this->GetChildren (TAG);\n }",
"public function getTagNames();",
"public function texttags() {\n\t$tags =\"\";\n\t//$array = $this->getTags()->toArray();\n\t$array = $this->getTags();\n\tforeach ($array as $tag) {\n\t $tags.= $tag->getNombre(). \" \";\n\t}\n\t//echo $tags;\n\treturn $tags;\n//\treturn count($array );\n//\treturn count($this->getTags());\n\t//implode(\", \", ->toArray());\n }",
"public function generateTags(): array\n {\n // TODO: Implement generateTags() method.\n }",
"public function getTags(): array\n {\n return $this->tags;\n }",
"public function tagNames()\n\t{\n\t\treturn $this->tags()->get()->lists('tag');\n\t}",
"static function getActiveLanguageTags() {\n\t\tif (empty(self::$memoizedActiveLanguageTags)) {\n\t\t\t$db = KenedoPlatform::getDb();\n\t\t\t$query = \"SELECT `tag` FROM `#__configbox_active_languages`\";\n\t\t\t$db->setQuery($query);\n\t\t\tself::$memoizedActiveLanguageTags = $db->loadResultList();\n\t\t}\n\t\treturn self::$memoizedActiveLanguageTags;\n\t}",
"public function get_tag_list(){\n for($b=0; $b<sizeof($this->taglist); $b++){\n if($b>0) echo \", \";\n echo $this->taglist[$b];\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation auManagerRosterShiftGetRosterShift Get Roster Shift by ID | public function auManagerRosterShiftGetRosterShift($roster_shift_id, $business_id, $include_costs = false, string $contentType = self::contentTypes['auManagerRosterShiftGetRosterShift'][0])
{
list($response) = $this->auManagerRosterShiftGetRosterShiftWithHttpInfo($roster_shift_id, $business_id, $include_costs, $contentType);
return $response;
} | [
"public function get_shift($id) {\n $sql = \"SELECT * FROM {$this->database}.shift where id={$id}\"; // XXX should use prepared statements\n $result = $this->query($sql);\n $nrows = mysql_numrows($result);\n if ($nrows < 1) {\n throw new ShiftMgrException (\n __class__.'::'.__METHOD__ ,\n 'Could not find shift with id ' . $id\n );\n }\n $shift = mysql_fetch_array($result, MYSQL_ASSOC);\n\n // Fetch all area_evaluation rows for this shift.\n $sql = \"SELECT * FROM {$this->database}.area_evaluation WHERE id={$id}\";\n $result = $this->query($sql);\n $nrows = mysql_numrows($result);\n $area_evaluations = array();\n for ($i = 0; $i < $nrows; $i++) {\n $area_evaluation = mysql_fetch_array($result, MYSQL_ASSOC);\n $area = $area_evaluation[\"area\"];\n $area_evaluations[$area] = $area_evaluation;\n }\n $shift[\"area_evaluation\"] = $area_evaluations;\n\n // Fetch all time_use rows for this shift.\n $sql = \"SELECT * FROM {$this->database}.time_use WHERE id={$id}\";\n $result = $this->query($sql);\n $nrows = mysql_numrows($result);\n $time_uses = array();\n for ($i = 0; $i < $nrows; $i++) {\n $time_use = mysql_fetch_array($result, MYSQL_ASSOC);\n $use = $time_use[\"use_name\"];\n $time_uses[$use] = $time_use;\n }\n $shift[\"time_use\"] = $time_uses;\n\n // Return fully populated shift.\n return $shift;\n }",
"public function getShift()\n {\n return $this->hasOne(Shift::className(), ['id' => 'id_shift']);\n }",
"function get_shift_by_id($shift_id)\n {\n $query = $this->db->get_where('shifts', array('id' => $shift_id));\n return $query->first_row();\n }",
"function get_shift($id)\n {\n return $this->db->get_where('shifts',array('id'=>$id))->row_array();\n }",
"public function fetchShiftById($id)\n {\n\t\t$db = $this->getAdapter();\n\t\t$select = $db->select();\n\t\t$select->from(array('s' => $this->_name))\n ->joinInner(array('t' => 'typists_default_shift'), 't.id = s.shift_id', array('start_time', 'end_time'))\n ->where('s.id = ?', $id);\n return $db->fetchRow($select);\n }",
"public function getShifts()\n {\n return $this->hasMany(\n $this->getClassName('Shift'),\n [\n 'shiftStateId' => 'id',\n ]\n );\n }",
"public function getScheduledShift()\n {\n\n if(Auth::check() && Auth::user()->primary_contact && Input::has('user_id')){\n Auth::loginUsingId(Input::get('user_id'));\n }\n\n $date = Input::has('date') ? new Carbon(Input::get('date'), Helper::organisationTimezone()) : new Carbon(Helper::organisationTimezone());\n\n $shift = RosteredShift::where('user_id', '=', Auth::user()->id)\n ->where('date', '=', $date->toDateString())\n ->with('task')\n ->first(array('id', 'rostered_start_time', 'rostered_end_time'));\n\n\n if (isset($shift))\n {\n return Helper::jsonLoader(SUCCESS, $shift->toArray());\n } else if (Input::has('create_shift') && !Input::has('date'))\n {\n $start_date = $date->copy()->startOfWeek();\n $roster = Roster::firstOrNew(\n array(\n 'team_id' => Auth::user()->team_id,\n 'date_start' => $start_date->toDateString(),\n 'date_ending' => $start_date->endOfWeek()->toDateString()\n )\n );\n if (!$roster->exists)\n {\n $roster->roster_stage = 'pending';\n $roster->save();\n }\n\n $now = Carbon::now();\n $now->subMinutes($now->minute % 15);\n $now->second = 0;\n\n $shift = RosteredShift::create(\n array(\n 'date' => $date->toDateString(),\n 'rostered_start_time' => $now->toDateTimeString(),\n 'rostered_end_time' => $now->addHour()->toDateTimeString(),\n 'user_id' => Auth::user()->id,\n 'roster_id' => $roster->id\n )\n );\n $shift = RosteredShift::whereId($shift->id)\n ->with('task')\n ->first(array('id', 'rostered_start_time', 'rostered_end_time'));\n return Helper::jsonLoader(SUCCESS, $shift->toArray());\n } else\n {\n return Helper::jsonLoader(DATA_NOT_FOUND);\n }\n }",
"public function getWorkersShift(){\n $sqlQuery = \"SELECT \n w.id as workerId ,\n w.name as workerName ,\n s.id as shiftId ,\n s.title as shiftName ,\n ws.date as date\n FROM worker as w, shift as s, workershift as ws \n WHERE ws.workerid = w.id AND ws.shiftid = s.id\";\n\n $stmt = $this->conn->prepare($sqlQuery);\n $stmt->execute();\n return $stmt;\n }",
"public function read_office_shift_information($id) {\r\n\t\r\n\t\t$sql = 'SELECT * FROM xin_office_shift WHERE office_shift_id = ? limit 1';\r\n\t\t$binds = array($id);\r\n\t\t$query = $this->db->query($sql, $binds);\r\n\t\t\r\n\t\tif ($query->num_rows() > 0) {\r\n\t\t\treturn $query->result();\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"public function get_shifts() {\n\t\treturn $this->db->query(\"SELECT DISTINCT(shift) FROM shifts\")->result_array();\n\t}",
"public function getDetailShifts()\n {\n return $this->hasMany(DetailShift::className(), ['id_shift' => 'id']);\n }",
"public function getShifts() {\n $shiftData = $this->getShiftDetails();\n foreach($shiftData as $data){\n $shiftArr[] = $data->name;\n }\n return $shiftArr;\n }",
"public function getShift_name() {\n return $this->shift_name;\n }",
"private function getShiftROW($shiftID) {\n $this->instance->db->select('id, caID, ScheduledShifts_id, startTime, endTime, note, signatureIn, signatureOut');\n $this->instance->db->where('id', $shiftID);\n $this->instance->db->limit(1);\n $query = $this->instance->db->get('ca_schedules.Shifts');\n return $query->row_array();\n }",
"public function getShift()\n {\n return $this->shift;\n }",
"public function getShifts($eid);",
"public function shifts()\n {\n return $this->hasmany('App\\Models\\Store\\Shifts');\n }",
"public function read_emp_shift_information($id) {\r\n\t\r\n\t\t$sql = 'SELECT * FROM xin_employee_shift WHERE emp_shift_id = ? limit 1';\r\n\t\t$binds = array($id);\r\n\t\t$query = $this->db->query($sql, $binds);\r\n\t\t\r\n\t\tif ($query->num_rows() > 0) {\r\n\t\t\treturn $query->result();\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"function selectEmployeeShiftFromID($id){\r\n $stmt = $this->conn->prepare(\"SELECT * FROM `employeeShifts`, employees WHERE employeeShifts.employeeID = employees.employeeID AND employeeShifts.scheduleID = $id\");\r\n $stmt->execute();\r\n $result = $stmt->get_result();\r\n $stmt->close();\r\n return $result;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build the default SoapFaultConverter By default, we pool together all existing SoapFaultConverters | public function build()
{
return new PooledSoapFaultConverter(
[
new AuthenticationFailureConverter(),
new ConnectionFailureConverter(),
]
);
} | [
"public function IterateFaultAndPrepareException($fault)\n {\n if (!$this->verifyFault($fault)) {\n return null;\n }\n // Collect information from XML entity\n $type = (string)$fault->attributes()->type;\n list($message, $code) = $this->arrayToMessageAndCode($this->collectErrors($fault));\n if (is_null($message)) {\n return new IdsException(\"Fault Exception of type: \" . $type . \" has been generated.\");\n }\n $idsException = null;\n\n\n // Fault types can be of Validation, Service, Authentication and Authorization. Run them through the switch case.\n switch ($type) {\n // If Validation errors iterate the Errors and add them to the list of exceptions.\n case \"Validation\":\n case \"ValidationFault\":\n // Throw specific exception like ValidationException.\n $idsException = new ValidationException($message, $code);\n break;\n // If Validation errors iterate the Errors and add them to the list of exceptions.\n case \"Service\":\n case \"ServiceFault\":\n // Throw specific exception like ServiceException.\n $idsException = new ServiceException($message, $code);\n break;\n // If Validation errors iterate the Errors and add them to the list of exceptions.\n case \"Authentication\":\n case \"AuthenticationFault\":\n case \"Authorization\":\n case \"AuthorizationFault\":\n $idsException = new SecurityException($message, $code);\n break;\n // Use this as default if there was some other type of Fault\n default:\n $idsException = new IdsException($message, $code);\n\n }\n\n\n // Return idsException which will be of type Validation, Service or Security.\n return $idsException;\n }",
"private function getSoapInitErrorHandler()\n {\n // No inspections on this, it is handled properly handled despite the immediate overrider.\n // The overrider is present as it has to be nulled out after each use.\n if (!is_null($this->currentErrorHandler)) {\n restore_error_handler();\n $this->currentErrorHandler = null;\n $this->soapWarningException['code'] = null;\n $this->soapWarningException['string'] = null;\n }\n $this->currentErrorHandler = set_error_handler(function ($errNo, $errStr) {\n if (empty($this->soapWarningException['string'])) {\n $this->soapWarningException['code'] = $errNo;\n $this->soapWarningException['string'] = $errStr;\n }\n restore_error_handler();\n return false;\n }, E_WARNING);\n\n return $this;\n }",
"abstract protected function getConverterFactory();",
"protected function getConverter_ToService()\n {\n throw new RuntimeException('You have requested a synthetic service (\"converter.to\"). The DIC does not know how to construct this service.');\n }",
"public function getExceptionConverter(): string\n {\n return \"App\\\\Exceptions\\\\ThirdService\\\\FintechExceptionCode\";\n }",
"function wsf_wsdl2php($wsdl_location) {\n\n require_once ('dynamic_invocation/wsf_wsdl_consts.php');\n require_once ('dynamic_invocation/wsf_wsdl_util.php');\n\n global $written_classes;\n global $operations;\n global $actions;\n\n $written_classes[WSF_XSD_ANYTYPE] = TRUE;\n\n $code = \"\";\n\n $wsdl_dom = new DomDocument();\n $sig_model_dom = new DOMDocument();\n\n $xslt_location = \"./xslt/\";\n\n $sig_model_dom->preserveWhiteSpace = false;\n $wsdl_dom->preserveWhiteSpace = false;\n\n if (!$wsdl_location) {\n echo \"WSDL is not found\";\n return NULL;\n }\n $is_multiple_interfaces = FALSE;\n\n // load WSDL as DOM\n if (!$wsdl_dom->load($wsdl_location)) {\n echo \"WSDL could not be loaded.\";\n return NULL;\n }\n\n\n $wsdl_dom->preserveWhiteSpace = false;\n\n // changing code for processing mutiple port types in wsdl 1.1 \n $is_multiple_interfaces = wsf_is_mutiple_port_types($wsdl_dom);\n\n $is_wsdl_11 = $wsdl_11_dom = NULL;\n if ($is_multiple_interfaces == FALSE) {\n //wsdl1.1 to wsdl2 conversion\n $wsdl_dom = wsf_get_wsdl_dom($wsdl_dom, $wsdl_location, $is_wsdl_11, $wsdl_11_dom);\n if (!$wsdl_dom) {\n echo \"Error creating WSDL DOM document\";\n return NULL;\n }\n $sig_model_dom = wsf_get_sig_model_dom($wsdl_dom);\n } else {\n //wsdl1.1 to wsdl2 conversion\n $wsdl_dom = wsf_get_wsdl_dom($wsdl_dom, $wsdl_location, $is_wsdl_11, $wsdl_11_dom);\n $sig_model_dom = wsf_process_multiple_interfaces($wsdl_dom, $sig_model_dom);\n }\n\n\n if (!$sig_model_dom) {\n echo \"Error creating intermediate service operations signature model\";\n return NULL;\n }\n\n\n // get the list of operations\n $op_nodes = $sig_model_dom->getElementsByTagName(WSF_OPERATION);\n\n // process each operation\n foreach ($op_nodes as $op_node) {\n\n // get operation name \n $op_attr = $op_node->attributes;\n\n if($op_attr == NULL || $op_attr->getNamedItem(WSF_NAME) == NULL) {\n continue;\n }\n $op_name = $op_attr->getNamedItem(WSF_NAME)->value;\n\n if (array_key_exists($op_name, $operations) == FALSE || $operations[$op_name] == NULL) { // it operation is already found in an earlier parse, should not re-set it\n $operations[$op_name] = array ();\n $operations[$op_name][WSF_CLIENT] = \"\";\n $operations[$op_name][WSF_SERVICE] = \"\";\n }\n else {\n continue; //no need to record same operation multiple times\n }\n\n // get the nodes describing operation characteristics \n $op_child_list = $op_node->childNodes;\n\n //first we have to have a good idea about headers, so processing headers first\n $in_headers = 0;\n $out_headers = 0;\n\n $in_header_objects = array();\n $in_header_objects[WSF_CLIENT] = \"\";\n $in_header_objects[WSF_SERVICE] = \"\";\n\n $out_header_objects = array();\n $out_header_objects[WSF_CLIENT] = \"\";\n $out_header_objects[WSF_SERVICE] = \"\";\n\n $service_function_doc_comment = \"\";\n $service_function_doc_comment .= \"/**\\n\";\n $service_function_doc_comment .= \" * Service function $op_name\\n\";\n\n // doc comments for input types\n foreach ($op_child_list as $op_child) {\n // process the signature node\n if ($op_child->nodeName == WSF_SIGNATURE) {\n // get the nodes representing operation parameters and return types within signature\n $param_list = $op_child->childNodes;\n foreach ($param_list as $param_node) {\n if ($param_node) {\n // look for params and returns nodes \n if ($param_node->nodeName == WSF_PARAMS) {\n if ($param_node->hasAttributes()) {\n // Wrapper element \n $params_attr = $param_node->attributes;\n\n // get wrapper element name, this is going to be the class name\n $ele_name = $params_attr->getNamedItem(WSF_WRAPPER_ELEMENT)->value;\n \n $service_function_doc_comment .= \" * @param object of $ele_name \\$input \\n\";\n }\n else {\n // No wrapper element, there won't be any class generated for this \n\n $child_array = array ();\n $param_child_list = $param_node->childNodes;\n\n foreach ($param_child_list as $param_child) {\n $param_attr = $param_child->attributes;\n\n $ele_name = $param_attr->getNamedItem(WSF_NAME)->value;\n\n $content_model = \"\";\n if($param_attr->getNamedItem(WSF_CONTENT_MODEL)) {\n $content_model = $param_attr->getNamedItem(WSF_CONTENT_MODEL)->value;\n }\n $param_type = $param_attr->getNamedItem(WSF_TYPE)->value;\n \n if($content_model == WSF_SIMPLE_CONTENT) {\n $service_function_doc_comment .= \" * @param object of $ele_name \\$input \\n\";\n }\n else {\n $service_function_doc_comment .= \" * @param $param_type \\$input \\n\";\n }\n }\n }\n }\n }\n }\n }\n }\n\n foreach ($op_child_list as $op_child) {\n if($op_child->nodeName == WSF_W2P_BINDING_DETAILS) {\n $op_binding_childs = $op_child->childNodes;\n foreach($op_binding_childs as $op_binding_child) {\n if($op_binding_child->nodeName == WSF_SOAPHEADER) {\n if($op_binding_child->attributes->getNamedItem(WSF_HEADER_FOR_ATTRIBUTE)) {\n if($op_binding_child->attributes->getNamedItem(WSF_HEADER_FOR_ATTRIBUTE)->value == WSF_WSDL_OUTPUT) {\n $direction = WSF_WSDL_OUTPUT;\n } else {\n $direction = WSF_WSDL_INPUT;\n }\n } else {\n $direction = WSF_WSDL_INPUT;\n }\n }\n \n if($op_binding_child->attributes->getNamedItem(WSF_TYPE)) {\n\t\t\t$param_node = $op_binding_child->firstChild;\n\t\t\n\t\t\tif($param_node && $param_node->attributes->getNamedItem(WSF_TYPE)){\n\t\t\n\t\t\t$class_name = $param_node->attributes->getNamedItem(WSF_TYPE)->value;\n if($direction == WSF_WSDL_INPUT) {\n if (($param_node->attributes && $param_node->attributes->getNamedItem(WSF_WSDL_SIMPLE) && \n $param_node->attributes->getNamedItem(WSF_WSDL_SIMPLE)->value == 'no') ||\n ($param_node->attributes->getNamedItem(WSF_CONTENT_MODEL) && \n $param_node->attributes->getNamedItem(WSF_CONTENT_MODEL)->value == WSF_SIMPLE_CONTENT)) {\n // for the complex types and simple contnet\n $in_header_objects[WSF_CLIENT] .= \" \\$header_in{$in_headers} = new $class_name();\\n // TODO: fill in the class fields of \\$header_in{$in_headers} object which is of type $class_name to match your business logic\\n\\n\";\n $in_header_objects[WSF_SERVICE] .= \" // NOTE: \\$header_in{$in_headers} object is of type $class_name\\n\";\n\n $service_function_doc_comment .= \" * @param object of $class_name \\$header_in{$in_headers} input header\\n\";\n }\n else {\n // for the simple types\n $in_header_objects[WSF_CLIENT] .= \" // TODO: fill in the \\$header_in{$in_headers} which is of type $class_name to match your business logic\\n\\n\";\n $in_header_objects[WSF_SERVICE] .= \" // NOTE: \\$header_in{$in_headers} header is of type $class_name\\n\";\n\n $service_function_doc_comment .= \" * @param $class_name \\$header_in{$in_headers} input header\\n\";\n }\n\n $in_headers ++;\n }\n else {\n\n if (($param_node->attributes && $param_node->attributes->getNamedItem(WSF_WSDL_SIMPLE) && \n $param_node->attributes->getNamedItem(WSF_WSDL_SIMPLE)->value == 'no') ||\n ($param_node->attributes->getNamedItem(WSF_CONTENT_MODEL) && \n $param_node->attributes->getNamedItem(WSF_CONTENT_MODEL)->value == WSF_SIMPLE_CONTENT)) {\n // for the complex types and simple contnet\n\n $out_header_objects[WSF_CLIENT] .= \"\\n // TODO: Implement business logic to consume \\$header_out{$out_headers} object, which is of type class $class_name\\n\";\n $out_header_objects[WSF_SERVICE] .= \" // NOTE: you should assign an object of type $class_name to \\$header_out{$out_headers}\\n\";\n \n $service_function_doc_comment .= \" * @param reference object of $class_name \\$header_out{$out_headers} object output header\\n\";\n }\n else {\n // for the simple types\n $out_header_objects[WSF_CLIENT] .= \"\\n // TODO: Implement business logic to consume \\$header_out{$out_headers}, which is of type $class_name\\n\";\n $out_header_objects[WSF_SERVICE] .= \" // NOTE: you should assign an object of type $class_name to \\$header_out{$out_headers}\\n\";\n \n $service_function_doc_comment .= \" * @param reference $class_name \\$header_out{$out_headers} output header\\n\";\n }\n\n $out_headers ++;\n }\n\n if (($param_node->attributes && $param_node->attributes->getNamedItem(WSF_WSDL_SIMPLE) && \n $param_node->attributes->getNamedItem(WSF_WSDL_SIMPLE)->value == 'no') ||\n ($param_node->attributes->getNamedItem(WSF_CONTENT_MODEL) && \n $param_node->attributes->getNamedItem(WSF_CONTENT_MODEL)->value == WSF_SIMPLE_CONTENT)) {\n $code_for_header = wsf_write_sub_classes($param_node);\n $code .= $code_for_header;\n }\n\t\t }\n\t }\n }\n }\n }\n\n\n // doc comments for the return type\n foreach ($op_child_list as $op_child) {\n // process the signature node\n if ($op_child->nodeName == WSF_SIGNATURE) {\n // get the nodes representing operation parameters and return types within signature\n $param_list = $op_child->childNodes;\n foreach ($param_list as $param_node) {\n if ($param_node) {\n // look for params and returns nodes \n if ($param_node->nodeName == WSF_RETURNS) {\n if ($param_node->hasAttributes()) {\n // Wrapper element \n $params_attr = $param_node->attributes;\n\n // get wrapper element name, this is going to be the class name\n $ele_name = $params_attr->getNamedItem(WSF_WRAPPER_ELEMENT)->value;\n \n $service_function_doc_comment .= \" * @return object of $ele_name \\n\";\n }\n else {\n\n // No wrapper element, there won't be any class generated for this \n\n $child_array = array ();\n $param_child_list = $param_node->childNodes;\n\n foreach ($param_child_list as $param_child) {\n $param_attr = $param_child->attributes;\n \n $ele_name = $param_type = \"\";\n if($param_attr->getNamedItem(WSF_NAME)) {\n $ele_name = $param_attr->getNamedItem(WSF_NAME)->value;\n }\n if($param_attr->getNamedItem(WSF_TYPE)) {\n $param_type = $param_attr->getNamedItem(WSF_TYPE)->value;\n }\n\n $content_model = \"\";\n if($param_attr->getNamedItem(WSF_CONTENT_MODEL)) {\n $content_model = $param_attr->getNamedItem(WSF_CONTENT_MODEL)->value;\n }\n \n if($content_model == WSF_SIMPLE_CONTENT) {\n $service_function_doc_comment .= \" * @return object of $ele_name \\n\";\n }\n else {\n $service_function_doc_comment .= \" * @return $param_type \\n\";\n }\n }\n }\n }\n }\n }\n }\n }\n\n $service_function_doc_comment .= \" */\\n\";\n \n /*\n if($out_headers > 0) {\n $in_header_objects[WSF_CLIENT] .= \" // Declration of variables for the output headers\\n\"; \n $in_header_objects[WSF_CLIENT] .= \" // NOTE: don't set any value to these objects, rather the call to proxy will assign values for them\\n\"; \n for($i = 0; $i < $out_headers; $i ++) {\n $in_header_objects[WSF_CLIENT] .= \" \\$header_out{$i} = NULL;\\n\";\n }\n $in_header_objects[WSF_CLIENT] .= \"\\n\"; \n $out_header_objects[WSF_SERVICE] .= \"\\n\";\n }\n */\n \n if($in_header_objects[WSF_CLIENT] != \"\") {\n $in_header_objects[WSF_CLIENT] = substr_replace($in_header_objects[WSF_CLIENT], \"\", -1);\n }\n if($in_header_objects[WSF_SERVICE] != \"\") {\n $in_header_objects[WSF_SERVICE] .= \"\\n\";\n }\n \n /* function declration variables for headers */\n $header_function_decl = \"\";\n for($i = 0; $i < $in_headers; $i ++) {\n $header_function_decl .= \", \\$header_in\".$i;\n }\n for($i = 0; $i < $out_headers; $i ++) {\n $header_function_decl .= \", &\\$header_out\".$i;\n }\n\n /* function call variables for headers */\n $header_function_call = \"\";\n for($i = 0; $i < $in_headers; $i ++) {\n $header_function_call .= \", \\$header_in\".$i;\n }\n for($i = 0; $i < $out_headers; $i ++) {\n $header_function_call .= \", &\\$header_out\".$i;\n }\n\n //put the doc comment\n //declare the start of service function\n $operations[$op_name][WSF_SERVICE] = $service_function_doc_comment;\n $operations[$op_name][WSF_SERVICE] .= \"function \" . $op_name . \"(\\$input{$header_function_decl}) {\\n\";\n\n \n foreach ($op_child_list as $op_child) {\n // process the signature node\n if ($op_child->nodeName == WSF_SIGNATURE) {\n // get the nodes representing operation parameters and return types within signature\n $param_list = $op_child->childNodes;\n foreach ($param_list as $param_node) {\n if ($param_node) {\n // look for params and returns nodes \n if ($param_node->nodeName == WSF_PARAMS || $param_node->nodeName == WSF_RETURNS) {\n if ($param_node->hasAttributes()) {\n // Wrapper element \n $params_attr = $param_node->attributes;\n\n // get wrapper element name, this is going to be the class name\n $ele_name = $params_attr->getNamedItem(WSF_WRAPPER_ELEMENT)->value;\n \n // array to hold child elements corresponding to sub classes\n $child_array = array ();\n\n // check if the class is already written\n if (array_key_exists($ele_name, $written_classes) && $written_classes[$ele_name] == TRUE) {\n continue;\n }\n\n // write the extension code..\n $extension_code = wsf_write_extension($param_node, $code);\n $derives_arr = wsf_write_derives($param_node, $code);\n\n\n // start writing class \n $code = $code . \"class \" . $ele_name . $extension_code. \" {\\n\";\n $written_classes[$ele_name] = TRUE;\n\n // prepare the demo code that the user could use for testing client. \n // shows how to create the input and receive the response\n\n if ($param_node->nodeName == WSF_PARAMS) {\n $operations[$op_name][WSF_CLIENT] = $operations[$op_name][WSF_CLIENT] . \" \\$input = new $ele_name();\\n\";\n if(count($derives_arr) > 0) {\n $operations[$op_name][WSF_CLIENT] = $operations[$op_name][WSF_CLIENT] . \" /**\\n * Here you can replace $ele_name with a following class(es)\\n\";\n foreach($derives_arr as $derive) {\n $operations[$op_name][WSF_CLIENT] = $operations[$op_name][WSF_CLIENT] . \" * $derive\\n\";\n }\n $operations[$op_name][WSF_CLIENT] = $operations[$op_name][WSF_CLIENT] . \" */\\n\";\n } \n $operations[$op_name][WSF_CLIENT] = $operations[$op_name][WSF_CLIENT] . \" //TODO: fill in the class fields of \\$input to match your business logic\\n\";\n $operations[$op_name][WSF_CLIENT] .= $in_header_objects[WSF_CLIENT];\n\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . \" // TODO: fill in the business logic\\n // NOTE: \\$input is of type $ele_name\\n\";\n if(count($derives_arr) > 0) {\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . \" /**\\n * You can expect \\$input to be an instance of following class(es) in addition to $ele_name\\n\";\n foreach($derives_arr as $derive) {\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . \" * $derive\\n\";\n }\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . \" */\\n\";\n }\n $operations[$op_name][WSF_SERVICE] .= $in_header_objects[WSF_SERVICE];\n }\n if ($param_node->nodeName == WSF_RETURNS) {\n $operations[$op_name][WSF_CLIENT] = $operations[$op_name][WSF_CLIENT] . \"\\n // call the operation\\n \\$response = \\$proxy->\" . $op_node->attributes->getNamedItem('name')->value . \"(\\$input{$header_function_call});\\n //TODO: Implement business logic to consume \\$response, which is of type $ele_name\\n\";\n if(count($derives_arr) > 0) {\n $operations[$op_name][WSF_CLIENT] = $operations[$op_name][WSF_CLIENT] . \" /**\\n * You can expect \\$response to be an instance of following class(es) in addition to $ele_name\\n\";\n foreach($derives_arr as $derive) {\n $operations[$op_name][WSF_CLIENT] = $operations[$op_name][WSF_CLIENT] . \" * $derive\\n\";\n }\n $operations[$op_name][WSF_CLIENT] = $operations[$op_name][WSF_CLIENT] . \" */\\n\";\n }\n $operations[$op_name][WSF_CLIENT] .= $out_header_objects[WSF_CLIENT];\n $operations[$op_name][WSF_SERVICE] .= $out_header_objects[WSF_SERVICE];\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . \" // NOTE: should return an object of type $ele_name\\n\";\n if(count($derives_arr) > 0) {\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . \" /**\\n * Here you can replace $ele_name with a following class(es)\\n\";\n foreach($derives_arr as $derive) {\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . \" * $derive\\n\";\n }\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . \" */\\n\";\n } \n }\n\n $child_array = array();\n $derived_classes_code = \"\";\n $code .= wsf_write_content_model($param_node, $child_array, $derived_classes_code);\n \n $code = $code . \"\\n}\\n\\n\";\n // done writing the current class, now go and write the sub classes\n foreach($child_array as $child) {\n $code = $code . wsf_write_sub_classes($child);\n }\n $code .= $derived_classes_code;\n } else {\n // TODO: No wrapper element, there won't be any class generated for this \n\n $child_array = array ();\n $param_child_list = $param_node->childNodes;\n\n foreach ($param_child_list as $param_child) {\n $param_attr = $param_child->attributes;\n\n $ele_name = $param_attr->getNamedItem(WSF_NAME)->value;\n $param_type = $param_attr->getNamedItem(WSF_TYPE)->value;\n\n $content_model = \"\";\n if($param_attr->getNamedItem(WSF_CONTENT_MODEL)) {\n $content_model = $param_attr->getNamedItem(WSF_CONTENT_MODEL)->value;\n }\n //resolving lists\n $is_list = FALSE;\n if($param_attr->getNamedItem(WSF_LIST)) {\n $is_list = $param_attr->getNamedItem(WSF_LIST)->value;\n }\n $type_prefix = \"\";\n if($is_list) {\n $type_prefix = \"array of \";\n }\n\n //resolving unions\n $is_union = FALSE;\n if($param_attr->getNamedItem(WSF_UNION)) {\n $is_union = $param_attr->getNamedItem(WSF_UNION)->value;\n }\n if($is_union) {\n $union_type_array = array();\n $union_childs = $param_child->childNodes;\n\n foreach($union_childs as $union_child) {\n if($union_child->nodeName == \"union\") {\n $union_type = $union_child->attributes->getNamedItem(WSF_TYPE)->value;\n $union_type_array[] = $union_type;\n }\n }\n $param_type = implode(\"/\", $union_type_array);\n }\n\n if($content_model == WSF_SIMPLE_CONTENT) {\n // start writing class \n if(!array_key_exists($ele_name, $written_classes) || !$written_classes[$ele_name]) {\n $written_classes[$ele_name] = TRUE;\n $code = $code . \"class \" . $ele_name. \" {\\n\";\n\n $derived_classes_code = \"\";\n $code .= wsf_write_content_model($param_child, $child_array, $derived_classes_code);\n $code = $code . \"\\n}\\n\\n\";\n\n $code .= $derived_classes_code;\n }\n\n if ($param_node->nodeName == WSF_PARAMS) {\n $operations[$op_name][WSF_CLIENT] = $operations[$op_name][WSF_CLIENT] . \" \\$input = new $ele_name();\\n //TODO: fill in the class fields of \\$input to match your business logic\\n\";\n $operations[$op_name][WSF_CLIENT] .= $in_header_objects[WSF_CLIENT];\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . \" // TODO: fill in the business logic\\n // NOTE: \\$input is of type $ele_name\\n\";\n $operations[$op_name][WSF_SERVICE] .= $in_header_objects[WSF_SERVICE];\n }\n if ($param_node->nodeName == WSF_RETURNS) {\n $operations[$op_name][WSF_CLIENT] = $operations[$op_name][WSF_CLIENT] . \"\\n // call the operation\\n \\$response = \\$proxy->\" . $op_node->attributes->getNamedItem('name')->value . \"(\\$input{$header_function_call});\\n //TODO: Implement business logic to consume \\$response, which is of type $ele_name\\n\";\n $operations[$op_name][WSF_CLIENT] .= $out_header_objects[WSF_CLIENT];\n $operations[$op_name][WSF_SERVICE] .= $out_header_objects[WSF_SERVICE];\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . \" // NOTE: should return an object of type $ele_name\\n\";\n }\n\n }\n else {\n // prepare the demo code that the user could use for testing client. \n // shows how to create the input and receive the response\n\n if ($param_node->nodeName == WSF_PARAMS) {\n $simple_type_comment = wsf_comment_on_simple_type_wrapper($param_child, \"\\$input\", $param_type);\n $operations[$op_name][WSF_CLIENT] = $operations[$op_name][WSF_CLIENT] . \" //TODO: fill \\$input with (data type: {$type_prefix}{$param_type}) data to match your business logic\\n\";\n if($param_child->getAttribute(\"simple\") == \"yes\"){\n $operations[$op_name][WSF_CLIENT] = $operations[$op_name][WSF_CLIENT] . $simple_type_comment.\"\\n\";\n }\n $operations[$op_name][WSF_CLIENT] .= $in_header_objects[WSF_CLIENT];\n\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . \" // TODO: fill in the business logic\\n // NOTE: \\$input is of type {$type_prefix}{$param_type}\\n\";\n if($param_child->getAttribute(\"simple\") == \"yes\"){\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . $simple_type_comment.\"\\n\";\n }\n $operations[$op_name][WSF_SERVICE] .= $in_header_objects[WSF_SERVICE];\n\n }\n if ($param_node->nodeName == WSF_RETURNS) {\n $simple_type_comment = wsf_comment_on_simple_type_wrapper($param_child, \"output \", $param_type);\n $operations[$op_name][WSF_CLIENT] = $operations[$op_name][WSF_CLIENT] . \"\\n // call the operation\\n \\$response = \\$proxy->\" . $op_node->attributes->getNamedItem('name')->value . \"(\\$input{$header_function_call});\\n //TODO: Implement business logic to consume \\$response, which is of type {$type_prefix}{$param_type}\\n\";\n $operations[$op_name][WSF_CLIENT] .= $out_header_objects[WSF_CLIENT];\n $operations[$op_name][WSF_SERVICE] .= $out_header_objects[WSF_SERVICE];\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . \" // NOTE: should return an object of (type: {$type_prefix}{$param_type})\\n\";\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . $simple_type_comment.\"\\n\";\n }\n }\n }\n }\n }\n }\n }\n }\n else if($op_child->nodeName == WSF_W2P_BINDING_DETAILS) {\n /* action is default to wsa waction */\n $action = $op_child->getAttribute('wsawaction'); \n if($action == NULL)\n {\n $action = $op_child->getAttribute('soapaction');\n }\n\n if($action != NULL)\n {\n /* we feeding the actions to the global variable */\n if($actions == NULL)\n {\n $actions = array();\n }\n \n $actions[$action] = $op_name;\n }\n }\n }\n $operations[$op_name][WSF_SERVICE] = $operations[$op_name][WSF_SERVICE] . \"\\n}\\n\\n\";\n }\n return $code;\n}",
"public function __construct($message, $countryCode, $config = NULL, $method = NULL, $log = NULL)\n {\n\n // WebService requests get a stdClass object back from the SoapClient instance\n if (is_object($message)) {\n\n // Web Service EU responses\n if (property_exists($message, \"CreateOrderEuResult\"))\n {\n $this->response = new CreateOrderResponse($message, $log);\n }\n elseif (property_exists($message, \"GetAddressesResult\")) // also legacy getAddresses result\n {\n $this->response = new GetAddressesResponse($message, $log);\n }\n elseif (property_exists($message, \"GetPaymentPlanParamsEuResult\"))\n {\n $this->response = new PaymentPlanParamsResponse($message, $log);\n }\n elseif (property_exists($message, \"DeliverOrderEuResult\"))\n {\n $this->response = new DeliverOrderResult($message, $log);\n }\n elseif (property_exists($message, \"GetAccountCreditParamsEuResult\"))\n {\n $this->response = new AccountCreditParamsResponse($message, $log);\n }\n elseif (property_exists($message, \"CloseOrderEuResult\"))\n {\n $this->response = new CloseOrderResult($message, $log);\n } // $method is set for i.e. AdminService requests\n elseif (isset($method))\n {\n switch ($method)\n {\n case \"CancelOrder\":\n $this->response = new CancelOrderResponse($message, $log);\n break;\n case \"DeliverOrders\":\n $this->response = new DeliverOrdersResponse($message, $log);\n break;\n case \"GetOrders\":\n $this->response = new GetOrdersResponse($message, $log);\n break;\n case \"GetAccountCredits\":\n $this->response = new GetAccountCreditsResponse($message, $log);\n break;\n case \"CancelOrderRows\":\n $this->response = new CancelOrderRowsResponse($message, $log);\n break;\n case \"AddOrderRows\":\n $this->response = new AddOrderRowsResponse($message, $log);\n break;\n case \"UpdateOrderRows\":\n $this->response = new UpdateOrderRowsResponse($message, $log);\n break;\n case \"UpdateOrder\":\n $this->response = new UpdateOrderResponse($message, $log);\n break;\n case \"CreditInvoiceRows\":\n $this->response = new CreditInvoiceRowsResponse($message, $log);\n break;\n case \"DeliverPartial\":\n $this->response = new DeliverPartialResponse($message, $log);\n break;\n case \"CancelPaymentPlanRows\":\n $this->response = new CreditPaymentPlanResponse($message, $log);\n break;\n case \"CancelPaymentPlanAmount\":\n $this->response = new CreditPaymentPlanResponse($message, $log);\n break;\n case \"CancelAccountCreditAmount\":\n $this->response = new CancelAccountCreditAmount($message, $log);\n break;\n case \"CancelAccountCreditRows\":\n $this->response = new CancelAccountCreditRows($message, $log);\n break;\n default:\n throw new Exception(\"unknown method: $method\");\n break;\n }\n } // legacy fallback -- webservice from hosted_admin -- used by preparedpayment\n elseif (property_exists($message, \"message\"))\n {\n $this->response = new HostedAdminResponse($message, $countryCode, $config);\n }\n } // webservice hosted payment\n elseif ($message != NULL)\n {\n $this->response = new HostedPaymentResponse($message, $countryCode, $config);\n }\n else\n {\n $this->response = \"Response is not recognized.\";\n }\n }",
"protected function getApiPlatform_IriConverterService()\n {\n $a = ($this->privates['api_platform.router'] ?? $this->getApiPlatform_RouterService());\n\n return $this->privates['api_platform.iri_converter'] = new \\ApiPlatform\\Core\\Bridge\\Symfony\\Routing\\IriConverter(($this->privates['api_platform.metadata.property.name_collection_factory.cached'] ?? $this->getApiPlatform_Metadata_Property_NameCollectionFactory_CachedService()), ($this->privates['api_platform.metadata.property.metadata_factory.cached'] ?? $this->getApiPlatform_Metadata_Property_MetadataFactory_CachedService()), ($this->privates['debug.api_platform.item_data_provider'] ?? $this->getDebug_ApiPlatform_ItemDataProviderService()), new \\ApiPlatform\\Core\\Bridge\\Symfony\\Routing\\CachedRouteNameResolver(($this->privates['api_platform.cache.route_name_resolver'] ?? $this->getApiPlatform_Cache_RouteNameResolverService()), new \\ApiPlatform\\Core\\Bridge\\Symfony\\Routing\\RouteNameResolver($a)), $a, ($this->privates['property_accessor'] ?? $this->getPropertyAccessorService()), ($this->privates['api_platform.identifiers_extractor.cached'] ?? $this->getApiPlatform_IdentifiersExtractor_CachedService()), ($this->privates['debug.api_platform.subresource_data_provider'] ?? $this->getDebug_ApiPlatform_SubresourceDataProviderService()), ($this->privates['api_platform.identifier.converter'] ?? $this->getApiPlatform_Identifier_ConverterService()), ($this->privates['api_platform.resource_class_resolver'] ?? $this->getApiPlatform_ResourceClassResolverService()), ($this->privates['api_platform.metadata.resource.metadata_factory.cached'] ?? $this->getApiPlatform_Metadata_Resource_MetadataFactory_CachedService()));\n }",
"protected static function initDtoRegistry()\n {\n FrontDtoFactory::register(ValidationError::CLASS_KEY, ValidationError::CLASS_NAME);\n FrontDtoFactory::register(Warehouse::CLASS_KEY, Warehouse::CLASS_NAME);\n FrontDtoFactory::register(ParcelInfo::CLASS_KEY, ParcelInfo::CLASS_NAME);\n FrontDtoFactory::register(DashboardStatus::CLASS_KEY, DashboardStatus::CLASS_NAME);\n FrontDtoFactory::register(Country::CLASS_KEY, Country::CLASS_NAME);\n FrontDtoFactory::register(RegistrationRequest::CLASS_KEY, RegistrationRequest::CLASS_NAME);\n FrontDtoFactory::register(RegistrationLegalPolicy::CLASS_KEY, RegistrationLegalPolicy::CLASS_NAME);\n FrontDtoFactory::register(ShippingPricePolicy::CLASS_KEY, ShippingPricePolicy::CLASS_NAME);\n }",
"protected function getConverter_FromService()\n {\n throw new RuntimeException('You have requested a synthetic service (\"converter.from\"). The DIC does not know how to construct this service.');\n }",
"public function dataProviderForGetSoapFaultMessageTest()\n {\n /** Include file with all expected SOAP fault XMLs. */\n $expectedXmls = include __DIR__ . '/../../_files/soap_fault/soap_fault_expected_xmls.php';\n\n //Each array contains data for SOAP Fault Message, Expected XML, and Assert Message.\n return [\n 'ArrayDataDetails' => [\n 'Fault reason',\n 'Sender',\n [\n Fault::NODE_DETAIL_PARAMETERS => ['key1' => 'value1', 'key2' => 'value2', 'value3'],\n Fault::NODE_DETAIL_TRACE => 'Trace',\n 'Invalid' => 'This node should be skipped'\n ],\n $expectedXmls['expectedResultArrayDataDetails'],\n 'SOAP fault message with associated array data details is invalid.',\n ],\n 'IndexArrayDetails' => [\n 'Fault reason',\n 'Sender',\n ['value1', 'value2'],\n $expectedXmls['expectedResultIndexArrayDetails'],\n 'SOAP fault message with index array data details is invalid.',\n ],\n 'EmptyArrayDetails' => [\n 'Fault reason',\n 'Sender',\n [],\n $expectedXmls['expectedResultEmptyArrayDetails'],\n 'SOAP fault message with empty array data details is invalid.',\n ],\n 'ObjectDetails' => [\n 'Fault reason',\n 'Sender',\n (object)['key' => 'value'],\n $expectedXmls['expectedResultObjectDetails'],\n 'SOAP fault message with object data details is invalid.',\n ],\n 'ComplexDataDetails' => [\n 'Fault reason',\n 'Sender',\n [Fault::NODE_DETAIL_PARAMETERS => ['key' => ['sub_key' => 'value']]],\n $expectedXmls['expectedResultComplexDataDetails'],\n 'SOAP fault message with complex data details is invalid.',\n ]\n ];\n }",
"protected function getApiPlatform_IriConverterService()\n {\n $a = ($this->privates['api_platform.router'] ?? $this->getApiPlatform_RouterService());\n\n return $this->privates['api_platform.iri_converter'] = new \\ApiPlatform\\Core\\Bridge\\Symfony\\Routing\\IriConverter(($this->privates['api_platform.metadata.property.name_collection_factory.cached'] ?? $this->getApiPlatform_Metadata_Property_NameCollectionFactory_CachedService()), ($this->privates['api_platform.metadata.property.metadata_factory.cached'] ?? $this->getApiPlatform_Metadata_Property_MetadataFactory_CachedService()), ($this->privates['api_platform.item_data_provider'] ?? $this->getApiPlatform_ItemDataProviderService()), new \\ApiPlatform\\Core\\Bridge\\Symfony\\Routing\\CachedRouteNameResolver(new \\Symfony\\Component\\Cache\\Adapter\\ArrayAdapter(), new \\ApiPlatform\\Core\\Bridge\\Symfony\\Routing\\RouteNameResolver($a)), $a, ($this->privates['property_accessor'] ?? $this->getPropertyAccessorService()), ($this->privates['api_platform.identifiers_extractor.cached'] ?? $this->getApiPlatform_IdentifiersExtractor_CachedService()), ($this->privates['api_platform.subresource_data_provider'] ?? $this->getApiPlatform_SubresourceDataProviderService()), ($this->privates['api_platform.identifier.converter'] ?? $this->getApiPlatform_Identifier_ConverterService()));\n }",
"public function getExceptionConverter(): string\n {\n return \"App\\\\Exceptions\\\\Business\\\\BetThirdExceptionCode\";\n }",
"protected function getTranslator_DefaultService()\n {\n $this->privates['translator.default'] = $instance = new \\Symfony\\Bundle\\FrameworkBundle\\Translation\\Translator(new \\Symfony\\Component\\DependencyInjection\\Argument\\ServiceLocator($this->getService, [\n 'translation.loader.csv' => ['privates', 'translation.loader.csv', 'getTranslation_Loader_CsvService', true],\n 'translation.loader.dat' => ['privates', 'translation.loader.dat', 'getTranslation_Loader_DatService', true],\n 'translation.loader.ini' => ['privates', 'translation.loader.ini', 'getTranslation_Loader_IniService', true],\n 'translation.loader.json' => ['privates', 'translation.loader.json', 'getTranslation_Loader_JsonService', true],\n 'translation.loader.mo' => ['privates', 'translation.loader.mo', 'getTranslation_Loader_MoService', true],\n 'translation.loader.php' => ['privates', 'translation.loader.php', 'getTranslation_Loader_PhpService', true],\n 'translation.loader.po' => ['privates', 'translation.loader.po', 'getTranslation_Loader_PoService', true],\n 'translation.loader.qt' => ['privates', 'translation.loader.qt', 'getTranslation_Loader_QtService', true],\n 'translation.loader.res' => ['privates', 'translation.loader.res', 'getTranslation_Loader_ResService', true],\n 'translation.loader.xliff' => ['privates', 'translation.loader.xliff', 'getTranslation_Loader_XliffService', true],\n 'translation.loader.yml' => ['privates', 'translation.loader.yml', 'getTranslation_Loader_YmlService', true],\n ], [\n 'translation.loader.csv' => '?',\n 'translation.loader.dat' => '?',\n 'translation.loader.ini' => '?',\n 'translation.loader.json' => '?',\n 'translation.loader.mo' => '?',\n 'translation.loader.php' => '?',\n 'translation.loader.po' => '?',\n 'translation.loader.qt' => '?',\n 'translation.loader.res' => '?',\n 'translation.loader.xliff' => '?',\n 'translation.loader.yml' => '?',\n ]), ($this->privates['translator.formatter.default'] ?? $this->getTranslator_Formatter_DefaultService()), 'en', ['translation.loader.php' => [0 => 'php'], 'translation.loader.yml' => [0 => 'yaml', 1 => 'yml'], 'translation.loader.xliff' => [0 => 'xlf', 1 => 'xliff'], 'translation.loader.po' => [0 => 'po'], 'translation.loader.mo' => [0 => 'mo'], 'translation.loader.qt' => [0 => 'ts'], 'translation.loader.csv' => [0 => 'csv'], 'translation.loader.res' => [0 => 'res'], 'translation.loader.dat' => [0 => 'dat'], 'translation.loader.ini' => [0 => 'ini'], 'translation.loader.json' => [0 => 'json']], ['cache_dir' => ($this->targetDir.''.'/translations'), 'debug' => true, 'resource_files' => ['af' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.af.xlf')], 'ar' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ar.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ar.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ar.xlf')], 'az' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.az.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.az.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.az.xlf')], 'be' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.be.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.be.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.be.xlf')], 'bg' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.bg.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.bg.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.bg.xlf')], 'ca' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ca.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ca.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ca.xlf')], 'cs' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.cs.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.cs.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.cs.xlf')], 'cy' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.cy.xlf')], 'da' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.da.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.da.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.da.xlf')], 'de' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.de.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.de.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.de.xlf')], 'el' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.el.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.el.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.el.xlf')], 'en' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.en.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.en.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.en.xlf'), 3 => (\\dirname(__DIR__, 4).'/translations/messages.en.xliff'), 4 => (\\dirname(__DIR__, 4).'/translations/messages.en.xliff')], 'es' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.es.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.es.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.es.xlf')], 'et' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.et.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.et.xlf')], 'eu' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.eu.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.eu.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.eu.xlf')], 'fa' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.fa.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.fa.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.fa.xlf')], 'fi' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.fi.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.fi.xlf')], 'fr' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.fr.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.fr.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.fr.xlf')], 'gl' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.gl.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.gl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.gl.xlf')], 'he' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.he.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.he.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.he.xlf')], 'hr' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.hr.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.hr.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.hr.xlf')], 'hu' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.hu.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.hu.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.hu.xlf')], 'hy' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.hy.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.hy.xlf')], 'id' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.id.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.id.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.id.xlf')], 'it' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.it.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.it.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.it.xlf')], 'ja' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ja.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ja.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ja.xlf')], 'lb' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.lb.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.lb.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.lb.xlf')], 'lt' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.lt.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.lt.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.lt.xlf')], 'lv' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.lv.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.lv.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.lv.xlf')], 'mn' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.mn.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.mn.xlf')], 'nb' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.nb.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.nb.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.nb.xlf')], 'nl' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.nl.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.nl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.nl.xlf')], 'nn' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.nn.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.nn.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.nn.xlf')], 'no' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.no.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.no.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.no.xlf')], 'pl' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.pl.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.pl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.pl.xlf')], 'pt' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.pt.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.pt.xlf')], 'pt_BR' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.pt_BR.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.pt_BR.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.pt_BR.xlf')], 'ro' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ro.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ro.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ro.xlf')], 'ru' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ru.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ru.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ru.xlf')], 'sk' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sk.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sk.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sk.xlf')], 'sl' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sl.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sl.xlf')], 'sq' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sq.xlf')], 'sr_Cyrl' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sr_Cyrl.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sr_Cyrl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sr_Cyrl.xlf')], 'sr_Latn' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sr_Latn.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sr_Latn.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sr_Latn.xlf')], 'sv' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sv.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sv.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sv.xlf')], 'th' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.th.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.th.xlf')], 'tl' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.tl.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.tl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.tl.xlf')], 'tr' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.tr.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.tr.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.tr.xlf')], 'uk' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.uk.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.uk.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.uk.xlf')], 'vi' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.vi.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.vi.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.vi.xlf')], 'zh_CN' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.zh_CN.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.zh_CN.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.zh_CN.xlf')], 'zh_TW' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.zh_TW.xlf')], 'pt_PT' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.pt_PT.xlf')]], 'scanned_directories' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations'), 3 => (\\dirname(__DIR__, 4).'/translations'), 4 => (\\dirname(__DIR__, 4).'/translations'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/monolog-bundle/translations'), 6 => (\\dirname(__DIR__, 4).'/vendor/sensio/framework-extra-bundle/src/translations'), 7 => (\\dirname(__DIR__, 4).'/vendor/symfony/swiftmailer-bundle/translations'), 8 => (\\dirname(__DIR__, 4).'/vendor/jms/serializer-bundle/translations'), 9 => (\\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/translations'), 10 => (\\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-migrations-bundle/translations'), 11 => (\\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-fixtures-bundle/translations'), 12 => (\\dirname(__DIR__, 4).'/vendor/simplethings/entity-audit-bundle/src/SimpleThings/EntityAudit/translations'), 13 => (\\dirname(__DIR__, 4).'/vendor/csa/guzzle-bundle/src/translations'), 14 => (\\dirname(__DIR__, 4).'/vendor/nelmio/security-bundle/translations'), 15 => (\\dirname(__DIR__, 4).'/vendor/nelmio/cors-bundle/translations'), 16 => (\\dirname(__DIR__, 4).'/vendor/tetranz/select2entity-bundle/translations'), 17 => (\\dirname(__DIR__, 4).'/vendor/qandidate/toggle-bundle/translations'), 18 => (\\dirname(__DIR__, 4).'/vendor/symfony/maker-bundle/src/translations'), 19 => (\\dirname(__DIR__, 4).'/vendor/theofidry/psysh-bundle/src/translations'), 20 => (\\dirname(__DIR__, 4).'/vendor/symfony/framework-bundle/translations'), 21 => (\\dirname(__DIR__, 4).'/vendor/symfony/web-profiler-bundle/translations'), 22 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-bundle/translations'), 23 => (\\dirname(__DIR__, 4).'/vendor/symfony/twig-bundle/translations'), 24 => (\\dirname(__DIR__, 4).'/vendor/symfony/debug-bundle/translations'), 25 => (\\dirname(__DIR__, 4).'/vendor/antishov/doctrine-extensions-bundle/translations'), 26 => (\\dirname(__DIR__, 4).'/vendor/twig/extra-bundle/src/translations')], 'cache_vary' => ['scanned_directories' => [0 => 'vendor/symfony/validator/Resources/translations', 1 => 'vendor/symfony/form/Resources/translations', 2 => 'vendor/symfony/security-core/Resources/translations', 3 => 'translations', 4 => 'translations', 5 => 'vendor/symfony/monolog-bundle/translations', 6 => 'vendor/sensio/framework-extra-bundle/src/translations', 7 => 'vendor/symfony/swiftmailer-bundle/translations', 8 => 'vendor/jms/serializer-bundle/translations', 9 => 'vendor/doctrine/doctrine-bundle/translations', 10 => 'vendor/doctrine/doctrine-migrations-bundle/translations', 11 => 'vendor/doctrine/doctrine-fixtures-bundle/translations', 12 => 'vendor/simplethings/entity-audit-bundle/src/SimpleThings/EntityAudit/translations', 13 => 'vendor/csa/guzzle-bundle/src/translations', 14 => 'vendor/nelmio/security-bundle/translations', 15 => 'vendor/nelmio/cors-bundle/translations', 16 => 'vendor/tetranz/select2entity-bundle/translations', 17 => 'vendor/qandidate/toggle-bundle/translations', 18 => 'vendor/symfony/maker-bundle/src/translations', 19 => 'vendor/theofidry/psysh-bundle/src/translations', 20 => 'vendor/symfony/framework-bundle/translations', 21 => 'vendor/symfony/web-profiler-bundle/translations', 22 => 'vendor/symfony/security-bundle/translations', 23 => 'vendor/symfony/twig-bundle/translations', 24 => 'vendor/symfony/debug-bundle/translations', 25 => 'vendor/antishov/doctrine-extensions-bundle/translations', 26 => 'vendor/twig/extra-bundle/src/translations']]], []);\n\n $instance->setConfigCacheFactory(($this->privates['config_cache_factory'] ?? $this->getConfigCacheFactoryService()));\n $instance->setFallbackLocales([0 => 'en']);\n\n return $instance;\n }",
"protected function getTranslator_DefaultService()\n {\n $this->privates['translator.default'] = $instance = new \\Symfony\\Bundle\\FrameworkBundle\\Translation\\Translator(new \\Symfony\\Component\\DependencyInjection\\Argument\\ServiceLocator($this->getService, [\n 'translation.loader.csv' => ['privates', 'translation.loader.csv', 'getTranslation_Loader_CsvService', false],\n 'translation.loader.dat' => ['privates', 'translation.loader.dat', 'getTranslation_Loader_DatService', false],\n 'translation.loader.ini' => ['privates', 'translation.loader.ini', 'getTranslation_Loader_IniService', false],\n 'translation.loader.json' => ['privates', 'translation.loader.json', 'getTranslation_Loader_JsonService', false],\n 'translation.loader.mo' => ['privates', 'translation.loader.mo', 'getTranslation_Loader_MoService', false],\n 'translation.loader.php' => ['privates', 'translation.loader.php', 'getTranslation_Loader_PhpService', false],\n 'translation.loader.po' => ['privates', 'translation.loader.po', 'getTranslation_Loader_PoService', false],\n 'translation.loader.qt' => ['privates', 'translation.loader.qt', 'getTranslation_Loader_QtService', false],\n 'translation.loader.res' => ['privates', 'translation.loader.res', 'getTranslation_Loader_ResService', false],\n 'translation.loader.xliff' => ['privates', 'translation.loader.xliff', 'getTranslation_Loader_XliffService', false],\n 'translation.loader.yml' => ['privates', 'translation.loader.yml', 'getTranslation_Loader_YmlService', false],\n ], [\n 'translation.loader.csv' => '?',\n 'translation.loader.dat' => '?',\n 'translation.loader.ini' => '?',\n 'translation.loader.json' => '?',\n 'translation.loader.mo' => '?',\n 'translation.loader.php' => '?',\n 'translation.loader.po' => '?',\n 'translation.loader.qt' => '?',\n 'translation.loader.res' => '?',\n 'translation.loader.xliff' => '?',\n 'translation.loader.yml' => '?',\n ]), new \\Symfony\\Component\\Translation\\Formatter\\MessageFormatter(new \\Symfony\\Component\\Translation\\IdentityTranslator()), 'en', ['translation.loader.php' => [0 => 'php'], 'translation.loader.yml' => [0 => 'yaml', 1 => 'yml'], 'translation.loader.xliff' => [0 => 'xlf', 1 => 'xliff'], 'translation.loader.po' => [0 => 'po'], 'translation.loader.mo' => [0 => 'mo'], 'translation.loader.qt' => [0 => 'ts'], 'translation.loader.csv' => [0 => 'csv'], 'translation.loader.res' => [0 => 'res'], 'translation.loader.dat' => [0 => 'dat'], 'translation.loader.ini' => [0 => 'ini'], 'translation.loader.json' => [0 => 'json']], ['cache_dir' => ($this->targetDir.''.'/translations'), 'debug' => true, 'resource_files' => ['af' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.af.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.af.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.af.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.af.yml')], 'ar' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ar.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ar.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ar.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ar.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ar.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfonycasts/reset-password-bundle/src/Resources/translations/ResetPasswordBundle.ar.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.ar.xliff')], 'az' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.az.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.az.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.az.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.az.xliff')], 'be' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.be.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.be.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.be.xlf')], 'bg' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.bg.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.bg.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.bg.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.bg.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.bg.yml')], 'bs' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.bs.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.bs.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.bs.xlf')], 'ca' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ca.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ca.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ca.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ca.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ca.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.ca.xliff')], 'cs' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.cs.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.cs.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.cs.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.cs.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.cs.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.cs.xliff')], 'cy' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.cy.xlf')], 'da' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.da.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.da.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.da.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.da.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.da.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.da.xliff')], 'de' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.de.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.de.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.de.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.de.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.de.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfonycasts/reset-password-bundle/src/Resources/translations/ResetPasswordBundle.de.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.de.xliff')], 'el' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.el.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.el.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.el.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.el.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.el.yml')], 'en' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.en.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.en.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.en.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.en.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.en.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfonycasts/reset-password-bundle/src/Resources/translations/ResetPasswordBundle.en.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.en.xliff')], 'es' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.es.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.es.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.es.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.es.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.es.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfonycasts/reset-password-bundle/src/Resources/translations/ResetPasswordBundle.es.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.es.xliff')], 'et' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.et.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.et.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.et.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.et.yml')], 'eu' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.eu.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.eu.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.eu.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.eu.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.eu.yml')], 'fa' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.fa.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.fa.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.fa.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.fa.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.fa.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.fa.xliff')], 'fi' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.fi.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.fi.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.fi.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.fi.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.fi.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfonycasts/reset-password-bundle/src/Resources/translations/ResetPasswordBundle.fi.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.fi.xliff')], 'fr' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.fr.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.fr.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.fr.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.fr.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.fr.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfonycasts/reset-password-bundle/src/Resources/translations/ResetPasswordBundle.fr.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.fr.xliff')], 'gl' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.gl.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.gl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.gl.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.gl.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.gl.xliff')], 'he' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.he.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.he.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.he.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.he.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.he.yml')], 'hr' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.hr.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.hr.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.hr.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.hr.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.hr.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.hr.xliff')], 'hu' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.hu.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.hu.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.hu.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.hu.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.hu.yml')], 'hy' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.hy.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.hy.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.hy.xlf')], 'id' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.id.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.id.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.id.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.id.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.id.yml')], 'it' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.it.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.it.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.it.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.it.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.it.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfonycasts/reset-password-bundle/src/Resources/translations/ResetPasswordBundle.it.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.it.xliff')], 'ja' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ja.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ja.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ja.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ja.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ja.yml')], 'lb' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.lb.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.lb.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.lb.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.lb.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.lb.yml')], 'lt' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.lt.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.lt.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.lt.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.lt.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.lt.yml')], 'lv' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.lv.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.lv.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.lv.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.lv.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.lv.yml')], 'mn' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.mn.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.mn.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.mn.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.mn.yml')], 'my' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.my.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.my.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.my.xlf')], 'nb' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.nb.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.nb.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.nb.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.nb.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.nb.yml')], 'nl' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.nl.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.nl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.nl.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.nl.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.nl.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.nl.xliff')], 'nn' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.nn.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.nn.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.nn.xlf')], 'no' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.no.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.no.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.no.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.no.xliff')], 'pl' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.pl.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.pl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.pl.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.pl.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.pl.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfonycasts/reset-password-bundle/src/Resources/translations/ResetPasswordBundle.pl.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.pl.xliff')], 'pt' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.pt.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.pt.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.pt.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.pt.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.pt.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfonycasts/reset-password-bundle/src/Resources/translations/ResetPasswordBundle.pt.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.pt.xliff')], 'pt_BR' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.pt_BR.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.pt_BR.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.pt_BR.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.pt_BR.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.pt_BR.yml')], 'ro' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ro.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ro.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ro.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ro.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ro.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.ro.xliff')], 'ru' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ru.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ru.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ru.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ru.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ru.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfonycasts/reset-password-bundle/src/Resources/translations/ResetPasswordBundle.ru.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.ru.xliff')], 'sk' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sk.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sk.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sk.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.sk.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.sk.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.sk.xliff')], 'sl' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sl.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sl.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.sl.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.sl.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.sl.xliff')], 'sq' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sq.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sq.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sq.xlf')], 'sr_Cyrl' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sr_Cyrl.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sr_Cyrl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sr_Cyrl.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.sr_Cyrl.xliff')], 'sr_Latn' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sr_Latn.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sr_Latn.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sr_Latn.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.sr_Latn.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.sr_Latn.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.sr_Latn.xliff')], 'sv' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sv.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sv.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sv.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.sv.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.sv.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.sv.xliff')], 'th' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.th.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.th.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.th.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.th.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.th.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.th.xliff')], 'tl' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.tl.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.tl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.tl.xlf')], 'tr' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.tr.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.tr.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.tr.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.tr.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.tr.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfonycasts/reset-password-bundle/src/Resources/translations/ResetPasswordBundle.tr.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.tr.xliff')], 'uk' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.uk.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.uk.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.uk.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.uk.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.uk.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfonycasts/reset-password-bundle/src/Resources/translations/ResetPasswordBundle.uk.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.uk.xliff')], 'uz' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.uz.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.uz.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.uz.xlf')], 'vi' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.vi.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.vi.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.vi.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.vi.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.vi.yml')], 'zh_CN' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.zh_CN.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.zh_CN.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.zh_CN.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.zh_CN.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.zh_CN.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.zh_CN.xliff')], 'zh_TW' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.zh_TW.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.zh_TW.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.zh_TW.xlf')], 'bn' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.bn.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.bn.yml')], 'bn_BD' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.bn_BD.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.bn_BD.yml')], 'eo' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.eo.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.eo.yml')], 'ky' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ky.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ky.yml')], 'sr' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfonycasts/reset-password-bundle/src/Resources/translations/ResetPasswordBundle.sr.xlf')], 'oc' => [0 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.oc.xliff')], 'sw' => [0 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations/pagerfanta.sw.xliff')]], 'scanned_directories' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfonycasts/reset-password-bundle/src/Resources/translations'), 5 => (\\dirname(__DIR__, 4).'/vendor/white-october/pagerfanta-bundle/Resources/translations'), 6 => (\\dirname(__DIR__, 4).'/translations'), 7 => (\\dirname(__DIR__, 4).'/vendor/symfony/framework-bundle/translations'), 8 => (\\dirname(__DIR__, 4).'/src/Resources/FrameworkBundle/translations'), 9 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/rest-bundle/translations'), 10 => (\\dirname(__DIR__, 4).'/src/Resources/FOSRestBundle/translations'), 11 => (\\dirname(__DIR__, 4).'/vendor/symfony/maker-bundle/src/translations'), 12 => (\\dirname(__DIR__, 4).'/src/Resources/MakerBundle/translations'), 13 => (\\dirname(__DIR__, 4).'/vendor/symfony/twig-bundle/translations'), 14 => (\\dirname(__DIR__, 4).'/src/Resources/TwigBundle/translations'), 15 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-bundle/translations'), 16 => (\\dirname(__DIR__, 4).'/src/Resources/SecurityBundle/translations'), 17 => (\\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/translations'), 18 => (\\dirname(__DIR__, 4).'/src/Resources/DoctrineBundle/translations'), 19 => (\\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-migrations-bundle/translations'), 20 => (\\dirname(__DIR__, 4).'/src/Resources/DoctrineMigrationsBundle/translations'), 21 => (\\dirname(__DIR__, 4).'/vendor/nelmio/cors-bundle/translations'), 22 => (\\dirname(__DIR__, 4).'/src/Resources/NelmioCorsBundle/translations'), 23 => (\\dirname(__DIR__, 4).'/vendor/api-platform/core/src/Bridge/Symfony/Bundle/translations'), 24 => (\\dirname(__DIR__, 4).'/src/Resources/ApiPlatformBundle/translations'), 25 => (\\dirname(__DIR__, 4).'/vendor/symfony/web-server-bundle/translations'), 26 => (\\dirname(__DIR__, 4).'/src/Resources/WebServerBundle/translations'), 27 => (\\dirname(__DIR__, 4).'/vendor/sensio/framework-extra-bundle/src/translations'), 28 => (\\dirname(__DIR__, 4).'/src/Resources/SensioFrameworkExtraBundle/translations'), 29 => (\\dirname(__DIR__, 4).'/vendor/lexik/jwt-authentication-bundle/translations'), 30 => (\\dirname(__DIR__, 4).'/src/Resources/LexikJWTAuthenticationBundle/translations'), 31 => (\\dirname(__DIR__, 4).'/vendor/symfony/web-profiler-bundle/translations'), 32 => (\\dirname(__DIR__, 4).'/src/Resources/WebProfilerBundle/translations'), 33 => (\\dirname(__DIR__, 4).'/src/Resources/FOSUserBundle/translations'), 34 => (\\dirname(__DIR__, 4).'/vendor/symfony/monolog-bundle/translations'), 35 => (\\dirname(__DIR__, 4).'/src/Resources/MonologBundle/translations'), 36 => (\\dirname(__DIR__, 4).'/src/Resources/SymfonyCastsResetPasswordBundle/translations'), 37 => (\\dirname(__DIR__, 4).'/src/Resources/WhiteOctoberPagerfantaBundle/translations'), 38 => (\\dirname(__DIR__, 4).'/vendor/symfony/swiftmailer-bundle/translations'), 39 => (\\dirname(__DIR__, 4).'/src/Resources/SwiftmailerBundle/translations'), 40 => (\\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-fixtures-bundle/translations'), 41 => (\\dirname(__DIR__, 4).'/src/Resources/DoctrineFixturesBundle/translations'), 42 => (\\dirname(__DIR__, 4).'/src/Resources/translations')], 'cache_vary' => ['scanned_directories' => [0 => 'vendor/symfony/validator/Resources/translations', 1 => 'vendor/symfony/form/Resources/translations', 2 => 'vendor/symfony/security-core/Resources/translations', 3 => 'vendor/friendsofsymfony/user-bundle/Resources/translations', 4 => 'vendor/symfonycasts/reset-password-bundle/src/Resources/translations', 5 => 'vendor/white-october/pagerfanta-bundle/Resources/translations', 6 => 'translations', 7 => 'vendor/symfony/framework-bundle/translations', 8 => 'src/Resources/FrameworkBundle/translations', 9 => 'vendor/friendsofsymfony/rest-bundle/translations', 10 => 'src/Resources/FOSRestBundle/translations', 11 => 'vendor/symfony/maker-bundle/src/translations', 12 => 'src/Resources/MakerBundle/translations', 13 => 'vendor/symfony/twig-bundle/translations', 14 => 'src/Resources/TwigBundle/translations', 15 => 'vendor/symfony/security-bundle/translations', 16 => 'src/Resources/SecurityBundle/translations', 17 => 'vendor/doctrine/doctrine-bundle/translations', 18 => 'src/Resources/DoctrineBundle/translations', 19 => 'vendor/doctrine/doctrine-migrations-bundle/translations', 20 => 'src/Resources/DoctrineMigrationsBundle/translations', 21 => 'vendor/nelmio/cors-bundle/translations', 22 => 'src/Resources/NelmioCorsBundle/translations', 23 => 'vendor/api-platform/core/src/Bridge/Symfony/Bundle/translations', 24 => 'src/Resources/ApiPlatformBundle/translations', 25 => 'vendor/symfony/web-server-bundle/translations', 26 => 'src/Resources/WebServerBundle/translations', 27 => 'vendor/sensio/framework-extra-bundle/src/translations', 28 => 'src/Resources/SensioFrameworkExtraBundle/translations', 29 => 'vendor/lexik/jwt-authentication-bundle/translations', 30 => 'src/Resources/LexikJWTAuthenticationBundle/translations', 31 => 'vendor/symfony/web-profiler-bundle/translations', 32 => 'src/Resources/WebProfilerBundle/translations', 33 => 'src/Resources/FOSUserBundle/translations', 34 => 'vendor/symfony/monolog-bundle/translations', 35 => 'src/Resources/MonologBundle/translations', 36 => 'src/Resources/SymfonyCastsResetPasswordBundle/translations', 37 => 'src/Resources/WhiteOctoberPagerfantaBundle/translations', 38 => 'vendor/symfony/swiftmailer-bundle/translations', 39 => 'src/Resources/SwiftmailerBundle/translations', 40 => 'vendor/doctrine/doctrine-fixtures-bundle/translations', 41 => 'src/Resources/DoctrineFixturesBundle/translations', 42 => 'src/Resources/translations']]]);\n\n $instance->setConfigCacheFactory(($this->privates['config_cache_factory'] ?? $this->getConfigCacheFactoryService()));\n $instance->setFallbackLocales([0 => 'en']);\n\n return $instance;\n }",
"protected function getTranslator_DefaultService()\n {\n $this->privates['translator.default'] = $instance = new \\Symfony\\Bundle\\FrameworkBundle\\Translation\\Translator(new \\Symfony\\Component\\DependencyInjection\\Argument\\ServiceLocator($this->getService, [\n 'translation.loader.csv' => ['privates', 'translation.loader.csv', 'getTranslation_Loader_CsvService', false],\n 'translation.loader.dat' => ['privates', 'translation.loader.dat', 'getTranslation_Loader_DatService', false],\n 'translation.loader.ini' => ['privates', 'translation.loader.ini', 'getTranslation_Loader_IniService', false],\n 'translation.loader.json' => ['privates', 'translation.loader.json', 'getTranslation_Loader_JsonService', false],\n 'translation.loader.mo' => ['privates', 'translation.loader.mo', 'getTranslation_Loader_MoService', false],\n 'translation.loader.php' => ['privates', 'translation.loader.php', 'getTranslation_Loader_PhpService', false],\n 'translation.loader.po' => ['privates', 'translation.loader.po', 'getTranslation_Loader_PoService', false],\n 'translation.loader.qt' => ['privates', 'translation.loader.qt', 'getTranslation_Loader_QtService', false],\n 'translation.loader.res' => ['privates', 'translation.loader.res', 'getTranslation_Loader_ResService', false],\n 'translation.loader.xliff' => ['privates', 'translation.loader.xliff', 'getTranslation_Loader_XliffService', false],\n 'translation.loader.yml' => ['privates', 'translation.loader.yml', 'getTranslation_Loader_YmlService', false],\n ], [\n 'translation.loader.csv' => '?',\n 'translation.loader.dat' => '?',\n 'translation.loader.ini' => '?',\n 'translation.loader.json' => '?',\n 'translation.loader.mo' => '?',\n 'translation.loader.php' => '?',\n 'translation.loader.po' => '?',\n 'translation.loader.qt' => '?',\n 'translation.loader.res' => '?',\n 'translation.loader.xliff' => '?',\n 'translation.loader.yml' => '?',\n ]), new \\Symfony\\Component\\Translation\\Formatter\\MessageFormatter(new \\Symfony\\Component\\Translation\\IdentityTranslator()), $this->getEnv('LOCALE'), ['translation.loader.php' => [0 => 'php'], 'translation.loader.yml' => [0 => 'yaml', 1 => 'yml'], 'translation.loader.xliff' => [0 => 'xlf', 1 => 'xliff'], 'translation.loader.po' => [0 => 'po'], 'translation.loader.mo' => [0 => 'mo'], 'translation.loader.qt' => [0 => 'ts'], 'translation.loader.csv' => [0 => 'csv'], 'translation.loader.res' => [0 => 'res'], 'translation.loader.dat' => [0 => 'dat'], 'translation.loader.ini' => [0 => 'ini'], 'translation.loader.json' => [0 => 'json']], ['cache_dir' => ($this->targetDir.''.'/translations'), 'debug' => true, 'resource_files' => ['tr' => [0 => (\\dirname(__DIR__, 4).'/translations/FOSUserBundle.tr.yml'), 1 => (\\dirname(__DIR__, 4).'/translations/messages.tr.yaml'), 2 => (\\dirname(__DIR__, 4).'/translations/validators.tr.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.tr.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.tr.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.tr.xliff'), 6 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations/messages.tr.yml'), 7 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.tr.xlf'), 8 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.tr.xlf'), 9 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.tr.xlf'), 10 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.tr.yaml')], 'af' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.af.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.af.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.af.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.af.xlf')], 'ar' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ar.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ar.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.ar.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ar.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ar.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ar.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.ar.yaml')], 'bg' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.bg.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.bg.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.bg.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.bg.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.bg.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.bg.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.bg.yaml')], 'bn' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.bn.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.bn.yml')], 'bn_BD' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.bn_BD.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.bn_BD.yml')], 'ca' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ca.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ca.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ca.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ca.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ca.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.ca.yaml')], 'cs' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.cs.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.cs.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.cs.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.cs.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.cs.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.cs.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.cs.yaml')], 'da' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.da.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.da.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.da.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.da.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.da.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.da.xlf')], 'de' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.de.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.de.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.de.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations/messages.de.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.de.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.de.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.de.xlf'), 7 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.de.yaml')], 'el' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.el.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.el.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.el.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.el.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.el.xlf')], 'en' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.en.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.en.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.en.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/payum/payum-bundle/Resources/translations/PayumBundle.en.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/payum/payum-bundle/Resources/translations/validators.en.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations/messages.en.yml'), 6 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.en.xlf'), 7 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.en.xlf'), 8 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.en.xlf'), 9 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.en.yaml')], 'eo' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.eo.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.eo.yml')], 'es' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.es.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.es.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.es.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations/messages.es.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.es.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.es.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.es.xlf'), 7 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.es.yaml')], 'et' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.et.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.et.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.et.xlf')], 'eu' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.eu.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.eu.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.eu.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations/messages.eu.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.eu.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.eu.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.eu.xlf')], 'fa' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.fa.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.fa.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.fa.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations/messages.fa.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.fa.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.fa.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.fa.xlf')], 'fi' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.fi.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.fi.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.fi.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.fi.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.fi.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.fi.yaml')], 'fr' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.fr.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.fr.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.fr.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/payum/payum-bundle/Resources/translations/PayumBundle.fr.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/payum/payum-bundle/Resources/translations/validators.fr.yml'), 5 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations/messages.fr.yml'), 6 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.fr.xlf'), 7 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.fr.xlf'), 8 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.fr.xlf'), 9 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.fr.yaml')], 'gl' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.gl.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.gl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.gl.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.gl.xlf')], 'he' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.he.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.he.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.he.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.he.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.he.xlf')], 'hr' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.hr.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.hr.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/payum/payum-bundle/Resources/translations/PayumBundle.hr.yml'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.hr.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.hr.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.hr.xlf')], 'hu' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.hu.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.hu.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.hu.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.hu.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.hu.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.hu.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.hu.yaml')], 'id' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.id.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.id.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.id.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.id.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.id.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.id.xlf')], 'it' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.it.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.it.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.it.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations/messages.it.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.it.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.it.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.it.xlf'), 7 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.it.yaml')], 'ja' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ja.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ja.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.ja.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ja.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ja.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ja.xlf')], 'ky' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ky.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ky.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.ky.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations/messages.ky.yml')], 'lb' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.lb.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.lb.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.lb.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.lb.xlf')], 'lt' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.lt.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.lt.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.lt.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.lt.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.lt.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.lt.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.lt.yaml')], 'lv' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.lv.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.lv.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.lv.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.lv.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.lv.xlf')], 'nb' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.nb.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.nb.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.nb.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.nb.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.nb.xlf')], 'nl' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.nl.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.nl.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.nl.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations/messages.nl.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.nl.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.nl.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.nl.xlf'), 7 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.nl.yaml')], 'pl' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.pl.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.pl.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.pl.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations/messages.pl.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.pl.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.pl.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.pl.xlf'), 7 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.pl.yaml')], 'pt' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.pt.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.pt.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations/messages.pt.yml'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.pt.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.pt.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.pt.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.pt.yaml')], 'pt_BR' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.pt_BR.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.pt_BR.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.pt_BR.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.pt_BR.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.pt_BR.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.pt_BR.xlf')], 'ro' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ro.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ro.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.ro.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ro.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ro.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ro.xlf')], 'ru' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.ru.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.ru.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.ru.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations/messages.ru.yml'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.ru.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.ru.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.ru.xlf'), 7 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.ru.yaml')], 'sk' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.sk.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.sk.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations/messages.sk.yml'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sk.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sk.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sk.xlf')], 'sl' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.sl.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.sl.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sl.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sl.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sl.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.sl.yaml')], 'sr_Latn' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.sr_Latn.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.sr_Latn.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sr_Latn.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sr_Latn.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sr_Latn.xlf')], 'sv' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.sv.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.sv.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.sv.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sv.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sv.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sv.xlf')], 'th' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.th.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.th.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.th.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.th.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.th.xlf')], 'uk' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.uk.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.uk.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.uk.xliff'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.uk.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.uk.xlf'), 5 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.uk.xlf'), 6 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.uk.yaml')], 'vi' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.vi.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.vi.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.vi.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.vi.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.vi.xlf')], 'zh_CN' => [0 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/FOSUserBundle.zh_CN.yml'), 1 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations/validators.zh_CN.yml'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.zh_CN.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.zh_CN.xlf'), 4 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.zh_CN.xlf')], 'no' => [0 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.no.xliff'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.no.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.no.xlf'), 3 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.no.xlf')], 'sw' => [0 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations/KnpPaginatorBundle.sw.xliff')], 'az' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.az.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.az.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.az.xlf')], 'be' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.be.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.be.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.be.xlf')], 'bs' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.bs.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.bs.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.bs.xlf')], 'hy' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.hy.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.hy.xlf')], 'mn' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.mn.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.mn.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.mn.xlf')], 'nn' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.nn.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.nn.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.nn.xlf')], 'sq' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sq.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sq.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sq.xlf')], 'sr_Cyrl' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.sr_Cyrl.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.sr_Cyrl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.sr_Cyrl.xlf')], 'tl' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.tl.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.tl.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.tl.xlf')], 'zh_TW' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations/validators.zh_TW.xlf'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations/security.zh_TW.xlf'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.zh_TW.xlf')], 'cy' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations/validators.cy.xlf')], 'vn' => [0 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations/messages.vn.yaml')]], 'scanned_directories' => [0 => (\\dirname(__DIR__, 4).'/vendor/symfony/validator/Resources/translations'), 1 => (\\dirname(__DIR__, 4).'/vendor/symfony/form/Resources/translations'), 2 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-core/Resources/translations'), 3 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Resources/translations'), 4 => (\\dirname(__DIR__, 4).'/vendor/sg/datatablesbundle/Resources/translations'), 5 => (\\dirname(__DIR__, 4).'/vendor/vich/uploader-bundle/translations'), 6 => (\\dirname(__DIR__, 4).'/vendor/knplabs/knp-paginator-bundle/translations'), 7 => (\\dirname(__DIR__, 4).'/vendor/payum/payum-bundle/Resources/translations'), 8 => (\\dirname(__DIR__, 4).'/translations'), 9 => (\\dirname(__DIR__, 4).'/vendor/symfony/framework-bundle/translations'), 10 => (\\dirname(__DIR__, 4).'/src/Resources/FrameworkBundle/translations'), 11 => (\\dirname(__DIR__, 4).'/vendor/symfony/twig-bundle/translations'), 12 => (\\dirname(__DIR__, 4).'/src/Resources/TwigBundle/translations'), 13 => (\\dirname(__DIR__, 4).'/vendor/symfony/security-bundle/translations'), 14 => (\\dirname(__DIR__, 4).'/src/Resources/SecurityBundle/translations'), 15 => (\\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-cache-bundle/translations'), 16 => (\\dirname(__DIR__, 4).'/src/Resources/DoctrineCacheBundle/translations'), 17 => (\\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-bundle/translations'), 18 => (\\dirname(__DIR__, 4).'/src/Resources/DoctrineBundle/translations'), 19 => (\\dirname(__DIR__, 4).'/vendor/api-platform/core/src/Bridge/Symfony/Bundle/translations'), 20 => (\\dirname(__DIR__, 4).'/src/Resources/ApiPlatformBundle/translations'), 21 => (\\dirname(__DIR__, 4).'/vendor/nelmio/cors-bundle/translations'), 22 => (\\dirname(__DIR__, 4).'/src/Resources/NelmioCorsBundle/translations'), 23 => (\\dirname(__DIR__, 4).'/vendor/symfony/web-profiler-bundle/translations'), 24 => (\\dirname(__DIR__, 4).'/src/Resources/WebProfilerBundle/translations'), 25 => (\\dirname(__DIR__, 4).'/vendor/sensio/framework-extra-bundle/src/translations'), 26 => (\\dirname(__DIR__, 4).'/src/Resources/SensioFrameworkExtraBundle/translations'), 27 => (\\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-migrations-bundle/translations'), 28 => (\\dirname(__DIR__, 4).'/src/Resources/DoctrineMigrationsBundle/translations'), 29 => (\\dirname(__DIR__, 4).'/vendor/symfony/swiftmailer-bundle/translations'), 30 => (\\dirname(__DIR__, 4).'/src/Resources/SwiftmailerBundle/translations'), 31 => (\\dirname(__DIR__, 4).'/vendor/symfony/monolog-bundle/translations'), 32 => (\\dirname(__DIR__, 4).'/src/Resources/MonologBundle/translations'), 33 => (\\dirname(__DIR__, 4).'/vendor/symfony/debug-bundle/translations'), 34 => (\\dirname(__DIR__, 4).'/src/Resources/DebugBundle/translations'), 35 => (\\dirname(__DIR__, 4).'/vendor/symfony/maker-bundle/src/translations'), 36 => (\\dirname(__DIR__, 4).'/src/Resources/MakerBundle/translations'), 37 => (\\dirname(__DIR__, 4).'/vendor/symfony/web-server-bundle/translations'), 38 => (\\dirname(__DIR__, 4).'/src/Resources/WebServerBundle/translations'), 39 => (\\dirname(__DIR__, 4).'/src/Resources/FOSUserBundle/translations'), 40 => (\\dirname(__DIR__, 4).'/vendor/lexik/jwt-authentication-bundle/translations'), 41 => (\\dirname(__DIR__, 4).'/src/Resources/LexikJWTAuthenticationBundle/translations'), 42 => (\\dirname(__DIR__, 4).'/vendor/stof/doctrine-extensions-bundle/translations'), 43 => (\\dirname(__DIR__, 4).'/src/Resources/StofDoctrineExtensionsBundle/translations'), 44 => (\\dirname(__DIR__, 4).'/vendor/symfony/webpack-encore-bundle/src/translations'), 45 => (\\dirname(__DIR__, 4).'/src/Resources/WebpackEncoreBundle/translations'), 46 => (\\dirname(__DIR__, 4).'/vendor/friendsofsymfony/jsrouting-bundle/translations'), 47 => (\\dirname(__DIR__, 4).'/src/Resources/FOSJsRoutingBundle/translations'), 48 => (\\dirname(__DIR__, 4).'/src/Resources/SgDatatablesBundle/translations'), 49 => (\\dirname(__DIR__, 4).'/vendor/sentry/sentry-symfony/src/translations'), 50 => (\\dirname(__DIR__, 4).'/src/Resources/SentryBundle/translations'), 51 => (\\dirname(__DIR__, 4).'/vendor/gos/pubsub-router-bundle/translations'), 52 => (\\dirname(__DIR__, 4).'/src/Resources/GosPubSubRouterBundle/translations'), 53 => (\\dirname(__DIR__, 4).'/vendor/gos/web-socket-bundle/translations'), 54 => (\\dirname(__DIR__, 4).'/src/Resources/GosWebSocketBundle/translations'), 55 => (\\dirname(__DIR__, 4).'/src/Resources/VichUploaderBundle/translations'), 56 => (\\dirname(__DIR__, 4).'/vendor/liip/imagine-bundle/translations'), 57 => (\\dirname(__DIR__, 4).'/src/Resources/LiipImagineBundle/translations'), 58 => (\\dirname(__DIR__, 4).'/src/Resources/KnpPaginatorBundle/translations'), 59 => (\\dirname(__DIR__, 4).'/vendor/ongr/elasticsearch-bundle/translations'), 60 => (\\dirname(__DIR__, 4).'/src/Resources/ONGRElasticsearchBundle/translations'), 61 => (\\dirname(__DIR__, 4).'/src/Resources/PayumBundle/translations'), 62 => (\\dirname(__DIR__, 4).'/vendor/twig/extra-bundle/src/translations'), 63 => (\\dirname(__DIR__, 4).'/src/Resources/TwigExtraBundle/translations'), 64 => (\\dirname(__DIR__, 4).'/src/Resources/translations')], 'cache_vary' => ['scanned_directories' => [0 => 'vendor/symfony/validator/Resources/translations', 1 => 'vendor/symfony/form/Resources/translations', 2 => 'vendor/symfony/security-core/Resources/translations', 3 => 'vendor/friendsofsymfony/user-bundle/Resources/translations', 4 => 'vendor/sg/datatablesbundle/Resources/translations', 5 => 'vendor/vich/uploader-bundle/translations', 6 => 'vendor/knplabs/knp-paginator-bundle/translations', 7 => 'vendor/payum/payum-bundle/Resources/translations', 8 => 'translations', 9 => 'vendor/symfony/framework-bundle/translations', 10 => 'src/Resources/FrameworkBundle/translations', 11 => 'vendor/symfony/twig-bundle/translations', 12 => 'src/Resources/TwigBundle/translations', 13 => 'vendor/symfony/security-bundle/translations', 14 => 'src/Resources/SecurityBundle/translations', 15 => 'vendor/doctrine/doctrine-cache-bundle/translations', 16 => 'src/Resources/DoctrineCacheBundle/translations', 17 => 'vendor/doctrine/doctrine-bundle/translations', 18 => 'src/Resources/DoctrineBundle/translations', 19 => 'vendor/api-platform/core/src/Bridge/Symfony/Bundle/translations', 20 => 'src/Resources/ApiPlatformBundle/translations', 21 => 'vendor/nelmio/cors-bundle/translations', 22 => 'src/Resources/NelmioCorsBundle/translations', 23 => 'vendor/symfony/web-profiler-bundle/translations', 24 => 'src/Resources/WebProfilerBundle/translations', 25 => 'vendor/sensio/framework-extra-bundle/src/translations', 26 => 'src/Resources/SensioFrameworkExtraBundle/translations', 27 => 'vendor/doctrine/doctrine-migrations-bundle/translations', 28 => 'src/Resources/DoctrineMigrationsBundle/translations', 29 => 'vendor/symfony/swiftmailer-bundle/translations', 30 => 'src/Resources/SwiftmailerBundle/translations', 31 => 'vendor/symfony/monolog-bundle/translations', 32 => 'src/Resources/MonologBundle/translations', 33 => 'vendor/symfony/debug-bundle/translations', 34 => 'src/Resources/DebugBundle/translations', 35 => 'vendor/symfony/maker-bundle/src/translations', 36 => 'src/Resources/MakerBundle/translations', 37 => 'vendor/symfony/web-server-bundle/translations', 38 => 'src/Resources/WebServerBundle/translations', 39 => 'src/Resources/FOSUserBundle/translations', 40 => 'vendor/lexik/jwt-authentication-bundle/translations', 41 => 'src/Resources/LexikJWTAuthenticationBundle/translations', 42 => 'vendor/stof/doctrine-extensions-bundle/translations', 43 => 'src/Resources/StofDoctrineExtensionsBundle/translations', 44 => 'vendor/symfony/webpack-encore-bundle/src/translations', 45 => 'src/Resources/WebpackEncoreBundle/translations', 46 => 'vendor/friendsofsymfony/jsrouting-bundle/translations', 47 => 'src/Resources/FOSJsRoutingBundle/translations', 48 => 'src/Resources/SgDatatablesBundle/translations', 49 => 'vendor/sentry/sentry-symfony/src/translations', 50 => 'src/Resources/SentryBundle/translations', 51 => 'vendor/gos/pubsub-router-bundle/translations', 52 => 'src/Resources/GosPubSubRouterBundle/translations', 53 => 'vendor/gos/web-socket-bundle/translations', 54 => 'src/Resources/GosWebSocketBundle/translations', 55 => 'src/Resources/VichUploaderBundle/translations', 56 => 'vendor/liip/imagine-bundle/translations', 57 => 'src/Resources/LiipImagineBundle/translations', 58 => 'src/Resources/KnpPaginatorBundle/translations', 59 => 'vendor/ongr/elasticsearch-bundle/translations', 60 => 'src/Resources/ONGRElasticsearchBundle/translations', 61 => 'src/Resources/PayumBundle/translations', 62 => 'vendor/twig/extra-bundle/src/translations', 63 => 'src/Resources/TwigExtraBundle/translations', 64 => 'src/Resources/translations']]]);\n\n $instance->setConfigCacheFactory(($this->privates['config_cache_factory'] ?? $this->getConfigCacheFactoryService()));\n $instance->setFallbackLocales([0 => $this->getEnv('LOCALE')]);\n\n return $instance;\n }",
"function buildFault($response) {\n\t\trequire_once(DOM_XMLRPC_INCLUDE_PATH . 'dom_xmlrpc_methodresponse_fault.php');\n\t\t$fault = new dom_xmlrpc_methodresponse_fault($response);\n\t\t\n\t\treturn $fault->toXML();\n\t}",
"static function newSoapFault( $p_fault_code, $p_fault_string ) {\n\t\treturn new SoapFault( $p_fault_code, $p_fault_string );\n\t}",
"protected function getConverter_ConverterService()\n {\n return $this->services['converter.converter'] = new \\Camspiers\\StatisticalClassifier\\DataSource\\Converter($this->get('converter.from'), $this->get('converter.to'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Edits an existing Sortie entity. | public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('SFCapBundle:Sortie')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Sortie entity.');
}
$deleteForm = $this->createDeleteForm($id);
$editForm = $this->createForm(new SortieType(), $entity);
$editForm->bind($request);
if ($editForm->isValid()) {
$em->persist($entity);
$em->flush();
$this->updateRunnerGoals($entity);
$this->updateRunnerBadges($entity);
return $this->redirect($this->generateUrl('sortie_edit', array('id' => $id)));
}
return $this->render('SFCapBundle:Sortie:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
'runner' => $this->get("CapRunner")
));
} | [
"public function updated(VoceOrdine $voceOrdine)\n {\n //\n }",
"private function edit()\n {\n //Load and store parameters\n $article_id = (int)$this->Request->get('article_id');\n $type = (int)$this->Request->get('type');\n $title = $this->Request->get('title');\n $text = $this->Request->get('text');\n $source = (int)$this->Request->get('source');\n $keywords = implode(', ', json_decode($this->Request->get('keywords')));\n $pics = array_map('intval', json_decode($this->Request->get('pics')));\n $captions = json_decode($this->Request->get('captions'));\n\n //Save article in database\n $ArticlesLib = new ArticlesLib($this->DB, $this->User);\n if($article_id)\n {\n $ArticlesLib->edit($article_id, $type, $source, $title, $text, $keywords, $pics, $captions);\n $this->responseSetParam('article_id', $article_id);\n }\n else\n {\n $article_id = $ArticlesLib->insert($type, $source, $title, $text, $keywords, $pics, $captions, $lang);\n $this->responseSetParam('article_id', $article_id);\n }\n }",
"public function editAction()\n {\n $anymarketordersId = $this->getRequest()->getParam('id');\n $anymarketorders = $this->_initAnymarketorders();\n if ($anymarketordersId && !$anymarketorders->getId()) {\n $this->_getSession()->addError(\n Mage::helper('db1_anymarket')->__('This anymarket orders no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getAnymarketordersData(true);\n if (!empty($data)) {\n $anymarketorders->setData($data);\n }\n Mage::register('anymarketorders_data', $anymarketorders);\n $this->loadLayout();\n $this->_title(Mage::helper('db1_anymarket')->__('AnyMarket'))\n ->_title(Mage::helper('db1_anymarket')->__('Anymarket Orders'));\n if ($anymarketorders->getId()) {\n $this->_title($anymarketorders->getNmoIdOrder());\n } else {\n $this->_title(Mage::helper('db1_anymarket')->__('Add anymarket orders'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }",
"public function editAction();",
"public function editar()\n {\n }",
"public function changeSortingAction(){\n\t\t$currentRequest = $this->request->getArguments();\n\t\t\n\t\t$lowSorting = $currentRequest['lowSorting'];\n\t\t$highSorting = $currentRequest['highSorting'];\n\t\t\n\t\t// On récupère les objets correspondants aux champs dont l'on souhaite échanger les places\n\t\t$fieldWithIncreasingSorting = $this->champBddRepository->findByUid($lowSorting);\n\t\t$fieldWithDecreasingSorting = $this->champBddRepository->findByUid($highSorting);\n\t\n\t\t// On stocke les sorting dans des variables\n\t\t$highestSorting = $fieldWithDecreasingSorting->getSorting(); \n\t\t$lowestSorting = $fieldWithIncreasingSorting->getSorting(); \n\t\t\t\t\t\n\t\t// On attribue le sorting de chaque item à l'autre\n\t\t$fieldWithIncreasingSorting->setSorting($highestSorting); \n\t\t$fieldWithDecreasingSorting->setSorting($lowestSorting); \n\t\t\t\n\t\t//On fait l'update\t\n\t\t$this->champBddRepository->update($fieldWithIncreasingSorting);\n\t\t$this->champBddRepository->update($fieldWithDecreasingSorting);\n\t\t\t\n\t\t\t\n\t\t// On rend effetifs les modifications définis au dessus\n\t\t$this->champBddRepository->publicPersistAll();\n\t}",
"protected function editar()\n {\n }",
"public function editOrderById($id)\n {\n\n }",
"public function editAction(){\n\t\t$view = Zend_Registry::get('view');\n\t\t$professor = new Professor();\n\t\t$view->assign('professorCollection',$professor->fetchAll());\n\t\t$aluno = new Aluno();\n\t\t$view->assign('alunoCollection',$aluno->fetchAll());\n\t\t$table = new ProfessorAluno();\n\t\t$table->edit();\n\t\t$this->_response->setBody($view->render('default.phtml'));\n\t}",
"public function editEntry() : void\n {\n $this->loginService->check();\n\n $error = null;\n\n $entry = new EntryModel();\n $entry->entryID = e($_GET['eid']);\n\n if($entry->entryID !== null)\n {\n if (isset($_POST['update']))\n {\n $content = trim($_POST['blogcontent']);\n $title = trim($_POST['blogtitle']);\n\n if(!empty($content) && !empty($title))\n {\n $entry->blogtitle = e($_POST['blogtitle']);\n $entry->blogcontent = e($_POST['blogcontent']);\n $this->entryRepository->updateEntry($entry);\n }\n else\n {\n $error = 'Der Eintrag darf nicht leer sein.';\n }\n\n }\n if (isset($_POST['delete'])) {\n $this->entryRepository->deleteById($entry);\n header('Location: userEntries');\n }\n }\n else\n {\n $error = 'Post nicht gefunden.';\n }\n\n $entry = $this->entryRepository->findByIdAndAuthor($entry->entryID, $_SESSION['login']);\n\n $this->render('layout/header', [\n 'navigation' => $this->loginService->getNavigation()\n ]);\n $this->render('User/editEntry', [\n 'entry' => $entry,\n 'error' => $error\n ]);\n }",
"public static function edit() {\n $id = $_POST['id'];\n $title = $_POST['title'];\n $content = $_POST['content'];\n\n //Check if title is set\n if(!isset($title) || $title == '') {\n View::setVariable('error', 'The title must be set.');\n View::setVariable('article', $wikipage);\n View::printEditView();\n return;\n }\n\n //Load wiki page\n $wikipage = Article::load($id);\n\n if(is_null($wikipage)) {\n header('Location: index.php?error=notfound');\n exit();\n }\n\n //Save wikipage\n $wikipage->setTitle($title);\n $wikipage->setContent($content);\n $wikipage->save();\n\n //Redirect to the created wiki page\n header('Location: index.php?id=' . $wikipage->getID());\n exit();\n }",
"public function editAction() {\n $em = $this->getDoctrine()->getManager();\n $id = $this->getRequest()->get(\"id\");\n\n $entity = $em->getRepository('BackendBundle:Feast')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find feast entity.');\n }\n $editForm = $this->createForm(new \\CoolwayFestivales\\BackendBundle\\Form\\FeastType(), $entity);\n\n return array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView()\n );\n }",
"public function actionEdit()\n\t{\n\t \t// render the template, pass model on render template\n \t$this->renderTemplate('weatheroots/_edit');\n\t}",
"public function editAction()\n {\n $filtro = $this->getDoctrine()->getRepository('BackendBundle:FeastStage')->setFiltroByUser(\n $this->get('security.authorization_checker'), $this->get('security.token_storage')\n );\n $artistas = $this->getDoctrine()->getRepository('BackendBundle:Artist')->getArtistasIds(\n $this->get('security.authorization_checker'), $this->get('security.token_storage')\n );\n $em = $this->getDoctrine()->getManager();\n $id = $this->getRequest()->get(\"id\");\n $entity = $em->getRepository('BackendBundle:FeastStageArtist')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find feaststageartist entity.');\n }\n $editForm = $this->createForm(new FeastStageArtistType($filtro, 'editar', $artistas, $entity->getDate()), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n );\n }",
"public function editAction() {\n\n //TAB CREATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_viewsitestore');\n\n //GET STORE ID AND STORE OBJECT\n $store_id = $this->_getParam('id');\n $sitestore = Engine_Api::_()->getItem('sitestore_store', $store_id);\n\n //FORM GENERATION\n $this->view->form = $form = new Sitestore_Form_Admin_Manage_Edit();\n\n if (!empty($sitestore->declined)) {\n return $this->_forward('notfound', 'error', 'core');\n }\n\n $status_storeOption = array();\n $approved = $sitestore->approved;\n if (empty($sitestore->aprrove_date) && empty($approved)) {\n $status_storeOption[\"0\"] = \"Approval Pending\";\n $status_storeOption[\"1\"] = \"Approved Store\";\n $status_storeOption[\"2\"] = \"Declined Store\";\n } else {\n $status_storeOption[\"1\"] = \"Approved\";\n $status_storeOption[\"0\"] = \"Dis-Approved\";\n }\n $form->getElement(\"status_store\")->setMultiOptions($status_storeOption);\n\n if (!$this->getRequest()->isPost()) {\n\n $form->getElement(\"closed\")->setValue($sitestore->closed);\n $form->getElement(\"status_store\")->setValue($sitestore->approved);\n $form->getElement(\"featured\")->setValue($sitestore->featured);\n $form->getElement(\"sponsored\")->setValue($sitestore->sponsored);\n $title = \"<a href='\" . $this->view->url(array('store_url' => $sitestore->store_url), 'sitestore_entry_view') . \"' target='_blank'>\" . $sitestore->title . \"</a>\";\n $form->title_dummy->setDescription($title);\n if (Engine_Api::_()->sitestore()->hasPackageEnable()) {\n $form->package_title->setDescription(\"<a href='\" . $this->view->url(array('route' => 'admin_default', 'module' => 'sitestore', 'controller' => 'package', 'action' => 'packge-detail', 'id' => $sitestore->package_id), 'admin_default') . \"' class ='smoothbox'>\" . ucfirst($sitestore->getPackage()->title) . \"</a>\");\n\n $package = $sitestore->getPackage();\n if ($package->isFree()) {\n\n $form->getElement(\"status\")->setMultiOptions(array(\"free\" => \"NA (Free)\"));\n $form->getElement(\"status\")->setValue(\"free\");\n $form->getElement(\"status\")->setAttribs(array('disable' => true));\n } else {\n $form->getElement(\"status\")->setValue($sitestore->status);\n }\n }\n } elseif ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n try {\n //PROCESS\n $values = $form->getValues();\n \n if(!empty ($values) && isset ($values['toggle_products_status'])){\n if(isset ($values['toggle_products_status']) && $values['toggle_products_status'] == 2){\n Engine_Api::_()->getDbtable('stores', 'sitestore')->toggleStoreProductsStatus($store_id, 1);\n }elseif(isset ($values['toggle_products_status']) && $values['toggle_products_status'] == 3){\n Engine_Api::_()->getDbtable('stores', 'sitestore')->toggleStoreProductsStatus($store_id, 0);\n }\n }\n \n if ($values['status_store'] == 2) {\n $values['declined'] = 1;\n } else {\n $approved = $values['status_store'];\n }\n $sitestore->setFromArray($values);\n if (!empty($sitestore->declined)) {\n Engine_Api::_()->sitestore()->sendMail(\"DECLINED\", $sitestore->store_id);\n }\n $sitestore->save();\n $db->commit();\n if ($approved != $sitestore->approved) {\n\n return $this->_helper->redirector->gotoRoute(array('module' => 'sitestore', 'controller' => 'admin', 'action' => 'approved', \"id\" => $store_id), \"default\", true);\n }\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n return $this->_helper->redirector->gotoRoute(array('action' => 'index'));\n }\n }",
"public function edit(Paiements $paiements)\n {\n //\n }",
"protected function edit() {\n\t}",
"public abstract function edit($data, $db);",
"public function edit($id, $newTitle = null, $newDescription = null);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
show the app dashboard | static function dashboard () {
Viewer::view('app_dashboard');
} | [
"public function dashboard()\n {\n return view('OnionEngineDashboard::index');\n }",
"private function showDashboard()\n {\n //Si es Admin\n if($this->registry->getObject('authenticate')->getUser()->isAdmin())\n {\n $this->registry->getObject('template')->buildFromTemplates(\n $this->registry->getSetting($this->registry->getObject('constants')->getConstant('pages_admin_base')).$this->registry->getObject('constants')->getHeaderTpl(),\n $this->registry->getSetting($this->registry->getObject('constants')->getConstant('pages_admin_base')).$this->registry->getObject('constants')->getDashboardTpl(),\n $this->registry->getSetting($this->registry->getObject('constants')->getConstant('pages_admin_base')).$this->registry->getObject('constants')->getFooterTpl()\n );\n }else\n { //Si es usuario normal\n $this->registry->getObject('template')->buildFromTemplates(\n $this->registry->getObject('constants')->getHeaderTpl(), \n $this->registry->getSetting($this->registry->getObject('constants')->getConstant('pages_logged_base')).$this->registry->getObject('constants')->getDashboardTpl(), \n $this->registry->getObject('constants')->getFooterTpl()\n );\n }\t\n }",
"public function display_dashboard_widget()\n {\n }",
"public function index()\n {\n $this->setTitle(trans('foundation::dashboard.titles.dashboard'));\n\n return $this->view('admin.dashboard');\n }",
"public function actionDashboard()\n {\n $items = [];\n foreach (Yii::$app->adminModules as $module) {\n foreach ($module->dashboardObjects as $config) {\n $items[] = Yii::createObject($config);\n }\n }\n\n return $this->renderPartial('dashboard', [\n 'items' => $items,\n ]);\n }",
"function dashboard() {\n\t\tif ($this -> session -> userdata('role') == 501) {\n\t\t\t$data['title'] = \"plus-ed.com | Dashboard\";\n\t\t\t$data['breadcrumb1'] = 'Dashboard';\n\t\t\t$data['breadcrumb2'] = '';\n\t\t\tif (APP_THEME == \"OLD\")\n\t\t\t\t$this -> load -> view('tuition/plused_survey_dashboard', $data);\n\t\t\telse { // if(APP_THEME == \"LTE\")\n\t\t\t\t$data['pageHeader'] = \"Plus Vision Dashboard\";\n\t\t\t\t$data['optionalDescription'] = \"\";\n\t\t\t\t$this -> ltelayout -> view('lte/gl/dashboard', $data);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tredirect('survey', 'refresh');\n\t\t}\n\t}",
"public function index()\n {\n return view('app.administrators.dashboard.index');\n }",
"function RenderDashboard(){\r\n\r\n\t\t$this->pageTitle=Yii::app()->name.\"- Home\";\r\n\r\n\t\techo $this->render(\"dashboard\",array(\r\n\t\t\r\n\t\t\"user\"=>helpers::GetUser()\r\n\t\t\r\n\t\t));\r\n\r\n\t}",
"function showDashboard(){\n\t\t//mostrar productos sin stock\n\t\t$this->setQueryController(\"productos\",\"Productos sin stock\", \"stock\", \"=\",0, $_SESSION['tienda']);\n\n\t\t$this->setQueryController(\"transaccion\",\"Transacciones realizadas hoy\", \"fecha\", \"=\", date('Y-m-d'), $_SESSION['tienda']);\n\t\t\n\t}",
"public function dashboard()\n {\n $accountModel=new AccountModel();\n $info=$accountModel->detail(Auth::user()->id);\n return view(\"account.dashboard\", [\n 'page_title'=>\"DashBoard\",\n 'site_title'=>\"NOJ\",\n 'navigation'=>\"DashBoard\",\n 'info'=>$info\n ]);\n }",
"public function dashboard() {\n // XXX implement this\n \n $this->set('title_for_layout', $this->cur_co['Co']['name']);\n }",
"public function dashboard()\n {\n if (!Services::modules()->hasMemberDashboard()) {\n return $this->showError();\n }\n\n $this->data['dashboards'] = Services::modules()->getMemberDashboards();\n\n $this->data['title'] = _l(\"Dashboard\", $this);\n $this->data['breadcrumb'] = array(\n array('title'=>_l(\"Dashboard\", $this))\n );\n $this->data['keyword'] = \"\";\n $this->data['page'] = \"dashboard\";\n return $this->viewRender(\"dashboards\");\n }",
"public function dashboard() {\n /* Do here something for user */\n }",
"public function display_dashboard_content() {\n\t\t$tabs = array(\t\t\t\n\t\t\t'shortcode-builder' => __( 'Shortcode Builder', 'all-in-one-video-gallery' ),\n\t\t\t'faq' => __( 'FAQ', 'all-in-one-video-gallery' )\n\t\t);\n\t\t\n\t\t$active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( $_GET['tab'] ) : 'shortcode-builder';\n\n\t\t// Issues\n\t\t$issues = $this->check_issues();\n\n\t\tif ( count( $issues['found'] ) || 'issues' == $active_tab ) {\n\t\t\t$tabs['issues'] = __( 'Issues Found', 'all-in-one-video-gallery' );\n\t\t}\n\n\t\trequire_once AIOVG_PLUGIN_DIR . 'admin/partials/dashboard.php';\t\n\t}",
"public function index()\n\t{\n\t\t$data['applications'] = $this->applicationRepo->getAll();\n\n\t\treturn view('admin.applications.overview', $data);\n\t}",
"public function dashboard(){\n $usuario = new Usuario();\n $allUserJson = $usuario->getAllJson();\n \n $allUser = $usuario->getAll();\n\t\t\t$allUsers = $allUser;\n\n $this->view(\"dashboard\",array(\n \"allUsers\" => $allUsers,\n \"allUserJsons\" => json_encode($allUserJson)\n\n ));\n }",
"public function index()\n {\n $this->view->render('dashboard/index', 'Dashboard');\n }",
"public function star_review_dashboard()\n\t{\n\t\techo \"This is Dashboard page\";\n\t}",
"public function showDashboard()\n {\n $reports = Report::where(\"user_id\", Auth::user()->id)->get();\n $reportsCount = Report::where(\"user_id\", Auth::user()->id)->count();\n\n return view(\"admin.report.index\")\n ->withReportsCount($reportsCount)\n ->withReports($reports);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get meta description length | public function getMetaDescriptionLength(); | [
"public function getMetaDescriptionLength()\n {\n return parent::getData(self::META_DESCRIPTION_LENGTH);\n }",
"protected function length()\n {\n if (!isset($this->meta['length'])) {\n $this->meta['length'] = strlen($this->raw_data);\n }\n\n return $this->meta['length'];\n }",
"public function calculateMetaDescription()\n {\n $tmp = $this->metaDescription;\n $metaDescriptionLength = strlen($tmp);\n if ($metaDescriptionLength > self::MAX_META_DESCRIPTION_LENGTH) {\n return \"Your meta description is too long\";\n } elseif ($metaDescriptionLength == null) {\n return \"Your page has no meta description\";\n } else {\n return \"Your meta description length is fine!\";\n }\n }",
"public function getMetadataSize()\n {\n $this->reader->seek($this->offset + 18 + $this->getAliasSize());\n\n return $this->readLong();\n }",
"public function getDescSize()\n {\n return $this->descSize;\n }",
"public function getDescriptionCount()\n {\n return $this->count(self::DESCRIPTION);\n }",
"public function getLength()\r\n {\r\n return $this->length;\r\n }",
"public function getArtLength() : int\n {\n return $this->artLength;\n }",
"function getLength() {\n\t\treturn $this->_Length;\n\t}",
"public function getLength() {\n return $this->length;\n }",
"public static function new_length() {\r\n if( isset(Appside_excerpt::$types[Appside_excerpt::$length]) )\r\n return Appside_excerpt::$types[Appside_excerpt::$length];\r\n else\r\n return Appside_excerpt::$length;\r\n }",
"public function getLength()\n {\n return isset($this->length) ? $this->length : null;\n }",
"public static function new_length() {\n\t if( isset(Excerpt::$types[Excerpt::$length]) )\n\t return Excerpt::$types[Excerpt::$length];\n\t else\n\t return Excerpt::$length;\n\t }",
"public static function new_length() {\n if( isset(Excerpt::$types[Excerpt::$length]) )\n return Excerpt::$types[Excerpt::$length];\n else\n return Excerpt::$length;\n }",
"public static function new_length() {\r\n if( isset(Excerpt::$types[Excerpt::$length]) )\r\n return Excerpt::$types[Excerpt::$length];\r\n else\r\n return Excerpt::$length;\r\n }",
"public function getLengthOf()\n {\n return $this->lengthOf;\n }",
"public function getShortDescriptionWordCount()\n {\n return (int)$this->getConfig(self::XML_PATH_SHORT_DESCRIPTION_WORD_COUNT);\n }",
"public function getLength()\n {\n return $this->parameters['length'] == 1 ? $this->parameters['length'] : null;\n }",
"public function countMeta();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
annoncer le service oembed dans le head des pages publiques | function oembed_insert_head($head) {
if(lire_config('oembed/inserer_head')=='non') {
return $head;
}
$service = 'oembed.api/';
$ins = '<link rel="alternate" type="application/json+oembed" href="<?php include_spip(\'inc/filtres_mini\');echo parametre_url(url_absolue("'.parametre_url($service, 'format', 'json').'"), "url", url_absolue(self()));?>" />'."\n";
/*
$ins .= '<link rel="alternate" type="text/xml+oembed" href="<?php echo parametre_url(url_absolue("'.parametre_url($service,'format','xml').'"),"url",url_absolue(self()));?>" />'."\n";
*/
$ins = "<?php if (!in_array(_request(_SPIP_PAGE),array('login')) AND strpos(\$_SERVER['REQUEST_URI'],'debut_')===false){?>$ins<?php } ?>";
return $head.$ins;
} | [
"function wp_filter_pre_oembed_result($result, $url, $args)\n{\n}",
"public function embed_scripts() {}",
"function wp_oembed_add_host_js()\n{\n}",
"function embed(){\n\t\techo $this->embedjw();\n\t}",
"public function embed()\n {\n global $page_output, $registry;\n\n /* First, determine the type of view we are asking for */\n $view = $this->vars->view;\n\n /* The DOM container to put the HTML in on the remote site */\n $container = $this->vars->container;\n\n /* The share_name of the calendar to display */\n $calendar = $this->vars->calendar;\n\n /* Deault to showing only 1 month when we have a choice */\n $count_month = $this->vars->get('months', 1);\n\n /* Default to no limit for the number of events */\n $max_events = $this->vars->get('maxevents', 0);\n\n /* Default to one week */\n $count_days = $this->vars->get('days', 7);\n\n if ($this->vars->css == 'none') {\n $nocss = true;\n }\n\n /* Build the block parameters */\n $params = array(\n 'calendar' => $calendar,\n 'maxevents' => $max_events,\n 'months' => $count_month,\n 'days' => $count_days\n );\n\n /* Call the Horde_Block api to get the calendar HTML */\n $title = $registry->call('horde/blockTitle', array('kronolith', $view, $params));\n $results = $registry->call('horde/blockContent', array('kronolith', $view, $params));\n\n /* Some needed paths */\n $js_path = $registry->get('jsuri', 'kronolith');\n\n /* Local js */\n $jsurl = Horde::url($js_path . '/embed.js', true);\n\n /* Horde's js */\n $hjs_path = $registry->get('jsuri', 'horde');\n $hjsurl = Horde::url($hjs_path . '/tooltips.js', true);\n $pturl = Horde::url($hjs_path . '/prototype.js', true);\n\n /* CSS */\n if (empty($nocss)) {\n $page_output->addThemeStylesheet('embed.css');\n\n Horde::startBuffer();\n $page_output->includeStylesheetFiles(array('nobase' => true), true);\n $css = Horde::endBuffer();\n } else {\n $css = '';\n }\n\n /* Escape the text and put together the javascript to send back */\n $container = Horde_Serialize::serialize($container, Horde_Serialize::JSON);\n $results = Horde_Serialize::serialize('<div class=\"kronolith_embedded\"><div class=\"title\">' . $title . '</div>' . $results . '</div>', Horde_Serialize::JSON);\n\n $js = <<<EOT\nif (typeof kronolith == 'undefined') {\n if (typeof Prototype == 'undefined') {\n document.write('<script type=\"text/javascript\" src=\"$pturl\"></script>');\n }\n if (typeof Horde_ToolTips == 'undefined') {\n Horde_ToolTips_Autoload = false;\n document.write('<script type=\"text/javascript\" src=\"$hjsurl\"></script>');\n }\n kronolith = new Object();\n kronolithNodes = new Array();\n document.write('<script type=\"text/javascript\" src=\"$jsurl\"></script>');\n document.write('$css');\n}\nkronolithNodes[kronolithNodes.length] = $container;\nkronolith[$container] = $results;\nEOT;\n\n return new Horde_Core_Ajax_Response_Raw($js, 'text/javascript');\n }",
"function add_issuu_oembed_provider(){\n wp_oembed_add_provider('#https?://(www\\.)?issuu\\.com/.+/docs/.+#i', 'http://issuu.com/oembed_wp', true);\n}",
"function wp_filter_pre_oembed_result($result, $url, $args)\n {\n }",
"function bon_add_oembed_links() {\n if('bon_se_film' == get_post_type()) {\n echo '<link href=\"/oembed?url='.urlencode( get_the_permalink() ).'\" rel=\"alternate\" type=\"application/json+oembed\" />';\n }\n}",
"function slate_oembed_provider() {\n\twp_oembed_add_provider( 'https://letitrainfilms.slateapp.com/work/*', 'https://letitrainfilms.slateapp.com/api/v2/oembed', false );\n\n}",
"function wp_ajax_oembed_cache()\n {\n }",
"function wp_oembed_add_discovery_links()\n{\n $output = '';\n\n if (is_singular()) {\n $output .= '<link rel=\"alternate\" type=\"application/json+oembed\" href=\"' . esc_url(get_oembed_endpoint_url(get_permalink())) . '\" />' . \"\\n\";\n\n if (class_exists('SimpleXMLElement')) {\n $output .= '<link rel=\"alternate\" type=\"text/xml+oembed\" href=\"' . esc_url(get_oembed_endpoint_url(get_permalink(), 'xml')) . '\" />' . \"\\n\";\n }\n }\n\n /**\n * Filters the oEmbed discovery links HTML.\n *\n * @since 4.4.0\n *\n * @param string $output HTML of the discovery links.\n */\n echo apply_filters('oembed_discovery_links', $output);\n}",
"public function embed_scripts()\n {\n }",
"function caldera_theme_oembed_get( $url ){\n $key = md5( __FUNCTION__ . $url );\n if( false == ( $embed = get_transient( $key ) ) ){\n $embed = wp_oembed_get( $url );\n if( ! empty( $embed ) ){\n set_transient( $key, $embed, WEEK_IN_SECONDS );\n }\n }\n\n return $embed;\n\n\n}",
"function maybe_add_discovery_tags() {\n\t\tif ( is_single() && stristr( get_post()->post_content, '[wpvideo' ) ) {\n\t\t\tprintf( '<link rel=\"alternate\" type=\"application/json+oembed\" href=\"%1$s\" title=\"%2$s\" />' . \"\\n\",\n\t\t\t\tesc_url( add_query_arg( array( 'url' => urlencode( get_permalink() ), 'format' => 'json' ), home_url( '/oembed/' ) ) ),\n\t\t\t\tthe_title_attribute( array( 'echo' => false ) )\n\t\t\t);\n\t\t\tprintf( '<link rel=\"alternate\" type=\"text/xml+oembed\" href=\"%1$s\" title=\"%2$s\" />' . \"\\n\",\n\t\t\t\tesc_url( add_query_arg( array( 'url' => urlencode( get_permalink() ), 'format' => 'xml' ), home_url( '/oembed/' ) ) ),\n\t\t\t\tthe_title_attribute( array( 'echo' => false ) )\n\t\t\t);\n\t\t}\n\t}",
"function _wp_oembed_get_object() {}",
"function embed()\r\n\t\t{\r\n\t\t\tSERIA_Router::instance()->addRoute('Authproviders', 'Authproviders config', array($this, 'showConfigurationPage'), 'components/authproviders/config');\r\n\t\t\tSERIA_Router::instance()->addRoute('Authproviders', 'Authproviders config check', array($this, 'showConfigCheck'), 'components/authproviders/configcheck');\r\n\t\t\tSERIA_Router::instance()->addRoute('Authproviders', 'Local usermanagement is blocked', array($this, 'showUsermanagementBlockage'), 'components/authproviders/usermanagement');\r\n\t\t\t/*\r\n\t\t\t * Single signon by javascript:\r\n\t\t\t */\r\n\t\t\tSERIA_Router::instance()->addRoute('Authproviders', 'Authproviders Javascript SSO', array($this, 'ssoByJavascriptCall'), 'components/authproviders/ssobyjs');\r\n\t\t\t/*\r\n\t\t\t * Delete user:\r\n\t\t\t */\r\n\t\t\tSERIA_Router::instance()->addRoute('Authproviders', 'Authproviders SSO delete user', array($this, 'ssoDeleteUser'), 'components/authproviders/ssodeleteuser');\r\n\r\n\t\t\tif ($this->isEnabled()) {\r\n\t\t\t\tSERIA_Hooks::listen('SeriaPlatformBootComplete', array($this, 'platformBootComplete'));\r\n\t\t\t\tSERIA_Hooks::listen('login', array($this, 'handleLogin'));\r\n\t\t\t\tSERIA_Hooks::listen('guestLogin', array($this, 'handleGuestLogin'));\r\n\t\t\t\tSERIA_Hooks::listen('SERIA_User::__construct', array('SERIA_Authproviders', 'userObjectHook'));\r\n\t\t\t}\r\n\t\t\tSERIA_Hooks::listen('seria_maintain', array('SERIA_UserLoginXml', 'cleanupSids'));\r\n\t\t\tSERIA_Hooks::listen('seria_maintain', array('SERIA_AsyncUserMetaSync', 'updateAllUsers'));\r\n\t\t\tSERIA_Hooks::listen('loggedIn', array($this, 'successfulLogin'));\r\n\t\t\tSERIA_Hooks::listen(SERIA_Base::LOGOUT_HOOK, array($this, 'beforeLogout'));\r\n\t\t\t/*\r\n\t\t\t * There is a chance for redirects, so attach a heavy hook.\r\n\t\t\t */\r\n\t\t\tSERIA_Hooks::listen(SERIA_Base::AFTER_LOGOUT_HOOK, array($this, 'logout'), 1000);\r\n\t\t\tSERIA_Hooks::listen(SERIA_GuiHooks::EMBED, array($this, 'guiEmbed'));\r\n\t\t\t/*\r\n\t\t\t * ExternalReq2 can show a user-consent-request for sending data to\r\n\t\t\t * an external server.\r\n\t\t\t */\r\n\t\t\tSERIA_Hooks::listen(SERIA_ExternalReq2ReturnPost::HOST_ACCESS_CONSENT_HOOK, array($this, 'hostAccessConsentRequest'), 1000);\r\n\t\t\t/*\r\n\t\t\t * Clean up login-provider info at delete:\r\n\t\t\t */\r\n\t\t\tSERIA_Hooks::listen(SERIA_User::DELETE_HOOK, array('SERIA_UserAuthenticationProvider', 'deletingUser'));\r\n\t\t\t/*\r\n\t\t\t * Clean up user-xml at user delete.\r\n\t\t\t */\r\n\t\t\tSERIA_Hooks::listen(SERIA_User::AFTER_DELETE_HOOK, array('SERIA_UserLoginXml', 'cleanupSids'));\r\n\t\t}",
"function p2_wrap_oembed( $html, $url, $attr, $post_id ) {\n return '<div class=\"video-embed\">'.$html.'</div>';\n}",
"private static function requireoEmbed() {\n\t\t\trequire_once(EXTENSIONS . '/multilingual_oembed_field/fields/field.multilingual_oembed.php');\n\t\t}",
"public function pagePresentation()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t$oEventmeta = new Oeventmeta($eventId);\r\n\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\r\n\t\t// Titres\r\n\t\t$t = $body->addP('', '', 'bn-title-2');\r\n\t\t$t->addBalise('span', '', LOC_ITEM_PRESENTATION);\r\n\r\n\t\t// Infos generales\r\n\t\t$form = $body->addForm('frmPresentation', BPREF_UPDATE_PRESENTATION, 'divPreferences_content');\r\n\t\t//$form->getForm()->addMetadata('success', \"updated\");\r\n\t\t//$form->getForm()->addMetadata('dataType', \"'json'\");\r\n\r\n\r\n\t\t$dl = $form->addDiv('', 'bn-div-left');\r\n\t\t$edt = $dl->addEditFile('poster', LOC_LABEL_EVENT_POSTER, '');\r\n\t\t$edt->noMandatory();\r\n\t\t$poster = $oEvent->getVal('poster');\r\n\t\tif (!empty($poster) )\r\n\t\t{\r\n\t\t\t$poster = '../img/poster/'.$poster;\r\n\t\t\t$form->addImage('poster', $poster, 'poster', array('height'=>70, 'width'=>155));\r\n\t\t}\r\n\r\n\t\t$d = $form->addDiv('', 'bn-div-line bn-div-clear');\r\n\t\t$handle=opendir('../skins');\r\n\t\twhile ($file = readdir($handle))\r\n\t\t{\r\n\t\t\tif ($file != \".\" && $file != \"..\" && $file != \"CVS\")\r\n\t\t\t$skins[$file] = $file;\r\n\t\t}\r\n\t\tclosedir($handle);\r\n\t\t$cbo = $form->addSelect('skin', LOC_LABEL_EVENT_SKIN);\r\n\t\t$cbo->addOptions($skins, $oEventmeta->getVal('skin'));\r\n\t\t$d->addBreak();\r\n\r\n\t\t$d = $form->addDiv('', 'bn-div-btn');\r\n\t\tif (!empty($poster) )\r\n\t\t{\r\n\t\t\t$d->addButton('btnDelposter', LOC_BTN_DELETE_POSTER, BPREF_DELETE_POSTER, 'trash', 'divPreferences_content');\r\n\t\t}\r\n\t\t$d->addButtonValid('btnValid', LOC_BTN_UPDATE);\r\n\r\n\t\t// Envoi au navigateur\r\n\t\t$body->display();\r\n\t\treturn false;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates styles for sticky haeder | function moments_qodef_sticky_header_styles() {
if(moments_qodef_options()->getOptionValue('sticky_header_in_grid') == 'yes' && moments_qodef_options()->getOptionValue('sticky_header_grid_background_color') !== '') {
$sticky_header_grid_background_color = moments_qodef_options()->getOptionValue('sticky_header_grid_background_color');
$sticky_header_grid_background_transparency = 1;
if(moments_qodef_options()->getOptionValue('sticky_header_grid_transparency') !== '') {
$sticky_header_grid_background_transparency = moments_qodef_options()->getOptionValue('sticky_header_grid_transparency');
}
echo moments_qodef_dynamic_css('.qodef-page-header .qodef-sticky-header .qodef-grid .qodef-vertical-align-containers', array('background-color' => moments_qodef_rgba_color($sticky_header_grid_background_color, $sticky_header_grid_background_transparency)));
}
if(moments_qodef_options()->getOptionValue('sticky_header_background_color') !== '') {
$sticky_header_background_color = moments_qodef_options()->getOptionValue('sticky_header_background_color');
$sticky_header_background_color_transparency = 1;
if(moments_qodef_options()->getOptionValue('sticky_header_transparency') !== '') {
$sticky_header_background_color_transparency = moments_qodef_options()->getOptionValue('sticky_header_transparency');
}
echo moments_qodef_dynamic_css('.qodef-page-header .qodef-sticky-header .qodef-sticky-holder', array('background-color' => moments_qodef_rgba_color($sticky_header_background_color, $sticky_header_background_color_transparency)));
}
if(moments_qodef_options()->getOptionValue('sticky_header_height') !== '') {
$max_height = intval(moments_qodef_filter_px(moments_qodef_options()->getOptionValue('sticky_header_height')) * 0.9).'px';
echo moments_qodef_dynamic_css('.qodef-page-header .qodef-sticky-header', array('height' => moments_qodef_options()->getOptionValue('sticky_header_height').'px'));
echo moments_qodef_dynamic_css('.qodef-page-header .qodef-sticky-header .qodef-logo-wrapper a', array('max-height' => $max_height));
}
$sticky_menu_item_styles = array();
if(moments_qodef_options()->getOptionValue('sticky_color') !== '') {
$sticky_menu_item_styles['color'] = moments_qodef_options()->getOptionValue('sticky_color');
}
if(moments_qodef_options()->getOptionValue('sticky_google_fonts') !== '-1') {
$sticky_menu_item_styles['font-family'] = moments_qodef_get_formatted_font_family(moments_qodef_options()->getOptionValue('sticky_google_fonts'));
}
if(moments_qodef_options()->getOptionValue('sticky_fontsize') !== '') {
$sticky_menu_item_styles['font-size'] = moments_qodef_options()->getOptionValue('sticky_fontsize').'px';
}
if(moments_qodef_options()->getOptionValue('sticky_lineheight') !== '') {
$sticky_menu_item_styles['line-height'] = moments_qodef_options()->getOptionValue('sticky_lineheight').'px';
}
if(moments_qodef_options()->getOptionValue('sticky_texttransform') !== '') {
$sticky_menu_item_styles['text-transform'] = moments_qodef_options()->getOptionValue('sticky_texttransform');
}
if(moments_qodef_options()->getOptionValue('sticky_fontstyle') !== '') {
$sticky_menu_item_styles['font-style'] = moments_qodef_options()->getOptionValue('sticky_fontstyle');
}
if(moments_qodef_options()->getOptionValue('sticky_fontweight') !== '') {
$sticky_menu_item_styles['font-weight'] = moments_qodef_options()->getOptionValue('sticky_fontweight');
}
if(moments_qodef_options()->getOptionValue('sticky_letterspacing') !== '') {
$sticky_menu_item_styles['letter-spacing'] = moments_qodef_options()->getOptionValue('sticky_letterspacing').'px';
}
$sticky_menu_item_selector = array(
'.qodef-main-menu.qodef-sticky-nav > ul > li > a'
);
echo moments_qodef_dynamic_css($sticky_menu_item_selector, $sticky_menu_item_styles);
$sticky_menu_item_hover_styles = array();
if(moments_qodef_options()->getOptionValue('sticky_hovercolor') !== '') {
$sticky_menu_item_hover_styles['color'] = moments_qodef_options()->getOptionValue('sticky_hovercolor');
}
$sticky_menu_item_hover_selector = array(
'.qodef-main-menu.qodef-sticky-nav > ul > li:hover > a',
'.qodef-main-menu.qodef-sticky-nav > ul > li.qodef-active-item:hover > a',
'body:not(.qodef-menu-item-first-level-bg-color) .qodef-main-menu.qodef-sticky-nav > ul > li:hover > a',
'body:not(.qodef-menu-item-first-level-bg-color) .qodef-main-menu.qodef-sticky-nav > ul > li.qodef-active-item:hover > a'
);
echo moments_qodef_dynamic_css($sticky_menu_item_hover_selector, $sticky_menu_item_hover_styles);
} | [
"function goodwish_edge_sticky_header_styles() {\n global $goodwish_edge_options;\n\n if($goodwish_edge_options['sticky_header_in_grid'] == 'yes' && $goodwish_edge_options['sticky_header_grid_background_color'] !== '') {\n $sticky_header_grid_background_color = $goodwish_edge_options['sticky_header_grid_background_color'];\n $sticky_header_grid_background_transparency = 1;\n\n if($goodwish_edge_options['sticky_header_grid_transparency'] !== '') {\n $sticky_header_grid_background_transparency = $goodwish_edge_options['sticky_header_grid_transparency'];\n }\n\n echo goodwish_edge_dynamic_css('.edgtf-page-header .edgtf-sticky-header .edgtf-grid .edgtf-vertical-align-containers', array('background-color' => goodwish_edge_rgba_color($sticky_header_grid_background_color, $sticky_header_grid_background_transparency)));\n }\n\n if($goodwish_edge_options['sticky_header_background_color'] !== '') {\n\n $sticky_header_background_color = $goodwish_edge_options['sticky_header_background_color'];\n $sticky_header_background_color_transparency = 1;\n\n if($goodwish_edge_options['sticky_header_transparency'] !== '') {\n $sticky_header_background_color_transparency = $goodwish_edge_options['sticky_header_transparency'];\n }\n\n echo goodwish_edge_dynamic_css('.edgtf-page-header .edgtf-sticky-header .edgtf-sticky-holder', array('background-color' => goodwish_edge_rgba_color($sticky_header_background_color, $sticky_header_background_color_transparency)));\n }\n\n if($goodwish_edge_options['sticky_header_height'] !== '') {\n $max_height = intval(goodwish_edge_filter_px($goodwish_edge_options['sticky_header_height']) * 0.9).'px';\n\n echo goodwish_edge_dynamic_css('.edgtf-page-header .edgtf-sticky-header', array('height' => $goodwish_edge_options['sticky_header_height'].'px'));\n echo goodwish_edge_dynamic_css('.edgtf-page-header .edgtf-sticky-header .edgtf-logo-wrapper a', array('max-height' => $max_height));\n }\n\n $sticky_menu_item_styles = array();\n if($goodwish_edge_options['sticky_color'] !== '') {\n $sticky_menu_item_styles['color'] = $goodwish_edge_options['sticky_color'];\n }\n if($goodwish_edge_options['sticky_google_fonts'] !== '-1') {\n $sticky_menu_item_styles['font-family'] = goodwish_edge_get_formatted_font_family($goodwish_edge_options['sticky_google_fonts']);\n }\n if($goodwish_edge_options['sticky_fontsize'] !== '') {\n $sticky_menu_item_styles['font-size'] = $goodwish_edge_options['sticky_fontsize'].'px';\n }\n if($goodwish_edge_options['sticky_lineheight'] !== '') {\n $sticky_menu_item_styles['line-height'] = $goodwish_edge_options['sticky_lineheight'].'px';\n }\n if($goodwish_edge_options['sticky_texttransform'] !== '') {\n $sticky_menu_item_styles['text-transform'] = $goodwish_edge_options['sticky_texttransform'];\n }\n if($goodwish_edge_options['sticky_fontstyle'] !== '') {\n $sticky_menu_item_styles['font-style'] = $goodwish_edge_options['sticky_fontstyle'];\n }\n if($goodwish_edge_options['sticky_fontweight'] !== '') {\n $sticky_menu_item_styles['font-weight'] = $goodwish_edge_options['sticky_fontweight'];\n }\n if($goodwish_edge_options['sticky_letterspacing'] !== '') {\n $sticky_menu_item_styles['letter-spacing'] = $goodwish_edge_options['sticky_letterspacing'].'px';\n }\n\n $sticky_menu_item_selector = array(\n '.edgtf-main-menu.edgtf-sticky-nav > ul > li > a'\n );\n\n echo goodwish_edge_dynamic_css($sticky_menu_item_selector, $sticky_menu_item_styles);\n\n $sticky_menu_item_hover_styles = array();\n if($goodwish_edge_options['sticky_hovercolor'] !== '') {\n $sticky_menu_item_hover_styles['color'] = $goodwish_edge_options['sticky_hovercolor'];\n }\n\n $sticky_menu_item_hover_selector = array(\n '.edgtf-main-menu.edgtf-sticky-nav > ul > li:hover > a',\n '.edgtf-main-menu.edgtf-sticky-nav > ul > li.edgtf-active-item:hover > a',\n 'body:not(.edgtf-menu-item-first-level-bg-color) .edgtf-main-menu.edgtf-sticky-nav > ul > li:hover > a',\n 'body:not(.edgtf-menu-item-first-level-bg-color) .edgtf-main-menu.edgtf-sticky-nav > ul > li.edgtf-active-item:hover > a'\n );\n\n echo goodwish_edge_dynamic_css($sticky_menu_item_hover_selector, $sticky_menu_item_hover_styles);\n }",
"function mixtape_qodef_sticky_header_styles() {\n global $mixtape_qodef_options;\n\n if($mixtape_qodef_options['sticky_header_in_grid'] == 'yes' && $mixtape_qodef_options['sticky_header_grid_background_color'] !== '') {\n $sticky_header_grid_background_color = $mixtape_qodef_options['sticky_header_grid_background_color'];\n $sticky_header_grid_background_transparency = 1;\n\n if($mixtape_qodef_options['sticky_header_grid_transparency'] !== '') {\n $sticky_header_grid_background_transparency = $mixtape_qodef_options['sticky_header_grid_transparency'];\n }\n\n echo mixtape_qodef_dynamic_css('.qodef-page-header .qodef-sticky-header .qodef-grid .qodef-vertical-align-containers', array('background-color' => mixtape_qodef_rgba_color($sticky_header_grid_background_color, $sticky_header_grid_background_transparency)));\n }\n\n if($mixtape_qodef_options['sticky_header_background_color'] !== '') {\n\n $sticky_header_background_color = $mixtape_qodef_options['sticky_header_background_color'];\n $sticky_header_background_color_transparency = 1;\n\n if($mixtape_qodef_options['sticky_header_transparency'] !== '') {\n $sticky_header_background_color_transparency = $mixtape_qodef_options['sticky_header_transparency'];\n }\n\n echo mixtape_qodef_dynamic_css('.qodef-page-header .qodef-sticky-header .qodef-sticky-holder', array('background-color' => mixtape_qodef_rgba_color($sticky_header_background_color, $sticky_header_background_color_transparency)));\n }\n\n if($mixtape_qodef_options['sticky_header_height'] !== '') {\n $max_height = intval(mixtape_qodef_filter_px($mixtape_qodef_options['sticky_header_height']) * 0.9).'px';\n\n echo mixtape_qodef_dynamic_css('.qodef-page-header .qodef-sticky-header', array('height' => $mixtape_qodef_options['sticky_header_height'].'px'));\n echo mixtape_qodef_dynamic_css('.qodef-page-header .qodef-sticky-header .qodef-logo-wrapper a', array('max-height' => $max_height));\n }\n\n $sticky_menu_item_styles = array();\n if($mixtape_qodef_options['sticky_color'] !== '') {\n $sticky_menu_item_styles['color'] = $mixtape_qodef_options['sticky_color'];\n }\n if($mixtape_qodef_options['sticky_google_fonts'] !== '-1') {\n $sticky_menu_item_styles['font-family'] = mixtape_qodef_get_formatted_font_family($mixtape_qodef_options['sticky_google_fonts']);\n }\n if($mixtape_qodef_options['sticky_fontsize'] !== '') {\n $sticky_menu_item_styles['font-size'] = $mixtape_qodef_options['sticky_fontsize'].'px';\n }\n if($mixtape_qodef_options['sticky_lineheight'] !== '') {\n $sticky_menu_item_styles['line-height'] = $mixtape_qodef_options['sticky_lineheight'].'px';\n }\n if($mixtape_qodef_options['sticky_texttransform'] !== '') {\n $sticky_menu_item_styles['text-transform'] = $mixtape_qodef_options['sticky_texttransform'];\n }\n if($mixtape_qodef_options['sticky_fontstyle'] !== '') {\n $sticky_menu_item_styles['font-style'] = $mixtape_qodef_options['sticky_fontstyle'];\n }\n if($mixtape_qodef_options['sticky_fontweight'] !== '') {\n $sticky_menu_item_styles['font-weight'] = $mixtape_qodef_options['sticky_fontweight'];\n }\n if($mixtape_qodef_options['sticky_letterspacing'] !== '') {\n $sticky_menu_item_styles['letter-spacing'] = $mixtape_qodef_options['sticky_letterspacing'].'px';\n }\n\n $sticky_menu_item_selector = array(\n '.qodef-main-menu.qodef-sticky-nav > ul > li > a'\n );\n\n echo mixtape_qodef_dynamic_css($sticky_menu_item_selector, $sticky_menu_item_styles);\n\n $sticky_menu_item_hover_styles = array();\n if($mixtape_qodef_options['sticky_hovercolor'] !== '') {\n $sticky_menu_item_hover_styles['color'] = $mixtape_qodef_options['sticky_hovercolor'];\n }\n\n $sticky_menu_item_hover_selector = array(\n '.qodef-main-menu.qodef-sticky-nav > ul > li:hover > a',\n '.qodef-main-menu.qodef-sticky-nav > ul > li.qodef-active-item:hover > a',\n 'body:not(.qodef-menu-item-first-level-bg-color) .qodef-main-menu.qodef-sticky-nav > ul > li:hover > a',\n 'body:not(.qodef-menu-item-first-level-bg-color) .qodef-main-menu.qodef-sticky-nav > ul > li.qodef-active-item:hover > a'\n );\n\n echo mixtape_qodef_dynamic_css($sticky_menu_item_hover_selector, $sticky_menu_item_hover_styles);\n }",
"function flow_elated_sticky_header_styles() {\n global $flow_elated_options;\n\n if($flow_elated_options['sticky_header_in_grid'] == 'yes' && $flow_elated_options['sticky_header_grid_background_color'] !== '') {\n $sticky_header_grid_background_color = $flow_elated_options['sticky_header_grid_background_color'];\n $sticky_header_grid_background_transparency = 1;\n\n if($flow_elated_options['sticky_header_grid_transparency'] !== '') {\n $sticky_header_grid_background_transparency = $flow_elated_options['sticky_header_grid_transparency'];\n }\n\n echo flow_elated_dynamic_css('.eltd-page-header .eltd-sticky-header .eltd-grid .eltd-vertical-align-containers', array('background-color' => flow_elated_rgba_color($sticky_header_grid_background_color, $sticky_header_grid_background_transparency)));\n }\n\n if($flow_elated_options['sticky_header_background_color'] !== '') {\n\n $sticky_header_background_color = $flow_elated_options['sticky_header_background_color'];\n $sticky_header_background_color_transparency = 1;\n\n if($flow_elated_options['sticky_header_transparency'] !== '') {\n $sticky_header_background_color_transparency = $flow_elated_options['sticky_header_transparency'];\n }\n\n echo flow_elated_dynamic_css('.eltd-page-header .eltd-sticky-header .eltd-sticky-holder', array('background-color' => flow_elated_rgba_color($sticky_header_background_color, $sticky_header_background_color_transparency)));\n }\n\n if($flow_elated_options['sticky_header_height'] !== '') {\n $max_height = intval(flow_elated_filter_px($flow_elated_options['sticky_header_height']) * 0.9).'px';\n\n echo flow_elated_dynamic_css('.eltd-page-header .eltd-sticky-header', array('height' => $flow_elated_options['sticky_header_height'].'px'));\n echo flow_elated_dynamic_css('.eltd-page-header .eltd-sticky-header .eltd-logo-wrapper a', array('max-height' => $max_height));\n }\n\n $sticky_menu_item_styles = array();\n if($flow_elated_options['sticky_color'] !== '') {\n $sticky_menu_item_styles['color'] = $flow_elated_options['sticky_color'];\n }\n if($flow_elated_options['sticky_google_fonts'] !== '-1') {\n $sticky_menu_item_styles['font-family'] = flow_elated_get_formatted_font_family($flow_elated_options['sticky_google_fonts']);\n }\n if($flow_elated_options['sticky_fontsize'] !== '') {\n $sticky_menu_item_styles['font-size'] = $flow_elated_options['sticky_fontsize'].'px';\n }\n if($flow_elated_options['sticky_lineheight'] !== '') {\n $sticky_menu_item_styles['line-height'] = $flow_elated_options['sticky_lineheight'].'px';\n }\n if($flow_elated_options['sticky_texttransform'] !== '') {\n $sticky_menu_item_styles['text-transform'] = $flow_elated_options['sticky_texttransform'];\n }\n if($flow_elated_options['sticky_fontstyle'] !== '') {\n $sticky_menu_item_styles['font-style'] = $flow_elated_options['sticky_fontstyle'];\n }\n if($flow_elated_options['sticky_fontweight'] !== '') {\n $sticky_menu_item_styles['font-weight'] = $flow_elated_options['sticky_fontweight'];\n }\n if($flow_elated_options['sticky_letterspacing'] !== '') {\n $sticky_menu_item_styles['letter-spacing'] = $flow_elated_options['sticky_letterspacing'].'px';\n }\n\n $sticky_menu_item_selector = array(\n '.eltd-main-menu.eltd-sticky-nav > ul > li > a'\n );\n\n echo flow_elated_dynamic_css($sticky_menu_item_selector, $sticky_menu_item_styles);\n\n $sticky_menu_item_hover_styles = array();\n if($flow_elated_options['sticky_hovercolor'] !== '') {\n $sticky_menu_item_hover_styles['color'] = $flow_elated_options['sticky_hovercolor'];\n }\n\n $sticky_menu_item_hover_selector = array(\n '.eltd-main-menu.eltd-sticky-nav > ul > li:hover > a',\n '.eltd-main-menu.eltd-sticky-nav > ul > li.eltd-active-item:hover > a',\n 'body:not(.eltd-menu-item-first-level-bg-color) .eltd-main-menu.eltd-sticky-nav > ul > li:hover > a',\n 'body:not(.eltd-menu-item-first-level-bg-color) .eltd-main-menu.eltd-sticky-nav > ul > li.eltd-active-item:hover > a'\n );\n\n echo flow_elated_dynamic_css($sticky_menu_item_hover_selector, $sticky_menu_item_hover_styles);\n }",
"function superfood_elated_sticky_header_styles() {\n global $superfood_elated_global_options;\n\n if ($superfood_elated_global_options['sticky_header_background_color'] !== '') {\n\n $sticky_header_background_color = $superfood_elated_global_options['sticky_header_background_color'];\n $sticky_header_background_color_transparency = 1;\n\n if ($superfood_elated_global_options['sticky_header_transparency'] !== '') {\n $sticky_header_background_color_transparency = $superfood_elated_global_options['sticky_header_transparency'];\n }\n\n echo superfood_elated_dynamic_css('.eltdf-page-header .eltdf-sticky-header .eltdf-sticky-holder', array('background-color' => superfood_elated_rgba_color($sticky_header_background_color, $sticky_header_background_color_transparency)));\n }\n\n if ($superfood_elated_global_options['sticky_header_border_color'] !== '') {\n\n $sticky_header_border_color = $superfood_elated_global_options['sticky_header_border_color'];\n\n echo superfood_elated_dynamic_css('.eltdf-page-header .eltdf-sticky-header .eltdf-sticky-holder', array('border-color' => $sticky_header_border_color));\n }\n\n if ($superfood_elated_global_options['sticky_header_height'] !== '') {\n $max_height = intval(superfood_elated_filter_px($superfood_elated_global_options['sticky_header_height'])) . 'px';\n\n echo superfood_elated_dynamic_css('.eltdf-page-header .eltdf-sticky-header', array('height' => $superfood_elated_global_options['sticky_header_height'] . 'px'));\n echo superfood_elated_dynamic_css('.eltdf-page-header .eltdf-sticky-header .eltdf-logo-wrapper a', array('max-height' => $max_height));\n }\n\n $sticky_menu_item_styles = array();\n if ($superfood_elated_global_options['sticky_color'] !== '') {\n $sticky_menu_item_styles['color'] = $superfood_elated_global_options['sticky_color'];\n }\n if ($superfood_elated_global_options['sticky_google_fonts'] !== '-1') {\n $sticky_menu_item_styles['font-family'] = superfood_elated_get_formatted_font_family($superfood_elated_global_options['sticky_google_fonts']);\n }\n if ($superfood_elated_global_options['sticky_fontsize'] !== '') {\n $sticky_menu_item_styles['font-size'] = superfood_elated_filter_px($superfood_elated_global_options['sticky_fontsize']) . 'px';\n }\n if ($superfood_elated_global_options['sticky_lineheight'] !== '') {\n $sticky_menu_item_styles['line-height'] = superfood_elated_filter_px($superfood_elated_global_options['sticky_lineheight']) . 'px';\n }\n if ($superfood_elated_global_options['sticky_texttransform'] !== '') {\n $sticky_menu_item_styles['text-transform'] = $superfood_elated_global_options['sticky_texttransform'];\n }\n if ($superfood_elated_global_options['sticky_fontstyle'] !== '') {\n $sticky_menu_item_styles['font-style'] = $superfood_elated_global_options['sticky_fontstyle'];\n }\n if ($superfood_elated_global_options['sticky_fontweight'] !== '') {\n $sticky_menu_item_styles['font-weight'] = $superfood_elated_global_options['sticky_fontweight'];\n }\n if ($superfood_elated_global_options['sticky_letterspacing'] !== '') {\n $sticky_menu_item_styles['letter-spacing'] = superfood_elated_filter_px($superfood_elated_global_options['sticky_letterspacing']) . 'px';\n }\n\n $sticky_menu_item_selector = array(\n '.eltdf-main-menu.eltdf-sticky-nav > ul > li > a'\n );\n\n echo superfood_elated_dynamic_css($sticky_menu_item_selector, $sticky_menu_item_styles);\n\n $sticky_menu_item_hover_styles = array();\n if ($superfood_elated_global_options['sticky_hovercolor'] !== '') {\n $sticky_menu_item_hover_styles['color'] = $superfood_elated_global_options['sticky_hovercolor'];\n }\n\n $sticky_menu_item_hover_selector = array(\n '.eltdf-main-menu.eltdf-sticky-nav > ul > li:hover > a',\n '.eltdf-main-menu.eltdf-sticky-nav > ul > li.eltdf-active-item > a'\n );\n\n echo superfood_elated_dynamic_css($sticky_menu_item_hover_selector, $sticky_menu_item_hover_styles);\n }",
"function wpex_sticky_header_style() {\n\n\t// Get default style from customizer\n\t$style = wpex_get_mod( 'fixed_header_style', 'standard' );\n\n\t// If disabled in Customizer but enabled in meta set to \"standard\" style\n\tif ( 'disabled' == $style && 'enable' == get_post_meta( wpex_get_current_post_id(), 'wpex_sticky_header', true ) ) {\n\t\t$style = 'standard';\n\t}\n\n\t// Sanitize\n\t$style = $style ? $style : 'standard';\n\n\t// Return style\n\treturn $style;\n\n}",
"function twentysixteen_header_style() {}",
"public function load_style() {\n\t\twp_add_inline_style( 'neve-style', '.fl-builder.bbhf-transparent-header:not(.bhf-sticky-header) #nv-beaver-header .fl-row-content-wrap{background-color:transparent;border:none;transition:background-color .3s ease-in-out}.fl-builder.bbhf-transparent-header .bhf-fixed-header:not(.bhf-fixed) .fl-row-content-wrap{background-color:transparent;border:none;transition:background-color .3s ease-in-out}.fl-builder.bbhf-transparent-header #nv-beaver-header{position:absolute;z-index:10;width:100%}' );\n\t}",
"public function customizer_styles() {\r\n\t\tnew Epsilon_Section_Styling( 'theme-css', 'stuff_frontpage_sections_', Stuff_Repeatable_Sections::get_instance() );\r\n\t}",
"function cp_sticky_header_background_color_css() {\n\n\t$color = get_theme_mod( 'sticky_header_background_color' );\n\n\tif ( ! $color ) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\t$php_colors = new APP_PHPColors( $color );\n\t} catch ( Exception $exc ) {\n\t\treturn;\n\t}\n\n\t$sep_color = new APP_PHPColors( $php_colors->darken( 5 ) );\n\n\t$sep_color->alpha = $php_colors->alpha;\n\n\t$css = \"\n\t\t/* ClassiPress Sticky Header Background Color */\n\t\t.sticky-header:not(.shrink_sticky_title_bar) #sticky_header.is-stuck #top-bar-primary,\n\t\t.sticky-header:not(.shrink_sticky_nav_bar) #sticky_header.is-stuck #top-bar-secondary,\n\t\t.sticky-header:not(.shrink_sticky_top_bar) #sticky_header.is-stuck #first-top-bar {\n\t\t\tbackground-color: {$color};\n\t\t}\n\t\t.sticky-header:not(.shrink_sticky_title_bar) #sticky_header.is-stuck #top-bar-primary {\n\t\t\tborder-bottom: 1px solid {$sep_color};\n\t\t}\n\t\";\n\n\t// Handle must match main theme stylesheet handle to work.\n\twp_add_inline_style( 'at-main', $css );\n}",
"function flow_elated_fixed_header_styles() {\n global $flow_elated_options;\n\n if($flow_elated_options['fixed_header_grid_background_color'] !== '') {\n\n $fixed_header_grid_background_color = $flow_elated_options['fixed_header_grid_background_color'];\n $fixed_header_grid_background_color_transparency = 1;\n\n if($flow_elated_options['fixed_header_grid_transparency'] !== '') {\n $fixed_header_grid_background_color_transparency = $flow_elated_options['fixed_header_grid_transparency'];\n }\n\n echo flow_elated_dynamic_css('.eltd-header-type1 .eltd-fixed-wrapper.fixed .eltd-grid .eltd-vertical-align-containers,\n .eltd-header-type3 .eltd-fixed-wrapper.fixed .eltd-grid .eltd-vertical-align-containers',\n array('background-color' => flow_elated_rgba_color($fixed_header_grid_background_color, $fixed_header_grid_background_color_transparency)));\n }\n\n if($flow_elated_options['fixed_header_background_color'] !== '') {\n\n $fixed_header_background_color = $flow_elated_options['fixed_header_background_color'];\n $fixed_header_background_color_transparency = 1;\n\n if($flow_elated_options['fixed_header_transparency'] !== '') {\n $fixed_header_background_color_transparency = $flow_elated_options['fixed_header_transparency'];\n }\n\n echo flow_elated_dynamic_css('.eltd-header-type1 .eltd-fixed-wrapper.fixed .eltd-menu-area,\n .eltd-header-type3 .eltd-fixed-wrapper.fixed .eltd-menu-area',\n array('background-color' => flow_elated_rgba_color($fixed_header_background_color, $fixed_header_background_color_transparency)));\n }\n\n }",
"function mixtape_qodef_fixed_header_styles() {\n global $mixtape_qodef_options;\n\n if($mixtape_qodef_options['fixed_header_grid_background_color'] !== '') {\n\n $fixed_header_grid_background_color = $mixtape_qodef_options['fixed_header_grid_background_color'];\n $fixed_header_grid_background_color_transparency = 1;\n\n if($mixtape_qodef_options['fixed_header_grid_transparency'] !== '') {\n $fixed_header_grid_background_color_transparency = $mixtape_qodef_options['fixed_header_grid_transparency'];\n }\n\n echo mixtape_qodef_dynamic_css('.qodef-header-type1 .qodef-fixed-wrapper.fixed .qodef-grid .qodef-vertical-align-containers,\n .qodef-header-type3 .qodef-fixed-wrapper.fixed .qodef-grid .qodef-vertical-align-containers',\n array('background-color' => mixtape_qodef_rgba_color($fixed_header_grid_background_color, $fixed_header_grid_background_color_transparency)));\n }\n\n if($mixtape_qodef_options['fixed_header_background_color'] !== '') {\n\n $fixed_header_background_color = $mixtape_qodef_options['fixed_header_background_color'];\n $fixed_header_background_color_transparency = 1;\n\n if($mixtape_qodef_options['fixed_header_transparency'] !== '') {\n $fixed_header_background_color_transparency = $mixtape_qodef_options['fixed_header_transparency'];\n }\n\n echo mixtape_qodef_dynamic_css('.qodef-header-type1 .qodef-fixed-wrapper.fixed .qodef-menu-area,\n .qodef-header-type3 .qodef-fixed-wrapper.fixed .qodef-menu-area',\n array('background-color' => mixtape_qodef_rgba_color($fixed_header_background_color, $fixed_header_background_color_transparency)));\n }\n\n }",
"function moments_qodef_fixed_header_styles() {\n\n if(moments_qodef_options()->getOptionValue('fixed_header_grid_background_color') !== '') {\n\n $fixed_header_grid_background_color = moments_qodef_options()->getOptionValue('fixed_header_grid_background_color');\n $fixed_header_grid_background_color_transparency = 1;\n\n if(moments_qodef_options()->getOptionValue('fixed_header_grid_transparency') !== '') {\n $fixed_header_grid_background_color_transparency = moments_qodef_options()->getOptionValue('fixed_header_grid_transparency');\n }\n\n echo moments_qodef_dynamic_css('.qodef-fixed-wrapper.fixed .qodef-grid .qodef-vertical-align-containers,\n .qodef-fixed-wrapper.fixed .qodef-grid .qodef-vertical-align-containers',\n array('background-color' => moments_qodef_rgba_color($fixed_header_grid_background_color, $fixed_header_grid_background_color_transparency)));\n }\n\n if(moments_qodef_options()->getOptionValue('fixed_header_background_color') !== '') {\n\n $fixed_header_background_color = moments_qodef_options()->getOptionValue('fixed_header_background_color');\n $fixed_header_background_color_transparency = 1;\n\n if(moments_qodef_options()->getOptionValue('fixed_header_transparency') !== '') {\n $fixed_header_background_color_transparency = moments_qodef_options()->getOptionValue('fixed_header_transparency');\n }\n\n echo moments_qodef_dynamic_css('.qodef-fixed-wrapper.fixed .qodef-menu-area,\n .qodef-fixed-wrapper.fixed .qodef-menu-area',\n array('background-color' => moments_qodef_rgba_color($fixed_header_background_color, $fixed_header_background_color_transparency)));\n }\n\n }",
"function pxlz_edgtf_footer_top_general_styles() {\n $item_styles = array();\n $background_color = pxlz_edgtf_options()->getOptionValue('footer_top_background_color');\n\n if (!empty($background_color)) {\n $item_styles['background-color'] = $background_color;\n }\n\n echo pxlz_edgtf_dynamic_css('.edgtf-page-footer .edgtf-footer-top-holder', $item_styles);\n }",
"public function customizer_styles() {\r\n\t\t//new Epsilon_Section_Styling( 'unapp-main', 'unapp_frontpage_sections_', Unapp_Repeatable_Sections::get_instance() );\r\n\t}",
"public function headStyle($content = NULL, $placement = 'APPEND', $attributes = array());",
"function flow_elated_get_sticky_header() {\n\n $parameters = array(\n 'hide_logo' => flow_elated_options()->getOptionValue('hide_logo') == 'yes' ? true : false,\n 'sticky_header_in_grid' => flow_elated_options()->getOptionValue('sticky_header_in_grid') == 'yes' ? true : false\n );\n\n flow_elated_get_module_template_part('templates/behaviors/sticky-header', 'header', '', $parameters);\n }",
"protected function generateCSS() {}",
"protected function setupStyles()\n {\n $style = new OutputFormatterStyle('yellow', 'black', ['bold']);\n $this->output->getFormatter()->setStyle('important', $style);\n\n $style = new OutputFormatterStyle('cyan', 'black', ['bold']);\n $this->output->getFormatter()->setStyle('code', $style);\n }",
"function klippe_mikado_footer_top_general_styles() {\n\t\t$item_styles = array();\n\t\t$background_color = klippe_mikado_options()->getOptionValue( 'footer_top_background_color' );\n\t\t\n\t\tif ( ! empty( $background_color ) ) {\n\t\t\t$item_styles['background-color'] = $background_color;\n\t\t}\n\t\t\n\t\techo klippe_mikado_dynamic_css( '.mkdf-page-footer .mkdf-footer-top-holder', $item_styles );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the key parameter keyword for the given controller type. | public static function getKeyParamKeyword($controller)
{
if ( $controller == self::ACT_CONTROLLER )
{
return self::ACT_KEY_PARAM;
}
else if ( $controller == self::DOC_CONTROLLER )
{
return self::DOC_KEY_PARAM;
}
else if ( self::isASettingController($controller) )
{
return self::SETTING_PARAM;
}
return "";
} | [
"public function getRouteParamKeyForType($type)\n {\n switch ($type) {\n case 'busReg':\n return 'busRegId';\n case 'irfoOrganisation':\n return 'organisation';\n case 'irhpApplication':\n return 'irhpAppId';\n default:\n return $type;\n }\n }",
"protected function getParamKeyName()\n {\n $result = \"query\";\n if($this->type == self::TYPE_POST)\n {\n $result = \"body\";\n }\n\n return $result;\n }",
"public function getControllerKeyword()\n {\n $mvcArray = $this->getMVCKeyword();\n if (isset($mvcArray['controller']) && !is_null($mvcArray)) {\n return $mvcArray['controller'];\n }\n return 'controller'; \n }",
"function getTypeKey() {\n $type = $this->getType();\n\t\t$typeMap =& $this->getTypeMap();\n\t\treturn $typeMap[$type];\n\t}",
"public function getApiTypeKey(): string;",
"public function getControllerExtensionKey() {}",
"public function getKeyByParams()\n {\n }",
"public function getKeys($type)\n {\n switch ($type) {\n case 'campaign':\n return $this->keysCampaign;\n break;\n\n case 'ads':\n return $this->keysAds;\n break;\n\n case 'group-report':\n return $this->keysGroup;\n break;\n }\n }",
"public function keyType(): ?string;",
"public function getControllerExtensionKey()\n {\n return \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::camelCaseToLowerCaseUnderscored($this->controllerExtensionName);\n }",
"private function typePK() {\n return constant($this->getClass() . '::KEY_TYPE');\n }",
"public function getControllerKey()\n {\n return $this->controllerKey;\n }",
"public function getControllerKey()\n {\n return $this->_controllerKey;\n }",
"private function typePK()\n {\n return constant($this->getClass() . '::KEY_TYPE');\n }",
"public function loadKey($type);",
"function meta_key( string $key, string $type ) {\n\n\t$prefixes = [\n\t\t'post_type' => get_post_type_meta_prefix(),\n\t\t'taxonomy' => get_taxonomy_meta_prefix()\n\t];\n\n\t$prefix = $prefixes[ $type ];\n\t$key = preg_replace( '/^' . preg_quote( $prefix, '/' ) . '/', '', $key );\n\treturn $prefix . $key;\n}",
"public function getKey() {\n $classParts = explode(\"\\\\\", get_class($this));\n $clazz = end($classParts);\n\n preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $clazz, $matches);\n $ret = $matches[ 0 ];\n\n foreach ($ret as &$match) {\n $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match);\n }\n\n return implode('_', $ret);\n }",
"protected function key_field() {\n $info = i18n_object_info($this->type);\n return $info['key']; \n }",
"protected function getSessionKey($type = null)\n {\n return $this->context\n . ($this->contextSub ? '[' . $this->contextSub . ']' : null)\n . ($type ? ':' . $type : null);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the specified MachineIde. | public function show($id)
{
$machineIde = $this->machineIdeRepository->findWithoutFail($id);
if (empty($machineIde)) {
Flash::error('没有找到该机器');
return redirect(route('machineIdes.index'));
}
return view('admin.machine_ides.show')->with('machineIde', $machineIde);
} | [
"static function showForVirtualMachine(Computer $comp) {\n\n $ID = $comp->fields['id'];\n\n if (!$comp->getFromDB($ID) || !$comp->can($ID, READ)) {\n return;\n }\n\n echo \"<div class='center'>\";\n\n if (isset($comp->fields['uuid']) && ($comp->fields['uuid'] != '')) {\n $hosts = getAllDataFromTable(\n self::getTable(), [\n 'RAW' => [\n 'LOWER(uuid)' => self::getUUIDRestrictCriteria($comp->fields['uuid'])\n ]\n ]\n );\n\n if (!empty($hosts)) {\n echo \"<table class='tab_cadre_fixehov'>\";\n echo \"<tr class='noHover'><th colspan='2' >\".__('List of virtualized environments').\"</th></tr>\";\n\n $header = \"<tr><th>\".__('Name').\"</th>\";\n $header .= \"<th>\".__('Entity').\"</th>\";\n $header .= \"</tr>\";\n echo $header;\n\n $computer = new Computer();\n foreach ($hosts as $host) {\n\n echo \"<tr class='tab_bg_2'>\";\n echo \"<td>\";\n if ($computer->can($host['computers_id'], READ)) {\n echo \"<a href='\".Computer::getFormURLWithID($computer->fields['id']).\"'>\";\n echo $computer->fields['name'].\"</a>\";\n $tooltip = \"<table><tr><td>\".__('Name').\"</td><td>\".$computer->fields['name'].\n '</td></tr>';\n $tooltip.= \"<tr><td>\".__('Serial number').\"</td><td>\".$computer->fields['serial'].\n '</td></tr>';\n $tooltip.= \"<tr><td>\".__('Comments').\"</td><td>\".$computer->fields['comment'].\n '</td></tr></table>';\n echo \" \".Html::showToolTip($tooltip, ['display' => false]);\n\n } else {\n echo $computer->fields['name'];\n }\n echo \"</td>\";\n echo \"<td>\";\n echo Dropdown::getDropdownName('glpi_entities', $computer->fields['entities_id']);\n echo \"</td></tr>\";\n\n }\n echo $header;\n echo \"</table>\";\n }\n }\n echo \"</div>\";\n if (!empty($hosts)) {\n echo \"<br>\";\n }\n\n }",
"public function displayEntityBrowser();",
"public function showGuestView(){\n\n $this->guestView->exampleSubmitUml();\n try{\n if($this->guestView->userSubmitUml()){\n $this->guestView->handleInput();\n }\n }\n catch(UmlStringToShortException $e){\n $this->guestView->umlToShortMSG();\n }\n catch(NoHTMLAllowedException $e){\n $this->guestView->noHTMLMSG();\n }\n return $this->guestView->show() ;\n }",
"function view($machineId = NULL)\n\t{\n\n\t\tif($machineId == NULL) show_error(\"You cannot access this page directly\");\n\n\t\t$m = new Machine();\n\t\t$m->include_related('status',array('name'));\n\t\t$m->include_related('machinemodel',array('name'));\n\t\t$m->get_by_id($machineId);\n\n\t\tif(!$m->exists()) show_error('The machine you are trying to view does not exist');\n\n\t\t$data['machines'] = $m;\n\t\t$data['title'] = 'Machine';\n\t\t$this->load->view('machines/view',$data); // This is the details view\n\t}",
"public function show()\n\t{\n\t\t$data = $this->workModel->find($this->id);\n\t\tif (empty($data)) {\n\t\t\texit('Work not found!');\n\t\t}\n\t\t$this->_view('show.php', ['work' => $data]);\n\t}",
"public function display()\n {\n $this->mode->display();\n }",
"public function showUi();",
"public function visualize(StateMachine $machine);",
"public function showAction(Expert $expert)\n {\n\n\n return $this->render('BoosterBundle:expert:show.html.twig', array(\n 'expert' => $expert,\n\n ));\n }",
"function actionShowHelpSelection() {\n\t $this->getInputManager()->setLookupGlobals(utilityInputManager::LOOKUPGLOBALS_GET);\n\t $data = $this->getInputManager()->doFilter();\n\n\t $this->addInputToModel($data, $this->getModel());\n\t \n\t $oView = new helpPagesView($this);\n\t $oView->showHelpContentsSelection();\n }",
"abstract function display();",
"function showEditor($msg = null)\r\n {\r\n $ID = getUserField('id');\r\n\r\n if ($ID)\r\n {\r\n $ItSystem = new ITSystem($ID);\r\n $data = array_merge(array(), $ItSystem);\r\n }\r\n\r\n $data['customer_list'] = getCustomerList();\r\n $data['category_list'] = getCategoryList(IT_PART);\r\n $data['status_list'] = getEnumFieldValues(IT_SYSTEM_TBL, 'status');\r\n $data['user_list'] = getUserList();\r\n $data['os_list'] = getDropDownList(OS);\r\n\r\n //dumpvar($data);\r\n\r\n $data['message'] = $msg;\r\n\r\n return createPage(IT_SYS_MNG_EDITOR_TEMPLATE, $data);\r\n }",
"public function showCommand($preset)\n {\n $presetSettings = $this->loadPreset($preset);\n array_walk($presetSettings['parts'], function ($partSetting, $partName) use ($preset) {\n $this->outputLine();\n $this->outputPartTitle($partSetting, $partName);\n });\n }",
"public function show() {\n $this->render('project_show');\n }",
"public static function show(){\n if(EB_DEBUG_TO_SCREEN && !empty($GLOBALS['debug'])){\n echo join('<br/>',$GLOBALS['debug']);\n }\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('DPMachineBundle:Machine')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Machine entity.');\n }\n\n $editForm = $this->createForm(new EditMachineType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('DPMachineBundle:Machine:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"function VM_GUIstepSelectHost($VM_software)\n{\n\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n\t//Preset values for making screenshots\n\tif ($_GET['screenshot'] == 1)\n\t{\n\t\t$_POST['SEL_vmHost'] = \"localhost\";\n\t}\n\n\n\t//Make sure the creation step is set in the session variable\n\tif (!isset($_SESSION['VM_createStep']))\n\t\t$_SESSION['VM_createStep'] = VM_stepSelectHost;\n\n\t//Get the list of all VM hosts with the chosen VM software\n\t$vmHosts = VM_getAllVMHosts($VM_software);\n\t$vmHost = HTML_selection(\"SEL_vmHost\",$vmHosts,SELTYPE_selection,true,$_SESSION['VM_host']);\n\n\tif (HTML_submit(\"BUT_selectHost\",$I18N_select))\n\t{\n\t\t$_SESSION['VM_host'] = $vmHost;\n\t\t$_SESSION['VM_createStep'] = VM_stepCheckHost;\n\t\t$_SESSION['VM_software'] = $VM_software;\n\t}\n\n\t//Draw it\n\techo('\n\t<tr>\n\t\t<td>'.$I18N_vmHost.' '.SEL_vmHost.'</td>\n\t\t<td align=\"right\">'.BUT_selectHost.'</td>\n\t</tr>');\n}",
"public function show(int $machineId): View\n {\n // Return HTTP 404 if no machine is found\n $machine = Machine::findOrFail((int) $machineId);\n\n return view('opnotes.opnote_show', [\n 'machine' => $machine,\n 'opNotes' => $machine->opnote,\n ]);\n }",
"function infoScreenObject()\n\t{\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreen();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Perform an action on an item. | function itemAction(ItemActionSelector $action); | [
"protected function itemAction($user_id, $item_id, $action) {\n $this->apiCall('actions/u2i.json', 'POST', array('pio_uid' => $user_id, 'pio_iid' => $item_id, 'pio_action' => $action));\n }",
"public function process($item);",
"public function processItem(): void;",
"protected function executeCurrentItem() : void\n {\n $item = $this->getSelectedItem();\n\n if ($item->canSelect()) {\n $callable = $item->getSelectAction();\n if ($callable) {\n $callable($this);\n }\n }\n }",
"abstract function process_item( $item );",
"public function buildItemActions();",
"public function applying_an_action_to_the_item_in_a_non_commercial_cart_is_ineffective()\n {\n $cart = $this->initCart()->useForCommercial(false);\n $item = $cart->addItem([\n 'id' => 123,\n 'title' => 'Example title',\n ]);\n\n $this->assertEquals(0, $item->countActions());\n\n $action = $item->applyAction([\n 'id' => 1,\n 'title' => 'Demo action',\n ]);\n\n $this->assertEquals(null, $action);\n $this->assertEquals(0, $item->countActions());\n }",
"public function perform()\n {\n foreach ($this->actions as $action) {\n $action->perform();\n }\n }",
"protected function setItemsAction(): void\n {\n foreach ($this->menuItems as $item) {\n // hack - render executor action via MenuItem::on() into container\n $item['item']->on('click.atk_crud_item', $item['executor']);\n $jsAction = array_pop($item['item']->_jsActions['click.atk_crud_item']);\n $this->container->js(true, $jsAction);\n }\n }",
"protected function setItemsAction()\n {\n foreach ($this->menuItems as $k => $item) {\n $this->container->js(true, $item['item']->on('click.atk_crud_item', $item['action']));\n }\n }",
"public function execute()\r\n {\r\n $method = $this->_action;\r\n $this->$method();\r\n }",
"function execute()\r\n\t\t{\r\n\t\t\tforeach($this->data as $actionType => $action)\r\n\t\t\t{\r\n\t\t\t\tif(isset($actionType)) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tswitch($actionType)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcase \"destroy\":\r\n\t\t\t\t\t\t\t\t$this->remove($action);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}catch(Exception $e) {\r\n\t\t\t\t\t\tdump('item module error', 'item module error');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"public function callAction()\n\t{\n\t\t$class = $this->module;\n\t\t\n\t\t$object = new $class();\n\n\t\tEvent::emit(Event::PRE_DISPATCH);\n\t\t\n\t\tcall_user_func(array($object, $this->action));\n\n\t\tEvent::emit(Event::POST_DISPATCH);\n\t}",
"abstract protected function applyChanges( Item $item );",
"public function executeAction();",
"abstract protected function process_item( $item, $job );",
"protected function callActionMethod() {}",
"function doAction() {\n\n\t\t$objId = \\Scrivo\\Request::post(\n\t\t\t\"itemId\", \\Scrivo\\Request::TYPE_INTEGER);\n\n\t\ttry {\n\t\t\t$obj = \\Scrivo\\Page::fetch($this->context, $objId);\n\t\t} catch (\\Exception $e) {\n\t\t\t$obj = \\Scrivo\\Asset::fetch($this->context, $objId);\n\t\t}\n\n\t\t// Convert the array with role ids.\n\t\t$rls = array();\n\t\tforeach (\\Scrivo\\Request::post(\n\t\t\t\t\"roles\", \\Scrivo\\Request::TYPE_INTEGER) as $id) {\n\t\t\t$r = new \\stdClass;\n\t\t\t$r->id = intval($id);\n\t\t\t$rls[] = $r;\n\t\t}\n\n\t\t// Set the roles for the object.\n\t\t\\Scrivo\\ObjectRole::set($this->context, $obj->id, $rls);\n\n\t\t$this->setResult(self::SUCCESS);\n\t}",
"function MouseClicked($item){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getter method. Duration for which the saved state information is considered valid. After this period has elapsed the state will be returned to the default. This option is also used to indicate to DataTables if localStorage or sessionStorage should be used for storing the table's state. When set to 1 sessionStorage will be used, while for 0 or greater localStorage will be used. The difference between the two storage APIs is that sessionStorage retains data only for the current session (i..e the current browser window). For more information on these two HTML APIs please refer to the Mozilla Storage documentation. Please note that the value is given in seconds. The value 0 is a special value as it indicates that the state can be stored and retrieved indefinitely with no time limit. | public function getStateDuration(): int {
return (int)$this->_getConfig('stateDuration');
} | [
"protected function saveStateTime() {\n $this->_save($this->aConfig['state_time_storage'], array(\n $this->tStateStart, $this->tStateEnd,\n $this->nStateTimeout, $this->tStateRun, $this->tStateStop\n ));\n }",
"public function getStoredState();",
"protected function loadState()\n {\n if (Session::has($this->sessionPrefix . 'state'))\n {\n $this->state = Session::get($this->sessionPrefix . 'state');\n\n return $this->state;\n }\n\n return null;\n }",
"public function getStoreState()\n {\n return $this->store_state;\n }",
"protected function getRememberLifetime()\n\t{\n\t\tif (!$this->isActivated())\n\t\t\treturn 0;\n\n\t\treturn ((int) $this->getPolicy('STORE_TIMEOUT')) * 60;\n\t}",
"public function getStoreTtl();",
"function GetState()\n {\n \n $cache_id = 'game_current_state';\n try\n {\n if ($cache = $GLOBALS['Cache']->GetFromCache($cache_id, $Seconds=(60*60*1), $IsObject=true)) {\n return $cache;\n }\n }\n catch (Exception $e)\n {\n // cache file was empty (0 bytes)\n return null;\n }\n \n $sql = \"SELECT * FROM game WHERE current='1'\";\n $results = $GLOBALS['Db']->GetRecords($sql);\n \n $return = null;\n if (is_array($results) && count($results) > 0)\n {\n $return = $results[0];\n }\n else\n {\n $return = array();\n }\n\n $GLOBALS['Cache']->WriteToCache($cache_id, $return);\n return $return;\n \n }",
"public function getStateTime()\n {\n return $this->state_time;\n }",
"public function getState()\n {\n $state = $this->getData('state');\n if ($state === null) {\n \\Magento\\Framework\\Profiler::start(__METHOD__);\n $state = $this->_layerStateFactory->create();\n $this->setData('state', $state);\n \\Magento\\Framework\\Profiler::stop(__METHOD__);\n }\n\n return $state;\n }",
"private function persistState() {\n\t\t$session = Environment::getSession(\"insertingBook\");\n\t\t$session->setExpiration(1800); // 30 minutes\n\t\t$session[\"state\"] = $this->state;\n\t}",
"public function getRememberDuration(): int\n {\n return $this->rememberDuration;\n }",
"public function getStateTime();",
"protected function _stateTable()\n {\n return $this->_stateTable;\n }",
"private function getSessionStorage(): Storage\n {\n /** @var Storage $storage */\n $storage = $this->storage;\n return $storage;\n }",
"public function getLifeTime()\n {\n if (is_null($this->_lifeTime)) {\n $configNode = Mage::app()->getStore()->isAdmin() ?\n 'admin/security/session_cookie_lifetime' : 'web/cookie/cookie_lifetime';\n $this->_lifeTime = (int) Mage::getStoreConfig($configNode);\n\n if ($this->_lifeTime < 60) {\n $this->_lifeTime = ini_get('session.gc_maxlifetime');\n }\n\n if ($this->_lifeTime < 60) {\n $this->_lifeTime = 3600; //one hour\n }\n\n if ($this->_lifeTime > self::SEESION_MAX_COOKIE_LIFETIME) {\n $this->_lifeTime = self::SEESION_MAX_COOKIE_LIFETIME; // 100 years\n }\n }\n return $this->_lifeTime;\n }",
"public function getState();",
"public function getStateReaderTimeout(): int;",
"public function getTimeout()\n {\n return $this->storage->getTimeout();\n }",
"public function getDsState()\n {\n return $this->ds_state;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: create Insert a new entry to the database Parameters: attrs (Array) A key value array of the information to be stored Returns: A key value array of the saved item, plus the unique id | public function create(Array $attrs) {
foreach ($attrs as $key => $value) {
$attrs[$key] = strip_tags($value);
}
$sql = "INSERT INTO $this->model ";
$sql .= '(' . implode(', ', array_keys($attrs)) . ') ';
$sql .= 'VALUES (' . implode(',', array_fill(0, count($attrs), '?')) . ')';
try {
$sth = $this->db->prepare($sql);
$sth->execute(array_values($attrs));
} catch (PDOException $e) {
error_log($e->getMessage());
return false;
}
$attrs['id'] = $this->db->lastInsertId();
return $attrs;
} | [
"function insert_set_attrs( $attrs )\n\t{\n\t\t$res = $this->db->insert_batch( 'mb_set_attributes', $attrs );\n\n\t\tif ( $res )\n\t\t{\n\t\t\treturn $this->db->insert_id();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"private static function insert_row($table, $attributes){\n\t\t\t$query = \"INSERT INTO \" . $table . \" (\";\n\t\t\tforeach($attributes as $key => $value){\n\t\t\t\t$query .= ($key . \",\");\n\t\t\t}\n\t\t\t$query = (substr($query, 0, -1) . \") VALUES (\");\n\t\t\tforeach($attributes as $key => $value){\n\t\t\t\t$query .= (\":\" . $key . \",\");\n\t\t\t}\n\t\t\t$query = (substr($query, 0, -1) . \")\");\n\n\t\t\t$connection = Utils::db_connection();\n\t\t\t$q = $connection->prepare($query);\n\t\t\t$q->execute($attributes);\n\n\t\t\treturn $connection->lastInsertId();\n\t\t}",
"private function create ()\r\n {\r\n // dropping all relations\r\n $this->dropAllRelations ();\r\n // building a insert query\r\n $class = get_called_class ();\r\n $_table = $class::$_table;\r\n $_pk = $class::$_pk;\r\n //$q = 'INSERT INTO '.$class::$_table.' (';\r\n $q = 'INSERT INTO '.$_table.' (';\r\n \r\n // if we did not specify id, it is specified as it is\r\n //if (!isset ($this->_attributes[$class::$_pk]))\r\n if (!isset ($this->_attributes[$_pk]))\r\n $this->_attributes[$_pk] = 0;\r\n \r\n // getting collumns\r\n $notFirst = false;\r\n foreach ($this->_attributes as $key => $val)\r\n if ($notFirst)\r\n $q .= ', '.$key;\r\n else\r\n {\r\n $q .= $key;\r\n $notFirst = true;\r\n }\r\n \r\n $q .= ') VALUES (';\r\n // getting values\r\n $notFirst = false;\r\n foreach ($this->_attributes as $val)\r\n if ($notFirst)\r\n {\r\n if (is_string ($val))\r\n $q .= ', \\''.$val.'\\'';\r\n else if ($val === null)\r\n $q .= ', NULL';\r\n else\r\n $q .= ', '.$val;\r\n }\r\n else\r\n {\r\n if (is_string ($val))\r\n $q .= '\\''.$val.'\\'';\r\n else if ($val === null)\r\n $q .= 'NULL';\r\n else\r\n $q .= $val;\r\n $notFirst = true;\r\n }\r\n \r\n $q .= ');';\r\n // executting it\r\n System::doMysql ($q);\r\n // storing id\r\n $this->_attributes[ActiveRecord::$_pk] = System::lastInsertId ();\r\n // making it old\r\n $this->_old = true;\r\n $this->eraseEdited ();\r\n }",
"function preparedCreate(){\n $obj_attributes_array = $this->attributes();\n\t\t\t$obj_attributes_array_keys = array_keys($obj_attributes_array);\n\t\t\t$sql = \"INSERT INTO \".static::$table_name;\n\t\t\t$sql .= \" (\".join(',',$obj_attributes_array_keys).\") \";\n\t\t\t$sql .= \"VALUES (:\".join(\",:\",$obj_attributes_array_keys).\")\";\n\t\t\t// echo $sql;\n $statement = $this->connection->prepare($sql);\n $statement->execute($obj_attributes_array);\n }",
"function as_new_attendant(){\n\t\t$database = new As_Dbconn();\t\t\t\n\t\t$New_Item_Details = array(\n\t\t\t'attendant_fullname' => trim($_POST['fullname']),\n\t\t\t'attendant_email' => trim($_POST['email']),\n\t\t\t'attendant_mobile' => as_slug_this($_POST['mobile']),\n\t\t\t'attendant_address' => trim($_POST['address']),\n\t\t\t'attendant_joined' => date('Y-m-d H:i:s'),\n\t\t);\n\t\t\t\n\t\t$add_query = $database->as_insert( 'as_attendant', $New_Item_Details ); \n\t}",
"function action_create()\n\t{\n\t\tlog_debug(\"attributes\", \"Executing action_create()\");\n\n\t\t// create a new attribute\n\t\t$sql_obj\t\t= New sql_query;\n\t\t$sql_obj->string\t= \"INSERT INTO `attributes` ( id, type, id_owner, id_group, `key`, value) \n\t\t\t\t\t\tVALUES ('\". $this->id .\"', '\". $this->type .\"', '\". $this->id_owner .\"', '\". $this->id_group . \"', '\". $this->data[\"key\"]. \"', '\". $this->data[\"value\"]. \"')\";\n\t\t$sql_obj->execute();\n\n\t\t$this->id = $sql_obj->fetch_insert_id();\n\n//\t\treturn $this->id; \n\t\treturn 1;\n\n\t}",
"public function createItem()\n {\n $pdo = DBConfig::openConnection();\n $query = $pdo->prepare('INSERT INTO Items (classID, name, imgURL, Description, userID, note)\n VALUES (:classID, :name, :imgURL, :Description, :userID, :note)');\n $query->bindValue(':classID', $this->classID, PDO::PARAM_STR);\n $query->bindValue(':name', $this->name, PDO::PARAM_STR);\n $query->bindValue(':imgURL', $this->imgURL, PDO::PARAM_STR);\n $query->bindValue(':Description', $this->Description, PDO::PARAM_STR);\n $query->bindValue(':userID', $this->userID, PDO::PARAM_STR);\n $query->bindValue(':note', $this->note, PDO::PARAM_STR);\n $query->execute();\n $query->CloseCursor();\n DBConfig::closeConnection($pdo);\n }",
"protected function _create()\n {\n $data = $this->_getData();\n if(!empty($data)) {\n try {\n $sql = 'INSERT INTO' . ' ' . $this->_getTableName() . '(' . implode(', ', array_keys($data)) . ') '\n . 'VALUES(' . implode(',', array_fill(0, count($data), '?')) . ')';\n\n if($this->_execute($sql, array_values($data))) {\n $this->_setId($this->_conn->lastInsertId());\n }\n } catch (\\PDOException $e) {\n echo $e->getMessage();\n }\n }\n }",
"public function createDatabaseEntry() {\n $data[static::$primaryKey] = $this->getPrimaryKey();\n foreach (static::$columns as $column) {\n if (isset($this->$column)) {\n $data[$column] = $this->$column;\n }\n }\n $data = array_merge($data, [static::$created => date('Y-m-d H:i:s')]);\n \n $qb = QueryBuilder::table(static::$table)\n ->values($data);\n $qb->insert();\n\n if ($qb->getMysqli()->error) {\n return $qb->getMysqli()->error;\n } else {\n return true;\n }\n }",
"public function create(Array $items){\n $title = (isset($items[\"title\"]) ? $items[\"title\"] : \"New ToDo Item\");\n $text = (isset($items[\"text\"]) ? $items[\"text\"] : \"\");\n $timestamp = (isset($items[\"timestamp\"]) ? $items[\"timestamp\"] : time() + (7 * 24 * 60 * 60));\n if ($this->pdo->table($this->dbtable)->insert([\n 'title'=>$title,\n 'text'=>$text,\n 'deadline'=>$timestamp,\n 'status'=>0\n ])) {\n return $this->pdo->insertId();\n }else{\n return 0;\n }\n }",
"public function addForceInsert($attrs)\n {\n if (!is_array($attrs))\n $attrs = func_get_args();\n\n foreach ($attrs as $attr)\n if (array_key_exists($attr, $this->m_attrs))\n $this->m_attrs[$attr][\"forceInsert\"] = true;\n }",
"public function insert () {\n\t\t$newRecord = ORM::for_table(self::CLIPS_TABLE)->create();\n\t\t$newRecord->description = $this->description;\n\t\t$newRecord->performer = $this->performer;\n\t\t$newRecord->event = $this->event;\n\t\t$newRecord->year = $this->year;\n\t\t$newRecord->url = $this->url;\n//\t\t$insstmt = \"INSERT INTO CLIPS (DESCRIPTION, URL) VALUES ($dsc, $url)\";\n\t\t$newRecord->save();\n\t\t$this->id = $newRecord->id();\n\t\treturn $newRecord->id();\n\t}",
"public function create($pid, $attrs = [])\n {\n $table = $this->getTable();\n\n $newUid = 'NEW_' . uniqid($table);\n\n $this->dh->stripslashes_values = 0;\n $this->dh->start([\n $table => [\n $newUid => array_merge($attrs, ['pid' => $pid])\n ]\n ], null);\n $this->dh->process_datamap();\n\n if (isset($this->dh->substNEWwithIDs[$newUid])) {\n return $this->dh->substNEWwithIDs[$newUid];\n } else {\n return null;\n }\n }",
"public function insert () {\n\t\t$recToInsert = ORM::for_table(self::SONG_TABLE)->create();\n\t\t$recToInsert->title = $this->title;\n\t\t$recToInsert->note = $this->note;\n\t\t$GLOBALS[\"logger\"]->debug (\"Inserting song with title \" . $this->title);\n//\t\t$insstmt = \"INSERT INTO SONGS (TITLE, NOTE) VALUES ($ttl, $nte)\";\n\t\t$recToInsert->save();\n\t\t$this->id = $recToInsert->id();\n\t\treturn $recToInsert->id();\n\t}",
"function save($table,$attributes,$values){\n\tfor($i=0;$i<count($values);$i++){\n\t\t$values[$i] = \"'\".$values[$i].\"'\";\n\t}\n\t\n\t$this->Connect();\t\n\tif(count($attributes)==count($values)){\n\t\t$this->SQLStatement = \"INSERT INTO \".$table.\" (\".implode(',',$attributes).\") VALUES (\".implode(',',$values).\")\";\n\t\t$results = mysql_query($this->SQLStatement);\n\t}\n\t$this->Disconnect();\n\t\n\treturn $results;\n}",
"function create($item) {\n\t\t//@todo change this to func_get_args ?\n\t\tif($this->_buildOptions['fixFields']) {\n\t\t\t$item = $this->fixFields($item);\n\t\t}\n\t\tif($this->lib('databases/Query')->insert($item)->into($this->tableName)->go()) {\n\t\t\tif(!is_array($item)) {\n\t\t\t\t$item = (array)$item;\n\t\t\t}\n\t\t\t$item[$this->pk] = $this->libs->Query->getLastInsert();\n\t\t\treturn new SweetRow($this, $item);\n\t\t}\n\t\treturn false;\n\t}",
"function insert_item($data){\n return $this->db->insert('t_model', $data);\n }",
"public function insert() {\n\n\t\t//Get the primary key\n\t\t$primary = static::$_primary_key;\n\n\t\t//Convert the object to an array\n\t\t$data = $this->toArray();\n\n\t\t//Define the arrya to hold the parameters\n\t\t$params = array();\n\n\t\t//Remove the primary key\n\t\tunset($data[$primary]);\n\n\t\t//Add the params\n\t\tforeach($data as $field => $value) {\n\n\t\t\t//If it's the primary key or it has no value, unset the field\n\t\t\tif($field == $primary || empty($value)) {\n\t\t\t\tunset($data[$field]);\n\t\t\t} else {\n\t\t\t\t$params[] = $value;\n\t\t\t}\n\n\t\t}\n\n\t\t//Build the SQL\n\t\t$statement = $this->_db->prepare(\"\n\t\t\tINSERT INTO `\" . static::$_table . \"`\n\t\t\t\t(`\" . implode('`, `', array_keys($data)) . \"`)\n\t\t\tVALUES\n\t\t\t\t(\" . rtrim(str_repeat('?, ', count($params)), ', ') . \")\n\t\t\");\n\n\t\t//Run the insert\n\t\t$statement->execute($params);\n\n\t\t//Set the primary key to be the insert id\n\t\t$this->$primary = $this->_db->lastInsertId();\n\n\t}",
"public function insert() {\n $this->exclude('id'); // exclude primary key \n \n // default values\n $this->fields['created_date'] = Ediary_Db::today();\n $this->fields['created_time'] = Ediary_Db::now();\n $this->fields['saved_at'] = Ediary_Db::datetime();\n \n // Insert into DB\n $result = parent::insertRow($this->getDb()->diarys);\n \n // Reset fields\n $this->fields['id'] = self::getDb()->lastInsertId();\n $this->fields = array_merge($this->fields, $this->newFields);\n $this->newFields = array();\n \n return $result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the JavaScript resource(s) specified by $urls. Resource will be loaded asynchronously by default. | public function loadJavaScriptResource($urls, array $options = array('async' => true)) {
return parent::loadJavaScriptResource($urls, $options);
} | [
"protected function loadJavascript() {}",
"private function loadResources()\n {\n $resources = '<link rel=\"stylesheet\" type=\"text/css\" href=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Css/Main.css\" />';\n $resources .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/toastr/build/toastr.min.css\" />';\n $resources .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/alertify.js/src/css/alertify.css\" />';\n $resources .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/lity/dist/lity.min.css\" />';\n $resources .= '<script src=\"typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery/jquery-' .\n PageRenderer::JQUERY_VERSION_LATEST . '.min.js\" type=\"text/javascript\"></script>';\n $resources .= '<script type=\"text/javascript\" src=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/ckeditor/ckeditor.js\"></script>';\n $resources .= '<script type=\"text/javascript\" src=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/ckeditor/adapters/jquery.js\"></script>';\n $resources .= '<script type=\"text/javascript\" src=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/toastr/build/toastr.min.js\"></script>';\n $resources .= '<script type=\"text/javascript\" src=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/immutable/dist/immutable.min.js\"></script>';\n $resources .= '<script type=\"text/javascript\" src=\"' .\n '/typo3conf/ext/frontend_editing/Resources/Public/Javascript/lity/dist/lity.min.js\"></script>';\n\n return $resources;\n }",
"protected function loadJavaScripts()\n {\n $this->pageRenderer->loadJquery();\n $this->pageRenderer->loadRequireJsModule('bootstrap');\n $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ContextHelp');\n $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DocumentHeader');\n $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/SplitButtons');\n }",
"private function fn_load_scripts() {\n\n\t\t/**\n\t\t * Load Common CSS and JS for a blank Page\n\t\t */\n\n\t\t$fixed_version = $this->fixed_version;\n\t\t$common_css_version = '0.3';\n\t\t$common_js_version = '0.1';\n\t\t$custom_css_version = '0.4';\n\t\t$custom_js_version = '0.4';\n\n\t\t$registered_styles = $this->registered_css;\n\t\t$registered_scripts = $this->registered_js;\n\n\t\t/**\n\t\t * Load CSS--------------------------------------------------------------\n\t\t */\n\n /** Load Google Fonts */\n\t\t$this->google_fonts['google_opensans'] = $registered_styles['google_opensans'];\n\n\t\t/** Load CSS Assets @todo Move the components in their containers */\n\t\t\n\t\t$this->css_assets['bootstrap'] = $registered_styles['bootstrap'].\"?ver=\".$fixed_version;\n\t\t$this->css_assets['fontawesome'] = $registered_styles['fontawesome'].\"?ver=\".$fixed_version;\n\t\t\n\t\t/**\n\t\t * Load JS--------------------------------------------------------------\n\t\t */\n\t\t\n\t\t/** Load footer js **/\n\t\t$this->footer_js['jquery'] = $registered_scripts['jquery'].\"?ver=\".$fixed_version;\t\t\n\t\t$this->footer_js['jquery-ui'] = $registered_scripts['jquery-ui'].\"?ver=\".$fixed_version;\n\n\t\t$this->footer_js['bootstrap'] = $registered_scripts['bootstrap'].\"?ver=\".$fixed_version;\n\t\t/**let other controllers load their own css/js files **/\n\t}",
"public function loadJavaScript()\n {\n // first include the common one\n $this->page->loadCommonJavaScript($this->file);\n // then the specific per view one\n $this->page->loadJavaScript($this->file);\n }",
"protected function loadJavascriptResources()\n {\n $this->pageRenderer->addJsFile(\n 'EXT:core/Resources/Public/JavaScript/Contrib/jquery/jquery.js'\n );\n $this->pageRenderer->loadRequireJs();\n $this->pageRenderer->addRequireJsConfiguration(\n [\n 'shim' => [\n 'ckeditor' => ['exports' => 'CKEDITOR'],\n 'ckeditor-jquery-adapter' => ['jquery', 'ckeditor'],\n ],\n 'paths' => [\n 'TYPO3/CMS/FrontendEditing/Contrib/toastr' =>\n 'EXT:frontend_editing/Resources/Public/JavaScript/Contrib/toastr',\n 'TYPO3/CMS/FrontendEditing/Contrib/immutable' =>\n 'EXT:frontend_editing/Resources/Public/JavaScript/Contrib/immutable'\n ]\n ]\n );\n\n $this->pageRenderer->addJsFile(\n 'EXT:backend/Resources/Public/JavaScript/backend.js'\n );\n // Load CKEDITOR and CKEDITOR jQuery adapter independent for global access\n $this->pageRenderer->addJsFooterFile('EXT:rte_ckeditor/Resources/Public/JavaScript/Contrib/ckeditor.js');\n $this->pageRenderer->addJsFooterFile(\n 'EXT:frontend_editing/Resources/Public/JavaScript/Contrib/ckeditor-jquery-adapter.js'\n );\n\n // Fixes issue #377, where CKEditor dependencies fail to load if the version number is added to the file name\n if ($GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename'] === 'embed') {\n $this->pageRenderer->addJsInlineCode(\n 'ckeditor-basepath-config',\n 'window.CKEDITOR_BASEPATH = ' . GeneralUtility::quoteJSvalue(PathUtility::getAbsoluteWebPath(\n GeneralUtility::getFileAbsFileName(\n 'EXT:rte_ckeditor/Resources/Public/JavaScript/Contrib/'\n )\n )) . ';',\n true,\n true\n );\n }\n\n $configuration = $this->getPluginConfiguration();\n if (isset($configuration['includeJS']) && is_array($configuration['includeJS'])) {\n foreach ($configuration['includeJS'] as $file) {\n $this->pageRenderer->addJsFile($file);\n }\n }\n }",
"private function loadJs()\n {\n $js = $_GET['Module'] . DS . $_GET['Controller'] . DS . $_GET['Action'] . '.js';\n if (is_file(JS_DIR . $js))\n Layout::appendJs('/js/' . $js);\n }",
"function load_javascript() {\r\n\t\t\r\n\t\t$js_files = scandir('app/assets/javascript');\r\n\r\n\t\tif (defined(\"JS_PRELOADS\"))\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$load_priorities = unserialize(JS_PRELOADS);\r\n\r\n\t\t\tforeach ($load_priorities as $js_file)\r\n\t\t\t{\r\n\t\t\t\techo '<script type=\"text/javascript\" src=\"' . ROOT . 'app/assets/javascript/' . $js_file . \"\\\"></script>\\n\";\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($js_files as $js) {\r\n\t\t\t\tif (($js != '.') && ($js != '..') && (!in_array($js, $load_priorities)))\r\n\t\t\t\t{\r\n\t\t\t\t\techo '<script type=\"text/javascript\" src=\"' . ROOT . 'app/assets/javascript/' . $js . \"\\\"></script>\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tforeach ($js_files as $js) {\r\n\t\t\t\tif (($js != '.') && ($js != '..'))\r\n\t\t\t\t{\r\n\t\t\t\t\techo '<script type=\"text/javascript\" src=\"' . ROOT . 'app/assets/javascript/' . $js . \"\\\"></script>\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function st_async_load_scripts($url)\n{\n if ( strpos( $url, '#asyncscript') === false ){\n return $url;\n }elseif( is_admin() ){\n return str_replace( '#asyncscript', '', $url );\n }\n\treturn str_replace( '#asyncscript', '', $url ).\"' async='async\" . \"' defer='defer\";\n}",
"public function loadAssets() {\r\n\t\t$this->app->document->addScript('assets:js/autosuggest.js');\r\n\t\t$this->app->document->addScript('assets:js/tag.js');\r\n\t}",
"function load_async_scripts($url)\n{\n\tif ( strpos( $url, '#asyncload') === false ) {\n\t\treturn $url;\n\t} else if ( is_admin() ) {\n\t\treturn str_replace( '#asyncload', '', $url );\n\t} else {\n\n\t\tif(function_exists('is_IE') && is_IE()) {\n\t\t\t$ie_url = str_replace( '.min.', '.ie.', $url );\n\n\t\t\tif(does_url_exists($ie_url)) {\n\t\t\t\t$url = $ie_url;\n\t\t\t}\n\t\t} \n\n\t\treturn str_replace( '#asyncload', '', $url ).\"' async='async\";\n\t}\n}",
"public function fetchAllJS()\n {\n foreach ($this->footer_js_files as $item) {\n $file = ROOTPATH . \"public/\" . $item;\n if (!file_exists($file)) {\n continue;\n }\n echo \"<script type='text/javascript' src='\".base_url($item).\"'></script>\\n\";\n }\n }",
"protected function loadJavascript() {\n\n\t\t// *********************************** //\n\t\t// Load ExtCore library\n\t\t$this->pageRenderer->loadExtJS();\n\t\t$this->pageRenderer->enableExtJsDebug();\n\n\t\t// Manage State Provider\n\t\t$this->template->setExtDirectStateProvider();\n\t\t$states = $GLOBALS['BE_USER']->uc['moduleData']['Taxonomy']['States'];\n\t\t$this->pageRenderer->addInlineSetting('Taxonomy', 'States', $states);\n\n\t\t// *********************************** //\n\t\t// Defines what files should be loaded and loads them\n\t\t$files = array();\n\t\t$files[] = 'Utility.js';\n\n\t\t// Application\n\t\t$files[] = 'Application.js';\n\t\t$files[] = 'Application/MenuRegistry.js';\n\t\t$files[] = 'Application/AbstractBootstrap.js';\n\n\t\t$files[] = 'Concept/ConceptTree.js';\n\t\t$files[] = 'Concept/ConceptGrid.js';\n\n//\t\t// Override\n//\t\t$files[] = 'Override/Chart.js';\n//\n\t\t// Stores\n//\t\t$files[] = 'Stores/Bootstrap.js';\n\t\t$files[] = 'Stores/ConceptStore.js';\n//\n//\t\t// User interfaces\n\t\t$files[] = 'UserInterface/Bootstrap.js';\n\t\t$files[] = 'UserInterface/FullDoc.js';\n\t\t$files[] = 'UserInterface/TopPanel.js';\n\t\t$files[] = 'UserInterface/DocHeader.js';\n\t\t$files[] = 'UserInterface/TreeEditor.js';\n\t\t$files[] = 'UserInterface/TreeNodeUI.js';\n\t\t$files[] = 'UserInterface/RecordTypeCombo.js';\n\t\t$files[] = 'UserInterface/ConfirmWindow.js';\n\n//\t\t// Plugins\n\t\t$files[] = 'Plugins/FitToParent.js';\n\t\t$files[] = 'Plugins/StateTreePanel.js';\n\n//\t\t// Newsletter Planner\n//\t\t$files[] = 'Planner/Bootstrap.js';\n//\t\t$files[] = 'Planner/PlannerForm.js';\n//\t\t#$files[] = 'Planner/PlannerForm/PlannerTab.js';\n//\t\t#$files[] = 'Planner/PlannerForm/SettingsTab.js';\n//\t\t#$files[] = 'Planner/PlannerForm/StatusTab.js';\n//\n//\t\t// Statistics\n//\t\t$files[] = 'Statistics/Bootstrap.js';\n//\t\t$files[] = 'Statistics/ModuleContainer.js';\n//\t\t$files[] = 'Statistics/NoStatisticsPanel.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel.js';\n//\t\t$files[] = 'Statistics/NewsletterListMenu.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/OverviewTab.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/LinkTab.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/LinkTab/LinkGrid.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/LinkTab/LinkGraph.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/EmailTab.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/EmailTab/EmailGrid.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/EmailTab/EmailGraph.js';\n//\t\t$files[] = 'Statistics/StatisticsPanel/OverviewTab/General.js';\n////\t\t$files[] = 'Statistics/StatisticsPanel/OverviewTab/Graph.js';\n\n\t\tforeach ($files as $file) {\n\t\t\t$this->pageRenderer->addJsFile($this->javascriptPath . $file, 'text/javascript', FALSE);\n\t\t}\n\t\t\n\t\t$this->pageRenderer->addJsFile('../t3lib/js/extjs/ExtDirect.StateProvider.js', 'text/javascript', FALSE);\n\n\t\t// ExtDirect\n//\t\t$this->pageRenderer->addExtDirectCode(array(\n//\t\t\t'TYPO3.Taxonomy'\n//\t\t));\n\t\t\n\t\t// Add ExtJS API\n\t\t#$this->pageRenderer->addJsFile('ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.Taxonomy', 'text/javascript', FALSE);\n\n\t\t#$numberOfStatistics = json_encode($this->statisticRepository->countStatistics($this->id));\n\t\t#TYPO3.Taxonomy.Data.numberOfStatistics = $numberOfStatistics;\n\n\t\t// *********************************** //\n\t\t// Defines onready Javascript\n\t\t$this->readyJavascript = array();\n\t\t$this->readyJavascript[] .= <<< EOF\n\n\t\t\tExt.ns(\"TYPO3.Taxonomy.Data\");\n\t\t\tTYPO3.Taxonomy.Data.imagePath = '$this->imagePath';\n\n\t\t\t// Enable our remote calls\n\t\t\t//for (var api in Ext.app.ExtDirectAPI) {\n\t\t\t//\tExt.Direct.addProvider(Ext.app.ExtDirectAPI[api]);\n\t\t\t//}\nEOF;\n\n\t\t$this->pageRenderer->addExtOnReadyCode(PHP_EOL . implode(\"\\n\", $this->readyJavascript) . PHP_EOL);\n\n\t\t// *********************************** //\n\t\t// Defines contextual variables\n\t\t$labels = json_encode($this->getLabels());\n\t\t$configuration = json_encode($this->getConfiguration());\n\t\t$sprites = json_encode($this->getSprites());\n\n\t\t$this->inlineJavascript[] .= <<< EOF\n\n\t\tExt.ns(\"TYPO3.Taxonomy\");\n\t\tTYPO3.Taxonomy.Language = $labels;\n\t\tTYPO3.Taxonomy.Configuration = $configuration;\n\t\tTYPO3.Taxonomy.Sprites = $sprites;\n\nEOF;\n\t\t$this->pageRenderer->addJsInlineCode('newsletter', implode(\"\\n\", $this->inlineJavascript));\n\t}",
"public function AutoloadResources(){\n $controllerName = Zend_Registry::get('controllerName');\n $actionName = Zend_Registry::get('actionName');\n \n if(CURRENT_MODULE == 'backoffice'){\n $file = ROOT_PATH . '/public/' . CURRENT_MODULE . '/js/autoload/' . $controllerName . '/' . strtolower(App_Inflector::camelCaseToDash($actionName)) . '.js';\n }else{\n $file = ROOT_PATH . '/public/' . CURRENT_MODULE . '/js/autoload/' . strtolower(App_Inflector::camelCaseToDash($controllerName)) . '.js';\n }\n \n if(file_exists($file)){\n if(CURRENT_MODULE == 'backoffice'){\n $file = $this->view->baseUrl() . '/js/autoload/' . $controllerName . '/' . strtolower(App_Inflector::camelCaseToDash($actionName)) . '.js';\n $this->view->headScript()->offsetSetFile(2, $file);\n }else{\n $file = $this->view->baseUrl() . '/js/autoload/' . strtolower(App_Inflector::camelCaseToDash($controllerName)) . '.js';\n $this->view->headScript()->appendFile($file);\n }\n }\n }",
"public function loadAssets() {\r\n\t\t$this->app->document->addScript('assets:js/finder.js');\r\n\t\t$this->app->document->addScript('elements:gallery/gallery.js');\r\n\t}",
"public function load_assets(){\r\n\t\tif(!isset($this->id)){\r\n\t\t\twp_die('You have to call RuntimeInfos::generate_unique_id() before RuntimeInfos::load_assets()');\r\n\t\t}\r\n\t\t$nonce = wp_create_nonce(\"runtime_infos_nonce\");\r\n\t\t$src = \r\n\t\t\tadmin_url('admin-ajax.php')\r\n\t\t\t.'?'\r\n\t\t\t.http_build_query(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'action'\t=>\tself::ajax_action,\r\n\t\t\t\t\t'id'\t\t=>\t$this->id,\r\n\t\t\t\t\t'nonce'\t\t=>\t$nonce\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\twp_register_script('ajax-runtime-infos', $src, false, false, false);\r\n\t\twp_enqueue_script('ajax-runtime-infos');\r\n\t}",
"function addScriptResources()\t{\n\t\tif (t3lib_extMgm::isLoaded('t3jquery')) {\n\t\t\trequire_once(t3lib_extMgm::extPath('t3jquery').'class.tx_t3jquery.php');\n\t\t}\n\n\t\t// checks if t3jquery is loaded\n\t\tif (T3JQUERY === TRUE) {\n\t\t\ttx_t3jquery::addJqJS();\n\t\t} else {\n\t\t\tif($this->conf['jQueryRes']) $this->jsFile[] = $this->conf['jQueryRes'];\n\t\t\tif($this->conf['tooltipJSRes']) $this->jsFile[] = $this->conf['tooltipJSRes'];\n\t\t}\n\n\t\t// Fix moveJsFromHeaderToFooter (add all scripts to the footer)\n\t\tif ($GLOBALS['TSFE']->config['config']['moveJsFromHeaderToFooter']) {\n\t\t\t$allJsInFooter = TRUE;\n\t\t} else {\n\t\t\t$allJsInFooter = FALSE;\n\t\t}\n\n\t\t$pagerender = $GLOBALS['TSFE']->getPageRenderer();\n\t\t\n\t\t// add all defined JS files\n\t\tif (count($this->jsFile) > 0) {\n\t\t\tforeach ($this->jsFile as $jsToLoad) {\n\t\t\t\tif (T3JQUERY === TRUE) {\n\t\t\t\t\t$conf = array(\n\t\t\t\t\t\t'jsfile' => $jsToLoad,\n\t\t\t\t\t\t'tofooter' => ($this->conf['jsInFooter'] || $allJsInFooter),\n\t\t\t\t\t\t'jsminify' => $this->conf['jsMinify'],\n\t\t\t\t\t);\n\t\t\t\t\ttx_t3jquery::addJS('', $conf);\n\t\t\t\t} else {\n\t\t\t\t\t$file = $GLOBALS['TSFE']->tmpl->getFileName($jsToLoad);\n\t\t\t\t\tif ($file) {\n\t\t\t\t\t\tif ($allJsInFooter) {\n\t\t\t\t\t\t\t$pagerender->addJsFooterFile($file, 'text/javascript', $this->conf['jsMinify']);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$pagerender->addJsFile($file, 'text/javascript', $this->conf['jsMinify']);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt3lib_div::devLog(\"'{\".$jsToLoad.\"}' does not exists!\", $this->extKey, 2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add defined CSS file\n\t\tif($this->conf['cssFile']) {\n\t\t\t// Add script only once\n\t\t\t$css = $GLOBALS['TSFE']->tmpl->getFileName($this->conf['cssFile']);\n\t\t\tif ($css) {\n\t\t\t\t$pagerender->addCssFile($css, 'stylesheet', 'all', '', $this->conf['cssMinify']);\n\t\t\t} else {\n\t\t\t\tt3lib_div::devLog(\"'{\".$this->conf['cssFile'].\"}' does not exists!\", $this->extKey, 2);\n\t\t\t}\n\t\t}\n\t}",
"private function loadURLs() {\r\n $status = $this->statusIsAvailable($this->getStatus()) ? $this->getStatus() : 'test';\r\n\r\n\tforeach ($this->_url as $scriptname => $modes)\r\n\t{\r\n\t\t$this->url[$scriptname] = $modes[$status];\r\n\t}\r\n }",
"public function loadScripts()\n\t{\n\t\tif(!$this->scriptLoader)\n\t\t\t$this->scriptLoader = new ScriptLoader($this->isProVersion());\n\t\t\n\t\tif(!empty($this->settings->developer_mode))\n\t\t\t$this->scriptLoader->build();\n\t\t\n\t\tif(Plugin::$enqueueScriptsFired)\n\t\t{\n\t\t\t$this->scriptLoader->enqueueScripts();\n\t\t\t$this->scriptLoader->enqueueStyles();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach(Plugin::$enqueueScriptActions as $action)\n\t\t\t{\n\t\t\t\tadd_action($action, function() {\n\t\t\t\t\t$this->scriptLoader->enqueueScripts();\n\t\t\t\t\t$this->scriptLoader->enqueueStyles();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Wallet function Inform site about transactions affecting the wallet. URI: /callback/wallet/$txn_id | public function wallet($txn_id = NULL){
// Abort if no transaction ID is supplied.
if($txn_id == NULL)
return FALSE;
$this->load->library('bw_bitcoin');
$this->load->model('bitcoin_model');
$this->bw_bitcoin->walletnotify($txn_id);
} | [
"public function walletnotify($txn_id){\n\t\t$this->bw_bitcoin->walletnotify($txn_id);\n\t}",
"function wallet_notify($transaction_id)\r\n\t{\r\n\t\t$result['status'] = 0;\r\n\t\t//$transaction_id = '797aa470d4ca6c362ce38de41422d794224e938d860c942ee44776c583229e54';\r\n\t\t//$a = $this->rpc_connection->gettransaction($transaction_id);\r\n\t\t$transaction = $this->get_transaction($transaction_id);\r\n\r\n\t\t\t\r\n\t\t$myFile = \"/tmp/temp.txt\";\r\n\t\t$fh = fopen($myFile, 'a+') or die(\"can't open file\");\r\n\t\t$string = $this->_crypto . ' wallet() ' . date('d-m-Y h:i:s', time()) . \" $transaction_id \" . PHP_EOL;\r\n\t\t$string2 = json_encode($transaction);\r\n\t\t\r\n\t\tfwrite($fh, $string);\r\n\t\tfwrite($fh, $string2 . \" ========== \". PHP_EOL);\r\n\t\tfclose($fh);\r\n\t\t\r\n\r\n\t\tif ($transaction['status'] == 1)\r\n\t\t{\r\n\t\t\t$crypto = $this->_crypto;\r\n\t\t\t$tx = $transaction['transaction'];\r\n\t\t\t$confirmation = $tx['confirmations'];\r\n\t\t\tif ($confirmation == '')\r\n\t\t\t{\r\n\t\t\t\t$confirmation = 0;\r\n\t\t\t}\r\n\t\t\t$txid = $tx['txid'];\r\n\t\t\t$time = $tx['time'];\r\n\t\t\t\r\n\t\t\t$category = $tx['details'][0]['category'];\r\n\t\t\r\n\t\t\t$transaction_obj = DB::query(Database::SELECT, \"SELECT confirmation FROM crypto_transaction WHERE crypto = :crypto AND txid = :txid\")\r\n\t\t\t->param(':crypto', $this->_crypto)\r\n\t\t\t->param(':txid', $txid)\r\n\t\t\t->execute();\r\n\t\t\t\r\n\t\t\tif (count($transaction_obj) == 0)\r\n\t\t\t{\r\n\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//The following block if ($category == 'send' won't be triggered as cryptowallet/withdraw_confirm will generate a new tx_id record and into it into the database (means there is already a 'send' record in the database. If the following block is triggered, means the txid record generated during send_coin() was not inserted into the db properly and we want to look at the situation properly. Probably send email notification etc\r\n\t\t\t\tif ($category == 'send')\r\n\t\t\t\t{\r\n\t\t\t\t\t$result['status'] = 0;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tDB::query('NULL', 'BEGIN')->execute();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$fee = $tx['details'][0]['fee'];\r\n\t\t\t\t\tif ($fee == '')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$fee = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$account = $tx['details'][0]['account'];\r\n\t\t\t\t\t$address = $tx['details'][0]['address'];\r\n\t\t\t\t\t$amount = $tx['details'][0]['amount'] * 1e8 * ((100 - $this->_crypto_commission) / 100);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$order_obj = DB::query(Database::SELECT, \"SELECT o.id, o.data, o.data->>'new_total' AS total, u.username AS seller, u.email, date_part('epoch', submitted)::int AS submitted FROM public.order o LEFT JOIN public.user u ON (data->'seller_id')::text::int = u.id WHERE data->>'crypto_address' = :crypto_address AND data->>'payment_method_name' = :crypto\")\r\n\t\t\t\t\t->param(':crypto_address', $address)\r\n\t\t\t\t\t->param(':crypto', $crypto)\r\n\t\t\t\t\t->execute();\r\n\t\t\t\t\tif ( ! $order_obj)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tDB::query('NULL', 'ROLLBACK')->execute();\r\n\t\t\t\t\t\tthrow new Kohana_Exception('site_error ');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (count($order_obj) == 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$order_id = $order_obj[0]['id'];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$db_obj = DB::query(Database::INSERT, \"INSERT into crypto_transaction(crypto, address, category, amount, confirmation, txid, time, account, fee, order_id) VALUES(:crypto, :address, :category, :amount, :confirmation, :txid, :time, :account, :fee, :order_id)\")\r\n\t\t\t\t\t\t->param(':crypto', $crypto)\r\n\t\t\t\t\t\t->param(':address', $address)\r\n\t\t\t\t\t\t->param(':category', $category)\r\n\t\t\t\t\t\t->param(':amount', $amount)\r\n\t\t\t\t\t\t->param(':confirmation', $confirmation)\r\n\t\t\t\t\t\t->param(':txid', $txid)\r\n\t\t\t\t\t\t->param(':time', $time)\r\n\t\t\t\t\t\t->param(':account', $account)\r\n\t\t\t\t\t\t->param(':fee', $fee)\r\n\t\t\t\t\t\t->param(':order_id', $order_id)\r\n\t\t\t\t\t\t->execute();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ( ! $db_obj)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tDB::query('NULL', 'ROLLBACK')->execute();\r\n\t\t\t\t\t\t\tthrow new Kohana_Exception('site_error ');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$total = $order_obj[0]['total'] * 1e8;\r\n\t\t\t\t\t\t$email = $order_obj[0]['email'];\r\n\t\t\t\t\t\t$array_data = self::object_to_array(json_decode($order_obj[0]['data']));\r\n\t\t\t\t\t\t$order_message = \"\\r\\n\\r\\n\" . I18n::get('order_summary') . \"\\r\\n====================\\r\\n\";\r\n\t\t\t\t\t\t$product = '';\r\n\t\t\t\t\t\tforeach ($array_data['item'] as $index => $record)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$title = HTML::chars($record['title']);\r\n\t\t\t\t\t\t\t$quantity = $record['quantity'];\r\n\t\t\t\t\t\t\t$order_message .= HTML::chars($record['title']) . ' x ' . $record['quantity'] . \"\\r\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$currency = strtoupper($array_data['new_currency_code']);\r\n\t\t\t\t\t\t$order_message .= \"====================\\r\\n\\r\\n\";\r\n\t\t\t\t\t\t$order_message .= I18n::get('subtotal') . ': ' . $array_data['new_grand_subtotal'] . \" $currency\\r\\n\";\r\n\t\t\t\t\t\t$order_message .= I18n::get('shipping') . ': ' . $array_data['new_shipping'] . \" $currency\\r\\n\";\r\n\t\t\t\t\t\t$order_message .= I18n::get('tax') . ': ' . $array_data['new_tax'] . \" $currency\\r\\n\";\r\n\t\t\t\t\t\t$order_message .= I18n::get('total') . ': ' . $array_data['new_total'] . \" $currency\\r\\n\";\r\n\t\t\t\t\t\t$order_message .= I18n::get('payment_method') . ': ' . $array_data['payment_method'] . \"\\r\\n\";\r\n\t\t\t\t\t\t$order_message .= I18n::get('shipping_service') . ': ' . $array_data['shipping_service'] . \"\\r\\n\";\r\n\t\t\t\t\t\t$order_message .= I18n::get('order_date') . ': ' . date('M d, Y', $order_obj[0]['submitted']) . \"\\r\\n\";\r\n\r\n\t\t\t\t\t\t//if the amount received is the same with/greater than the amount request, mark the order status = paid + send an email notification to the seller,\r\n\t\t\t\t\t\t//test value\r\n\t\t\t\t\t\t//$total = 30000000;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($amount >= $total)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//order_status = 3: payment_received, hardcoded\r\n\t\t\t\t\t\t\t$array_data['order_status'] = 3;\r\n\t\t\t\t\t\t\t$json_data = json_encode($array_data);\r\n\t\t\t\t\t\t\t$update_obj = DB::query(Database::UPDATE, \"UPDATE public.order SET data = json_add_update(data, :json_data) WHERE id = :order_id\")\r\n\t\t\t\t\t\t\t->param(':json_data', $json_data)\r\n\t\t\t\t\t\t\t->param(':order_id', $order_id)\r\n\t\t\t\t\t\t\t->execute();\r\n\t\t\t\t\t\t\tif ( ! $update_obj)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tDB::query('NULL', 'ROLLBACK')->execute();\r\n\t\t\t\t\t\t\t\tthrow new Kohana_Exception('site_error ');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$email_subject = sprintf(I18n::get('email.subject.payment_received'), $order_id);\r\n\t\t\t\t\t\t\t$email_message = sprintf(I18n::get('email.message.payment_received'), $amount / 1e8 . ' ' . strtoupper($crypto), $order_id, $order_message);\r\n\t\t\t\t\t\t\t$transport = Swift_MailTransport::newInstance();\r\n\t\t\t\t\t\t\t$mailer = Swift_Mailer::newInstance($transport);\r\n\t\t\t\t\t\t\t$message = Swift_Message::newInstance($email_subject)\r\n\t\t\t\t\t\t\t->setFrom(array($this->cfg[\"from_email\"] => $this->cfg[\"site_name\"] . ' Support'))\r\n\t\t\t\t\t\t\t->setTo($email)\r\n\t\t\t\t\t\t\t->setBody($email_message, 'text/plain');\r\n\t\t\t\t\t\t\t$mailer->send($message);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$transport = Swift_MailTransport::newInstance();\r\n\t\t\t\t\t\t\t$mailer = Swift_Mailer::newInstance($transport);\r\n\t\t\t\t\t\t\t$message = Swift_Message::newInstance(\"new transaction for order $order_id $currency\")\r\n\t\t\t\t\t\t\t->setFrom(array($this->cfg[\"from_email\"] => $this->cfg[\"site_name\"] . ' Support'))\r\n\t\t\t\t\t\t\t->setTo($this->cfg[\"from_email\"])\r\n\t\t\t\t\t\t\t->setBody('', 'text/plain');\r\n\t\t\t\t\t\t\t$mailer->send($message);\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//print\"<br>$email_subject\";\r\n\t\t\t\t\t\t\t//print\"<br>$email_message\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$result['status'] = 1;\r\n\t\t\t\t\tDB::query('NULL', 'COMMIT')->execute();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//wallet_notify() might be triggered twice..\r\n\t\t\t\t$result['status'] = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$result['error'] = 'wallet_notify()';\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"public function walletnotify($txn_hash) {\n\n\t\t$transaction = $this->gettransaction($txn_hash);\n\t\t// Abort if there's an error obtaining the transaction (not for our wallet)\n\t\tif(isset($transaction['code']) || $transaction == NULL)\n\t\t\treturn FALSE;\n\n\t\t// Extract details for send/receive from inputs and oupputs.\n\t\t$send = array();\n\t\t$receive = array();\n\t\tforeach($transaction['details'] as $detail) {\n\t\t\tif($detail['category'] == 'send')\n\t\t\t\tarray_push($send, $detail);\n\t\t\tif($detail['category'] == 'receive')\n\t\t\t\tarray_push($receive, $detail);\n\t\t}\n\n\t\t// Work out if the transaction is for a registration payment.\n\t\tif(isset($receive[0]) && $receive[0]['account'] == 'fees' && $receive[0]['category'] == \"receive\") {\n\t\t\t$this->CI->load->model('users_model');\n\t\t\t$address = $receive[0]['address'];\n\n\t\t\t$user_hash = $this->CI->users_model->get_payment_address_owner($address);\n\t\t\tif($user_hash !== FALSE) {\n\t\t\t\t// Add payment.\n\t\t\t\t$update = array('txn_id' => $txn_hash,\n\t\t\t\t\t\t\t\t'user_hash' => $user_hash,\n\t\t\t\t\t\t\t\t'value' => $receive[0]['amount'],\n\t\t\t\t\t\t\t\t'confirmations' => $transaction['confirmations'],\n\t\t\t\t\t\t\t\t'address' => $receive[0]['address'],\n\t\t\t\t\t\t\t\t'category' => 'receive',\n\t\t\t\t\t\t\t\t'credited' => '0',\n\t\t\t\t\t\t\t\t'time' => $transaction['time']);\n\n\t\t\t\t// If we don't have the payment, add it.\n\t\t\t\tif($this->CI->bitcoin_model->user_transaction($user_hash, $txn_hash, $update['category']) == FALSE) {\n\t\t\t\t\t$this->CI->bitcoin_model->add_pending_txn($update);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Work out if the transaction is cashing out anything.\n\t\tif(isset($send[0]) && $send[0]['account'] == \"main\" && $send[0]['category'] == \"send\") {\n\t\t\t$user_hash = $this->CI->bitcoin_model->get_cashout_address_owner($send[0]['address']);\n\t\t\tif($user_hash !== FALSE) {\n\n\n\t\t\t\t$update = array('txn_id' => $txn_hash,\n\t\t\t\t\t\t\t\t'user_hash' => $user_hash,\n\t\t\t\t\t\t\t\t'value' => $send[0]['amount'],\n\t\t\t\t\t\t\t\t'confirmations' => $transaction['confirmations'],\n\t\t\t\t\t\t\t\t'address' => $send[0]['address'],\n\t\t\t\t\t\t\t\t'category' => 'send',\n\t\t\t\t\t\t\t\t'credited' => '1',\n\t\t\t\t\t\t\t\t'time' => $transaction['time']);\n\n\n\n\t\t\t\t// If we do not already have this transaction, add it, and deduct the users balance.\n\t\t\t\tif($this->CI->bitcoin_model->user_transaction($user_hash, $txn_hash, $update['category']) == FALSE) {\n\n\t\t\t\t\t$this->CI->bitcoin_model->add_pending_txn($update);\n\t\t\t\t\t\n\t\t\t\t\t// Immediately deduct a users balance if cashing out.\n\t\t\t\t\t$debit = array( 'user_hash' => $user_hash,\n\t\t\t\t\t\t\t\t\t'value' => $update['value']);\n\t\t\t\t\t$this->CI->bitcoin_model->update_credits(array($debit));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Workout if the transaction is topping an account up.\n\t\tif(isset($receive[0]) && $receive[0]['account'] == 'topup' && $receive[0]['category'] == \"receive\") {\n\t\t\t$user_hash = $this->CI->bitcoin_model->get_address_owner($receive[0]['address']);\n\t\t\tif($user_hash !== FALSE) {\n\t\t\t\n\t\t\t\t$update = array('txn_id' => $txn_hash,\n\t\t\t\t\t\t\t\t'user_hash' => $user_hash,\n\t\t\t\t\t\t\t\t'value' => $receive[0]['amount'],\n\t\t\t\t\t\t\t\t'confirmations' => $transaction['confirmations'],\n\t\t\t\t\t\t\t\t'address' => $receive[0]['address'],\n\t\t\t\t\t\t\t\t'category' => 'receive',\n\t\t\t\t\t\t\t\t'time' => $transaction['time']);\n\n\t\t\t\t// If we do not already have the transaction, add it, and generate a new address if needed.\n\t\t\t\tif($this->CI->bitcoin_model->user_transaction($user_hash, $txn_hash, $update['category']) == FALSE) {\n\t\t\t\t\t$this->CI->bitcoin_model->add_pending_txn($update);\n\n\t\t\t\t\t// If the users current topup equals the one used to top up, generate a new one.\n\t\t\t\t\tif($this->CI->bitcoin_model->get_user_address($user_hash) == $update['address']) \n\t\t\t\t\t\t@$this->new_address($user_hash);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private function forward_deposit($params, $tx) {\n\n if($addr = Coinprism::get_address($params['address'])) {\n\n $btc_balance = $addr['btc_address']['balance'];\n\n $fee_required = DEFAULT_TRANSACTION_FEE - $btc_balance;\n\n\t\t\t\t//send a transaction fee, we'll forward next time\n if( ($fee_required > 0) && (! $tx['FeeSent']) ) {\n\n $input = array('address' => TRANSACTION_FEE_ADDRESS, 'key' => TRANSACTION_FEE_KEY);\n $outputs[] = array('address' => $addr['btc_address']['address'], 'amount' => $fee_required);\n\n $fee_sent_hash = Coinprism::send($input, $outputs);\n $data['FeeSent'] = $fee_sent_hash;\n\n }\n\n \t\t\t\t//if no fee required and not already been forwarded, forward to warm wallet\n elseif( ($fee_required <= 0) && (! $tx['Forwarded']) ) {\n\n if('BTC' == $params['currency']) {\n $asset_id = false;\n $amount = $params['amount'] - DEFAULT_TRANSACTION_FEE;\n $output_address = WARM_WALLET_BTC;\n\n //we set the FeeSent to NotNeeded here, otherwise subsequent notifications (after the deposit has been forwarded) will trigger a fee_required\n $data['FeeSent'] = 'NotNeeded';\n\n }\n else{\n if('TCP' == $params['currency']) $asset_id = TCP_ASSET_ID;\n if('DCT' == $params['currency']) $asset_id = DCT_ASSET_ID;\n $amount = $params['amount'];\n $output_address = WARM_WALLET_ASSET;\n }\n\n if($amount > 0) {\n\n //now we need the private key\n $privkey = Addresses::find('first', array(\n 'conditions' => array(\n 'btc_address' => $addr['btc_address']['address']\n ))\n );\n $privkey = $privkey['private_key'];\n\n\n $input = array('address' => $params['address'], 'key' => $privkey);\n $outputs[0]['address'] = $output_address;\n $outputs[0]['amount'] = $amount;\n\n if($asset_id) $outputs[0]['asset_id'] = $asset_id;\n\n $forward_hash = Coinprism::send($input, $outputs);\n $data['Forwarded'] = $forward_hash;\n\n }\n }\n\t\t\treturn $data;\n\n } //get_address\n\t\t\t\n\t\treturn false;\n\t}",
"function wallet_to_bank()\n{\n\tif(!empty($_REQUEST['user_id']) && !empty($_REQUEST['transfer_amount']) && !empty($_REQUEST['bankcode'])&& !empty($_REQUEST['account_number'])&& !empty($_REQUEST['account_holder_name'])){\n\t$user_id \t\t=\t$_REQUEST['user_id'];\n\t$sql='select * from user where user_id=\"'.$user_id.'\"';\n\t$user_records \t= $this -> conn -> getData($sql);\n\tif(empty($user_records)){\n\t\t$post=array('status'=>'false','message'=>'Invalid User ID','user_id'=>$user_id);\n\t\techo $this -> json($post); \n\t\texit();\n\t}\n\t$user_email \t\t=\t$user_records['0']['user_email'];\n\t$user_contact_no = \"+\".$user_records['0']['user_contact_no'];\n\t$wallet_amount \t\t=\t$user_records['0']['wallet_amount'];\n\t\n\t$user_name\t\t\t=\t$_REQUEST['account_holder_name'];\n\t\n\t$date = new DateTime();\n $lock_pass \t=\twallet_pass;\n\t$amount \t=\t$_REQUEST['transfer_amount'];\n\t$trans_chage= transfer_charge;\n\t$total_deduct_amt= $amount+$trans_chage;\n\t$bank_code \t=\t$_REQUEST['bankcode'];\n\t$ac_number \t=\t$_REQUEST['account_number'];\n\t$currency \t=\tcurrency;\n\t$narration =\t'Wallet To Bank Transfer in '.$user_name.' with account number is '.$ac_number;\n\t$ref_number =\t$date->getTimestamp().rand(111111,999999);\n\t$current_date \t\t=\tdate(\"Y-m-d H:i:s\");\n\t$payment_type \t\t=\t3;\n\t$wt_category \t\t=\t17; // wallet to Bank\n if($wallet_amount>$total_deduct_amt)\n {\n \t$token=$this->create_token_moneywave();\n\t if(!empty($token))\n\t {\n\t \t\t//$balence=$this->check_moneywave_balence($token); // check balence in wallet\n\t \t\t$postField=\"lock=$lock_pass&amount=$amount&bankcode=$bank_code&accountNumber=$ac_number¤cy=$currency&senderName=$user_name&narration=$narration&ref=$ref_number\";\n\t \t\t \t$curl = curl_init();\n \t\t\t\tcurl_setopt_array($curl, array(\n\t\t\t\t CURLOPT_URL => wallet_bank_url,\n\t\t\t\t CURLOPT_RETURNTRANSFER => true,\n\t\t\t\t CURLOPT_ENCODING => \"\",\n\t\t\t\t CURLOPT_MAXREDIRS => 10,\n\t\t\t\t CURLOPT_TIMEOUT => 300,\n\t\t\t\t CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\t\t\t\t CURLOPT_CUSTOMREQUEST => \"POST\",\n\t\t\t\t CURLOPT_POSTFIELDS => $postField,\n\t\t\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t \"authorization:$token\",\n\t\t\t \"cache-control: no-cache\",\n\t\t\t \"content-type: application/x-www-form-urlencoded\",\n\t\t\t \"postman-token: 35210e9c-caa9-1b21-c19e-b23db51aca52\"\n\t\t\t ),\n\t\t\t));\n\n\t\t\t\t $response = curl_exec($curl);\n\t\t\t\n\t\t\t\t $err = curl_error($curl);\n\t\t\t\t curl_close($curl);\n\t\t\t\t $data=json_decode($response);\n\t\t\t\t $error_message=$data->message;\n\t\t\t\t $status=$data->status;\n\t\t\t\tif ($err) {\n\t\t\t\t\t\n\t\t\t\t $sql11 \t\t\t\t=\t\"insert into payment_transaction (pay_trans_userid,p_transaction_id,p_reffernce_id,pay_trans_amount,trans_pay_type,p_response_msg,pay_trans_data,pay_trans_status,p_trans_datetime) values ('$user_id','$ref_number','$ref_number','$total_deduct_amt','$payment_type','$err','$response','$status','$current_date')\";\n\t \t\t\t\t\t $im= mysql_query($sql11);\n\t \t\t\t\t\t$last_id=mysql_insert_id();\n\t \t\t\t\t\t$transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_category,wt_amount,transaction_id,wt_desc,payment_type,payment_gateway_id,trans_ref_no,wt_status', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_category . '\",\"' . $total_deduct_amt . '\",\"' . $ref_number . '\",\"' . $narration . '\",\"' . $payment_type . '\",\"' . $ref_number . '\",\"' . $ref_number . '\",\"2\"');\n\n\t \t\t\t\t\t$walletbank = $this -> conn -> insertnewrecords('wallet_bank_transactions', 'wallet_bank_trans_user_id, wallet_bank_trans_amount,wallet_bank_trans_bankcode,wallet_bank_trans_account_no,wallet_bank_trans_date,wallet_bank_transactions,wallet_bank_trans_status,wallet_bank_trans_id,wallet_bank_trans_ref,wallet_bank_trans_msg', \"'\" . $user_id . \"','\" . $total_deduct_amt . \"','\". $bank_code . \"','\" . $ac_number . \"','\" . $current_date . \"','\".$response.\"','\" . $status . \"','\" . $ref_number . \"','\" . $ref_number . \"','\" . $error_message . \"'\");\n\t \t\t\t\t\t\t\n\t\t\t\t\t\t\t$post=array('status'=>'false','message'=>$data->message, 'transaction_id' => $ref_number,'transaction_date' => date('F-d-Y h:i A',strtotime($current_date)),'transaction_ref'=>$ref_number);\n\t \t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\n\n\t\t\t\t if($data->status=='success')\n\t\t\t\t {\n\t\t\t\t \t\t$status \t\t\t=\t$data->status;\n\t\t\t\t \t\t$response_code \t\t=\t$data->data['responsecode'];\n\t\t\t\t \t\t$uniquereference \t=\t$data->data['uniquereference'];\n\t\t\t\t \t\t$internalreference \t=\t$data->data['internalreference'];\n\t\t\t\t \t\t$oya_refference \t=\t$data->data['ref'];\n\t\t\t\t \t\t$respoonse_msg \t\t=\t$data->data['responsemessage'];\n\t\t\t\t \t\t\n\n\t\t\t\t \t\t\n\t\t\t\t \t\t$sql11 \t\t\t\t=\t\"insert into payment_transaction (pay_trans_userid,p_transaction_id,p_reffernce_id,pay_trans_amount,trans_pay_type,p_response_msg,pay_trans_data,pay_trans_status,p_trans_datetime) values ('$user_id','$uniquereference','$internalreference','$total_deduct_amt','$payment_type','$respoonse_msg','$response','$status','$current_date')\";\n\t \t\t\t\t\t $im= mysql_query($sql11);\n\t \t\t\t\t\t$last_id=mysql_insert_id();\n\t \t\t\t\t\t$transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_category,wt_amount,transaction_id,wt_desc,payment_type,payment_gateway_id,trans_ref_nowt_status', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_category . '\",\"' . $total_deduct_amt . '\",\"' . $oya_refference . '\",\"' . $narration . '\",\"' . $payment_type . '\",\"' . $uniquereference . '\",\"' . $internalreference . '\",\"1\"');\n\n\t \t\t\t\t\t$walletbank = $this -> conn -> insertnewrecords('wallet_bank_transactions', 'wallet_bank_trans_user_id, wallet_bank_trans_amount,wallet_bank_trans_bankcode,wallet_bank_trans_account_no,wallet_bank_trans_date,wallet_bank_transactions,wallet_bank_trans_status,wallet_bank_trans_id,wallet_bank_trans_ref,wallet_bank_trans_msg', \"'\" . $user_id . \"','\" . $total_deduct_amt . \"','\". $bank_code . \"','\" . $ac_number . \"','\" . $current_date . \"','\".$response.\"','\" . $status . \"','\" . $uniquereference . \"','\" . $oya_refference . \"','\" . $respoonse_msg . \"'\");\n\t \t\t\t\t\tif($transfer>0)\n\t \t\t\t\t\t{\n\t \t\t\t\t\t\t$deduct_amount=$wallet_amount-$total_deduct_amt;\n\t \t\t\t\t\t\t$data11111['wallet_amount'] = $deduct_amount;\n\t\t\t\t\t\t\t$update_amount = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data11111);\n\t\t\t\t\t\t\t$post=array('status'=>'true','message'=>'Wallet to Bank Transfer amount is successfully done', 'transaction_id' => $oya_refference,'transaction_date' => date('F-d-Y h:i A',strtotime($current_date)),'transaction_ref'=>$internalreference);\n\n\t \t\t\t\t\t}\n\t\t\t\t }else if($data->status=='error'){\n\t\t\t\t \t\t\n\t\t\t\t \t\t $sql11 \t\t\t\t=\t\"insert into payment_transaction (pay_trans_userid,p_transaction_id,p_reffernce_id,pay_trans_amount,trans_pay_type,p_response_msg,pay_trans_data,pay_trans_status,p_trans_datetime) values ('$user_id','$ref_number','$ref_number','$total_deduct_amt','$payment_type','$error_message','$response','$status','$current_date')\";\n\t \t\t\t\t\t $im= mysql_query($sql11);\n\t \t\t\t\t\t$last_id=mysql_insert_id();\n\t \t\t\t\t\t$transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_category,wt_amount,transaction_id,wt_desc,payment_type,payment_gateway_id,trans_ref_no,wt_status', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_category . '\",\"' . $total_deduct_amt . '\",\"' . $ref_number . '\",\"' . $narration . '\",\"' . $payment_type . '\",\"' . $ref_number . '\",\"' . $ref_number . '\",\"2\"');\n\n\t\t\t\t\t$walletbank = $this -> conn -> insertnewrecords('wallet_bank_transactions', 'wallet_bank_trans_user_id, wallet_bank_trans_amount,wallet_bank_trans_bankcode,wallet_bank_trans_account_no,wallet_bank_trans_date,wallet_bank_transactions,wallet_bank_trans_status,wallet_bank_trans_id,wallet_bank_trans_ref,wallet_bank_trans_msg', \"'\" . $user_id . \"','\" . $total_deduct_amt . \"','\". $bank_code . \"','\" . $ac_number . \"','\" . $current_date . \"','\".$response.\"','\" . $status . \"','\" . $ref_number . \"','\" . $ref_number . \"','\" . $error_message . \"'\");\n\n\t\t\t\t \t\t$post=array('status'=>'false','message'=>$data->message, 'transaction_id' => $ref_number,'transaction_date' => date('F-d-Y h:i A',strtotime($current_date)),'transaction_ref'=>$ref_number);\n\t\t\t\t }\n\t\t\t}\n\t\t\t\t\n\n\t }else{\n\t \t$post=array('status'=>'false','message'=>'Invalid token or errro in token create');\n\t }\n\t}else{\n\t\t$post=array('status'=>'false','message'=>'Insufficent amount in your wallet');\n\t}\n\t \n }else{\n \t$post=array('status'=>'false','message'=>'Missing Parameter','user_id'=>$_REQUEST['user_id'],'transfer_amount'=>$_REQUEST['transfer_amount'],'bankcode'=>$_REQUEST['bankcode'],'account_number'=>$_REQUEST['account_number'],'account_holder_name'=>$_REQUEST['account_holder_name']);\n }\n echo $this -> json($post); \n}",
"public function sendToWallet($from_account, $to_wallet, $amount);",
"public function walletAction() {\r\n $id = trim(Mage::app()->getRequest()->getParam('id'));\r\n if ($id == null) {\r\n $this->_redirect('*/*/payments');\r\n return;\r\n }\r\n\r\n $alpesainvoices = Mage::helper('Boonagel_Alpesa')->dynoData('alpesa/alpesainvoice', array('id,eq,' . $id), 1);\r\n if ($alpesainvoices->count() != 1) {\r\n $this->_redirect('*/*/payments');\r\n return;\r\n }\r\n $alpesainvoice = $alpesainvoices->getFirstItem();\r\n\r\n //already validated\r\n if ($alpesainvoice->getValidated() == 1) {\r\n $this->_redirect('*/*/payments');\r\n return;\r\n }\r\n $alpesainvoice->setValidated(1);\r\n $alpesainvoice->save();\r\n //change to validated and update order status\r\n $order = Mage::getModel(\"sales/order\")->load($alpesainvoice->getOrderId());\r\n if (count($order) != 1) {\r\n $this->_redirect('*/*/payments');\r\n return;\r\n }\r\n\r\n $comment = ' Amount : ' . $order->grand_total\r\n . ', Through : Alpesa.';\r\n $order->setStatus('Alpesa Payment By Actual Amount');\r\n $order->addStatusToHistory('alpesa_payment_complete', $comment, false)->setIsVisibleOnFront(1);\r\n $order->save();\r\n $this->_redirect('*/*/payments');\r\n }",
"public function action_account_transaction() {\n $package = Model::factory('package');\n $invoice_id = explode('/', $_SERVER['REQUEST_URI']);\n $transaction_info = $package->account_transaction($invoice_id[3]);\n $this->template->title = CLOUD_SITENAME . ' | Account';\n $this->template->page_title = __('account_transaction_details');\n $this->meta_description = \"\";\n $this->template->content = View::factory(\"admin/package_plan/account_transaction\")\n ->bind('transaction_info', $transaction_info);\n }",
"function manageWallet() {\r\n\r\n\t// Globals\r\n\tglobal $MySelf;\r\n\tglobal $DB;\r\n\t$MyCredits = getCredits($MySelf->getID());\r\n\r\n\t// Get (recent?) transactions\r\n\t$html = getTransactions($MySelf->getID());\r\n\r\n\tif ($MyCredits > 0) {\r\n\r\n\t\t// Create the dropdown menu with all pilots.\r\n\t\t$NamesDS = $DB->query(\"SELECT DISTINCT username, id FROM users WHERE deleted='0' ORDER BY username\");\r\n\t\t$ddm = \"<select name=\\\"to\\\">\";\r\n\t\twhile ($name = $NamesDS->fetchRow()) {\r\n\t\t\t// Lets not allow transfers to self.\r\n\t\t\tif ($name[id] != $MySelf->getID()) {\r\n\t\t\t\t$ddm .= \"<option value=\\\"\" . $name[id] . \"\\\">\" . ucfirst($name[username]) . \"</option>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$ddm .= \"</select>\";\r\n\r\n\t\t$tt = new table(2, true);\r\n\t\t$tt->addHeader(\">> Transfer ISK\");\r\n\t\t$tt->addRow(\"#060622\");\r\n\t\t$tt->addCol(\"You can transfer ISK into another Pilots wallet by using this form.\", array (\r\n\t\t\t\"colspan\" => 2\r\n\t\t));\r\n\t\t$tt->addRow();\r\n\t\t$tt->addCol(\"Transfer from:\");\r\n\t\t$tt->addCol(ucfirst($MySelf->getUsername()));\r\n\t\t$tt->addRow();\r\n\t\t$tt->addCol(\"Transfer to:\");\r\n\t\t$tt->addCol($ddm);\r\n\t\t$tt->addRow();\r\n\t\t$tt->addCol(\"Amount:\");\r\n\t\t$tt->addCol(\"<input type=\\\"text\\\" name=\\\"amount\\\">\");\r\n\t\t$tt->addHeaderCentered(\"<input type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"Transfer money\\\">\");\r\n\r\n\t\t// Create form stuff, and embed the table within.\r\n\t\t$transfer = \"<form action=\\\"index.php\\\" method=\\\"POST\\\">\";\r\n\t\t$transfer .= $tt->flush();\r\n\t\t$transfer .= \"<input type=\\\"hidden\\\" name=\\\"check\\\" value=\\\"true\\\">\";\r\n\t\t$transfer .= \"<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"transferMoney\\\">\";\r\n\t\t$transfer .= \"</form>\";\r\n\r\n\t\t// Create the payout form.\r\n\t\t$payout = new table(2, true);\r\n\t\t$payout->addHeader(\">> Request payout\");\r\n\t\t$payout->addRow(\"#060622\");\r\n\t\t$payout->addCol(\"Fill out this form to request payout of ISK. An accountant will honor your request soon.\", array (\r\n\t\t\t\"colspan\" => 2\r\n\t\t));\r\n\t\t$payout->addRow();\r\n\t\t$payout->addCol(\"Payout amount:\");\r\n\t\t$payout->addCol(\"<input type=\\\"text\\\" name=\\\"amount\\\" value=\\\"\" . $MyCredits . \"\\\"> ISK\");\r\n\t\t$payout->addHeaderCentered(\"<input type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"request payout\\\">\");\r\n\r\n\t\t// Create form stuff, and embed the table within.\r\n\t\t$requestPayout = \"<form action=\\\"index.php\\\" method=\\\"POST\\\">\";\r\n\t\t$requestPayout .= $payout->flush();\r\n\t\t$requestPayout .= \"<input type=\\\"hidden\\\" name=\\\"check\\\" value=\\\"true\\\">\";\r\n\t\t$requestPayout .= \"<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"requestPayout\\\">\";\r\n\t\t$requestPayout .= \"</form>\";\r\n\t}\r\n\r\n\t/*\r\n\t* Show current requests\r\n\t*/\r\n\t$requests = $DB->query(\"SELECT * FROM payoutRequests WHERE payoutTime IS NULL AND applicant='\" . $MySelf->getID() . \"' ORDER BY time\");\r\n\r\n\t$table = new table(4, true);\r\n\t$table->addHeader(\">> Pending payout requests\");\r\n\r\n\t$table->addRow(\"#060622\");\r\n\t$table->addCol(\"request\");\r\n\t$table->addCol(\"time\");\r\n\t$table->addCol(\"amount\");\r\n\t$table->addCol(\"Cancel\");\r\n\r\n\twhile ($request = $requests->fetchRow()) {\r\n\t\t$table->addRow();\r\n\t\t$table->addCol(\"#\" . str_pad($request[request], \"5\", \"0\", STR_PAD_LEFT));\r\n\t\t$table->addCol(date(\"d.m.y H:i:s\", $request[time]));\r\n\t\t$table->addCol(number_format($request[amount], 2) . \" ISK\");\r\n\t\t$table->addCol(\"<input type=\\\"checkbox\\\" name=\\\"\".$request[request].\"\\\" value=\\\"true\\\">\");\r\n\t\t$haveRequest = true;\r\n\t}\r\n\t$table->addHeaderCentered(\"<input type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"cancel marked requests\\\">\");\r\n\t\r\n\t$takeBack = \"<form action=\\\"index.php\\\" method=\\\"POST\\\">\";\r\n\t$takeBack .= \"<input type=\\\"hidden\\\" name=\\\"check\\\" value=\\\"true\\\">\";\r\n\t$takeBack .= \"<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"deleteRequest\\\">\";\r\n\t$takeBack .= $table->flush();\r\n\t$rakeBack .= \"</form>\";\r\n\r\n\t/*\r\n\t * Show fulfilled requests\r\n\t */\r\n\t$requests = $DB->query(\"SELECT * FROM payoutRequests WHERE payoutTime IS NOT NULL AND applicant='\" . $MySelf->getID() . \"' ORDER BY time\");\r\n\t$table_done = new table(5, true);\r\n\t$table_done->addHeader(\">> Fulfilled payout requests\");\r\n\r\n\t$table_done->addRow(\"#060622\");\r\n\t$table_done->addCol(\"request\");\r\n\t$table_done->addCol(\"time\");\r\n\t$table_done->addCol(\"amount\");\r\n\t$table_done->addCol(\"Payout time\");\r\n\t$table_done->addCol(\"Paid by\");\r\n\r\n\twhile ($request = $requests->fetchRow()) {\r\n\t\t$table_done->addRow();\r\n\t\t$table_done->addCol(\"#\" . str_pad($request[request], \"5\", \"0\", STR_PAD_LEFT));\r\n\t\t$table_done->addCol(date(\"d.m.y H:i:s\", $request[time]));\r\n\t\t$table_done->addCol(number_format($request[amount], 2) . \" ISK\");\r\n\t\t$table_done->addCol(date(\"d.m.y H:i:s\", $request[payoutTime]));\r\n\t\t$table_done->addCol(ucfirst(idToUsername($request[banker])));\r\n\t\t$haveOldRequests = true;\r\n\t}\r\n\r\n\tif ($html) {\r\n\t\t$html = \"<h2>Your Wallet</h2>\" . $html . \"<br>\" . $requestPayout . $transfer;\r\n\r\n\t\tif ($haveRequest) {\r\n\t\t\t$html .= $takeBack . \"<br>\";\r\n\t\t}\r\n\r\n\t\tif ($haveOldRequests) {\r\n\t\t\t$html .= $table_done->flush();\r\n\t\t}\r\n\t\t\r\n\t} else {\r\n\t\t$html = \"<h2>Your Wallet</h2>Once your wallet has any transactions you can view the details here. And once you obtained a positive balance you can transfer money and request payouts.<br>\";\r\n\t}\r\n\treturn ($html);\r\n\r\n}",
"public function logTransaction()\n\t{\n\t\t$ipn_nv \t\t\t\t= $this->getIpnNV();\n\t\t$payment_details_nv \t= $this->getPaymentDetailsNV();\n\n\t\tif ($this->isRefundTransaction()) {\n\t\t\t$primary_receiver_trans_id = $this->payment_details['paymentInfoList.paymentInfo('.$this->primary_receiver . ').senderTransactionId'];\n\t\t\t$buyer_trans_id = '';\n\t\t} else {\n\t\t\t$buyer_trans_id = $this->payment_details['paymentInfoList.paymentInfo(' . $this->primary_receiver . ').senderTransactionId'];\n\t\t\t$primary_receiver_trans_id = isset($this->payment_details['paymentInfoList.paymentInfo('.$this->secondary_receiver . ').senderTransactionId']) ? $this->payment_details['paymentInfoList.paymentInfo('.$this->secondary_receiver . ').senderTransactionId'] : '';\n\t\t}\n\n\t\t$payment_receiver_details = $this->getPaymentReceiverDetailsInArray();\n\t\t$payment_receiver_details_ser = serialize($payment_receiver_details);\n\t\t//echo $payment_receiver_details_ser;\n\n\t\t//Transaction entry made in adaptive payment package\n\t\t$this->paypal_transaction->setPayKey($this->ipn_data['pay_key']);\n\t\t$this->paypal_transaction->setTrackingId($this->payment_details['trackingId']);\n\t\t$this->paypal_transaction->setCurrencyCode($this->payment_details['currencyCode']);\n\t\t$this->paypal_transaction->setBuyerEmail($this->payment_details['sender.email']);\n\t\t$this->paypal_transaction->setReceiverDetails($payment_receiver_details_ser);\n\t\t$this->paypal_transaction->setIpnPostString($ipn_nv);\n\t\t$this->paypal_transaction->setPaymentDetailsString($payment_details_nv);\n\t\t$this->paypal_transaction->setErrorId($this->errno);\n\t\t$this->paypal_transaction->setStatus($this->payment_details['status']);\n\t\t$this->paypal_transaction->setBuyerTransId($buyer_trans_id);\n\t\t$paypal_adaptive_transaction_det = $this->paypal_transaction->add();\n\t\t$paypal_adaptive_transaction_det = json_decode($paypal_adaptive_transaction_det);\n\n\n\t\t$this->paypal_adaptive_transaction_id = isset($paypal_adaptive_transaction_det->transaction_id)?$paypal_adaptive_transaction_det->transaction_id:0;\n\t}",
"public function SendAmountToWallet($params)\n {\n $customerModel = $this->_walletHelper->getCustomerByCustomerId($params['sender_id']);\n $senderName = $customerModel->getFirstname().\" \".$customerModel->getLastname();\n if ($params['walletnote']=='') {\n $params['walletnote'] = __(\"Transfer by %1\", $senderName);\n }\n $transferAmountData = [\n 'customerid' => $params['reciever_id'],\n 'walletamount' => $params['base_amount'],\n 'walletactiontype' => 'credit',\n 'curr_code' => $params['curr_code'],\n 'curr_amount' => $params['curr_amount'],\n 'walletnote' => __($params['walletnote']),\n 'sender_id' => $params['sender_id'],\n 'sender_type' => 4,\n 'order_id' => 0,\n 'status' => 1,\n 'increment_id' => ''\n ];\n $this->_walletUpdate->creditAmount($params['reciever_id'], $transferAmountData);\n }",
"function q_wallet_transfer()\n {\n if($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n $Amount = clean($_POST['ticket-amount']);\n $username = $_SESSION['loginID'];\n\n $query = \" SELECT * FROM users WHERE username='$username' OR user_phone='$username' OR user_email='$username' \";\n $result = Query($query);\n\n if($row = fetch_data($result))\n {\n $dbUsername = $row['username'];\n\n $query = \" SELECT * FROM users WHERE username='$dbUsername' \";\n $result = Query($query);\n confirm($result);\n\n if($rows = fetch_data($result))\n {\n $Wallet = $rows['wallet'];\n\n if($Wallet >= $Amount)\n {\n $query = \" UPDATE users SET q_wallet=q_wallet+$Amount, wallet=wallet-$Amount WHERE username='$dbUsername' \";\n $result = Query($query);\n confirm($result);\n\n if($result)\n {\n $query = \" INSERT INTO q_money_transaction(user,transaction,amount,date) VALUES('$dbUsername','Transfer','$Amount',now()) \";\n $result = Query($query);\n confirm($result);\n\n if($result)\n {\n ?>\n <script type=\"text/javascript\">\n alert(\"Q-Wallet Has Been Topped Up With ₦<?php echo $Amount; ?> Successfully!\");\n window.location.href = \"wallet.php\";\n </script>\n <?php\n }\n }\n }\n else\n {\n ?>\n <script type=\"text/javascript\">\n alert(\"Wallet Balance Not Enough! Please Top Up Your Wallet.\");\n window.location.href = \"wallet.php\";\n </script>\n <?php\n }\n }\n }\n }\n }",
"function wallet_add_new_wallet(){\n\t}",
"function bitPoints_Redeem($customer_id, $amount, $description) {\n bitPoints_HTTP('POST', 'program/'.$GLOBALS['bitPoints_ProgramId'].'/customer/'.$customer_id.'/transaction', \r\n '[{'. \r\n '\"transaction_type\":\"Redeem\",'.\r\n '\"amount\":\"'.$amount.'\",'.\n '\"description\":\"'.$description\n .'\"}]');\n return bitPoints_RefreshCustomer($customer_id);\n}",
"public function GetWalletInfo($wallet) {\r\n\r\n $totalReceived = \"0\";\r\n $totalSpend = \"0\";\r\n\r\n $totalReceived_tmp = $this->db->query(\"SELECT amount FROM transactions WHERE wallet_to = '\".$wallet.\"';\");\r\n if (!empty($totalReceived_tmp)) {\r\n while ($txnInfo = $totalReceived_tmp->fetch_array(MYSQLI_ASSOC)) {\r\n $totalReceived = bcadd($totalReceived, $txnInfo['amount'], 8);\r\n }\r\n }\r\n\r\n //Obtenemos lo que ha gastado el usuario (pendiente o no de tramitar)\r\n $totalSpended_tmp = $this->db->query(\"SELECT amount FROM transactions WHERE wallet_from = '\".$wallet.\"';\");\r\n if (!empty($totalSpended_tmp)) {\r\n while ($txnInfo = $totalSpended_tmp->fetch_array(MYSQLI_ASSOC)) {\r\n $totalSpend = bcadd($totalSpend, $txnInfo['amount'], 8);\r\n }\r\n }\r\n\r\n $totalSpendedPending_tmp = $this->db->query(\"SELECT amount FROM transactions_pending WHERE wallet_from = '\".$wallet.\"';\");\r\n if (!empty($totalSpendedPending_tmp)) {\r\n while ($txnInfo = $totalSpendedPending_tmp->fetch_array(MYSQLI_ASSOC)) {\r\n $totalSpend = bcadd($totalSpend, $txnInfo['amount'], 8);\r\n }\r\n }\r\n\r\n $totalSpendedPendingToSend_tmp = $this->db->query(\"SELECT amount FROM transactions_pending_to_send WHERE wallet_from = '\".$wallet.\"';\");\r\n if (!empty($totalSpendedPendingToSend_tmp)) {\r\n while ($txnInfo = $totalSpendedPendingToSend_tmp->fetch_array(MYSQLI_ASSOC)) {\r\n $totalSpend = bcadd($totalSpend, $txnInfo['amount'], 8);\r\n }\r\n }\r\n\r\n $current = bcsub($totalReceived,$totalSpend,8);\r\n\r\n return array(\r\n 'sended' => $totalSpend,\r\n 'received' => $totalReceived,\r\n 'current' => $current\r\n );\r\n }",
"public function changeWallet() //BY tian\r\n {\r\n $user_id = Users::getUserId();\r\n $currency_id = request()->input(\"currency_id\", '');\r\n $number = request()->input(\"number\", '');\r\n $type = request()->input(\"type\", ''); //1Transfer From Legal Currency To Transaction Account Number\r\n if (empty($currency_id) || empty($number) || empty($type)) {\r\n return $this->error('Parameter Error');\r\n }\r\n if ($number < 0) {\r\n return $this->error('The Amount Entered Cannot Be Negative');\r\n }\r\n\r\n switch ($type) {\r\n case 1:\r\n $from_field = 1;\r\n $to_field = 3;\r\n $from_account_log_type = AccountLog::WALLET_LEGAL_OUT;\r\n $to_account_log_type = AccountLog::WALLET_LEVER_IN;\r\n $memo = 'Transfer Of Legal Currency To Contract Currency';\r\n break;\r\n case 2:\r\n $from_field = 3;\r\n $to_field = 1;\r\n $from_account_log_type = AccountLog::WALLET_LEVER_OUT;\r\n $to_account_log_type = AccountLog::WALLET_LEGAL_IN;\r\n $memo = 'Transfer Of Contract Currency To Legal Currency';\r\n if ($this->hasLeverTrade($user_id)) {\r\n return $this->error('Do You Have A Leverage Deal In Progress,This Operation Cannot Be Performed');\r\n }\r\n break;\r\n case 3:\r\n $from_field = 1;\r\n $to_field = 2;\r\n $from_account_log_type = AccountLog::WALLET_LEGAL_OUT;\r\n $to_account_log_type = AccountLog::WALLET_CHANGE_IN;\r\n $memo = 'Transfer Of Legal Currency To Transaction Currency';\r\n break;\r\n case 4:\r\n $from_field = 2;\r\n $to_field = 1;\r\n $from_account_log_type = AccountLog::WALLET_CHANGE_OUT;\r\n $to_account_log_type = AccountLog::WALLET_LEGAL_IN;\r\n $memo = 'Transfer Of Transaction Currency To Legal Currency';\r\n break;\r\n default:\r\n return $this->error('Transfer Type Error');\r\n break;\r\n }\r\n try {\r\n DB::beginTransaction();\r\n $user_wallet = UsersWallet::where('user_id', $user_id)\r\n ->lockForUpdate()\r\n ->where('currency', $currency_id)\r\n ->first();\r\n if (!$user_wallet) {\r\n throw new \\Exception('The Wallet Doesnt Exist');\r\n }\r\n $result = change_wallet_balance($user_wallet, $from_field, -$number, $from_account_log_type, $memo);\r\n if ($result !== true) {\r\n throw new \\Exception($result);\r\n }\r\n $result = change_wallet_balance($user_wallet, $to_field, $number, $to_account_log_type, $memo);\r\n if ($result !== true) {\r\n throw new \\Exception($result);\r\n }\r\n //Increase Exchange Record Of Legal Currency And Contract\r\n if ($type == 1 || $type == 2) {\r\n // $res11 = new Levertolegal();\r\n // $res11->user_id = $user_id;\r\n // $res11->number = $number;\r\n // $res11->type = $type;\r\n // $res11->status = 2; //2:Approved\r\n // $res11->add_time = time();\r\n // $res11->save();\r\n }\r\n DB::commit();\r\n return $this->success('Successful Transfer');\r\n } catch (\\Exception $e) {\r\n DB::rollBack();\r\n return $this->error('Operation Failed:' . $e->getMessage());\r\n }\r\n }",
"function bitPoints_Earn($customer_id, $amount, $description) {\n bitPoints_HTTP('POST', 'program/'.$GLOBALS['bitPoints_ProgramId'].'/customer/'.$customer_id.'/transaction', \r\n '[{'. \r\n '\"transaction_type\":\"Earn\",'.\r\n '\"amount\":\"'.$amount.'\",'.\n '\"description\":\"'.$description\n .'\"}]');\n return bitPoints_RefreshCustomer($customer_id);\n}",
"function wallet_update($orderid = NULL, $customerid = null, $walletAmount = null) {\n $cithis = & get_instance();\n $cithis->load->database();\n $cithis->load->model('common');\n if ((!empty($customerid)) && (!empty($walletAmount)) && (!empty($orderid))) {\n $walletid = 0;\n $datawallet = $cithis->common->getRow('wallet', 'id,amount', array('customer_id' => $customerid));\n\n if (!empty($datawallet)) {\n\n $walletmain = $walletAmount + $datawallet->amount;\n $warray = array(\n 'amount' => $walletmain\n );\n $walletid = $datawallet->id;\n $wupdate = $cithis->common->update('wallet', $warray, array('customer_id' => $customerid));\n } else {\n $warray = array(\n 'customer_id' => $customerid,\n 'amount' => $walletAmount,\n 'created_date' => date('Y-m-d H:i:s')\n );\n $wupdate = $cithis->common->insert('wallet', $warray);\n $walletid = $wupdate;\n }\n if ($wupdate) {\n $warrayhistory = array(\n 'wallet_id' => $walletid,\n 'order_id' => $orderid,\n 'deposit' => $walletAmount,\n 'comments' => 'Customer has paid extra amount of the total amount!',\n 'created_date' => date('Y-m-d H:i:s')\n );\n $wallet_history = $cithis->common->insert('wallet_history', $warrayhistory);\n return TRUE;\n } else {\n return FALSE;\n }\n } else {\n return FALSE;\n }\n}",
"public function wallet();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the national levels | public function updateNationLevels()
{
$constants=Constants::model()->findbyPk(1);
$round=Round::model()->findbyPk($constants->roundId);
if($round!==null){
// loop calculating nation levels
$criteria=new CDbCriteria;
$condition="roundId = ".$round->roundId." AND victoryTime > ".(time() - 86400); // 24 hours
$nations = array(Player::CHINA, Player::RUSSIA, Player::UNITED_STATES, Player::EUROPEAN_UNION);
foreach($nations as $nation){
$criteria->condition=$condition." AND victorNation = ".$nation;
$missions=Mission::model()->count($criteria);
// determine the weighted average for the nation
$query="SELECT COUNT(playerId) AS activePlayers, AVG(informationLevel) AS averageLevel FROM Player WHERE roundId = ? AND nation = ? AND locationTimeStamp > ?";
$parameters=array($round->roundId, $nation, (time()-86400));
$information=Player::model()->findBySql($query,$parameters);
if($information!==null)
$weightedPlayers=$information->activePlayers * $information->averageLevel;
if($weightedPlayers < self::MINIMUM_PLAYERS)
$weightedPlayers=self::MINIMUM_PLAYERS;
// determine the percent completed
$expectedMissions=self::EXPECTED_DAYS * self::EXPECTED_DAILY_PLAYER_MISSIONS * $weightedPlayers;
$percentComplete=$missions/$expectedMissions;
// set the nation level
switch($nation){
case Player::CHINA:
$round->percentCh = $round->percentCh + $percentComplete;
$level=(int)($round->levelRequirement * $round->percentCh);
$round->levelCh = $level;
break;
case Player::RUSSIA:
$round->percentRu = $round->percentRu + $percentComplete;
$level=(int)($round->levelRequirement * $round->percentRu);
$round->levelRu = $level;
break;
case Player::UNITED_STATES:
$round->percentUs = $round->percentUs + $percentComplete;
$level=(int)($round->levelRequirement * $round->percentUs);
$round->levelUs = $level;
break;
case Player::EUROPEAN_UNION:
$round->percentEu = $round->percentEu + $percentComplete;
$level=(int)($round->levelRequirement * $round->percentEu);
$round->levelEu = $level;
break;
}
}
$round->save();
}
} | [
"public function setNumLevels($numLevels);",
"public function setNationality($value)\n {\n $this->nationality = $value;\n }",
"protected function setLevelInfo() {\n\t\tforeach($this->plugin->getSettings()->getNested(\"xp.levels\") as $key => $data) {\n\t\t\t$this->levels[$key] = LevelInfo::fromArray([\n\t\t\t\t\"level\" => $key,\n\t\t\t\t\"minXp\" => $data[\"min-xp\"],\n\t\t\t\t\"maxXp\" => $data[\"max-xp\"],\n\t\t\t\t\"commands\" => $data[\"commands\"]\n\t\t\t]);\n\t\t}\n\t}",
"public function setLevels(){\n foreach (self::$modules as $key => $val){\n $module_levels = explode(',', $val['run_level']);\n foreach ($module_levels as $k => $v){\n $this->levels[$v][] = $val['module_name'];\n }\n }\n }",
"public function loadLevels(){\n \n $levels = $this->getSetting('enabled_levels');\n if ($levels)\n {\n \n $levels = explode(\",\", $levels);\n foreach($levels as $level)\n {\n \n $maxSubCrit = $this->getSetting(\"max_sub_crit_level_{$level}\");\n $this->addLevel($level, $maxSubCrit);\n \n }\n \n }\n \n }",
"private function convertLevel()\n\t{\n\t\tswitch ($this->level)\n\t\t{\n\n\t\t\tcase 'FR':\n\t\t\t\t$this->level = 'Freshman';\n\t\t\t\tbreak;\n\t\t\tcase 'SO':\n\t\t\t\t$this->level = 'Sophomore';\n\t\t\t\tbreak;\n\t\t\tcase 'JR':\n\t\t\t\t$this->level = 'Junior';\n\t\t\t\tbreak;\n\t\t\tcase 'SR':\n\t\t\t\t$this->level = 'Senior';\n\t\t\t\tbreak;\n\t\t\tcase 'GR':\n\t\t\t\t$this->level = 'Graduate';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//if the person is not the above levels, then they must be faculty/staff, but check to see if they are engineering faculty\n\t\t\t\tif($this->isEngineer())\n\t\t\t\t\t$this->level = 'Faculty/Staff';\n\t\t\t\tbreak;\n\t\t}\n\t}",
"function set_levels($table = 'categories')\n {\n\tglobal $ilance;\n\t$sql = $ilance->db->query(\"\n\t SELECT cid, parentid, level\n\t FROM \" . DB_PREFIX . $table . \"\n\t\", 0, null, __FILE__, __LINE__);\n\twhile ($cats = $ilance->db->fetch_array($sql, DB_ASSOC))\n\t{\n\t if ($cats['parentid'] == 0)\n\t {\n\t\t$ilance->db->query(\"\n\t\t UPDATE \" . DB_PREFIX . $table . \"\n\t\t SET level = '1'\n\t\t WHERE cid = '\" . $cats['cid'] . \"'\n\t\t\", 0, null, __FILE__, __LINE__);\n\t }\n\t else\n\t {\n\t\t$level = 1;\n\t\t$this->set_levels_update($cats['cid'], $cats['parentid'], $level, '', $table);\n\t }\n\t}\n }",
"public function setLevels($levels) {\n static $levelMap = [\n 'error' => Logger::LEVEL_ERROR,\n 'warning' => Logger::LEVEL_WARNING,\n 'info' => Logger::LEVEL_INFO,\n 'trace' => Logger::LEVEL_TRACE,\n 'profile' => Logger::LEVEL_PROFILE,\n ];\n if (is_array($levels)) {\n $intrestingLevels = [];\n\n foreach ($levels as $level) {\n if (!isset($this->_levels[$level]) && !isset($levelMap[$level])) {\n throw new InvalidConfigException(\"Unrecognized level: $level\");\n }\n if (isset($levelMap[$level])) {\n $intrestingLevels[$levelMap[$level]] = $this->_levels[$levelMap[$level]];\n }\n if (isset($this->_levels[$level])) {\n $intrestingLevels[$level] = $this->_levels[$level];\n }\n }\n\n $this->_levels = $intrestingLevels;\n } else {\n throw new InvalidConfigException(\"Incorrect $levels value\");\n }\n }",
"function acmeu_u_program_default_levels(){\n\n\t\t\t\t// see if we already have populated any terms\n\t\t\t\t$level = get_terms( 'acmeu_degree_levels', array( 'hide_empty' => false ) );\n\n\t\t\t\t// if no terms then lets add our terms.\n\t\t\t\tif ( empty( $level ) ){\n\t\t\t\t\t\t\t\t$levels = acmeu_u_program_levels();\n\t\t\t\t\t\t\t\tforeach ( $levels as $level ){\n\t\t\t\t\t\t\t\t\t\t\t\tif ( ! term_exists( $level['name'], 'acmeu_degree_levels' ) ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twp_insert_term( $level['name'], 'acmeu_degree_levels', array( 'slug' => $level['short'] ) );\n\t\t\t}\n\t\t}\n\t}\n\n}",
"function update_country_npl( $term_id, $tt_id ){\n if( isset( $_POST['country-npl'] ) && '' !== $_POST['country-npl'] ){\n $country_npl = filter_var($_POST['country-npl'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);\n update_term_meta( $term_id, 'country-npl', $country_npl );\n }\n }",
"public function Set_Levels()\n\t\t{\n\t\t\t$this->page_array = func_get_args();\n\t\t}",
"public function setLevels(LogLevels $levels);",
"function setMaxLevels($max_levels) {\n\t\t$this->_maxLevels = $max_levels;\n\t}",
"public function fillNationalities(array $nationalities)\n {\n foreach ($nationalities as $nationality) {\n $nationality = (array)$nationality;\n $values = [\n 'en' => $nationality['nationality'],\n 'ar' => $nationality['nationality']\n ];\n $values = json_encode($values);\n \\App\\Constant::create([\n 'name' => NATIONALITY_CONSTANT,\n 'value' => $values\n ]);\n }\n\n }",
"public static function getLevels(){}",
"final private function SetNationalID($ID)\n\t\t{\n\t\t}",
"public function setLevel($level=self::ALL) {\n\n if(is_numeric($level)) {\n \n /* set */\n \t\n $this->level = (int)$level;\n \n return true;\n }\n \n $input = null;\n if(is_array($level)) {\n $input = $level;\n }\n if($input === null) {\n $input = explode(',', $level);\n }\n \n $mask = 0;\n \n foreach($input as $item) {\n \t\n $item = trim($item);\n \n if(is_numeric($item)) {\n \t$mask = $mask | (int)$item;\n \tcontinue;\n }\n \n $key = array_search(strtoupper($item), self::$levels);\n if($key !== false) {\n $mask |= (int)$key;\t\n }\n }\n \n /* set */\n \n $this->level = $mask;\n \n return true;\n }",
"public static function default_experience_levels( $levels ) {\n $levels['beginner'] = __( 'Beginner', 'inventor-jobs' );\n $levels['intermediate'] = __( 'Intermediate', 'inventor-jobs' );\n $levels['professional'] = __( 'Professional', 'inventor-jobs' );\n return $levels;\n }",
"function wc_uk_counties_add_counties( $states ) {\n\n $states['GB'] = array(\n 'AV' => 'Avon',\n 'BE' => 'Bedfordshire',\n 'BK' => 'Berkshire',\n 'BU' => 'Buckinghamshire',\n 'CA' => 'Cambridgeshire',\n 'CH' => 'Cheshire',\n 'CL' => 'Cleveland',\n 'CO' => 'Cornwall',\n 'CD' => 'County Durham',\n 'CU' => 'Cumbria',\n 'DE' => 'Derbyshire',\n 'DV' => 'Devon',\n 'DO' => 'Dorset',\n 'ES' => 'East Sussex',\n 'EX' => 'Essex',\n 'GL' => 'Gloucestershire',\n 'HA' => 'Hampshire',\n 'HE' => 'Herefordshire',\n 'HT' => 'Hertfordshire',\n 'IW' => 'Isle of Wight',\n 'KE' => 'Kent',\n 'LA' => 'Lancashire',\n 'LE' => 'Leicestershire',\n 'LI' => 'Lincolnshire',\n 'LO' => 'London',\n 'ME' => 'Merseyside',\n 'MI' => 'Middlesex',\n 'NO' => 'Norfolk',\n 'NH' => 'North Humberside',\n 'NY' => 'North Yorkshire',\n 'NS' => 'Northamptonshire',\n 'NL' => 'Northumberland',\n 'NT' => 'Nottinghamshire',\n 'OX' => 'Oxfordshire',\n 'SH' => 'Shropshire',\n 'SO' => 'Somerset',\n 'SM' => 'South Humberside',\n 'SY' => 'South Yorkshire',\n 'SF' => 'Staffordshire',\n 'SU' => 'Suffolk',\n 'SR' => 'Surrey',\n 'TW' => 'Tyne and Wear',\n 'WA' => 'Warwickshire',\n 'WM' => 'West Midlands',\n 'WS' => 'West Sussex',\n 'WY' => 'West Yorkshire',\n 'WI' => 'Wiltshire',\n 'WO' => 'Worcestershire',\n 'ABD' => 'Scotland / Aberdeenshire',\n 'ANS' => 'Scotland / Angus',\n 'ARL' => 'Scotland / Argyle & Bute',\n 'AYR' => 'Scotland / Ayrshire',\n 'CLK' => 'Scotland / Clackmannanshire',\n 'DGY' => 'Scotland / Dumfries & Galloway',\n 'DNB' => 'Scotland / Dunbartonshire',\n 'DDE' => 'Scotland / Dundee',\n 'ELN' => 'Scotland / East Lothian',\n 'EDB' => 'Scotland / Edinburgh',\n 'FIF' => 'Scotland / Fife',\n 'GGW' => 'Scotland / Glasgow',\n 'HLD' => 'Scotland / Highland',\n 'LKS' => 'Scotland / Lanarkshire',\n 'MLN' => 'Scotland / Midlothian',\n 'MOR' => 'Scotland / Moray',\n 'OKI' => 'Scotland / Orkney',\n 'PER' => 'Scotland / Perth and Kinross',\n 'RFW' => 'Scotland / Renfrewshire',\n 'SB' => 'Scotland / Scottish Borders',\n 'SHI' => 'Scotland / Shetland Isles',\n 'STI' => 'Scotland / Stirling',\n 'WLN' => 'Scotland / West Lothian',\n 'WIS' => 'Scotland / Western Isles',\n 'AGY' => 'Wales / Anglesey',\n 'GNT' => 'Wales / Blaenau Gwent',\n 'CP' => 'Wales / Caerphilly',\n 'CF' => 'Wales / Cardiff',\n 'CAE' => 'Wales / Carmarthenshire',\n 'CR' => 'Wales / Ceredigion',\n 'CW' => 'Wales / Conwy',\n 'DEN' => 'Wales / Denbighshire',\n 'FLN' => 'Wales / Flintshire',\n 'GLA' => 'Wales / Glamorgan',\n 'GWN' => 'Wales / Gwynedd',\n 'MT' => 'Wales / Merthyr Tydfil',\n 'MON' => 'Wales / Monmouthshire',\n 'PT' => 'Wales / Neath Port Talbot',\n 'NP' => 'Wales / Newport',\n 'PEM' => 'Wales / Pembrokeshire',\n 'POW' => 'Wales / Powys',\n 'RT' => 'Wales / Rhondda Cynon Taff',\n 'SS' => 'Wales / Swansea',\n 'TF' => 'Wales / Torfaen',\n 'WX' => 'Wales / Wrexham',\n 'ANT' => 'Northern Ireland / County Antrim',\n 'ARM' => 'Northern Ireland / County Armagh',\n 'DOW' => 'Northern Ireland / County Down',\n 'FER' => 'Northern Ireland / County Fermanagh',\n 'LDY' => 'Northern Ireland / County Londonderry',\n 'TYR' => 'Northern Ireland / County Tyrone',\n );\n return $states;\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Implement getIterator() method. | public function getIterator()
{
} | [
"public function getIterator()\n {\n }",
"public function getIterator();",
"public function getIterator(): \\Iterator\n {\n return parent::getIterator();\n }",
"public function getInnerIterator () {}",
"public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator( $this->data );\n\t}",
"public function getIterator() {\n\t\tif (!$this->loaded) $this->load();\n\t\t\n\t\treturn parent::getIterator();\n\t}",
"public function getIterator(): \\Generator;",
"public function getIterator()\n {\n return ($this->generator)();\n }",
"public function getIterator() {\n return new \\ArrayIterator($this->cast);\n }",
"public function getInnerIterator ();",
"public function getIterator(): ContentIterator;",
"public function getIterator() {\n\t\treturn new \\ArrayObject($this->data);\n\t}",
"public function getIterator()\n {\n return new ArrayIterator((array)$this->data);\n }",
"public function getIterator()\n {\n return $this->collection->getIterator();\n }",
"public function getInnerIterator();",
"public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->items);\n\t}",
"public function getArrayIterator () {}",
"public function getIterator() {\n\t\treturn new \\ArrayIterator( $this->_fields );\n\t}",
"public function getIterator () {\r\n yield from $this->arr;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is object already viewed by user? | protected function isViewed($id){
if(!Auth::check()) {
$viewed = \Session::get($this->get_view_key($id));
if(!empty($viewed))
return true;
} else {
$userAction = UserCounters::where('action', 'view')->where('class_name', snake_case(get_class($this)))
->where('object_id', $id)->where('user_id', Auth::user()->user_id)->count();
if($userAction > 0)
return true;
}
return false;
} | [
"public function isViewed()\n {\n if (!\\Auth::user()) {\n $viewed = \\Session::get($this->get_view_key());\n if (!empty($viewed)) {\n return true;\n }\n } else {\n $user_action = $this->user_counters()\n ->where('action', 'view')\n ->where('class_name', snake_case(get_class($this)))\n ->where('object_id', $this->id)\n ->where('user_id', \\Auth::user()->id)->count();\n if ($user_action > 0) {\n return true;\n }\n }\n\n return false;\n }",
"function isViewable()\n {\n \n if (sfContext::getInstance()->getUser()->hasCredential(\"viewallcontent\"))\n { \r\n \tsfContext::getInstance()->getLogger()->info(\"You have the fu, you can see me.\");\n \treturn true;\n } \n\n // Access to approved artork is for anyone\n if ($this->isApproved()) \n {\n sfContext::getInstance()->getLogger()->info(\"This artwork is approved, so it is viewable\");\n \treturn true;\n }\n\n // Access to removed artwork is only for admin (returned true above)\n if ($this->isRemoved())\n {\n sfContext::getInstance()->getLogger()->info(\"This artwork is removed, and cannot be seen\");\n \treturn false;\n }\n \n // also allow access to owner of artwork - unless they have removed it\n if (sfContext::getInstance()->getUser()->isAuthenticated()\n && $this->getUserId() == sfContext::getInstance()->getUser()->getGuardUser()->getId())\n {\n sfContext::getInstance()->getLogger()->info(\"You can see this artwork since you are the owner\");\n \treturn true;\n }\n\n sfContext::getInstance()->getLogger()->info(\"This artwork is not approved, and cannot be seen\");\n return false;\n }",
"public function isLiked()\n {\n if(!\\Auth::user())\n {\n $viewed = \\Session::get($this->get_like_key());\n if(!empty($viewed)) {\n return true;\n } \n } else {\n $user_action = $this->user_counters()\n ->where('action', 'like')\n ->where('class_name', snake_case(get_class($this)))\n ->where('object_id', $this->id)\n ->where('user_id', \\Auth::user()->id)->count();\n if($user_action > 0)\n return true;\n }\n return false;\n }",
"public function canBeSeenBy($obj) {\n $isUser = ($obj instanceof User);\n if($this->isPublic()) {\n // Everyone can see this.\n return true;\n } else if($isUser) {\n if(!$this->isPrivate()) {\n // Logged in users can see all but private content.\n return true;\n } else {\n // A class using this trait should overwrite `canBeSeenByUser()`\n // to guarantee this to work properly.\n return $this->canBeSeenByUser($obj);\n }\n }\n }",
"public function isViewingOne(): bool\n {\n return $this->isMethod('GET') && $this->hasResourceId() && $this->isNotRelationship();\n }",
"public function isCurrent()\n {\n if (static::getCurrentUser() && $this->getObjectId()) {\n if ($this->getObjectId() == static::getCurrentUser()->getObjectId()) {\n return true;\n }\n }\n\n return false;\n }",
"function _hasAccess()\r\n {\r\n // create user object\r\n $user =& User::singleton();\r\n\r\n $timePoint =& TimePoint::singleton($_REQUEST['sessionID']);\r\n $candID = $timePoint->getCandID();\r\n\r\n $candidate =& Candidate::singleton($candID);\r\n\r\n // check user permissions\r\n return ($user->hasPermission('access_all_profiles') || $user->getData('CenterID') == $candidate->getData('CenterID') || $user->getData('CenterID') == $timePoint->getData('CenterID'));\r\n }",
"function _hasAccess()\n {\n // create user object\n $user =& User::singleton();\n\n $timePoint =& TimePoint::singleton($_REQUEST['sessionID']);\n $candID = $timePoint->getCandID();\n\n $candidate =& Candidate::singleton($candID);\n\n // check user permissions\n return ($user->hasPermission('access_all_profiles') || $user->getData('CenterID') == $candidate->getData('CenterID') || $user->getData('CenterID') == $timePoint->getData('CenterID'));\n }",
"public function canBeViewed()\n\t{\n\t\treturn $this->isPublished()\n\t\t\t|| ($this->getPostStatus() === 'private' && Mage::getSingleton('customer/session')->isLoggedIn());\n\t}",
"public function canView()\n\t{\n\t\t// Assert the object is loaded.\n\t\t$this->assertIsLoaded();\n\n\t\t// Check if an access level is set.\n\t\tif (isset($this->access))\n\t\t{\n\t\t\t// Get the user's authorised view levels.\n\t\t\t$levels = $this->user->getAuthorisedViewLevels();\n\n\t\t\t// Check if the user has access.\n\t\t\treturn in_array($this->access, $levels);\n\t\t}\n\n\t\treturn null;\n\t}",
"static public function isUserHasSomeViewAccess()\n\t{\n\t\ttry{\n\t\t\tself::checkUserHasViewAccess( $idSites );\n\t\t\treturn true;\n\t\t} catch( Exception $e){\n\t\t\treturn false;\n\t\t}\n\t}",
"function checkAccess () {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) return true;\n else { return false; }\n }",
"public function canView(Model $object): bool {\n\t\treturn $this->can('view', $object);\n\t}",
"public function isUserVisible(): bool;",
"public function in_view() { \n return $GLOBALS['pagenow'] === 'admin.php' && isset($_GET['page']) && $_GET['page'] === $this->config['id'];\n }",
"public function view(User $user)\n {\n return $user->hasPermissionTo('experience_view');\n }",
"public function canUserView()\n\t{\n\t\tfor($i = 0; $i < sizeof($this->_nonViewers); $i++)\n\t\t{\n\t\t\tif($this->_userRole == $this->_nonViewers[$i] && $this->layout != null)\n\t\t\t{\n\t\t\t\t$this->actionIndex();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"static function owns($object) {\n if ($object->owner_guid == $this->guid || adminLoggedIn()) {\n return true;\n }\n return false;\n }",
"public function isViewedByUser(int $userId,int $objectId){\n $userUid = $this->userUid($userId);\n $objectUid = $this->objectUid($objectId);\n $gremlinScript = \"g.V('{$objectUid}').in('{$this->labelView}').hasId('{$userUid}').count()\";\n $result = $this->runGremlinScript($gremlinScript);\n return isset($result['result']['data']['@value'][0]['@value']) && $result['result']['data']['@value'][0]['@value'] > 0;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Slugify a full file name with file extension. | public function slugifyFile(string $fileName) : string
{
// Retrieve extension
$explodedFileName = explode('.', $fileName);
$extension = end($explodedFileName);
// Remove extension
$string = preg_replace('/.[^.]*$/', '', $fileName);
return $this->slugify($string).'.'.$extension;
} | [
"public function slugifyFile($fileName);",
"public function slugFileName($file_name, $extension) : string\n {\n return \\Str::slug($file_name) . '.' . $extension;\n // return $this->slugify($file_name) . '.' . $extension;\n }",
"private static function slugify($filename) {\n\n if (!isset(self::$config['slugify']) && !isset(self::$options['slugify'])) {\n return Str::slug($filename);\n }\n\n if (isset(self::$options['slugify'])) {\n return Str::slug($filename);\n }\n\n if (isset(self::$config['slugify'])) {\n return self::$config['slugify'] ? Str::slug($filename) : $filename;\n }\n\n return $filename;\n }",
"protected function _slug_filename($filename)\n {\n return strtolower(preg_replace('/[^A-Z0-9._-]/i', '_', $filename));\n }",
"public function slug_from_filename( $filename ) {\n\t\treturn str_slug( explode( '.', $filename )[0] );\n\t}",
"public static function file_name($file) { return preg_replace('/(\\.[^\\.]+){1,2}$/', '', self::clean(basename($file))); }",
"function hm_sanitize_file_name( $filename ) {\n if( function_exists( 'normalizer_normalize' ) ) {\n $filename = normalizer_normalize( $filename );\n }\n\n $filename = remove_accents( $filename );\n\n return $filename;\n}",
"function getPostSlug($fileName) {\n return substr($fileName, 0, -3);\n }",
"public static function sanitizeFileName( $fileName )\n\t{\n\t\t$fileParts = explode( \".\", basename( $fileName ) );\n\t\tif ( count( $fileParts ) > 1 )\n\t\t{\n\t\t\tarray_pop( $fileParts );\n\t\t\t$fileName = end( $fileParts );\n\t\t}\n\t\treturn preg_replace('/[^A-Za-z0-9_\\-]/', '_', $fileName );\n\t}",
"public function turnFilenameToName()\n {\n $parts = explode('-', $this->getFilename());\n return ucwords(trim($parts[0]));\n }",
"function sanitize_file_name($filename) {\n\t// Remove characters that could alter file path.\n\t// I disallowed spaces because they cause other headaches.\n\t// \".\" is allowed (e.g. \"photo.jpg\") but \"..\" is not.\n\t$filename = preg_replace(\"/([^A-Za-z0-9_\\-\\.]|[\\.]{2})/\", \"\", $filename);\n\t// basename() ensures a file name and not a path\n\t$filename = basename($filename);\n\treturn $filename;\n}",
"public function normalizeFileName($file)\n\t{\n\t\t$extension = pathinfo($file, PATHINFO_EXTENSION);\n\n\t\tif ( ! $extension)\n\t\t{\n\t\t\t$file .= '.'.$this->defaultExtension;\n\t\t}\n\n\t\treturn ltrim($file, '/');\n\t}",
"function get_filename_slug_from_path( string $file_path ) : string {\n\treturn basename( str_replace(\n\t\t[ '/namespace.php', '.php' ],\n\t\t[ '', '' ],\n\t\t$file_path\n\t) );\n}",
"public function sanitizeFilename()\n {\n $this->fileName = static::secureName($this->fileName, $this->config->get('disallowUnsafeCharacters'));\n\n $resourceType = $this->workingFolder->getResourceType();\n\n if ($this->config->get('checkDoubleExtension')) {\n $pieces = explode('.', $this->fileName);\n\n $basename = array_shift($pieces);\n $extension = array_pop($pieces);\n\n foreach ($pieces as $p) {\n $basename .= $resourceType->isAllowedExtension($p) ? '.' : '_';\n $basename .= $p;\n }\n\n // Add the last extension to the final name.\n $this->fileName = $basename . '.' . $extension;\n }\n }",
"static function buildSlug($name='')\n\t{\n\t\t$slug = self::convert_string_vi_to_en($name);\n $slug = strtolower(preg_replace('/[^a-zA-Z0-9]+/i', '-', str_replace('.', '', $slug)));\n return $slug;\n\t}",
"public function _prep_filename($filename) {\n if ($this->mod_mime_fix === FALSE OR $this->allowed_types === '*' OR ( $ext_pos = strrpos($filename, '.')) === FALSE) {\n return $filename;\n }\n\n $ext = substr($filename, $ext_pos);\n $filename = substr($filename, 0, $ext_pos);\n return str_replace('.', '_', $filename) . $ext;\n }",
"function sanitize_file_names_for_uploads( $filename ) {\n\n $sanitized_filename = remove_accents( $filename ); // Convert to ASCII\n\n // Standard replacements\n $invalid = array(\n ' ' => '-',\n '%20' => '-',\n '_' => '-',\n );\n $sanitized_filename = str_replace( array_keys( $invalid ), array_values( $invalid ), $sanitized_filename );\n $sanitized_filename = preg_replace('/[^A-Za-z0-9-\\. ]/', '', $sanitized_filename); // Remove all non-alphanumeric except .\n $sanitized_filename = preg_replace('/\\.(?=.*\\.)/', '', $sanitized_filename); // Remove all but last .\n $sanitized_filename = preg_replace('/-+/', '-', $sanitized_filename); // Replace any more than one - in a row\n $sanitized_filename = str_replace('-.', '.', $sanitized_filename); // Remove last - if at the end\n $sanitized_filename = strtolower( $sanitized_filename ); // Lowercase\n\n return $sanitized_filename;\n}",
"private function slug()\n {\n $name = get_called_class();\n $name = str_replace('\\\\', '-', $name);\n $name = $this->camelToSnake($name);\n\n return $name;\n }",
"function sanitizeTemplateName($filename)\n {\n return preg_replace('/[^A-Z0-9]/i', '_',\n ucfirst(str_replace('.dwt', '', $filename)));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of id_source. | public function getIdSource()
{
return $this->id_source;
} | [
"public function getSourceId()\n {\n return $this->getData('source_id');\n }",
"public function getSourceId() {\n return $this->_source_id;\n }",
"public function getSourceID()\n {\n return $this->sourceID;\n }",
"function getSourceID() {\n\t\treturn $this->_SourceID;\n\t}",
"public function getSourceId() {\n\t\treturn $this->_sourceId;\n\t}",
"public function sourceObjectId()\n {\n return $this->sourceObjectId;\n }",
"public function getSourceEntityId() {\n return $this->sourceEntityId;\n }",
"public function getSourceObjectId()\n {\n return $this->id;\n }",
"protected function getSourceID()\n\t{\n\t\t$source_id = NULL;\n\t\t\n\t\tswitch ($this->call_type)\n\t\t{\n\t\t\tcase self::TYPE_IDVE_IMPACT:\t$source_id = 5; break;\n\t\t\tcase self::TYPE_PDX_REWORK:\t\t$source_id = 6; break;\n\t\t\tcase self::TYPE_IDVE_IFS:\t\t$source_id = 12; break;\n\t\t\tcase self::TYPE_IDVE_IPDL:\t\t$source_id = 13; break;\n\t\t\tcase self::TYPE_IDVE_ICF:\t\t$source_id = 14; break;\n\t\t}\n\t\t\n\t\treturn $source_id;\n\t}",
"public function getSourceEntityId() {\n\t\treturn $this->sourceEntityId;\n\t}",
"protected function getSourceID()\n\t{\n\t\t$source_id = NULL;\n\t\t\n\t\tswitch ($this->call_type)\n\t\t{\n\t\t\tcase self::TYPE_IDV_PW:\t\t\t$source_id = 3; break;\n\t\t\tcase self::TYPE_DF_PHONE:\t\t$source_id = 7; break;\n\t\t\tcase self::TYPE_IDV_CCRT:\t\t$source_id = 8; break;\n\t\t}\n\t\t\n\t\treturn $source_id;\n\t}",
"public function getSourcedId()\n {\n return array_get($this->response, 'imsx_POXBody.replaceResultRequest.resultRecord.sourcedGUID.sourcedId');\n }",
"public function getSourceLinkedid()\n {\n return $this->getKey('SourceLinkedid');\n }",
"public function getIdAttribute()\n {\n return $this->data_source_id;\n }",
"public function getResIDSource()\n {\n return $this->resIDSource;\n }",
"abstract public function get_source_object_id();",
"public function get($source_id);",
"public function getSourceUniqueid()\n {\n return $this->getKey('SourceUniqueid');\n }",
"public function getId()\n {\n return $this->source->meta_id;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find the page by the id, give the subject_id , send it to find subject by id. | function subject_name_by_page_id($id){
global $db;
$sql="SELECT * FROM pages WHERE id={$id}";
$result_set=mysqli_query($db,$sql);
$page=mysqli_fetch_assoc($result_set);
$subject= find_subject_by_id($page['subject_id']);
return $subject['menu_name'];
} | [
"function find_pages_by_subject_id($id, $options=[]){\n\t\tglobal $db;\n\t\t//$visible = $options['visible'] ?? 'false';\n\t\t$visible = isset($options['visible']) ? $options['visible'] : 'false';\n\t\t$sql = \"SELECT * FROM pages \";\n\t\t$sql .= \"WHERE subject_id='\" . db_escape($db, $id) . \"' \";\n\t\tif ($visible == 'true') {\n\t\t\t$sql .= \"AND visible=true \"; \n\t\t}\n\t\t$sql .= \"ORDER BY position ASC\";\n\t\t$result = mysqli_query($db, $sql);\n\t\tconfirm_query_result($result);\n\n\t\treturn $result;\n\t}",
"function find_subject_by_id($subject_id) {\n\tglobal $connect;\n\n\t$query = \"SELECT * FROM subject WHERE id = {$subject_id};\";\n\t$result3 = $connect->query($query);\n\tconfirm_query($result3);\n\t\n\t\n\n\tif ($row3 = $result3->fetch(PDO::FETCH_ASSOC)) {\n\t\treturn $row3;\n\t} else {\n\t\treturn null;\n\t}\n}",
"function find_pages_for_subject($subject_id, $public = true) {\r\n\t\tglobal $db;\r\n\t\t\r\n\t\t$safe_subject_id = mysqli_real_escape_string($db, $subject_id);\r\n\r\n\t\t$query = \"SELECT * \";\r\n\t\t$query .= \"FROM pages \";\r\n\t//\t$query .= \"WHERE visible = 1 \";\r\n\t//\t$query .= \"AND subject_id = {$safe_subject_id} \";\r\n\t\t$query .= \"WHERE subject_id = {$safe_subject_id} \";\r\n\t\tif($public) {\r\n\t\t\t$query .= \"AND visible = 1 \";\r\n\t\t}\r\n\t\t$query .= \"ORDER BY position ASC\";\r\n\r\n\t\t$page_set = mysqli_query($db, $query);\r\n\t\tconfirm_query($page_set);\r\n\r\n\t\treturn $page_set;\r\n\t}",
"function findSelectedSubjectById($subject_id){\n\tglobal $connection;\n\n\t$safe_id = mysqli_real_escape_string($connection,$subject_id);\n\t$query = \"SELECT * FROM subjects\n\t\t\t\t WHERE id = {$safe_id}\n\t\t\t\t LIMIT 1\";\n\t$subject_set = mysqli_query($connection, $query);\n\tconfirmQuery($subject_set);\n\tif ($subject = mysqli_fetch_assoc($subject_set)){\n\t\treturn $subject;\n\t} else {\n\t\treturn null;\n\t}\n}",
"function find_subject_by_id($selected_subject_id, $public = true) {\n\t// CAUTION: since $selected_subject_id is simply a query number from the URL, it could be tampered with\n\t// so be sure to protect the code from SQL Injection threats...\n\tglobal $connection;\n\t$safe_subject_id = mysqli_real_escape_string($connection, $selected_subject_id);\n\t$query = \"SELECT * FROM subjects WHERE id = {$safe_subject_id} \";\n\tif ($public) { $query .= \"AND visible = 1 \"; }\n\t$query .= \"LIMIT 1\";\n\t$subject_content = mysqli_query($connection, $query);\n\tconfirm_query($subject_content);\n\tif ($output = mysqli_fetch_assoc($subject_content)) {\n\t\treturn $output;\n\t} else {\n\t\treturn null; // return no value if there is nothing in the queried row\n\t}\n}",
"function getsubjectbyid($id){\n $q = \"select * from subject where id=$id\";\n $r = mysql_query($q);\n \n return $r;\n }",
"function findSubjectByID($subject_id, $public = true) {\n\tglobal $mysqli;\n\t$subject_id = mysqli_real_escape_string($mysqli, $subject_id);\n\t$query = \"SELECT * FROM subjects WHERE id = {$subject_id} \";\n\tif ($public) {\n\t\t$query .= \" AND visible = 1\";\n\t}\n\t$subject_set = mysqli_query($mysqli, $query);\n\tconfirmQuery($subject_set);\n\tif ($subject = mysqli_fetch_assoc($subject_set)) {\n\t\treturn $subject;\n\t} else {\n\t\treturn null;\n\t}\n}",
"function check_subject_or_page($public = False) {\n\tglobal $subject_by_id;\n\tglobal $page_by_id;\n\tglobal $selected_subject_id;\n\tglobal $selected_page_id;\n\n\tif (isset($_GET['subject'])) {\n\t\t$selected_subject_id = $_GET['subject'];\n\t\t$subject_by_id = find_subject_by_id($selected_subject_id); \n\t\tif ($public) {\n\t\t\t$page_by_id = find_default_page_for_subject($selected_subject_id); //find a default page\n\t\t} else {\n\t\t\t$page_by_id = null;\n\t\t}\n\t\t$selected_page_id = null; \n\t} elseif (isset($_GET['page'])) {\n\t\t$selected_page_id = $_GET['page'];\n\t\t$page_by_id = find_page_by_id($selected_page_id, $public); \n\t\t$subject_by_id = null;\n\t\t$selected_subject_id = null;\n\t} else {\n\t\t$selected_subject_id = null;\n\t\t$selected_page_id = null; \n\t\t$subject_by_id = null;\n\t\t$page_by_id = null;\n\t}\n}",
"function getsubjectbyid($id)\n {\n $q = \"select * from subject where id=$id\";\n $r = mysql_query($q);\n return $r;\n }",
"function find_selected_menu(){\n\tglobal $current_page;\n\tglobal $current_subject;\n\tif(isset($_GET[\"subject\"])){\n\t\t$current_subject= find_subject_by_id($_GET[\"subject\"]);\n\t\t$current_page=null;\n\t}\n\telseif(isset($_GET[\"page\"])){\n\t\t$current_page=find_page_by_id($_GET[\"page\"]);\n\t\t$current_subject=null;\n\t}\n\telse{\n\t\t$current_subject=null;\n\t\t$current_page=null;\n\t\t}\n\t\t\n\t\t\n\t}",
"public function pageesmcAction()\n {\n\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmc');\n \n\n $id = (int) $this->_request->getParam('id');\n if($id > 0){\n $page = new Application_Model_EuPage();\n $pageM = new Application_Model_EuPageMapper();\n $pageM->find2($id, $page);\n $this->view->page = $page;\n } else { $this->_redirect('/'); } \n }",
"function find_default_page_for_subject($subject_id) {\n\t$page_set = find_pages_for_subject($subject_id);\n\tif ($first_page = $page_set->fetch(PDO::FETCH_ASSOC)) {\n\t\treturn $first_page;\n\t} else {\n\t\treturn null;\n\t}\n}",
"function find_selected_page($public = false) {\r\n\t\tglobal $current_subject;\r\n\t\tglobal $current_page;\r\n\t\t\r\n\t\tif(isset($_GET[\"subject\"])) {\r\n\t\t\t$current_subject = find_subject_by_id($_GET[\"subject\"], $public);\r\n\t\t\tif($current_subject && $public) {\r\n\t\t\t\t$current_page = find_default_page_for_subject($current_subject[\"id\"]);\r\n\t\t\t} else {\r\n\t\t\t\t$current_page = null;\r\n\t\t\t}\r\n\t\t} elseif (isset($_GET[\"page\"])) {\r\n\t\t\t$current_page = find_page_by_id($_GET[\"page\"], $public);\r\n\t\t\t$current_subject = null;\r\n\t\t} else {\r\n\t\t\t$current_subject = null;\r\n\t\t\t$current_page = null;\r\n\t\t}\r\n\t}",
"public function idToSubjectAction() { //Should be DEPRECATED in due course\n $data = $this->fromJson();\n if(!isset($data['ids'])) { return $this->fail('wrong input'); }\n $ids = [];\n $unids = [];\n $subjects = [];\n foreach($data['ids'] as $id) {\n if(is_array($id)) { $id = reset($id); }\n if(!$id) { continue; }\n if($this->isUnid($id)) {\n $unids[] = $id;\n } else {\n $ids = $id;\n }\n } \n $portal_rep = $this->getRepo('Portal');\n \n $portalDatasId = $portal_rep->findBy(['_id' => ['$in' => $ids]]);\n $portalDatasUnid = $portal_rep->findBy(['unid' => ['$in' => $unids]]);\n \n foreach($portalDatasId as $doc) {\n $s = $doc->getSubject() ? $doc->getSubject() : ($doc->GetSubjVoting() ? $doc->GetSubjVoting() : null);\n if($s) {\n $subjects[$doc->getId()] = $subjects[$doc->getUnid()] = $s;\n }\n }\n foreach($portalDatasUnid as $doc) {\n $s = $doc->getSubject() ? $doc->getSubject() : ($doc->GetSubjVoting() ? $doc->GetSubjVoting() : null);\n if($s) {\n $subjects[$doc->getId()] = $subjects[$doc->getUnid()] = $s;\n }\n }\n if(empty($subjects)) {\n return $this->fail('no documents with specified subjects found', ['ids' => $ids, 'unids' => $unids]);\n }\n return $this->success(['subjects' => $subjects]);\n }",
"function show_subjectlist_Byid( $id ) {\n\t$db = Database::getInstance();\n\t$conn = $db->getConnection();\n\t$sql = \"SELECT * FROM tbl_subject_list WHERE subjectlist_id=:id\";\n\t$stmt = $conn->prepare($sql) ;\n\t$stmt->bindValue(':id',$id) ;\n\t$stmt->execute();\n\treturn $stmt ;\n}",
"function find_default_page($subject_id){\r\n\t $page_set = find_pages_for_subject($subject_id, true);\r\n\t if($first_page = mysqli_fetch_assoc($page_set)){\r\n\t\t return $first_page;\r\n\t }else{\r\n\t\t return null;\r\n\t }\r\n }",
"function get_all_pages_under_subject($id, $public = true) {\n\t\tglobal $connection;\r\n\t\t$query = \"SELECT * FROM pages\n\t\t\t\t WHERE subject_id = {$id} \";\n\t\tif ($public) {\n\t\t\t$query .= \"AND visible = 'yes' \";\n\t\t}\n\t\t$query .= \"ORDER BY position ASC\";\r\n\t\t$page_set = mysql_query($query, $connection);\r\n\t\tconfirm_query($page_set);\r\n\t\treturn $page_set;\r\n\t}",
"public function swipe_subjects($id = '')\n {\n //echo $index; die();\n if(in_array($id, Session::get('subjects'))){\n Session::put('current_subject', $id);\n\n $index_of_subject = array_search(Session::get('current_subject'), Session::get('subjects'));\n //echo $index_of_subject; die();\n if($index_of_subject == 0){ //First Subject selected\n Session::put('answers-tab', Session::get('selected_answers_first'));\n }else if($index_of_subject == 1){ // Second subject selected\n Session::put('answers-tab', Session::get('selected_answers_second'));\n }else if($index_of_subject == 2){ // Third subject selected\n Session::put('answers-tab', Session::get('selected_answers_third'));\n }\n }\n //echo Session::get('current_subject'); die();\n Redirect::to('/student/start-exam');\n }",
"public function show(int $id)\n {\n try {\n $query = 'SELECT * FROM subjects WHERE id = :id';\n $stmt = $this->db->prepare($query);\n $stmt->bindValue(':id', $id, PDO::PARAM_INT); // id param must be int\n $stmt->execute();\n $subject = $stmt->fetch(PDO::FETCH_ASSOC); // get subject with id\n $stmt->closeCursor();\n\n return $subject;\n } catch (PDOException $exception) {\n die($exception->getMessage());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes all classes required for displaying flash messages. | protected function initializeFashMessageClasses()
{
if (isset($this->flashMessageService)) {
return;
}
$this->flashMessageService = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
$this->languageService = $GLOBALS['LANG'];
} | [
"function flashMessengerInit()\n\t{\n\t\t/* Getting instance of FlashMessenger Action Helper */\n\t\t$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t\t\n\t\t/* Getting stored messages on FlashMessenger and setting in view */\n\t\t$this->view->flashMessengerAlerts = $this->_flashMessenger->getMessages();\n\t}",
"public function __construct()\n\t{\n\t\tif (!Phpr::$session->has(self::flash_key))\n\t\t\treturn;\n\n\t\t$this->flash = Phpr::$session->get(self::flash_key);\n\t\t$this->now();\n\t}",
"private function initializeFlash() {\n static::$flashInitialized = true;\n $_SESSION[self::FLASHED_THISREQ] = $this->get(self::FLASHED_NEXTREQ, []);\n $_SESSION[self::FLASHED_NEXTREQ] = [];\n }",
"protected function addFlashMessages() {}",
"public function prepareFlashMessages()\n {\n global $session;\n\n $messages = [];\n foreach ($session->getFlashBag()->all() as $msgType => $msg) {\n $messages[$msgType] = $msg;\n }\n //print_r($messages);\n //exit;\n\n $this->addTwigVar('messages', $messages);\n }",
"public static function setFlashMessages(){\n\n\t\t// check session has flash message then regenerate flash message and render with ajax request\n\t\tif (session()->has('flash_notification')) {\n\n\t\t\tif(count((array) session('flash_notification')) == 1){\n\t\t\t\tforeach ((array) session('flash_notification') as $message){\n\t\t\t\t\t\\Log::info('set flash message',['set message' => $message['message']]);\n\t\t\t\t\tif(isset($message['level']) && $message['level'] == 'success'){\n\t\t\t\t\t\tflash($message['message'])->success();\n\t\t\t\t\t}else if(isset($message['level']) && $message['level'] == 'danger'){\n\t\t\t\t\t\tflash($message['message'])->error();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// check session has message then regenerate flash message and render with ajax request\n\t\tif (session()->has('message')) {\n\t\t\tflash(session('message'))->error();\n\t\t}\n\n\t\t// check session has success message then regenerate flash message and render with ajax request\n\t\tif (session()->has('success')) {\n\t\t\tflash(session('success'))->success();\n\t\t}\n\t}",
"function prepare_messages(){\n\t\t\n\t\tforeach($this->messages as $type => $messages){\n\t\t\t\n\t\t\t// add flash data for this type to the stack\n\t\t\t$flash = $this->CI->session->flashdata($type);\n\t\t\tif($flash != ''){\n\t\t\t\t$messages[] = $flash;\n\t\t\t}\n\t\t\t\n\t\t\t// if there's messages of this type, prepare for printing\n\t\t\tif(sizeof($messages)){\n\t\t\t\t$this->data['messages'] .= '<ul class=\"messages '.$type.'\">';\n\t\t\t\n\t\t\t\tforeach($messages as $message){\n\t\t\t\t\t$this->data['messages'] .= '<li>'.$message.'</li>';\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$this->data['messages'] .= '</ul>';\n\t\t\t}\n\t\t\t\n\t\t}\n\t\n\t}",
"public static function get_flash()\n\t{\t\n\t\tif (isset(static::$_flash['success']))\n\t\t{\n\t\t\t\\Session::set_flash('success', \"<strong>Success:</strong><br>\".implode('<br>', static::$_flash['success']));\n\t\t}\n\t\t\n\t\tif (isset(static::$_flash['error']))\n\t\t{\n\t\t\t\\Session::set_flash('error', \"<strong>Error:</strong><br>\".implode('<br>', static::$_flash['error']));\n\t\t}\n\t}",
"public static function init()\n {\n // setup alerts\n self::$alerts[self::TYPE_ERROR] = array();\n self::$alerts[self::TYPE_NOTICE] = array();\n\n if (Pfw_Session::isStarted()) {\n // setup session alerts\n $session_alerts = Pfw_Session::get(self::SESSION_KEY);\n if (isset($session_alerts)) {\n if (isset($session_alerts[self::TYPE_ERROR])) {\n self::$alerts[self::TYPE_ERROR] = $session_alerts[self::TYPE_ERROR];\n }\n if (isset($session_alerts[self::TYPE_NOTICE])) {\n self::$alerts[self::TYPE_NOTICE] = $session_alerts[self::TYPE_NOTICE];\n }\n Pfw_Session::clear(self::SESSION_KEY);\n }\n } else {\n error_log(\"Pfw_Session is not initialized prior to Pfw_Alert, \".\n \"alerts / notices which follow redirects \".\n \"may exhibit unexpected behavior\", \n E_USER_WARNING\n );\n }\n\n self::$initialized = true;\n }",
"protected function initializeRequiredClasses() {\n\t\tif (isset($this->tabHandlerFactory)) {\n\t\t\treturn;\n\t\t}\n\t\t$this->tabHandlerFactory = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('Aoe\\\\Linkhandler\\\\Browser\\\\TabHandlerFactory');\n\t\t$this->languageService = $GLOBALS['LANG'];\n\t\t$this->databaseConnection = $GLOBALS['TYPO3_DB'];\n\t}",
"protected function renderFlashMessages() {}",
"public function __construct() {\n if (!isset($_SESSION['messages'])) {\n $_SESSION['messages'] = array();\n }\n\n parent::__construct();\n }",
"public function main()\n {\n $this->addDummyFlashMessage();\n parent::main();\n }",
"public function __construct()\n {\n if (get_called_class() != 'ApplicationController') {\n $this->_set_default_layout();\n $this->_vars = new stdClass();\n $this->_init();\n }\n }",
"public function renderFlashMessages() {}",
"public static function enable_flash_notices() {\n self::$flash_enabled = true;\n\n add_action('admin_init', [static::class, 'display_flash_notices']);\n }",
"public function __construct() {\n\t\t$this->controller = array();\n\t\t$this->lib = array();\n\t\t$this->model = array();\n\n\t\t$this->form = new Form();\n\n\t\t// NOTE: let's assume that we'll always need session.\n\t\tSession::init();\n\t}",
"private function messages_init() {\n\t\treturn $this->messages = [\n\t\t\t'error' => [\n\t\t\t\t'prefix' => __( 'Browsersync Helper Error: ', 'browsersync-helper' ),\n\t\t\t\t'entries' => [],\n\t\t\t],\n\t\t\t'notification' => [\n\t\t\t\t'prefix' => __( 'Browsersync Helper Notification: ', 'browsersync-helper' ),\n\t\t\t\t'entries' => [],\n\t\t\t],\n\t\t];\n\t}",
"protected function initMessage()\n {\n $this->message = new Message(static::DEFAULT_LANG);\n $this->message->setLang($this->db->getSetting('lang'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add WooCommerce as reviews source. | public function reviews_source( $data ) {
$data['options']['woocommerce'] = 'WooCommerce';
foreach ( $this->get_fields() as $field_key => $field_data ) {
if ( 'woo_template' == $field_key ) {
continue;
}
$data['toggle']['woocommerce']['fields'][] = $field_key;
}
$data['toggle']['woocommerce']['fields'][] = 'product_img';
$data['hide']['custom']['fields'][] = 'woo_custom_url';
$data['hide']['woocommerce']['fields'] = array( 'review_template', 'woo_custom_url', 'woo_product_orders' );
return $data;
} | [
"private function addReviews()\n {\n $this->_doQuery(\n \"\n INSERT INTO \" . $this->_getTableName(\n 'catalog_product_entity_text'\n ) . \" (\n attribute_id,\n store_id,\n entity_id,\n value\n )(\n SELECT\n \" . $this->_getProductAttributeId('reviews')\n . \",\n w.website,\n a.entity_id,\n b.Reviews\n FROM \" . $this->_getTableName(\n 'catalog_product_entity'\n ) . \" a\n INNER JOIN \" . $this->_getTableName(\n 'products_temp'\n ) . \" b\n ON a.store_product_id = b.store_product_id\n INNER JOIN \" . $this->_getTableName(\n 'products_website_temp'\n ) . \" w\n ON a.store_product_id=w.store_product_id\n )\n ON DUPLICATE KEY UPDATE\n value = b.Reviews\n \"\n );\n\n // product Reviews for all web sites\n $this->_doQuery(\n \"\n INSERT INTO \" . $this->_getTableName(\n 'catalog_product_entity_text'\n ) . \" (\n attribute_id,\n store_id,\n entity_id,\n value\n )(\n SELECT\n \" . $this->_getProductAttributeId('reviews')\n . \",\n 0,\n a.entity_id,\n b.Reviews\n FROM \" . $this->_getTableName(\n 'catalog_product_entity'\n ) . \" a\n INNER JOIN \" . $this->_getTableName(\n 'products_temp'\n ) . \" b\n ON a.store_product_id = b.store_product_id\n )\n ON DUPLICATE KEY UPDATE\n value = b.Reviews\n \"\n );\n }",
"function learn_press_add_course_review( $args = array() ) {\n\t$args = wp_parse_args(\n\t\t$args,\n\t\tarray(\n\t\t\t'title' => '',\n\t\t\t'content' => '',\n\t\t\t'rate' => '',\n\t\t\t'user_id' => 0,\n\t\t\t'course_id' => 0\n\t\t)\n\t);\n\t$user_id = $args['user_id'];\n\t$course_id = $args['course_id'];\n\t$user_review = learn_press_get_user_rate( $course_id, $user_id );\n\t$comment_id = 0;\n\tif ( ! $user_review ) {\n\t\t$user = get_user_by( 'id', $user_id );\n\t\t$comment_id = wp_new_comment(\n\t\t\tarray(\n\t\t\t\t'comment_post_ID' => $course_id,\n\t\t\t\t'comment_author' => $user->display_name,\n\t\t\t\t'comment_author_email' => $user->user_email,\n\t\t\t\t'comment_author_url' => '',\n\t\t\t\t'comment_content' => $args['content'],\n\t\t\t\t'comment_parent' => 0,\n\t\t\t\t'user_id' => $user->ID,\n\t\t\t\t'comment_approved' => 1,\n\t\t\t\t'comment_type' => 'review' // let filter to not display it as comments\n\t\t\t)\n\t\t);\n\t}\n\tif ( $comment_id ) {\n\t\tadd_comment_meta( $comment_id, '_lpr_rating', $args['rate'] );\n\t\tadd_comment_meta( $comment_id, '_lpr_review_title', $args['title'] );\n\t}\n\n\treturn $comment_id;\n}",
"public function actionAddReview() {\r\n if (Yii::$app->user->isGuest) {\r\n return $this->redirect(array('site/login-signup'));\r\n }\r\n if (Yii::$app->request->isAjax) {\r\n $product_id = $_POST['product_id'];\r\n $model_review = new \\common\\models\\CustomerReviews();\r\n $product_details = Product::findOne($product_id);\r\n $data = $this->renderPartial('add_reviews', [\r\n 'model_review' => $model_review,\r\n 'product_id' => $product_id,\r\n 'product_details' => $product_details,\r\n ]);\r\n echo $data;\r\n }\r\n }",
"public function actionAddReview() {\r\n $prod_id = $this->_input->filterSingle(\"product_id\", XenForo_Input::INT);\r\n $current_user = XenForo_Visitor::getInstance()->toArray();\r\n $user_review = $this->getModelFromCache('ProdsTool_Model_PTUtils')->getUserProductReview($current_user['user_id'], $prod_id);\r\n\t\tif (!$current_user['user_id'] || $user_review) { return $this->responseNoPermission(); }\r\n\r\n if(isset($_REQUEST['submit'])) {\r\n $data = $this->_input->filter(array(\"product_id\" => XenForo_Input::INT,\r\n \"title\" => XenForo_Input::STRING,\r\n \"rating\" => XenForo_Input::FLOAT,\r\n \"editor_rating\" => XenForo_Input::FLOAT));\r\n $data['description'] = $this->getHelper('Editor')->getMessageText('description', $this->_input);\r\n $data['created_by'] = $current_user['user_id'];\r\n $this->getModelFromCache('ProdsTool_Model_PTUtils')->createProductReview($data);\r\n\r\n $product = $this->getModelFromCache('ProdsTool_Model_PTUtils')->getProductDetails($data['product_id']);\r\n $redirect_link = 'pthome/product/'. ($data['editor_rating'] ? \"userreviews/\" : 'review/');\r\n return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS,\r\n XenForo_Link::buildPublicLink($redirect_link, $product),\r\n \"Review added successfully...\",\r\n array(\"review\" => \"add\"));\r\n }\r\n\r\n $viewParams = array();\r\n $product = $this->getModelFromCache('ProdsTool_Model_PTUtils')->getProductDetails($prod_id);\r\n $category = $this->getModelFromCache('ProdsTool_Model_PTUtils')->getProductCategoryDetails($prod_id);\r\n $viewParams = array(\"product\" => $product, \"category\" => $category);\r\n\r\n return $this->responseView('ProdsTool_ViewPublic_ProductAddReview', 'ProdsTool_ProductAddReview', $viewParams);\r\n }",
"function add_review_link ($id=0, $context='display') {\n\tif (!$product = get_post($id)) {\n\t\treturn;\n\t}\n\n\tif ('display' == $context) {\n\t\t$action = '&action=edit&post_parent=';\n\t}\n\telse {\n\t\t$action = '&action=edit&post_parent=';\n\t}\n\n\t$post_type_object = get_post_type_object('ml_review');\n\tif (!$post_type_object) {\n\t\treturn;\n\t}\n\n\tif (!current_user_can($post_type_object->cap->edit_posts)) {\n\t\treturn;\n\t}\n\n\t$args = array('post_type' => 'ml_review', 'post_parent' => $product->ID, 'post_author' => wp_get_current_user());\n\t$reviews = get_posts($args);\n\n\tif (!empty($reviews)) {\n\t\treturn;\n\t}\n\n\treturn apply_filters('get_add_review_link', admin_url('post.php?post_type=ml_review' . $action . $product->ID), $context);\n}",
"public function addReview(Review $review): void\n {\n array_push($this->reviews, $review);\n }",
"protected function _getCollection()\n {\n /** @var $reviews Clockworkgeek_Extrarestful_Model_Resource_Review_Collection */\n $reviews = parent::_getCollection();\n\n // product reviews only\n // category and customer reviews are possible although unlikely\n if (($productId = $this->getRequest()->getParam('product'))) {\n $reviews->addEntityFilter(Mage_Review_Model_Review::ENTITY_PRODUCT_CODE, $productId);\n }\n $reviews->addFilterToMap('product_id', 'entity_pk_value');\n $reviews->addExpressionFieldToSelect('product_id', 'entity_pk_value', array());\n\n $reviews->addStoreFilter($this->_getStore()->getId());\n if ($this->isReadable('stores')) {\n $reviews->addStoreData();\n }\n if ($this->isReadable('status')) {\n $reviews->addStatusCodes();\n }\n\n return $reviews;\n }",
"function my_custom_post_reviews() {\n\t$labels = array(\n\t\t'name' => _x( 'Reviews', 'post type general name' ),\n\t\t'singular_name' => _x( 'Review', 'post type singular name' ),\n\t\t'add_new' => _x( 'Add New', 'review' ),\n\t\t'add_new_item' => __( 'Add New Review' ),\n\t\t'edit_item' => __( 'Edit Review' ),\n\t\t'new_item' => __( 'New Review' ),\n\t\t'all_items' => __( 'All Reviews' ),\n\t\t'view_item' => __( 'View Reviews' ),\n\t\t'search_items' => __( 'Search Reviews' ),\n\t\t'not_found' => __( 'No Reviews found' ),\n\t\t'not_found_in_trash' => __( 'No Reviews found in the Trash' ), \n\t\t'parent_item_colon' => '',\n\t\t'menu_name' => 'Reviews'\n\t);\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'description' => 'Holds all Reviews data',\n\t\t'public' => true,\n\t\t'menu_position' => 4,\n\t\t'supports' => array( 'title', 'editor', 'excerpt', 'comments' ),\n\t\t'taxonomies' => array('post_tag'),\n\t\t'has_archive' => true,\n\t);\n\tregister_post_type( 'reviews', $args );\t\n}",
"private function transfer_reviews() {\r\n\t\t$res = mysql_query(\"SELECT * FROM `reviews` WHERE 1\", $this->sql);\r\n\t\twhile ($row = mysql_fetch_array($res)) {\r\n\t\t\tif (\r\n\t\t\t\tarray_key_exists($row['restaurant_id'], $this->restaurants)\r\n\t\t\t\t&& array_key_exists($row['location_id'], $this->locations)\r\n\t\t\t) {\r\n\t\t\t\t$row = $this->toText($row);\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t'Review' => array(\r\n\t\t\t\t\t\t'coupon_code' => $row['coupon_code'],\r\n\t\t\t\t\t\t'email' => $row['email'],\r\n\t\t\t\t\t\t'first_name' => $row['first_name'],\r\n\t\t\t\t\t\t'language' => $row['language'],\r\n\t\t\t\t\t\t'last_name' => $row['last_name'],\r\n\t\t\t\t\t\t'location_id' => $this->locations[$row['location_id']],\r\n\t\t\t\t\t\t'rating' => $row['rating'],\r\n\t\t\t\t\t\t'restaurant_id' => $this->restaurants[$row['restaurant_id']],\r\n\t\t\t\t\t\t'review' => $row['review'],\r\n\t\t\t\t\t\t'review_date' => $row['review_date'],\r\n\t\t\t\t\t\t'status' => ($row['status'] == 'active') ? 'active' : 'inactive',\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t\t$this->Review->create();\r\n\t\t\t\t$this->Review->save($data, false);\r\n\t\t\t\t$this->reviews[$row['review_id']] = $this->Review->getLastInsertID();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function addReview($value)\n {\n $this->reviews[] = $value;\n }",
"public function add_user_review()\n {\n if ($this->general_settings->user_reviews != 1) {\n exit();\n }\n $seller_id = $this->input->post('seller_id', true);\n $review = $this->user_review_model->get_review_by_user($seller_id, user()->id);\n if (!empty($review)) {\n echo \"voted_error\";\n } else {\n $this->user_review_model->add_review();\n }\n }",
"private function setEnableReviews() {\n $this->product->set_reviews_allowed($this->wcData->isEnableReviews());\n }",
"public function addReview($review)\n {\n return $this->reviews()->create($review);\n }",
"public function actionAddReview() {\n\n\t\tif (Yii::$app->request->isAjax) {\n\t\t\t$model_review = new \\common\\models\\CustomerReviews();\n\t\t\tif ($model_review->load(Yii::$app->request->post())) {\n\t\t\t\t$model_review->user_id = Yii::$app->user->identity->id;\n\t\t\t\t$model_review->review_date = date('Y-m-d');\n\t\t\t\t$model_review->save();\n\t\t\t}\n\t\t}\n\t}",
"public function add_review_rating_post() {\n\n $product_id = $this -> post('product_id') ? $this -> post('product_id') : \"\";\n $user_id = $this -> post('user_id') ? $this -> post('user_id') : \"\";\n\n $review_comment = $this -> post('review_comment') ? $this -> post('review_comment') : \"\";\n $review_rating = $this -> post('review_rating') ? $this -> post('review_rating') : \"\";\n\n $result = $this -> reviewmodel -> add_review_rating($user_id, $product_id, $review_comment, $review_rating);\n \n // Get Reviews for the product\n $allReviews = $this -> reviewmodel -> get_products_all_reviews($product_id);\t\n \n if ($result) { //If reviews added\n $retArr['status'] = SUCCESS;\n $retArr['message'] = \"Review added successfully\";\n $retArr['allReviews'] = ($allReviews);\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n else { //If reviews exists already\n $retArr['status'] = FAIL;\n $retArr['message'] = \"Review already exists\";\n $retArr['allReviews'] = ($allReviews);\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n }",
"function before_insert_review()\n{\n\tglobal $rr, $db, $table_prefix, $review_type_name;\n\tif ($review_type_name == \"product_question\") {\n\t\t$review_settings = get_settings(\"product_questions\"); \n\t} else {\n\t\t$review_settings = get_settings(\"products_reviews\"); \n\t}\n\t$auto_approve = get_setting_value($review_settings, \"auto_approve\", 0);\n\t$approved = ($auto_approve == 1) ? 1 : 0;\n\t$rr->set_value(\"review_type\", 1); // 1 - basic product review\n\t$rr->set_value(\"date_added\", va_time());\n\t$rr->set_value(\"remote_address\", get_ip());\n\t$rr->set_value(\"approved\", $approved);\n\t$rr->set_value(\"user_id\", get_session(\"session_user_id\"));\n\t$user_id = get_session(\"session_user_id\");\n\tif ($user_id) {\t\n\t\t$user_info = get_session(\"session_user_info\");\n\t\t$user_nickname = get_setting_value($user_info, \"nickname\", \"\");\n\t\t$user_email = get_setting_value($user_info, \"email\", \"\");\n\t\tif (strlen($user_nickname)) {\n\t\t\t$rr->set_value(\"user_name\", $user_nickname);\n\t\t}\n\t\tif (strlen($user_email)) {\n\t\t\t$rr->set_value(\"user_email\", $user_email);\n\t\t}\n\t}\n\n\t// set automatically recommended value based on rating if it wasn't set\n\tif ($rr->is_empty(\"recommended\")) {\n\t\t$rating = $rr->get_value(\"rating\");\n\t\tif ($rating == 4 || $rating == 5) {\n\t\t\t$rr->set_value(\"recommended\", 1);\n\t\t} else if ($rating == 1 || $rating == 2) {\n\t\t\t$rr->set_value(\"recommended\", -1);\n\t\t} else {\n\t\t\t$rr->set_value(\"recommended\", 0);\n\t\t}\t\t\n\t}\n\n\t// check if customer is verified buyer\n\t$item_id = $rr->get_value(\"item_id\"); \n\t$verified_buyer = 0;\n\t$sql = \" SELECT oi.order_item_id FROM (\".$table_prefix.\"orders_items oi \";\n\t$sql .= \" INNER JOIN \".$table_prefix.\"order_statuses os ON oi.item_status=os.status_id) \";\n\t$sql .= \" WHERE oi.item_id=\".$db->tosql($item_id, INTEGER);\n\t$sql .= \" AND oi.user_id=\".$db->tosql($user_id, INTEGER);\n\t$sql .= \" AND os.paid_status=1 \";\n\t$db->query($sql);\n\tif ($db->next_record()) {\n\t\t$verified_buyer = 1;\n\t}\n\t$rr->set_value(\"verified_buyer\", $verified_buyer);\n\n}",
"public function setReviews($value)\n {\n $this->reviews = $value;\n }",
"function add_review($name, $city, $address, $review, $user, $rating) {\n\t\t$conn = get_db_conn();\n\t\tmysql_query(\"INSERT INTO reviews VALUES(NULL, '\".$name.\"', '\".$city.\"','\".$address.\"','\".$review.\"','\".$user.\"','\".$rating.\"', NOW())\", $conn);\n\t\t//add into club names\n\t\tmysql_query(\"INSERT INTO clubs VALUES(NULL, '\".$name.\"', '\".$city.\"')\", $conn);\n\t}",
"protected function genProdReviewSite() {\n\n $revConf = $this->getHelper()->getProdReviewConf($this->getStoreId());\n\n $enabled = (string) $revConf->getEnabled();\n\n if ($enabled) {\n\n $changefreq = (string) $revConf->getChangefreq();\n $priority = (string) $revConf->getPriority();\n\n $queryCollection = Mage::getResourceModel('sitemapEnhanced/catalog_review')->getCollection($this->getStoreId());\n\n if ($queryCollection->rowCount()) {\n $this->_addFileHelper(self::REVIEW_FILENAME, TRUE);\n\n while ($reviewRow = $queryCollection->fetch()) {\n $prodId = $reviewRow['prod_id'];\n $reviewRoute = 'review/product/list/id/' . $prodId . '/';\n $url = htmlspecialchars($this->_baseUrl . $reviewRoute);\n\n $tmpXml = '';\n if ($changefreq)\n $tmpXml = sprintf('<changefreq>%s</changefreq>', $changefreq);\n if ($priority)\n $tmpXml .= sprintf('<priority>%.1f</priority>', $priority);\n\n $xml = sprintf('<url><loc>%s</loc><lastmod>%s</lastmod>%s</url>', $url, $this->_date, $tmpXml);\n if ($this->_isUrlAllowed($url)) {\n $this->_addLink($xml, 'sitemap', true);\n $this->setSitemapReviewLinks($this->getSitemapReviewLinks() + 1);\n }\n }\n unset($queryCollection);\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Interpolates context values into the message placeholders. | function interpolate($message, array $context = array())
{
$replace = array();
foreach ($context as $key => $val) {
$replace['{' . $key . '}'] = $val;
}
return strtr($message, $replace);
} | [
"function interpolate($message, array $context = array()) {\n\t// build a replacement array with braces around the context keys\n\t$replace = array();\n\tforeach ($context as $key => $val) {\n\t\t$replace['{' . $key . '}'] = $val;\n\t}\n\t// interpolate replacement values into the message and return\n\treturn strtr($message, $replace);\n}",
"protected function interpolate($message, $context = array()) {}",
"protected function interpolate($message, array &$context = array())\n {\n // build a replacement array with braces around the context keys\n \\preg_match_all('/\\{([a-z0-9_.]+)\\}/', $message, $matches);\n $placeholders = \\array_unique($matches[1]);\n $replace = array();\n foreach ($placeholders as $key) {\n if (!isset($context[$key])) {\n continue;\n }\n $val = $context[$key];\n if (!\\is_array($val) && (!\\is_object($val) || \\method_exists($val, '__toString'))) {\n $replace['{' . $key . '}'] = $val;\n }\n }\n $context = \\array_diff_key($context, \\array_flip($placeholders));\n if (!$context) {\n $context = $this->debug->meta();\n }\n return \\strtr($message, $replace);\n }",
"private function interpolate($message, array $context = array())\n {\n // build a replacement array with braces around the context keys\n $replace = array();\n foreach ($context as $key => $val) {\n // check that the value can be casted to string\n if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) {\n $replace['{' . $key . '}'] = $val;\n }\n }\n\n // interpolate replacement values into the message and return\n return strtr($message, $replace);\n }",
"private static function interpolate( $message, array $context ) {\n\t\t// build a replacement array with braces around the context keys\n\t\t$replace = array();\n\t\tforeach ( $context as $key => $val ) {\n\t\t\t$replace[ '{' . $key . '}' ] = $val;\n\t\t}\n\n\t\t// interpolate replacement values into the message and return\n\t\treturn strtr( $message, $replace );\n\t}",
"public static function doInterpolate(&$message, array $context = array())\n\t{\n\t\t$items = array();\n\n\t\tforeach ($context as $index => $item) {\n\t\t\tif (is_string($item)) {\n\t\t\t\t$items[$index] = Lang::get($item, Lang::$lang);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn strtr($message, $items);\n\t}",
"private function interpolate(\n string $message,\n array $context = []\n ): string {\n $replace = [];\n\n foreach ($context as $key => $val) {\n if (\n !is_array($val) &&\n (\n !is_object($val) ||\n method_exists($val, '__toString')\n )\n ) {\n $replace['{' . $key . '}'] = $val;\n }\n }\n\n return strtr($message, $replace);\n }",
"protected function interpolate($message, array $context = array()) {\n // build a replacement array with braces around the context\n // keys\n $replace = array();\n foreach ($context as $key => $val) {\n $replace['{' . $key . '}'] = $val;\n }\n \n // interpolate replacement values into the message and return\n return strtr($message, $replace);\n }",
"private function substitutePlaceholders($message, array $context)\n {\n if (false === strpos($message, '{')) {\n return $message;\n }\n\n $replacements = [];\n foreach ($context as $key => $value) {\n if (\n $key === 'exception' && (\n $value instanceof Exception || // PHP 5\n $value instanceof Throwable // PHP 7\n )\n ) {\n $replacements['{' . $key . '}'] = $value->getMessage();\n } else {\n $replacements['{' . $key . '}'] = $value;\n }\n }\n\n return strtr($message, $replacements);\n }",
"public function interpolate( $template, array $context = array())\n {\n // build a replacement array with braces around the context keys\n $replace = array();\n foreach (array_merge($this->defaults, $context) as $key => $val) {\n $replace['{' . $key . '}'] = is_string($val)\n ? $val\n : (is_numeric($val)\n ? $this->interpolateNum( $val )\n : ( is_null($val)\n ? 'NULL'\n : ( is_bool($val)\n ? ($val ? 'TRUE' : 'FALSE')\n : ( is_object($val)\n ? $this->interpolateObject( $val )\n # Any other: array etc.\n : var_dump($val, \"noecho\")\n )\n )\n )\n );\n }\n\n // interpolate replacement values into the message and return\n return strtr( $template, $replace);\n }",
"protected function interpolateContext(string $format, array $context = []): string {\n $final = preg_replace_callback('/{([^\\s][^}]+[^\\s]?)}/', function ($matches) use ($context) {\n $field = trim($matches[1], '{}');\n if (array_key_exists($field, $context)) {\n return $context[$field];\n } else {\n return $matches[1];\n }\n }, $format);\n return $final;\n }",
"public function parseMessagePlaceholders(&$message, array &$context);",
"public function getInterpolatedMessage()\n {\n static $message;\n\n if ($message === null) {\n if (empty($this->context) || false === strpos($this->message, '{')) {\n $message = $this->message;\n } else {\n $replace = [];\n foreach ($this->context as $key => $val) {\n $replace['{' . $key . '}'] = (string) $val;\n }\n\n $message = strtr($this->message, $replace);\n }\n }\n\n return $message;\n }",
"function _x($message, $context) {\n\t$arguments = array_slice(func_get_args(), 2);\n\n\treturn ($context == '')\n\t\t? _params($message, $arguments)\n\t\t: _params(pgettext($context, $message), $arguments);\n}",
"function ctools_context_replace_placeholders($contexts, $arguments) {\n foreach ($contexts as $cid => $context) {\n if (empty($context->empty)) {\n continue;\n }\n\n $new_context = NULL;\n switch ($context->placeholder['type']) {\n case 'relationship':\n $relationship = $context->placeholder['conf'];\n if (isset($contexts[$relationship['context']])) {\n $new_context = ctools_context_get_context_from_relationship($relationship, $contexts[$relationship['context']]);\n }\n break;\n case 'argument':\n if (isset($arguments[$cid]) && $arguments[$cid] !== '') {\n $argument = $context->placeholder['conf'];\n $new_context = ctools_context_get_context_from_argument($argument, $arguments[$cid]);\n }\n break;\n case 'context':\n if (!empty($arguments[$cid])) {\n $context_info = $context->placeholder['conf'];\n $new_context = ctools_context_get_context_from_context($context_info, 'context', $arguments[$cid]);\n }\n break;\n }\n\n if ($new_context && empty($new_context->empty)) {\n $contexts[$cid] = $new_context;\n }\n }\n\n return $contexts;\n}",
"public function pgettext($context, $message);",
"public function format($message, $context);",
"static private function format_message(string $message, array $context): string\n\t{\n\t\treturn $context ? format($message, $context) : $message;\n\t}",
"private function transformMessage(string $message, array $context): string\n {\n $params = [];\n foreach ($context as $key => $value) {\n $params['{' . $key . '}'] = $value;\n }\n\n return strtr($message, $params);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks a hash against the db to see if we should avoid sending the error report too many times. The system sends at most one report a day. | public static function shouldThrottleReport($hash)
{
if (!class_exists('Application\\DeskPRO\\App')) {
return false;
}
try {
$db = App::getDb();
$exist_date = $db->fetchColumn("
SELECT date_expire
FROM tmp_data
WHERE name = ?
LIMIT 1
", array('submitreport_' . $hash));
if ($exist_date) {
$date = \DateTime::createFromFormat('Y-m-d H:i:s', $exist_date);
// If its under 24 hours, then we dont send the report
if (time() - $date->getTimestamp() < 86400) {
return true;
}
}
} catch (\Exception $e) {};
return false;
} | [
"public function doHashCheck()\n {\n // some sql to select fields from oxarticles,\n // calculate hash and compare it to snapshot item hash.\n }",
"static function hashCheck($form, $hash) {\n\t\t\t$form = sqlescape($form);\n\t\t\t$hash = sqlescape($hash);\n\t\t\t$result = sqlfetch(sqlquery(\"SELECT id FROM btx_form_builder_entries \n\t\t\t\t\t\t\t\t\t\t WHERE form = '$form'\n\t\t\t\t\t\t\t\t\t\t AND hash = '$hash'\n\t\t\t\t\t\t\t\t\t\t AND created_at >= '\".date(\"Y-m-d H:i:s\", strtotime(\"-10 minutes\")).\"'\"));\n\t\t\t\n\t\t\treturn !empty($result);\n\t\t}",
"private function beenSent($hash, $time)\n {\n foreach($this->errors as $key => $val)\n {\n if($key == $hash && $val + $time > time())\n return TRUE;\n }\n return FALSE;\n }",
"protected function checkHashKey() {}",
"function verify_hash($hash){\n\n $valid = true;\n\n $query = $this->db->get_where('new_registrations', array('hash' => $hash));\n\n if($query->num_rows() != 1)\n $valid = false;\n\n $hash_data = $query->row();\n\n $age = time() - strtotime($hash_data->date_added);\n\n // If the hash is older than 3 days, delete it\n if($age > 60*60*24*3){\n $this->delete_registration_hash($hash_data->user_id);\n $valid = false;\n }\n\n if(!$valid)\n throw new RecoverableException(\"This registration link is invalid.\");\n\n return $hash_data->user_id;\n }",
"public function checkUniqueHash($hash);",
"function esiCheckErrors($tokenID,$route) {\r\n global $MAX_ERRORS;\r\n if (db_count(\"SELECT * FROM `esistatus` WHERE errorCode>0 AND errorCode<500 AND errorCount >= $MAX_ERRORS AND tokenID='$tokenID' AND route='$route';\")>0) {\r\n return true; //returns true when there are unrecoverable errors\r\n } else {\r\n return false; //returns false if there have been no unrecoverable errors\r\n }\r\n}",
"function findUnusedPasswordHash()\n {\n /* Lock the table so 2 users can't retrieve the same password */\n $query = <<<SQL\nLOCK TABLE web_form_account WRITE\nSQL;\n $this->DB->execute($query,'locking web_form_account to ensure no one else retrieves the same password');\n\n $query = <<<SQL\nSELECT\n password\nFROM\n web_form_account\nWHERE\n form_id = $this->id\nSQL;\n $result = $this->DB->execute($query,'retrieving password hash for a public questionnaire');\n if($this->DB->numRows($result))\n {\n $row = $this->DB->getData($result);\n return $row['password'];\n }\n else\n {\n $this->error = 'Unable to find an unused password and/or the maximum number of respondents has been reached.';\n return FALSE;\n }\n }",
"function hash_authenticated($hash) {\n $query = \"SELECT webid FROM recovery WHERE recovery_hash='\".mysql_real_escape_string(trim($hash)).\"'\";\n $result = mysql_query($query);\n if (!$result) {\n die('Unable to connect to the database!');\n } else if (mysql_num_rows($result) > 0) {\n $row = mysql_fetch_assoc($result);\n $this->webid = $row['webid'];\n mysql_free_result($result);\n\n // remove the hash to disable it\n $query = \"UPDATE recovery SET \".\n \"recovery_hash=NULL \".\n \"WHERE webid='\".mysql_real_escape_string($this->webid).\"'\";\n $result = mysql_query($query);\n if (!$result) {\n die('Unable to connect to the database!');\n } else {\n mysql_free_result($result);\n }\n\n } else {\n $this->reason = 'Your recovery code does not match any records in our database.';\n return False;\n }\n return True;\n }",
"function apiCheckErrors($keyID,$fileName) {\r\n global $MAX_ERRORS;\r\n\tif (db_count(\"SELECT * FROM `apistatus` WHERE errorCode>0 AND errorCode<500 AND errorCount >= $MAX_ERRORS AND keyID='$keyID' AND fileName='$fileName';\")>0) {\r\n\t\treturn true; //returns true when there are unrecoverable errors\r\n\t} else {\r\n\t\treturn false; //returns false if there have been no unrecoverable errors\r\n\t}\r\n}",
"private function checkHash($hash) {\r\n\r\n\t\t$sql = $this->dbh->prepare(\"SELECT COUNT(*) AS count FROM bs_cookies WHERE series = ? OR token = ?\");\r\n\t\t$sql->execute(array($hash, $hash));\r\n\t\t$row = $sql->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\tif ($row['count'] > 0) {\r\n\t\t\treturn FALSE;\r\n\t\t} else {\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t}",
"function checkLog() {\n\t\tfor ($x = 0; $x < count($this->lines); $x++) {\n\t\t\t\n\t\t\t// If eventid or dbid is matched...\t\t\n\t\t\tif (preg_match(\"/(dbid)\\s+([0-9]+)\\s/i\",$this->lines[$x],$matches) || preg_match(\"/eventid\\s+([0-9]+)/i\",$this->lines[$x],$matches)) { \n\t\n\t\t\t\t// Set the DBID array if its a DBID\n\t\t\t\tif ($matches[1] == \"dbid\") {\n\t\t\t\t\n\t\t\t\t\t$this->dbid[$matches[2]]=time();\n\t\t\t\t\t$this->EventQueue++;\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Otherwise it must be an eventid.\n\t\t\t\telse {\n\t\t\t\t\t\n\t\t\t\t\tif($this->CoreWasDown && time() - $this->CoreTimeUp < 60 ) { $this->eventQueueProcessing = 1;}\n\t\t\t\t\t$this->eventid[$matches[1]] = time();\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t}\n\t\t\t\t\n\t}",
"private function checkHash($hash)\n {\n $sql = 'SELECT hash FROM bookshop_users WHERE hash = :hash';\n $result = $this->db->execute($sql, ['hash' => $hash]);\n \n if (!$result)\n return FALSE;\n\n return TRUE;\n }",
"function check_data_completeness(){\n GLOBAL $LOGFILE;\n //Connect to Heroku database\n GLOBAL $SERVER, $USERNAME, $PASSWORD, $DB;\n $conn = new mysqli($SERVER, $USERNAME, $PASSWORD, $DB);\n if ($conn->connect_error) {\n return(\"Connection failed: \" . $conn->connect_error);\n } \n \n //Open log file \n $loghandle = fopen('logs/'.$LOGFILE, 'a+') or die('cannot open file');\n fwrite($loghandle, \"----------Test data completeness: check_data_completeness()----------\\n\");\n \n //Connect to database and check count\n $result = $conn->query(\n \"SELECT COUNT(*) AS count FROM inspection\");\n if ($result->num_rows != 1) {\n fwrite($loghandle, \"Error: DB error has occurred\\n\");\n return false;\n }\n // output data of each row\n while($row = $result->fetch_assoc()) {\n $count = $row['count'];\n if($count == 383522){\n fwrite($loghandle, \"Complete set of data\\n\\n\");\n return true;\n } else {\n fwrite($loghandle, \"Incomplete set of data\\n\");\n fwrite($loghandle, \"Data count: $count \\n\\n\");\n }\n }\n\n return false;\n}",
"protected function checkHash($hash)\n {\n $sql = 'SELECT hash FROM rest_users WHERE hash = :hash';\n $result = $this->db->execute($sql, ['hash' => $hash]);\n \n if (!$result)\n return FALSE;\n\n return TRUE;\n }",
"public function isValidHash($hash) {\n\t\t\t$conn = $this->getConnection();\n\t\t\t$query = \"SELECT user_id FROM pwd_reset WHERE pwd_hash=:hash LIMIT 1\";\n\t\t\t$q = $conn->prepare($query);\n\t\t\t$q->bindParam(\":hash\", $hash);\n\t\t\t$q->execute();\n\t\t\t$array = $q->fetch();\n\t\t\tif(isset($array['user_id']))\n\t\t\t\treturn true;\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function hasCheckhash()\n {\n return !empty($this->ch);\n }",
"function hashesMatch($email, $hash){\n\n\ttry {\n\n\t\t# Throw exception if hash is not 32 characters\n\t\tif (strlen($hash) != 32){\n\t\t\tthrow new Exception(\"Hash value must be 32 character\");\n\t\t}\n\n\n\t\t# Query database to see if $email exists\n\t\t$base = Connector::getDatabase();\n\t\t$sql = \"SELECT * FROM user WHERE email = '$email';\";\n\t\t$stmt = $base->prepare($sql);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetch();\n\n\t\tif ($result['hash'] == $hash){\n\t\t\treturn True;\n\t\t} else {\n\t\t\treturn False;\n\t\t}\n\n\t} catch (Exception $e){\n\t\terror_log($e);\n\t\theader(\"Location: /src/views/error.php\");\n \texit();\n\t}\n\n\treturn True;\n}",
"function hashcheck($requestSalt, $dbSalt){\n\t$dbHash = md5($dbSalt);\t//using md5 hash as example\n\t$requestHash = md5($requestSalt);\n\t\n\treturn (hash_equals($dbHash, $requestHash));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for getPackingPlanTags Get the tags for a packingPlan.. | public function testGetPackingPlanTags()
{
} | [
"function TestPlan_get_tags($plan_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.get_tags', array(new xmlrpcval($plan_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"public function test_getReplenishmentPlanTags() {\n\n }",
"public function testGetFulfillmentPlanTags()\n {\n }",
"public function test_get_plugin_tags() {\n\t\t$plugin = $this->plugin;\n\n\t\t$this->assertInternalType(\n\t\t\t'array',\n\t\t\t$plugin->get( 'tags', 'extensions-for-grifus' )\n\t\t);\n\t}",
"public function testAdministrationRestExporterAdministrationGetAvailableTags()\n {\n\n }",
"public function getTags();",
"public function test_getBuildingTags() {\n\n }",
"public function testListTags()\n {\n }",
"public function test_getReplenishmentProcessTags() {\n\n }",
"function TestCase_get_tags($case_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.get_tags', array(new xmlrpcval($case_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}",
"public function test_getSubstitutionTags() {\n\n }",
"public function testGetTags()\n {\n $pushwooshMock = new PushwooshMock();\n\n // At the beginning no pushwoosh requests have been sent\n $this->assertCount(0, $pushwooshMock->getPushwooshRequests());\n\n // Test call\n $getTagsRequest = GetTagsRequest::create();\n $getTagsResponse = $pushwooshMock->getTags($getTagsRequest);\n\n $this->assertNotNull($getTagsResponse);\n $this->assertSame(200, $getTagsResponse->getStatusCode());\n $this->assertSame('OK', $getTagsResponse->getStatusMessage());\n $this->assertTrue($getTagsResponse->isOk());\n\n $getTagsResponseResponse = $getTagsResponse->getResponse();\n $this->assertNotNull($getTagsResponseResponse);\n $this->assertCount(1, $getTagsResponseResponse->getResult());\n $this->assertArrayHasKey('Language', $getTagsResponseResponse->getResult());\n $this->assertSame('fr', $getTagsResponseResponse->getResult()['Language']);\n\n // One more requests has been send\n $this->assertCount(1, $pushwooshMock->getPushwooshRequests());\n $this->assertSame($getTagsRequest, $pushwooshMock->getPushwooshRequests()[0]);\n }",
"public function testProductTagsGet()\n {\n\n }",
"public function getTags() {\n\t\t$tags = [\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_link',\n\t\t\t\t'name' => __( 'Permalink', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The permalink.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_label',\n\t\t\t\t'name' => __( 'Label', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The label.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_post_title',\n\t\t\t\t// Translators: 1 - The post type single name.\n\t\t\t\t'name' => sprintf( __( '%1$s Title', 'all-in-one-seo-pack' ), 'Post' ),\n\t\t\t\t'description' => __( 'The original title of the current post.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_taxonomy_title',\n\t\t\t\t// Translators: 1 - The name of a taxonomy.\n\t\t\t\t'name' => sprintf( __( '%1$s Title', 'all-in-one-seo-pack' ), 'Category' ),\n\t\t\t\t// Translators: 1 - The name of a taxonomy.\n\t\t\t\t'description' => sprintf( __( 'The %1$s title.', 'all-in-one-seo-pack' ), 'Category' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_separator',\n\t\t\t\t'name' => __( 'Separator', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The crumb separator.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_blog_page_title',\n\t\t\t\t'name' => __( 'Blog Page Title', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The blog page title.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_author_display_name',\n\t\t\t\t'name' => __( 'Author Display Name', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The author\\'s display name.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_author_first_name',\n\t\t\t\t'name' => __( 'Author First Name', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The author\\'s first name.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_author_last_name',\n\t\t\t\t'name' => __( 'Author Last Name', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The author\\'s last name.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_search_result_format',\n\t\t\t\t'name' => __( 'Search result format', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The search result format.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_404_error_format',\n\t\t\t\t'name' => __( '404 Error Format', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The 404 error format.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_date_archive_year',\n\t\t\t\t'name' => __( 'Year', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The year.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_date_archive_month',\n\t\t\t\t'name' => __( 'Month', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The month.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_date_archive_day',\n\t\t\t\t'name' => __( 'Day', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The day.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_search_string',\n\t\t\t\t'name' => __( 'Search String', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The search string.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_format_page_number',\n\t\t\t\t'name' => __( 'Page Number', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The page number.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_archive_post_type_format',\n\t\t\t\t'name' => __( 'Archive format', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The archive format.', 'all-in-one-seo-pack' )\n\t\t\t],\n\t\t\t[\n\t\t\t\t'id' => 'breadcrumb_archive_post_type_name',\n\t\t\t\t'name' => __( 'Post Type Name', 'all-in-one-seo-pack' ),\n\t\t\t\t'description' => __( 'The archive post type name.', 'all-in-one-seo-pack' )\n\t\t\t]\n\t\t];\n\n\t\t$postTypes = aioseo()->helpers->getPublicPostTypes();\n\t\tforeach ( $postTypes as $postType ) {\n\t\t\tif ( 'product' === $postType['name'] && aioseo()->helpers->isWoocommerceActive() ) {\n\t\t\t\t$tags[] = [\n\t\t\t\t\t'id' => 'breadcrumb_wc_product_price',\n\t\t\t\t\t// Translators: 1 - The name of a post type.\n\t\t\t\t\t'name' => sprintf( __( '%1$s Price', 'all-in-one-seo-pack' ), $postType['singular'] ),\n\t\t\t\t\t// Translators: 1 - The name of a post type.\n\t\t\t\t\t'description' => sprintf( __( 'The %1$s price.', 'all-in-one-seo-pack' ), $postType['singular'] )\n\t\t\t\t];\n\t\t\t\t$tags[] = [\n\t\t\t\t\t'id' => 'breadcrumb_wc_product_sku',\n\t\t\t\t\t// Translators: 1 - The name of a post type.\n\t\t\t\t\t'name' => sprintf( __( '%1$s SKU', 'all-in-one-seo-pack' ), $postType['singular'] ),\n\t\t\t\t\t// Translators: 1 - The name of a post type.\n\t\t\t\t\t'description' => sprintf( __( 'The %1$s SKU.', 'all-in-one-seo-pack' ), $postType['singular'] )\n\t\t\t\t];\n\t\t\t\t$tags[] = [\n\t\t\t\t\t'id' => 'breadcrumb_wc_product_brand',\n\t\t\t\t\t// Translators: 1 - The name of a post type.\n\t\t\t\t\t'name' => sprintf( __( '%1$s Brand', 'all-in-one-seo-pack' ), $postType['singular'] ),\n\t\t\t\t\t// Translators: 1 - The name of a post type.\n\t\t\t\t\t'description' => sprintf( __( 'The %1$s brand.', 'all-in-one-seo-pack' ), $postType['singular'] )\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\treturn $tags;\n\t}",
"public function testGetTags()\n {\n $result = $this->api->get_tags();\n $this->assertIsArray($result);\n\n // Convert to array to check for keys, as assertObjectHasAttribute() will be deprecated in PHPUnit 10.\n $tag = get_object_vars($result[0]);\n $this->assertArrayHasKey('id', $tag);\n $this->assertArrayHasKey('name', $tag);\n $this->assertArrayHasKey('created_at', $tag);\n }",
"public function testTags() {\n\t\t$this->assertTrue($this->get($this->testhost.'tagslist/0/'));\n\t\t$this->assertTitle('BicBucStriim :: Tags');\n\t}",
"public function testTagsList()\n {\n }",
"function getTags() {\n\n parent::getTags();\n\n $tags = [\n 'satisfactionsmiley.smileys' => __(\"Affichage notation avec les smileys\", \"satisfactionsmiley\"),\n ];\n\n foreach ($tags as $tag => $label) {\n $this->addTagToList([\n 'tag' => $tag,\n 'label' => $label,\n 'value' => true,\n 'events' => NotificationTarget::TAG_FOR_ALL_EVENTS\n ]);\n }\n\n asort($this->tag_descriptions);\n }",
"public function testListSellerTagsGET1()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation executeSepaDirectDebitAsync Execute SEPA Direct Debit | public function executeSepaDirectDebitAsync($body)
{
return $this->executeSepaDirectDebitAsyncWithHttpInfo($body)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function isSepaDirectDebitPossible();",
"public function requestSepaDirectDebitAsync($body)\n {\n return $this->requestSepaDirectDebitAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function payoutCanBeCalledForSepaDirectDebitGuaranteedType(): void\n {\n $sepa = new SepaDirectDebitGuaranteed('DE89370400440532013000');\n $this->heidelpay->createPaymentType($sepa);\n $customer = $this->getMaximumCustomer()->setShippingAddress($this->getBillingAddress());\n $payout = $sepa->payout(100.0, 'EUR', self::RETURN_URL, $customer);\n $this->assertTransactionResourceHasBeenCreated($payout);\n\n $payment = $payout->getPayment();\n $this->assertInstanceOf(Payment::class, $payment);\n $this->assertNotEmpty($payment->getId());\n $this->assertEquals(self::RETURN_URL, $payout->getReturnUrl());\n $this->assertAmounts($payment, 0, 0, -100, 0);\n }",
"public function testRequestSepaDirectDebit()\r\n {\r\n }",
"public function testDebit()\n {\n $timestamp = $this->getMethod(__METHOD__).\" \".date(\"Y-m-d H:i:s\");\n $this->paymentObject->getRequest()->basketData($timestamp, 13.42, $this->currency, $this->secret);\n $this->paymentObject->getRequest()->async('DE','https://dev.heidelpay.de');\n $this->paymentObject->getRequest()->getFrontend()->set('enabled','FALSE');\n \n $this->paymentObject->getRequest()->getAccount()->set('iban', $this->iban);\n $this->paymentObject->getRequest()->getAccount()->set('holder', $this->holder);\n \n $this->paymentObject->debit();\n \t\n /* prepare request and send it to payment api */\n $request = $this->paymentObject->getRequest()->prepareRequest();\n $response = $this->paymentObject->getRequest()->send($this->paymentObject->getPaymentUrl(), $request);\n \n $this->assertTrue($response[1]->isSuccess(), 'Transaction failed : '.print_r($response[1],1));\n $this->assertFalse($response[1]->isError(),'authorize failed : '.print_r($response[1]->getError(),1));\n \n return (string)$response[1]->getPaymentReferenceId();\n }",
"public function executeSepaDirectDebitAsyncWithHttpInfo($body)\n {\n $returnType = '\\Swagger\\Client\\Model\\PaymentExecutionResponse';\n $request = $this->executeSepaDirectDebitRequest($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 }",
"protected function _allowDebit()\n {\n $sTxid = $this->fcGetPostParam('txid');\n\n $blReturn = false;\n $sAuthMode = oxDb::getDb()->GetOne(\"SELECT fcpoauthmode FROM oxorder WHERE fcpotxid = '\".$sTxid.\"'\");\n if ($sAuthMode == 'authorization') {\n $blReturn = true;\n } else {\n $iCount = oxDb::getDb()->GetOne(\"SELECT COUNT(*) FROM fcpotransactionstatus WHERE fcpo_txid = '{$sTxid}' AND fcpo_txaction = 'capture'\");\n if ($iCount > 0) {\n $blReturn = true;\n }\n }\n\n if (!$blReturn) {\n return;\n }\n\n $oOrder = $this->_getOrder();\n $sOrderId = $oOrder->getId();\n $sQuery = \"UPDATE oxorder SET oxpaid = NOW() WHERE oxid = '{$sOrderId}'\";\n try {\n oxDb::getDb()->Execute($sQuery);\n\n } catch (Exception $e){\n throw $e;\n }\n }",
"public function debtorPOSTRequestPostAsync($accept, $jiwa_stateful = null, $credit_limit = null, $early_payment_discount_days = null, $early_payment_discount_amount = null, $last_purchase_date = null, $last_payment_date = null, $standing_discount_on_invoices = null, $account_on_hold = null, $current_balance = null, $period1_balance = null, $period2_balance = null, $period3_balance = null, $period4_balance = null, $fx_current_balance = null, $fx_period1_balance = null, $fx_period2_balance = null, $fx_period3_balance = null, $fx_period4_balance = null, $notify_required = null, $web_access = null, $commence_date = null, $trading_status = null, $period_type = null, $uses_fx = null, $is_cash_only = null, $terms_days = null, $terms_type = null, $exclude_from_aging = null, $debtor_is_branch_account = null, $remaining_normal_prepaid_labour_pack_hours = null, $remaining_special_prepaid_labour_pack_hours = null, $fx_decimal_places = null, $prospect_id = null, $account_no = null, $alt_account_no = null, $name = null, $address1 = null, $address2 = null, $address3 = null, $address4 = null, $postcode = null, $phone = null, $fax = null, $email_address = null, $acn = null, $abn = null, $aust_post_dpid = null, $aust_post_bcsp = null, $bank_name = null, $bank_account_no = null, $bank_bsbn = null, $bank_account_name = null, $tax_exemption_no = null, $notify_address = null, $parent_debtor_id = null, $parent_debtor_account_no = null, $parent_debtor_name = null, $price_scheme_id = null, $price_scheme_description = null, $trading_name = null, $company_name = null, $proprietors_name = null, $fax_header = null, $fxid = null, $fx_name = null, $fx_short_name = null, $b_pay_reference = null, $classification = null, $category1 = null, $category2 = null, $category3 = null, $category4 = null, $category5 = null, $contact_names = null, $group_memberships = null, $branch_debtors = null, $delivery_addresses = null, $freight_forwarder_addresses = null, $notes = null, $credit_notes = null, $directors = null, $budgets = null, $debtor_part_numbers = null, $custom_field_values = null, $documents = null, $debtor_systems = null, $debtor_ledgers = null, $body = null)\n {\n return $this->debtorPOSTRequestPostAsyncWithHttpInfo($accept, $jiwa_stateful, $credit_limit, $early_payment_discount_days, $early_payment_discount_amount, $last_purchase_date, $last_payment_date, $standing_discount_on_invoices, $account_on_hold, $current_balance, $period1_balance, $period2_balance, $period3_balance, $period4_balance, $fx_current_balance, $fx_period1_balance, $fx_period2_balance, $fx_period3_balance, $fx_period4_balance, $notify_required, $web_access, $commence_date, $trading_status, $period_type, $uses_fx, $is_cash_only, $terms_days, $terms_type, $exclude_from_aging, $debtor_is_branch_account, $remaining_normal_prepaid_labour_pack_hours, $remaining_special_prepaid_labour_pack_hours, $fx_decimal_places, $prospect_id, $account_no, $alt_account_no, $name, $address1, $address2, $address3, $address4, $postcode, $phone, $fax, $email_address, $acn, $abn, $aust_post_dpid, $aust_post_bcsp, $bank_name, $bank_account_no, $bank_bsbn, $bank_account_name, $tax_exemption_no, $notify_address, $parent_debtor_id, $parent_debtor_account_no, $parent_debtor_name, $price_scheme_id, $price_scheme_description, $trading_name, $company_name, $proprietors_name, $fax_header, $fxid, $fx_name, $fx_short_name, $b_pay_reference, $classification, $category1, $category2, $category3, $category4, $category5, $contact_names, $group_memberships, $branch_debtors, $delivery_addresses, $freight_forwarder_addresses, $notes, $credit_notes, $directors, $budgets, $debtor_part_numbers, $custom_field_values, $documents, $debtor_systems, $debtor_ledgers, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"function dsf_wirecard_sepa_pending_debit($dsv_orderid, $dd_name, $dsv_iban, $dsv_bic, $dsv_amount, $savedorder){\n\t\n global $wirecard_attempts;\n\n\n\n\t$dsv_wirecard_request_id = SAP_ORDER_PREFIX . $dsv_orderid . '--' . date('YmdHis');\n\t$dsv_wirecard_mandate_id = SAP_ORDER_PREFIX . $dsv_orderid;\n\n\t// build the request\n\t\n\t$dsv_wire_xml = new dsXmlBuilder;\n\t\n\t$dsv_wire_xml->dsXmlHeaderPush('payment','xmlns=\"http://www.elastic-payments.com/schema/payment\"');\n\n\t$dsv_wire_xml->dsXmlElement('merchant-account-id',MODULE_PAYMENT_WIREDD_MERCHANT);\n\t$dsv_wire_xml->dsXmlElement('request-id',$dsv_wirecard_request_id);\n\n\t$dsv_wire_xml->dsXmlElement('transaction-type','pending-debit');\n\n\t$dsv_wire_xml->dsXmlElement('requested-amount',$dsv_amount, array('currency' => DEFAULT_CURRENCY) );\n\n\t$dsv_wire_xml->dsXmlPush('account-holder');\n\n\t\t$dsv_wire_xml->dsXmlElement('first-name',$savedorder->customer['firstname']);\n\t\t$dsv_wire_xml->dsXmlElement('last-name',$savedorder->customer['lastname']);\n\t\t$dsv_wire_xml->dsXmlElement('email',$savedorder->customer['email_address']);\n\t\t$dsv_wire_xml->dsXmlElement('phone',$savedorder->customer['telephone']);\n\n\n\t\t$dsv_wire_xml->dsXmlPush('address');\n\n\t\t\t$dsv_wire_xml->dsXmlElement('street1', trim($savedorder->customer['house'] . ' ' . $savedorder->customer['street']));\n\n\t\t\tif (strlen($savedorder->customer['district']) > 1){\n\t\t\t\t$dsv_wire_xml->dsXmlElement('street2', $savedorder->customer['district']);\n\t\t\t}\n\t\t\t\n\t\t\tif (strlen($savedorder->customer['town']) > 1){\n\t\t\t\t$dsv_wire_xml->dsXmlElement('city', $savedorder->customer['town']);\n\t\t\t}\n\t\t\t\n\t\t\tif (strlen($savedorder->customer['county']) > 1){\n\t\t\t\t$dsv_wire_xml->dsXmlElement('state', $savedorder->customer['county']);\n\t\t\t}\n\n\t\t\t\t$dsv_wire_xml->dsXmlElement('country', CONTENT_COUNTRY);\n\n\t\t\tif (strlen($savedorder->customer['postcode']) > 1){\n\t\t\t\t$dsv_wire_xml->dsXmlElement('postal-code', $savedorder->customer['postcode']);\n\t\t\t}\n\n\n\n\n\t\t$dsv_wire_xml->dsXmlPop('address');\n\n\t$dsv_wire_xml->dsXmlPop('account-holder');\n\t\n\t$dsv_wire_xml->dsXmlPush('payment-methods');\n\t\t$dsv_wire_xml->dsXmlHeaderPushSingle('payment-method','name=\"sepadirectdebit\"');\n\t$dsv_wire_xml->dsXmlPop('payment-methods');\n\n\n\n\t// delivery address is not part of sepa.\n\t\t\n\n\t\t$dsv_wire_xml->dsXmlPush('bank-account');\n\t\t\t\t$dsv_wire_xml->dsXmlElement('iban', $dsv_iban);\n\t\t\t\t$dsv_wire_xml->dsXmlElement('bic', $dsv_bic);\n\t$dsv_wire_xml->dsXmlPop('bank-account');\n\t\n\t\t$dsv_wire_xml->dsXmlPush('mandate');\n\t\t\t\t$dsv_wire_xml->dsXmlElement('mandate-id', $dsv_wirecard_mandate_id);\n\t\t\t\t$dsv_wire_xml->dsXmlElement('signed-date', date(\"Y-m-d\" , time()));\n\t$dsv_wire_xml->dsXmlPop('mandate');\n\t\n\t\n\t\n\t$dsv_wire_xml->dsXmlElement('creditor-id', MODULE_PAYMENT_WIREDD_CREDITOR_ID);\n\n\n\t$dsv_wire_xml->dsXmlElement('ip-address', substr(dsf_get_ip_address_nonproxy(),0,15));\n\t$dsv_wire_xml->dsXmlElement('order-number',SAP_ORDER_PREFIX . $dsv_orderid);\n\t$dsv_wire_xml->dsXmlElement('descriptor',SAP_ORDER_PREFIX . $dsv_orderid);\n\n\n\t\n\t$dsv_wire_xml->dsXmlPop('payment');\n\t\n\t\n\t\n\t\n// generate the xml to send.\n\t$dsv_xml_to_post = $dsv_wire_xml->dsXmlGetXML();\n\n\n\n// make a record in the wirecard_responses table.\n\n\t\t$sql_data_array = array('orders_id' => $dsv_orderid,\n\t\t\t\t\t\t\t\t'orderid' => $dsv_wirecard_mandate_id,\n\t\t\t\t\t\t\t\t'amount' => $dsv_amount,\n\t\t\t\t\t\t\t\t'trans_type' => 2,\n\t\t\t\t\t\t\t\t'txntype' => 'pending-debit',\n\t\t\t\t\t\t\t\t'request_id' => $dsv_wirecard_request_id);\n\t\t\t\t\t\t\t\t\n\t\t// save it\n\t\t\n\t\t\t$prev_item = dsf_db_query(\"select token_id from \" . DS_DB_SHOP . \".wirecard_responses where orders_id='\" . $dsv_orderid . \"' and trans_type='2'\");\n\t\t\t\n\t\t\tif (dsf_db_num_rows($prev_item) == 0){\n\t\t\t\t// this is a new attempt therefore we a new record\n\t\t\t\t\t$sve = dsf_db_perform(DS_DB_SHOP . '.wirecard_responses' , $sql_data_array);\n\t\t\t}else{\n\t\t\t\t// we have already attempted this order before and it must have failed - update with new details.\n\t\t\t\t\t$sve = dsf_db_perform(DS_DB_SHOP . '.wirecard_responses' , $sql_data_array, \"update\" , \"orders_id='\" . $dsv_orderid . \"' and trans_type='2'\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t// $response = $dsv_xml_to_post;\n\n\t// save a copy of the XML we are about to post - \tTHIS IS ONLY DURING INTEGRATION TESTING AND MUST BE REMOVED\n\t//\t\t\t\t\t\t\t\t\t\t\t\t\tBECAUSE IT CONTAINS CARD DETAILS. THIS IS FINE WHEN WE ARE\n\t//\t\t\t\t\t\t\t\t\t\t\t\t\tUSING THE FALSE TEST CARD NUMBERS AND IS SOLELY SO WE CAN\n\t//\t\t\t\t\t\t\t\t\t\t\t\t\tCHECK WHAT XML WE ARE CREATING AND PASSING TO WIRECARD WITHOUT\n\t//\t\t\t\t\t\t\t\t\t\t\t\t\tECHOING TO THE SCREEN BREAKING THE SMOOTH TRANSACTION FLOW.\n\t\n\t\t\t// save a copy of this file before sending it.\n//\t\t$id = 'WC-DD-' . time();\n//\t\t$fp = fopen(DS_UNIT_ROOT . DS_XML . $id . '.' . 'xml', \"w\");\n//\t\tfputs($fp, $dsv_xml_to_post);\n//\t\tfclose($fp);\n\n\t\n// post the xml created and return back to the requesting script.\n\n\t $response = dsf_wirecard_post(WIREDD_PURCHASE_URL , $dsv_xml_to_post, 'sepa');\n\t\nreturn $response;\n\n}",
"public function executeDebit($username, $password, $mtid, $subId, $amount, $currency, $close, $partialDebitId) {\n Validators::validateStringNotNull($username, 'username');\n Validators::validateStringNotNull($password, 'password');\n Validators::validateStringNotNull($mtid, 'mtid');\n Validators::validateCurrency($currency);\n\n $params = array('username'=>$username, \n 'password'=>$password,\n 'mtid'=>$mtid,\n 'subid'=>$subId,\n 'amount'=>$amount,\n 'currency'=>strtoupper($currency),\n 'close'=>$close,\n 'partialDebitId'=>$partialDebitId);\n \t\n $response = $this->client->executeDebit($params);\n \t\t\t\t\t\t\t\t\t\t\n return $response->executeDebitReturn;\n }",
"public function ddAction() {\n $pageForm = new TenantsInsuranceQuoteB_Form_DirectDebit();\n $pageSession = new Zend_Session_Namespace('tenants_insurance_quote');\n\t\t// Tell page NOT to use AJAX validation as we go\n $this->view->headScript()->appendScript(\n 'var ajaxValidate = true; var ajaxValidatePage = \\'dd\\';'\n );\n\n\t\tif ($this->getRequest()->isPost()) {\n\t\t\t$valid = $this->_formStepCommonValidate($pageForm, 'dd');\n if ($valid && isset($_POST['dd_confirm'])) {\n\t\t\t\t// Form is valid and the user has confirmed the bank branch details\n $pageSession->completed['dd'] = true; // Mark page as valid, so user can progress\n\t\t\t\t// Save the direct debit details and redirect to confirmation page\n\t\t\t\t$formData = $pageForm->getValues();\n\t\t\t\t$ddData = new Model_Core_Directdebit();\n\n\t\t\t\t$ddData->refNo = $this->_customerReferenceNumber;\n\t\t\t\t$ddData->policyNumber = $this->_policyNumber;\n\t\t\t\t$ddData->accountName = $formData[\"subform_directdebit\"][\"dd_accountname\"];\n\t\t\t\t$ddData->accountNumber = $formData[\"subform_directdebit\"][\"bank_account_number\"];\n\t\t\t\t$ddData->sortCode =preg_replace('/-/','',$formData[\"subform_directdebit\"][\"bank_sortcode_number\"]);\n\n\t\t\t\t$quote = new Manager_Insurance_TenantsContentsPlus_Quote(null, null, $this->_policyNumber);\n\t\t\t\t$startDate = $quote->getStartDate();\n\t\t\t\t$firstPayMonth = date(\"Y-m-d\",strtotime(\"$startDate + 1 month\"));\n\n\t\t\t\t$ddData->paymentDate = $firstPayMonth;\n\t\t\t\t$ddData->paymentFrequency = ucfirst(strtolower($quote->getPayBy()));\n\t\t\t\t// Create the Manage Object\n\t\t\t\t$ddPayment = new Manager_Core_Directdebit();\n\t\t\t\t// Save the stuffs\n\t\t\t\t$ddPayment->save($ddData);\n\n\t\t\t\t$this->_formStepCommonNavigate('dd');\n\t\t\t\treturn;\n\t\t\t} elseif($valid && !isset($_POST['dd_confirm'])){\n\t\t\t\t// Form data is valid but they haven't confirmed their branch details\n\t\t\t\t$formData = $pageForm->getValues();\n\n\t\t\t\t// Switch the form to the confirmation form (essentially the same but with hidden fields)\n\t\t\t\t$pageForm = new TenantsInsuranceQuoteB_Form_BankConfirmation();\n\n\t\t\t\t// Populate the confirmation form with the data from the main DD form and also fill in the branch details\n\t\t\t\t// This is to show the bank branch details in the confirmation screen\n\t\t\t\t$bankManager = new Manager_Core_Bank();\n\t\t\t\t$this->view->branchDetails = $bankManager->getBranchDetail($_POST['bank_sortcode_number']);\n\n\t\t\t\t$formData['subform_directdebit']['dd_confirm'] = \"yes\";\n\n\t\t\t\t// The form data is in the wrong subform now because we want to use the confirmation form\n\t\t\t\t// so we have to switch the key over\n\t\t\t\t$formData['subform_bankconfirmation'] = $formData['subform_directdebit'];\n\t\t\t\tunset($formData['subform_directdebit']);\n\n\t\t\t\t$pageForm->populate($formData);\n\n\t\t\t}\n\n\t\t\tif (isset($_POST['back'])) {\n\t\t\t\t$this->_formStepCommonNavigate('dd');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Load the element data from the database if we can\n\t\tif ($this->_formStepCommonPopulate($pageForm, 'dd'))\n\t\t{\n\t\t\t// Render the page unless we have been redirected\n\t\t\t$this->view->form = $pageForm;\n\t\t\t$this->render('step');\n\t\t}\n }",
"public function testDebitSuccessfully(): void\n {\n $data = $this->createResponse([\n 'action' => Transaction::ACTION_DEBIT,\n 'description' => 'TEST DEBIT',\n 'metadata' => [\n 'ping0' => 'pong0',\n 'ping1' => 'pong1',\n ],\n 'paymentSource' => [\n 'token' => \\mb_strtoupper($this->generateId()),\n 'type' => 'bank_account',\n ],\n ]);\n\n $expected = new Transaction(\\array_merge($data, [\n 'amount' => new Amount($data['amount']),\n 'paymentSource' => new BankAccount($data['paymentSource']),\n ]));\n\n $actual = $this->createApiManager($this->createResponse($data))\n ->create((string)\\getenv('PAYMENTS_API_KEY'), $expected);\n\n $actual = $this->performTransactionAssertions($expected, $actual);\n\n self::assertInstanceOf(Amount::class, $actual->getAmount());\n self::assertInstanceOf(BankAccount::class, $actual->getPaymentSource());\n self::assertInstanceOf(Ewallet::class, $actual->getPaymentDestination());\n }",
"public function debit_post()\n {\n $add_data=array(\n 'da_id'=>$this->post('da_id'),\n 'd_balance'=>$this->post('d_balance')\n );\n $insert_id=$this->Debit_model->add_debit($add_data);\n if($insert_id)\n {\n $message = [\n // 'id_book' => $insert_id,\n 'da_id'=>$this->post('da_id'),\n 'd_balance'=>$this->post('d_balance'),\n 'message' => 'Added a resource'\n ];\n $this->set_response($message, REST_Controller::HTTP_CREATED); // CREATED (201) being the HTTP response code\n }\n else\n {\n // Set the response and exit\n $this->response([\n 'status' => FALSE,\n 'message' => 'Can not add data'\n ], REST_Controller::HTTP_CONFLICT); // CAN NOT CREATE (409) being the HTTP response code\n }\n\n }",
"public function testIsDirectDebitPaymentGettableByID()\n {\n $response = self::VALIDATED_DIRECT_DEBIT_PAYMENT_RESPONSE;\n\n $this->stubRequest(\n 'GET',\n '/direct_debits/' . self::DIRECT_DEBIT_PAYMENT_ID . '/',\n [],\n [],\n $response\n );\n\n $result = DirectDebit::getDirectDebitPaymentByID(\n self::DIRECT_DEBIT_PAYMENT_ID\n );\n\n $this->assertEquals($response, $result);\n }",
"public function testPaymentSecupaydebitsPost()\n {\n $debitData = [\n 'customer' => self::$customerId,\n 'container' => self::$containerId,\n 'amount' => self::$amount,\n 'currency' => self::$currency,\n 'purpose' => self::$purpose,\n 'order_id' => self::$orderId,\n 'opt_data' => self::$optData,\n 'basket' => self::$basket,\n 'demo' => true\n ];\n try {\n $response = $this->api->paymentSecupaydebitsPost(new SecupayTransactionProductDTO($debitData));\n self::$debitTransactionId = $response->getId();\n } catch (ApiException $e) {\n if ($e->getResponseObject()->getErrorDetails() == 'Payment method not available (for this customer)') {\n echo $e->getResponseObject()->getErrorDetails() . ' PaymentSecupaydebitsPost';\n } else {\n print_r($e->getResponseObject()->getErrorDetails());\n }\n throw $e;\n }\n\n if (isset(self::$debitTransactionId)) {\n $this->assertNotEmpty(self::$debitTransactionId);\n $this->assertInstanceOf(SecupayTransactionProductModel::class, $response);\n $this->assertEquals('payment.secupaydebits', $response->getObject());\n $this->assertEquals(self::$debitTransactionId, $response->getId());\n $this->assertNotEmpty($response->getTransId());\n $this->assertNotEmpty($response->getStatus());\n $this->assertEquals(self::$amount, $response->getAmount());\n $this->assertEquals(self::$currency, $response->getCurrency());\n $this->assertEquals(self::$purpose, $response->getPurpose());\n $this->assertEquals(self::$orderId, $response->getOrderId());\n\n for ($i = 0; $i < 3; ++$i) {\n $this->assertEquals(self::$basket[$i], $response->getBasket()[$i]);\n $this->assertEquals(self::$basket[$i]->getItemType(), $response->getBasket()[$i]->getItemType());\n $this->assertEquals(self::$basket[$i]->getArticleNumber(), $response->getBasket()[$i]->getArticleNumber());\n $this->assertEquals(self::$basket[$i]->getQuantity(), $response->getBasket()[$i]->getQuantity());\n $this->assertEquals(self::$basket[$i]->getName(), $response->getBasket()[$i]->getName());\n $this->assertEquals(self::$basket[$i]->getModel(), $response->getBasket()[$i]->getModel());\n $this->assertEquals(self::$basket[$i]->getEan(), $response->getBasket()[$i]->getEan());\n $this->assertEquals(self::$basket[$i]->getTax(), $response->getBasket()[$i]->getTax());\n $this->assertEquals(self::$basket[$i]->getTotal(), $response->getBasket()[$i]->getTotal());\n $this->assertEquals(self::$basket[$i]->getPrice(), $response->getBasket()[$i]->getPrice());\n $this->assertEquals(self::$basket[$i]->getApikey(), $response->getBasket()[$i]->getApikey());\n $this->assertEquals(self::$basket[$i]->getTransactionHash(), $response->getBasket()[$i]->getTransactionHash());\n $this->assertEquals(self::$basket[$i]->getContractId(), $response->getBasket()[$i]->getContractId());\n }\n\n $this->assertNotEmpty($response->getTransactionStatus());\n $this->assertEquals('sale', $response->getPaymentAction());\n $this->assertInstanceOf(PaymentCustomersProductModel::class, $response->getCustomer());\n $this->assertNotEmpty($response->getCustomer());\n $this->assertEquals('payment.customers', $response->getCustomer()->getObject());\n $this->assertEquals(self::$customerId, $response->getCustomer()->getId());\n $this->assertNotEmpty($response->getCustomer()->getCreated());\n $this->assertInstanceOf(SecupayTransactionProductModelUsedPaymentInstrument::class, $response->getUsedPaymentInstrument());\n $this->assertEquals('bank_account', $response->getUsedPaymentInstrument()->getType());\n $this->assertInstanceOf(BankAccountDescriptor::class, $response->getUsedPaymentInstrument()->getData());\n /**\n * @var BankAccountDescriptor $used_payment_instrument\n */\n $used_payment_instrument = $response->getUsedPaymentInstrument()->getData();\n $this->assertEmpty($used_payment_instrument->getOwner());\n $this->assertNotEmpty($used_payment_instrument->getIban());\n $this->assertNotEmpty($used_payment_instrument->getBic());\n $this->assertNotEmpty($used_payment_instrument->getBankname());\n $this->assertInstanceOf(PaymentContainersProductModel::class, $response->getContainer());\n $this->assertNotEmpty($response->getContainer());\n $this->assertEquals('payment.containers', $response->getContainer()->getObject());\n $this->assertEquals(self::$containerId, $response->getContainer()->getId());\n $this->assertInstanceOf(BankAccountDescriptor::class, $response->getContainer()->getPrivate());\n /**\n * @var BankAccountDescriptor $private_data\n */\n $private_data = $response->getContainer()->getPrivate();\n $this->assertNotEmpty($private_data->getOwner());\n $this->assertNotEmpty($private_data->getIban());\n $this->assertNotEmpty($private_data->getBic());\n $this->assertNotEmpty($private_data->getBankname());\n $this->assertInstanceOf(BankAccountDescriptor::class, $response->getContainer()->getPublic());\n /**\n * @var BankAccountDescriptor $public_data\n */\n $public_data = $response->getContainer()->getPublic();\n $this->assertNotEmpty($public_data->getOwner());\n $this->assertNotEmpty($public_data->getIban());\n $this->assertNotEmpty($public_data->getBic());\n $this->assertNotEmpty($public_data->getBankname());\n $this->assertEquals('bank_account', $response->getContainer()->getType());\n $this->assertNotEmpty($response->getContainer()->getCreated());\n $this->assertNotEmpty($response->getContainer()->getCustomer());\n $this->assertEquals('payment.customers', $response->getContainer()->getCustomer()->getObject());\n $this->assertEquals(self::$customerId, $response->getContainer()->getCustomer()->getId());\n }\n }",
"function debit( $debitAmount, $accountNum)\n{\n\t$accdb = \"accounts\";\n\t$acconn = connRTServer( $accdb);\n\t$sql = \"select balance from accounts where accNum = \" . $accountNum . \";\";\n\t$result = $acconn->query($sql);\n\t$currBal = $result->fetch_row();\n\n\t//Check if can be debited\n\tif(canDebit($currBal[0], $debitAmount))\n\t{\n\t\t$newBal = $currBal[0] - $debitAmount;\n\t\t$sql2 = \"update accounts set balance = \" . $newBal . \" where accNum = \" . $accountNum . \";\";\n\t\t$acconn->query($sql2);\n\t\treturn TRUE;\n\t}\n\telse\n\t{\n\t\treturn FALSE;\n\t}\n\n\t$acconn->close();\n}",
"function xdce_deposit_process1()\n {\n try {\n $admin = SiteSettings::where('id', 1)->first();\n $last_block = $admin->xdce_block;\n $last_block = $last_block + 1;\n $latest_xdc_block_number = get_last_block('78.129.229.18', 8545);\n\n if ($latest_xdc_block_number > 0) {\n for ($i = $last_block; $i <= $latest_xdc_block_number; $i++) {\n\n\n $block_number = $i;\n\n $eurl = 'http://xinfin.info/api/blocknumber/' . $block_number . '_0_0';\n\n $cObj = curl_init();\n curl_setopt($cObj, CURLOPT_URL, $eurl);\n curl_setopt($cObj, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($cObj, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($cObj, CURLOPT_RETURNTRANSFER, TRUE);\n $output = curl_exec($cObj);\n $curlinfos = curl_getinfo($cObj);\n\n $result = json_decode($output);\n\n if ($result && $result->status == 'SUCCESS') {\n $transactionList = $result->message;\n\n } else {\n $transactionList = '';\n }\n\n //iterating transaction lists\n foreach ($transactionList as $transaction) {\n $to_address = $transaction->args->_to;\n $user = Users::where('XDC_addr', '=', $to_address)->first();\n if ($user != null && $to_address != null) {\n $dep_id = $transaction->transactionHash;\n $ether_balance = $transaction->args->_value;\n $dep_already = $this->eth_checkdepositalready($user->id, $dep_id);\n if ($dep_already === TRUE && (float)$ether_balance > 0) {\n\n\n $email = get_usermail($user->id);\n //$pass = Session::get('xinfinpass');\n $pass = get_user_details($user->id, 'xinpass');\n login_xdc_fun($email, owndecrypt($pass));\n\n\n $adminethaddr = decrypt(get_config('xdc_address'));\n $res = transfer_xdctoken($to_address, $ether_balance, $adminethaddr, $user->id, owndecrypt($pass));\n $userid = $user->id;\n if ($res->status == 'SUCCESS') {\n $fetchbalance = get_userbalance($userid, 'XDC');\n $uptbal = $fetchbalance + $ether_balance;\n $upt = Balance::where('user_id', $userid)->first();\n $upt->XDC = $uptbal;\n $upt->save();\n\n $transid = 'TXD' . $userid . time();\n $today = date('Y-m-d H:i:s');\n $ip = \\Request::ip();\n $ins = new Transaction;\n $ins->user_id = $userid;\n $ins->payment_method = 'Cryptocurrency Account';\n $ins->transaction_id = $transid;\n $ins->currency_name = 'XDC';\n $ins->type = 'Deposit';\n $ins->transaction_type = '1';\n $ins->amount = $ether_balance;\n $ins->updated_at = $today;\n $ins->crypto_address = $to_address;\n $ins->transfer_amount = '0';\n $ins->fee = '0';\n $ins->tax = '0';\n $ins->verifycode = '1';\n $ins->order_id = '0';\n $ins->status = 'Completed';\n $ins->cointype = '2';\n $ins->payment_status = 'Paid';\n $ins->paid_amount = '0';\n $ins->wallet_txid = $dep_id;\n $ins->ip_address = $ip;\n $ins->verify = '1';\n $ins->blocknumber = $transaction->blockNumber;\n $ins->save();\n }\n }\n }\n\n\n }\n if ($last_block < $i) {\n $admin->mined_block = $i;\n $admin->save();\n }\n }\n }\n\n } catch (\\Exception $e) {\n \\Log::error([$e->getMessage(), $e->getLine(), $e->getFile()]);\n return view('errors.404');\n }\n }",
"private function transactionExecute() {\n\n $bd = new caDialogueBD();\n\n $countrydb = $this->getCountryDatabase();\n\n //type = 2 refers to Offers only.(see Transaction entity for more details). Check only Cashback and Subscription gain offer types\n $condition_transaction = 'validation_date IS NOT NULL AND status ='.TRANSACTION_STATUS_PENDING_CONFIRMATION .' and type ='.TRANSACTION_TYPE_OFFER .' and offer_type in ('.OFFER_TYPE_CASHBACK.','.OFFER_TYPE_SUBSCRIPTION_GAIN.')';\n $transactions = $bd->select($countrydb . '.transactions', array('id', 'merchant_id', 'validation_date'), $condition_transaction);\n\n if ($transactions === FALSE) {\n $this->exitlog('SQL error selecting the transactions from the country database', self::$logFile);\n }\n\n if (!$transactions) {\n $message = 'There are no records to update the status to confirmed in the transactions table';\n $this->exitlog($message, self::$logFile);\n }\n\n $rows_transactions = $bd->toutesLignes();\n\n $fields = array();\n $i = 0;\n foreach ($rows_transactions as $trans) {\n\n $merchants[] = $trans['merchant_id'];\n echo $trans['merchant_id'];\n echo $trans['validation_date'];\n $fields[$i]['id'] = $trans['merchant_id'];\n $fields[$i]['days'] = $this->getDaysDifference($trans['validation_date']);\n $fields[$i]['transaction_id'] = $trans['id'];\n echo $fields[$i]['days']; \n $i++;\n }\n\n $merchants = array_unique($merchants);\n $condition_merchants = 'id in(' . implode(\",\", $merchants) . ')';\n $merchants = $bd->select($countrydb . '.merchants', array('id', 'offer_maturity_period'), $condition_merchants);\n\n if ($merchants === FALSE) {\n $this->exitlog('SQL error selecting the merchants from the country database');\n }\n\n $merchants_period = $bd->toutesLignes();\n $updateRecord = array();\n\n foreach ($fields as $final) {\n \n $period = intval($this->searchForOfferMaturity($final['id'], $merchants_period));\n if (intval($final['days']) > $period && intval($final['days']) > 15 ) { \n $updateRecord[] = $final['transaction_id'];\n }\n }\n\n if (count($updateRecord) > 0) {\n $currentTime = new DateTime(\"now\", new DateTimeZone(self::$localTimeZone));\n $currentTime = $currentTime->format('Y-m-d H:i:s');\n $condition_update = 'id in(' . implode(\",\", $updateRecord) . ') and status ='.TRANSACTION_STATUS_PENDING_CONFIRMATION;\n $this->updated = $bd->update($countrydb . '.transactions', array('status' => TRANSACTION_STATUS_CONFIRMED, 'confirmation_date' => $currentTime, 'updated_at' => $currentTime, 'validation_date' => $currentTime), $condition_update);\n if ($this->updated === FALSE) {\n $this->exitlog('SQL Error updating the status to confirmed ', self::$logFile);\n }\n }\n $bd->ferme();\n }",
"function declineCSD()\n\t{\n\t\trequire 'db.php';\n\t\t$request = $_POST;\n\n\t\t$doneBy = $request['approvedBy']??\"\";\n\t\t$user = $request['accountUser']??\"\";\n\t\t$message = $request['message']??\"\";\n\n\t\tif($user && $doneBy){\n\t\t\t//checking id the user is a broker\n\t\t\t$query = $investDb->query(\"SELECT * FROM users WHERE id = \\\"$doneBy\\\" AND account_type = 'broker' LIMIT 1 \") or trigger_error($db->error);\n\t\t\tif($query->num_rows){\n\t\t\t\t//here user is a broker we can now assign the CSD\n\t\t\t\t$investDb->query(\"UPDATE clients SET status = 'declined', statusBy = \\\"$doneBy\\\", statusOn = NOW() WHERE id = \\\"$user\\\" \") or trigger_error($db->error);\n\n\t\t\t\t//Client data for messaging\n\t\t\t\t$clientData = checkClient($user);\n\t\t\t\t$userId = $clientData['userCode'];\n\n\t\t\t\tif($userId){\n\t\t\t\t\t//get user details\n\t\t\t\t\t$userData = $User->details($userId);\n\t\t\t\t\t$userphone = $userData['phone'];\n\t\t\t\t\t$feedBankMessage = \"Dear $userData[name], Your CSD account request was not approved with reason: $message\";\n\t\t\t\t\tsendsms($userphone, $feedBankMessage);\n\t\t\t\t}\n\n\t\t\t\t$response = \"Done\";\n\t\t\t}else{\n\t\t\t\t$response = \"Failed\";\n\t\t\t}\n\t\t}else{\n\t\t\t$response = \"Failed\";\n\t\t}\n\t\techo json_encode($response);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get file content of the record | public function getFileContent(\Models\Record $record, $is_bag, $database_address); | [
"public function getFileContents()\n {\n return $this->get('FileContents');\n }",
"public function getFileContent()\n {\n return $this->fileContent;\n }",
"public function getRecord()\n {\n return $this->_content;\n }",
"public function getFileContent(): string\n {\n return $this->_content;\n }",
"public function get_file_content($file);",
"function GetContent()\n {\n//** non-empty literal content is available. Use that as the attachment.\n//** Assume the user has used correct MIME type.\n\n if($this->HasLiteralContent())\n return $this->LiteralContent;\n\n//** no literal content available. Try to get file data.\n\n else\n {\n if(!$this->Exists()) //** file does not exist.\n return null; //** no content is available.\n else\n {\n//** open the file attachment in binary mode and read the contents. \n\n $thefile = fopen($this->FilePath, \"rb\"); \n $data = fread($thefile, filesize($this->FilePath));\n fclose($thefile);\n return $data; \n }\n }\n }",
"public static function getContent()\n {\n $content= '';\n fseek(self::$fileResource, 0);\n while (($line = fgets(self::$fileResource)) !== false) {\n $content.= $line;\n }\n return unserialize($content);\n }",
"public final function getFileContents() {\n return \\file_get_contents($this->file->getAbsolutePath());\n }",
"public function getContents()\n {\n return fopen($this->file, 'r');\n }",
"public function getContent() {\n\t\treturn file_get_contents($this->filename);\n\t}",
"public function getAttachFileContent() {\n return $this->file_content;\n }",
"public function fetchContent()\n {\n\n $data = file_get_contents($this->filePath);\n\n return $data;\n }",
"public function getContentFile()\n {\n return $this->contentFile;\n }",
"public function getFile()\n {\n \treturn $this->file;\n }",
"public function getFile () \r\n {\r\n return $this->file;\r\n }",
"protected function getContent()\n\t{\n\t\tif (!isset($this->content)) $this->content = file($this->filename, \\FILE_IGNORE_NEW_LINES);\n\t\treturn $this->content;\n\t}",
"public function getContents()\n {\n if ($this->file) {\n return $this->directory->readFile($this->directory->getRelativePath($this->file));\n }\n return '';\n }",
"public function getFile()\n {\n return $this->file($this->getParameter());\n }",
"public function contents(){\n\t\treturn file_get_contents($this->path);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns whether or not the current user can suspend/unsuspend a member. | public function canSuspend($member)
{
// The user must be an administrator, or they must have the "canSuspend" permission and the member's
// account be either "member" or "suspended". A user cannot suspend or unsuspend themselves, and the root
// admin cannot be suspended.
return
(
ET::$session->isAdmin()
or (ET::$session->user["canSuspend"] and ($member["account"] == ACCOUNT_MEMBER or $member["account"] == ACCOUNT_SUSPENDED))
)
and $member["memberId"] != C("esoTalk.rootAdmin") and $member["memberId"] != ET::$session->userId;
} | [
"public static function is_member()\n {\n static $is_member = NULL;\n if (NULL !== $is_member)\n return ($is_member);\n\n $role = self::_get_role();\n // banned, and registered/verified but not approved users are not full members\n if ('ban' === $role || 'register' === $role || 'verified' === $role)\n return ($is_member = FALSE);\n\n // TODO: use current_user_can() when/if we create capabilities\n//\t\tif (current_user_can('peepso_member'))\n//\t\t\treturn ($is_member = FALSE);\n\n return ($is_member = TRUE);\n }",
"public function isUttMember()\n\t{\n\t\treturn $this->isUser() && ! $this->user->getIsStudent() && ! $this->user->getKeepActive();\n\t}",
"function isSuspended()\n{\n\tglobal $config;\n\tif (!$this->user) return false;\n\t\n\t// If the user's suspension is unknown, get it from the database and cache it for later.\n\tif ($this->user[\"suspended\"] !== true and $this->user[\"suspended\"] !== false) {\n\t\t$account = $this->db->result(\"SELECT account FROM {$config[\"tablePrefix\"]}members WHERE memberId={$this->user[\"memberId\"]}\", 0);\n\t\t$this->user[\"account\"] = $_SESSION[\"user\"][\"account\"] = $account;\n\t\t$this->user[\"suspended\"] = $account == \"Suspended\";\n\t}\n\treturn $this->user[\"suspended\"];\n}",
"public function canCustomerSuspend(){\n\t\treturn (boolean) $this->getSubscription()->getCanCustomerSuspend();\n\t}",
"function session_is_member()\r\n\t{\r\n\t\tif ( session_is_active() )\r\n\t\t{\r\n\t\t\treturn !$_SESSION['USER']['is_biz_owner'];\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}",
"public function user_is_poweruser()\n {\n return $this->current_auth_lvl() >= $this->auth_poweruser_level();\n }",
"public function isSuspend();",
"public static function is_suspendable_user($userid) {\n global $USER;\n\n if (empty($userid)) {\n // Userid of 0.\n return false;\n }\n\n if ($userid == $USER->id) {\n // Is current user.\n return false;\n }\n\n if (isguestuser($userid)) {\n return false;\n }\n\n if (is_siteadmin($userid)) {\n return false;\n }\n\n return true;\n }",
"public function isMember()\n {\n return $this->isRole(Role::ROLE_MEMBER);\n }",
"static public function was_member() {\n global $wpdb, $current_user;\n\n $return = false;\n\n // Must be logged in to know if she was a member...\n if ( empty( $current_user->ID ) ) {\n $return = null;\n }\n else {\n //$old_member = $wpdb->get_var(\"SELECT id FROM $wpdb->pmpro_memberships_users WHERE user_id = '\" . $current_user->ID . \"' AND status NOT IN('cancelled')\");\n $old_member = $wpdb->get_var(\"SELECT id FROM $wpdb->pmpro_memberships_users WHERE user_id = '\" . $current_user->ID . \"' AND status = 'expired'\");\n if ( ! empty( $old_member ) )\n $return = true;\n }\n\n return $return;\n }",
"public function isMember()\n {\n return ($this->userable instanceof Member);\n }",
"public static function is_active_member() {\n\n $db = Database::getConnection();\n $uid = \\Drupal::currentUser()->id();\n\n if ($uid == 0) return false;\n // if ($uid == 1) $uid = 2;\n\n $sql = \"SELECT * FROM members m WHERE m.ID = :id\";\n $data = $db->query($sql, array(':id' => $uid))->fetch();\n\n if (!$data) return false;\n\n if ($data->Date_renewed == '0000-00-00') {\n return false;\n }\n\n $today = strtotime('now');\n $expiration_date = strtotime($data->Date_renewed);\n\n if ($expiration_date < $today) {\n return false;\n }\n\n return $data;\n }",
"function isMember() {\n return $this->isMember;\n }",
"public function isMember(){\n\n\t\t$s = DB::table('project_user')->whereProjectId($this->id)->whereUserId(Auth::id())->get();\n\t\tif(count($s) == 0){\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"function canLock()\n{\n\treturn $this->esoTalk->user and $this->esoTalk->user[\"moderator\"];\n}",
"public function canInvitUser()\n {\n if ($this->getRemainingInvitations() > 0) {\n return true;\n }\n\n return false;\n }",
"static function _is_ch_member_exclusively()\n {\n // Get current user\n $user = wp_get_current_user();\n\n /**\n * @see is_user_logged_in()\n */\n if ($user->exists()) {\n return count($user->roles) === 1 && reset($user->roles) === 'ch_member';\n }\n\n return false;\n }",
"public function CanEmulateUser(){\r\n\t\r\n\t\t// if we're not an admin, GET OUT\t\r\n\t\tif( !Permission::check('ADMIN') )\r\n\t\t\treturn false;\r\n\t\t\r\n\t\t// also, make sure we haven't been manually disabled\r\n\t\t$config = SiteConfig::current_site_config();\r\n\t\tif( $config->EmulateUserDisabled )\r\n\t\t\treturn false;\r\n\t\t\t\r\n\t\treturn true;\r\n\t}",
"public function getIsMemberState()\n {\n return $this->isMemberState;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation checkoutsConsignmentsByCheckoutIdAndConsignmentIdDeleteAsyncWithHttpInfo Delete Checkout Consignment | public function checkoutsConsignmentsByCheckoutIdAndConsignmentIdDeleteAsyncWithHttpInfo($checkout_id, $accept, $content_type, $consignment_id)
{
$returnType = '\BigCommerce\Api\V3\Model\Checkout\Checkout1';
$request = $this->checkoutsConsignmentsByCheckoutIdAndConsignmentIdDeleteRequest($checkout_id, $accept, $content_type, $consignment_id);
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 checkoutsConsignmentsByCheckoutIdAndConsignmentIdDeleteAsync($checkout_id, $accept, $content_type, $consignment_id)\n {\n return $this->checkoutsConsignmentsByCheckoutIdAndConsignmentIdDeleteAsyncWithHttpInfo($checkout_id, $accept, $content_type, $consignment_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function checkoutsConsignmentsByCheckoutIdAndConsignmentIdDelete($checkout_id, $accept, $content_type, $consignment_id)\n {\n list($response) = $this->checkoutsConsignmentsByCheckoutIdAndConsignmentIdDeleteWithHttpInfo($checkout_id, $accept, $content_type, $consignment_id);\n return $response;\n }",
"public function deleteCovidCase(CovidCaseDeleteRequest $request) {\n $validated = $request->validated(); // validation\n \n if ($request->filled('covid_case_id')) {\n $input['covid_case_id'] = $request->request->get('covid_case_id'); \n }\n\n DB::beginTransaction();\n\n try {\n foreach ($input['covid_case_id'] as $key) {\n $covid_case_id = (integer)$key;\n \n LaCovidCase::destroy($covid_case_id);\n }\n \n DB::commit();\n \n return response()->json([\n 'success' => true,\n 'message' => 'COVID case deleted successfully.'\n ], self::SUCCESS_STATUS);\n } catch (Exception $e) {\n DB::rollback();\n return response()->json([\n 'success' => false,\n 'message' => 'COVID case deletion failed.'\n ], self::INTERNAL_SERVER_STATUS);\n }\n }",
"public function publicationServiceApplicationControllerSubscriptionApiControllerCdelete()\n {\n $this->publicationServiceApplicationControllerSubscriptionApiControllerCdeleteWithHttpInfo();\n }",
"public function deleteAction(Request $request, $id)\n {\n $form = $this->createDeleteForm($id);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('ICantGoConcertBundle:Concert')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Concert entity.');\n }\n\n $em->remove($entity);\n $em->flush();\n }\n\n return $this->redirect($this->generateUrl('concert'));\n }",
"public function deleteCenWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->cenId)) {\n $query['CenId'] = $request->cenId;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'DeleteCen',\n 'version' => '2017-09-12',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return DeleteCenResponse::fromMap($this->callApi($params, $req, $runtime));\n }",
"public function teamsProjectsDeleteWithHttpInfo($account_id, $team_id, $id, $x_phrase_app_otp = null)\n {\n $request = $this->teamsProjectsDeleteRequest($account_id, $team_id, $id, $x_phrase_app_otp);\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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function teamsProjectsDeleteAsyncWithHttpInfo($account_id, $team_id, $id, $x_phrase_app_otp = null)\n {\n $returnType = '';\n $request = $this->teamsProjectsDeleteRequest($account_id, $team_id, $id, $x_phrase_app_otp);\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 deleteCouponsByOidAsync($coupon_delete_request)\n {\n return $this->deleteCouponsByOidAsyncWithHttpInfo($coupon_delete_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function deleteAction(Request $request, $id)\n {\n $form = $this->createDeleteForm($id);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('GestionPassBundle:Consigne')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Consigne entity.');\n }\n\n $em->remove($entity);\n $em->flush();\n }\n\n return $this->redirect($this->generateUrl('consigne'));\n }",
"function deleteWebinar($webinarKey, $sendCancellationEmails = true)\n {\n ($sendCancellationEmails) ? $parameters = ['sendCancellationEmails' => true] : $parameters = null;\n\n $path = $this->getPathRelativeToOrganizer(sprintf('webinars/%s', $webinarKey));\n\n return $this->sendRequest('DELETE', $path, $parameters, $payload = null);\n }",
"public function cdeleteAction(Request $request)\n {\n $idsData = $request->get('ids');\n $ids = \\explode(',', $idsData);\n\n if (!\\count($ids)) {\n throw new MissingParameterException('TargetGroupController', 'ids');\n }\n\n $targetGroups = $this->targetGroupRepository->findById($ids);\n\n foreach ($targetGroups as $targetGroup) {\n $this->entityManager->remove($targetGroup);\n }\n\n $this->entityManager->flush();\n\n return $this->handleView($this->view(null, 204));\n }",
"public function correlationDelete($params = array(), $arrayKeyProperty = '')\n {\n return $this->request('correlation.delete', $this->getRequestParamsArray($params), $arrayKeyProperty, true);\n }",
"public function deleteDhcpOptions($request);",
"public function checkoutsCouponsByCheckoutIdAndCouponCodeDeleteAsyncWithHttpInfo($checkout_id, $accept, $content_type, $coupon_code)\n {\n $returnType = '\\BigCommerce\\Api\\V3\\Model\\Checkout\\Checkout1';\n $request = $this->checkoutsCouponsByCheckoutIdAndCouponCodeDeleteRequest($checkout_id, $accept, $content_type, $coupon_code);\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 static function delete($checkoutId){\n\t\t//1. delete checkout_setting\n\t\t$sql = \"delete from checkout_setting where checkout_id=$checkoutId\";\n\t\tDataBaseHelper::query($sql, null, null);\n\t\t\n\t\t//2. delete in data base\n\t\t$sql = \"delete from checkout where checkout_id=$checkoutId\";\n\t\tDataBaseHelper::query($sql, null, null);\n\t}",
"public function deleteCouponsWithHttpInfo($applicationId, $campaignId, $value = null, $createdBefore = null, $createdAfter = null, $startsAfter = null, $startsBefore = null, $expiresAfter = null, $expiresBefore = null, $valid = null, $batchId = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false)\n {\n $request = $this->deleteCouponsRequest($applicationId, $campaignId, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch);\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 return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function deleteCen($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->deleteCenWithOptions($request, $runtime);\n }",
"public function deleteCertificateAsyncWithHttpInfo($company_id, $id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0')\n {\n $returnType = '\\Together\\Taxes\\Provider\\AvaTax\\Swagger\\Model\\ErrorDetail[]';\n $request = $this->deleteCertificateRequest($company_id, $id, $x_avalara_client);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the given user can manage the categories. | public function manage_categories(User $user)
{
return $user->can_manage_categories;
} | [
"public function manage(User $user)\n {\n return $user->can('manage-tag');\n }",
"public function view(User $user) {\n return $user->can('view-category');\n }",
"function canAdd($user) {\n \treturn $user->isAdministrator() || $user->getSystemPermission('can_add_documents') && (boolean) DocumentCategories::findAll($user);\n }",
"public function delete(User $user) {\n return $user->can('delete-category');\n }",
"public function manage(User $user)\n {\n return $user->hasPermission('user-invite') ||\n $user->hasPermission('user-edit') ||\n $user->hasPermission('user-delete');\n }",
"public function canCreateCategoryByAdmin()\n {\n return !!$this->categories_create_by_user;\n }",
"function publisher_userIsModerator($itemObj)\r\n{\r\n $publisher = PublisherPublisher::getInstance();\r\n $categoriesGranted = $publisher->getHandler('permission')->getGrantedItems('category_moderation');\r\n return (is_object($itemObj) && in_array($itemObj->categoryid(), $categoriesGranted));\r\n}",
"public function create(User $user)\n {\n return $user->HasRole('Admin') || $user->hasPermissionTo('create_categorias');\n }",
"public function viewAny(User $user)\n {\n return $user->can('view_skill_categories');\n }",
"public function create(User $user)\n {\n return $user->canDo('category.category.create');\n }",
"public function create(User $user) {\n return $user->hasPermission('categories.create');\n }",
"public function create(User $user)\n {\n return $user->hasPermission('guide-categories-create');\n }",
"public function delete(User $user)\n {\n return $user->can('delete_article_categories');\n }",
"public function isCategoryAllowedByUser(array $context, string $category): bool\n {\n $cookieChecker = $this->getCookieChecker($context['app']->getRequest());\n\n return $cookieChecker->isCategoryAllowedByUser($category);\n }",
"public function current_user_can_manage()\n\t\t{\n\t\t\t$option = avia_get_option( 'alb_element_templates' );\n\n\t\t\tif( '' == $option )\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn current_user_can( $this->get_capability() );\n\t\t}",
"public function create(User $user)\n {\n if ($user->hasPermissionTo('create crm product categories')) {\n return true;\n }\n }",
"function canManage($user, $project) {\n return ProjectObject::canManage($user, $project, 'discussion');\n }",
"public function create_layoutcategory(User $user)\n {\n return $user->role === 'admin';\n }",
"public function is_manage()\n {\n if ($this->is_login()) {\n $user = $this->session->userdata(USER_SESSION_KEY);\n // $role_manage = array(IN_ADMIN, IN_CONSULTANT);\n $this->load->model('t_user');\n $user_property = $this->t_user->get_data_by_id('*', $user['ID_USER']);\n if ($user_property['USER_ROLE'] == 2 || $user_property['USER_ROLE'] == 1) {\n return true;\n } else {\n return false;\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation salesOrderCustomFieldValuesGETManyRequestInvoiceIDCustomFieldValuesGetAsync Retrieves a list of custom field values for a sales order. | public function salesOrderCustomFieldValuesGETManyRequestInvoiceIDCustomFieldValuesGetAsync($accept, $invoice_id, $jiwa_stateful = null)
{
return $this->salesOrderCustomFieldValuesGETManyRequestInvoiceIDCustomFieldValuesGetAsyncWithHttpInfo($accept, $invoice_id, $jiwa_stateful)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function salesOrderCustomFieldValuesGETManyRequestInvoiceIDCustomFieldValuesGet($accept, $invoice_id, $jiwa_stateful = null)\n {\n list($response) = $this->salesOrderCustomFieldValuesGETManyRequestInvoiceIDCustomFieldValuesGetWithHttpInfo($accept, $invoice_id, $jiwa_stateful);\n return $response;\n }",
"public function billCustomFieldValuesGETManyRequestBillIDCustomFieldValuesGet($accept, $bill_id, $jiwa_stateful = null)\n {\n list($response) = $this->billCustomFieldValuesGETManyRequestBillIDCustomFieldValuesGetWithHttpInfo($accept, $bill_id, $jiwa_stateful);\n return $response;\n }",
"public function billOutputCustomFieldValuesGETManyRequestBillIDOutputsOutputIDCustomFieldValuesGet($accept, $bill_id, $output_id, $jiwa_stateful = null)\n {\n list($response) = $this->billOutputCustomFieldValuesGETManyRequestBillIDOutputsOutputIDCustomFieldValuesGetWithHttpInfo($accept, $bill_id, $output_id, $jiwa_stateful);\n return $response;\n }",
"public function billInputCustomFieldValuesGETManyRequestBillIDStagesStageIDInputsInputIDCustomFieldValuesGet($accept, $bill_id, $stage_id, $input_id, $jiwa_stateful = null)\n {\n list($response) = $this->billInputCustomFieldValuesGETManyRequestBillIDStagesStageIDInputsInputIDCustomFieldValuesGetWithHttpInfo($accept, $bill_id, $stage_id, $input_id, $jiwa_stateful);\n return $response;\n }",
"public function billStageCustomFieldValuesGETManyRequestBillIDStagesStageIDCustomFieldValuesGetAsync($accept, $bill_id, $stage_id, $jiwa_stateful = null)\n {\n return $this->billStageCustomFieldValuesGETManyRequestBillIDStagesStageIDCustomFieldValuesGetAsyncWithHttpInfo($accept, $bill_id, $stage_id, $jiwa_stateful)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function customFieldValues()\n {\n return $this->morphMany(\\VentureDrake\\LaravelCrm\\Models\\FieldValue::class, 'custom_field_valueable');\n }",
"public function salesOrderLineCustomFieldValuesGETManyRequestInvoiceIDHistorysInvoiceHistoryIDLinesInvoiceLineIDCustomFieldValuesGetWithHttpInfo($accept, $invoice_id, $invoice_history_id, $invoice_line_id, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\CustomFieldValue[]';\n $request = $this->salesOrderLineCustomFieldValuesGETManyRequestInvoiceIDHistorysInvoiceHistoryIDLinesInvoiceLineIDCustomFieldValuesGetRequest($accept, $invoice_id, $invoice_history_id, $invoice_line_id, $jiwa_stateful);\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 '\\Jiwa\\Model\\CustomFieldValue[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\CustomFieldValue[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\CustomFieldValue[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\CustomFieldValue[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function convertCustomFieldValues()\n {\n return $this->custom_field_values\n ->load(['custom_field', 'custom_field_option', 'custom_field_option.image'])\n ->map(function (CustomFieldValue $value) {\n $data = $value->toArray();\n $data['display_value'] = $value->displayValue;\n\n $prices = $value->priceForFieldOption($value->custom_field)->load('currency');\n\n $data['price'] = $prices->mapWithKeys(function (Price $price) {\n return [$price->currency->code => $price->float];\n })->toArray();\n\n if (isset($data['custom_field']['custom_field_options'])) {\n unset($data['custom_field']['custom_field_options']);\n }\n\n return $data;\n });\n }",
"public function billCustomFieldValuesGETManyRequestBillIDCustomFieldValuesGetWithHttpInfo($accept, $bill_id, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\CustomFieldValue[]';\n $request = $this->billCustomFieldValuesGETManyRequestBillIDCustomFieldValuesGetRequest($accept, $bill_id, $jiwa_stateful);\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 '\\Jiwa\\Model\\CustomFieldValue[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\CustomFieldValue[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\CustomFieldValue[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Jiwa\\Model\\CustomFieldValue[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function debtorCustomFieldValuesGETManyRequestDebtorIDCustomFieldValuesGetAsyncWithHttpInfo($accept, $debtor_id, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\CustomFieldValue[]';\n $request = $this->debtorCustomFieldValuesGETManyRequestDebtorIDCustomFieldValuesGetRequest($accept, $debtor_id, $jiwa_stateful);\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 productFieldValuesList($productId)\n {\n if (empty($productId)) {\n throw new InsalesApiException(\"Product id must be set\");\n }\n\n $url = sprintf('/admin/products/%s/product_field_values.json', $productId);\n\n return $this->client->makeRequest($url, Request::METHOD_GET);\n }",
"public function billCustomFieldValuesGETManyRequestBillIDCustomFieldValuesGetAsyncWithHttpInfo($accept, $bill_id, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\CustomFieldValue[]';\n $request = $this->billCustomFieldValuesGETManyRequestBillIDCustomFieldValuesGetRequest($accept, $bill_id, $jiwa_stateful);\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 billStageCustomFieldValuesGETManyRequestBillIDStagesStageIDCustomFieldValuesGetAsyncWithHttpInfo($accept, $bill_id, $stage_id, $jiwa_stateful = null)\n {\n $returnType = '\\Jiwa\\Model\\CustomFieldValue[]';\n $request = $this->billStageCustomFieldValuesGETManyRequestBillIDStagesStageIDCustomFieldValuesGetRequest($accept, $bill_id, $stage_id, $jiwa_stateful);\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 billInputCustomFieldValuesGETManyRequestBillIDStagesStageIDInputsInputIDCustomFieldValuesGetAsync($accept, $bill_id, $stage_id, $input_id, $jiwa_stateful = null)\n {\n return $this->billInputCustomFieldValuesGETManyRequestBillIDStagesStageIDInputsInputIDCustomFieldValuesGetAsyncWithHttpInfo($accept, $bill_id, $stage_id, $input_id, $jiwa_stateful)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function setValues($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Yoti\\Protobuf\\Attrpubapi\\MultiValue\\Value::class);\n $this->values = $arr;\n\n return $this;\n }",
"public function getCustomFieldsValues()\n {\n if (!$this->customFieldsValues) {\n $customer = Mage::registry('current_customer');\n $this->customFieldsValues = unserialize($customer->getCustomFieldsValues());\n }\n\n return $this->customFieldsValues;\n }",
"public function getValues()\n {\n if (!isset($this->values)) {\n $this->values = array();\n foreach ($this->columns as $column) {\n $this->values[$column['dcr:name']] = $column['dcr:value'];\n }\n }\n\n return $this->values;\n }",
"public function inventoryCustomFieldValueGETRequestInventoryIDCustomFieldValuesSettingIDGet($accept, $inventory_id, $setting_id, $jiwa_stateful = null)\n {\n list($response) = $this->inventoryCustomFieldValueGETRequestInventoryIDCustomFieldValuesSettingIDGetWithHttpInfo($accept, $inventory_id, $setting_id, $jiwa_stateful);\n return $response;\n }",
"public function setValues($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1\\FeatureValueList::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generated from protobuf field .common.Block block = 2; | public function getBlock()
{
return $this->readOneof(2);
} | [
"public function getBlock()\n {\n return $this->block;\n }",
"public function getGenericBlock();",
"private function getBlock()\n {\n\n return $this->block;\n }",
"public function getBlock() {\n\t\treturn $this->block;\n\t}",
"public function setBlock($block) : Field {\n // remember the block\n $this->block = $block;\n // return the block for chained method calling\n return $this;\n }",
"public function getPType() {\n return 'block';\n }",
"public function updateBlock(Block $block, BlockUpdateStruct $blockUpdateStruct): Block;",
"public function setBlocks($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::BYTES);\n $this->blocks = $arr;\n\n return $this;\n }",
"public function getBlockId()\n {\n return $this->_blockId;\n }",
"public function createBlockInstance ($block);",
"protected function _getBlock()\n {\n return $this->block;\n }",
"public function setBlockNo($var)\n {\n GPBUtil::checkUint64($var);\n $this->blockNo = $var;\n\n return $this;\n }",
"function getBlockIdentifier() { return $this->m_BlockIdentifier; }",
"public function getBlockId()\n\t{\n\t\treturn $this->block->id;\n\t}",
"public function setBlock($block) {\n $this->block = $block;\n }",
"public function getBlockId()\n {\n return $this->block_id;\n }",
"public function getBlockId() {\n return $this->block_id;\n }",
"public function getNewBlock()\n\t{\n\t\t$class = __NAMESPACE__.'\\\\'.$this->blockModelClass;\n\t\treturn new $class();\n\t}",
"public function testBlock() {\n $config = array();\n $plugin = array('module' => 'drupalgotchi', 'id' => 'drupalgotchi_hello');\n $block_plugin = new HelloBlock($config, 'drupalgotchi_hello', $plugin);\n\n $build = $block_plugin->build();\n $this->assertEquals('drupalgotchi_hello_block', $build['#theme']);\n $this->assertEquals('World', $build['#person']);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Purge any styles that do not have corresponding elements. | public function purgeStylesWithoutElements()
{
$selectors = $this->getSeletors();
$styles = $this->getStyles();
foreach ($styles as $key => $style) {
if (!in_array($key, $selectors)) {
unset($styles[$key]);
}
}
$this->styles = $styles;
} | [
"public function removeCSS();",
"function qed_flush_style_cache() {\r\n\t\tdelete_transient( 'qed_generated_styles_list' );\r\n\t\tdelete_transient( 'qed_generated_styles_list_rtl' );\r\n\t}",
"public function clearStylesheets()\n {\n foreach (array_keys($this->getStylesheets()) as $file)\n {\n $this->removeStylesheet($file);\n }\n }",
"function deregister_styles(){\n\t\t}",
"public static function clearStylesheets() {\n self::$stylesheets = array();\n }",
"public static function purge_rules() {\n global $DB;\n $DB->delete_records('block_css_theme_tool');\n $DB->delete_records('block_css_theme_tool_styles');\n }",
"function deregister_theme_styling() {\n global $wp_styles;\n $themes_uri = get_theme_root_uri();\n foreach ( $wp_styles->registered as $wp_style ) {\n if ( strpos( $wp_style->src, $themes_uri ) !== false ) {\n wp_deregister_style( $wp_style->handle );\n }\n }\n }",
"public function deleteAll()\n {\n foreach ($this->_styles as $style) {\n $instance = $style['instance'];\n $instance->delete();\n }\n $this->delete();\n }",
"public function cleanStyles($e) {\n\t\tif (!is_object($e)) return;\n\t\t$elems = $e->getElementsByTagName('*');\n\t\tforeach ($elems as $elem) {\n\t\t\t$elem->removeAttribute('style');\n\t\t}\n\t}",
"function wpex_remove_woo_styles( $styles ) {\n\tunset( $styles['woocommerce-general'] );\n\tunset( $styles['woocommerce-layout'] );\n\tunset( $styles['woocommerce-smallscreen'] );\n\treturn $styles;\n}",
"public function remove_styles(){\r\n\t\t\r\n\t\twp_dequeue_style('admin-menu');\r\n\t\twp_deregister_style('admin-menu');\r\n\t\twp_register_style(\r\n\t\t\t'admin-menu',\r\n\t\t\t$this->path . 'assets/css/modules/blank.css',\r\n\t\t\tarray(),\r\n\t\t\t$this->version\r\n\t\t);\r\n\t\twp_enqueue_style('admin-menu');\r\n\t\t\r\n\t}",
"static public function remove_gform_styles()\n {\n wp_dequeue_style( 'gforms_reset_css' );\n // wp_dequeue_style( 'gforms_datepicker_css' );\n wp_dequeue_style( 'gforms_formsmain_css' );\n wp_dequeue_style( 'gforms_ready_class_css' );\n wp_dequeue_style( 'gforms_browsers_css' );\n }",
"private function stripStyleTags() : void\n {\n if(!ConvertHelper::isStringHTML($this->subject))\n {\n return;\n }\n\n $this->subject = (string)preg_replace(\n '%<style\\b[^>]*>(.*?)</style>%six',\n '',\n $this->subject\n );\n }",
"function remove_editor_styles()\n {\n }",
"function ClearDocumentStyle(){}",
"public function remove_wp_block_library_css(){\n\t\twp_dequeue_style( 'global-styles' );\n\t}",
"function tve_remove_theme_css() {\n\tglobal $wp_styles;\n\n\t$theme = get_template();\n\t$stylesheet_dir = basename( get_stylesheet_directory() );\n\n\tforeach ( $wp_styles->queue as $handle ) {\n\t\t$src = $wp_styles->registered[ $handle ]->src;\n\t\tif ( apply_filters( 'tcb_remove_theme_css', strpos( $src, $theme ) !== false || strpos( $src, $stylesheet_dir ) !== false, $src ) ) {\n\t\t\twp_deregister_style( $handle );\n\t\t}\n\t}\n}",
"function wps_deregister_styles() {\n\twp_dequeue_style( 'wp-block-library' );\n}",
"function wps_deregister_styles() {\n wp_dequeue_style( 'wp-block-library' );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the value of the AdditionalLocationInfo and returns this instance | public function withAdditionalLocationInfo($value)
{
$this->setAdditionalLocationInfo($value);
return $this;
} | [
"public function setAdditionalLocationInfo($value) \n {\n $this->_fields['AdditionalLocationInfo']['FieldValue'] = $value;\n return $this;\n }",
"public function setAdditionalInfo(array $additionalInfo) {\n $this->additionalInfo = $additionalInfo;\n return $this;\n }",
"public function setAdditionalInfo($additionalInfo)\n {\n $this->additionalInfo = $additionalInfo;\n return $this;\n }",
"public function getAdditionalLocationInfo()\n {\n return $this->_fields['AdditionalLocationInfo']['FieldValue'];\n }",
"public function setAdditionalInfoLabel($additional_info_label)\n {\n $this->additional_info_label = $additional_info_label;\n return $this;\n }",
"function setLocation($inLocation) {\n\t\tif ( $this->_Location !== $inLocation ) {\n\t\t\t$this->_Location = $inLocation;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}",
"public function addLocationElements()\n {\n $hat = $this->options['auth']->getIdentity()->hat;\n /** @var \\InterpretersOffice\\Entity\\Repository\\LocationRepository $repo*/\n $repo = $this->objectManager->getRepository(Entity\\Location::class);\n\n $options = $repo->getLocationOptionsForHat($hat);\n array_unshift($options, ['label' => ' ','value' => '']);\n $this->add(\n [\n 'type' => 'Laminas\\Form\\Element\\Select',\n 'name' => 'location',\n 'options' => [\n 'label' => 'location',\n 'value_options' => $options,\n ],\n 'attributes' => ['class' => 'custom-select text-muted', 'id' => 'location'],\n ]\n );\n $this->add([\n 'type' => 'textarea',\n 'name' => 'comments',\n 'attributes' => ['id' => 'comments', 'class' => 'form-control',\n 'placeholder' => 'any noteworthy details or special instructions'\n ]\n ]);\n\n return $this;\n }",
"public function setLocationData()\n\t{\n\t\t$location = Locations::where('id', '=', $this->location_id)->first();\n\t\t$this->location = $location;\n\t}",
"public function addToLocationDetails(\\Devlabs91\\TravelgateNotify\\Models\\Ota\\VehicleLocationDetailsType $locationDetails)\n {\n $this->locationDetails[] = $locationDetails;\n return $this;\n }",
"public function setOrganizationAdditionalInfo($value)\n {\n return $this->set(self::ORGANIZATIONADDITIONALINFO, $value);\n }",
"public function setAdditionalData(array $additionalData)\n {\n $this->additionalData = $additionalData;\n return $this;\n }",
"public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }",
"public function setAdditionalInfos($additionalInfos)\n {\n $this->setValue('additionalInfos', $additionalInfos);\n }",
"public function setAdditional($var)\n {\n GPBUtil::checkMessage($var, \\Yinge\\Grpc\\Finance\\AdditionalInfo::class);\n $this->additional = $var;\n\n return $this;\n }",
"public function setAdditionalData($data) {\n $this->set('additional_data', $data);\n return $this;\n }",
"public function setExtendedLocationCode($extendedLocationCode)\n {\n $this->extendedLocationCode = $extendedLocationCode;\n return $this;\n }",
"public function addToAdditionalInformation(\\Greenter\\Ubl\\Entity\\CommonBasic\\AdditionalInformation $additionalInformation)\n {\n $this->additionalInformation[] = $additionalInformation;\n return $this;\n }",
"function set_location_other($new_location_other){\n\t\treturn $this->location_name=$new_location_other;\n\t}",
"public function setAdditionalDetails(array $additionalDetails)\n {\n $this->additionalDetails = $additionalDetails;\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
populate columns headers from columns in $this>table | private function fetchColumnHeading()
{
$headings = array();
foreach ($this->table->getColumns() as $key => $details) {
$columnName = $this->getController()->translate($details['label']);
/**
* NB excel cannot have columns called 'ID' causes a format failure
*/
if ($columnName == 'ID')
{
$columnName = '_ID';
}
$headings[$key] = $columnName;
}
$this->headings = $headings;
return $this;
} | [
"private function prepare_column_headers() {\n\n\t\t$this->_column_headers = [\n\t\t\t$this->get_columns(),\n\t\t\t[],\n\t\t\t[],\n\t\t];\n\t}",
"private function setup_columns() {\n\t\t$this->_column_headers = array( $this->get_columns(), array(), $this->get_sortable_columns() );\n\t}",
"public function getColumnHeaders();",
"protected function set_column_headers()\n {\n }",
"public function column_headers($columns)\n {\n }",
"public function buildTableHeader()\n {\n $counter = 0;\n\n if ($this->actionHandler)\n {\n $this->setHeaderContents(0, $counter, '');\n $counter ++;\n }\n\n foreach ($this->defaultProperties as $defaultproperty)\n {\n if (method_exists($this->cellRenderer, 'get_prefix'))\n {\n $prefix = $this->cellRenderer->get_prefix();\n }\n\n if ($defaultproperty)\n {\n $this->setHeaderContents(0, $counter, Translation::get($prefix . $defaultproperty));\n }\n else\n {\n $this->setHeaderContents(0, $counter, '');\n }\n\n $counter ++;\n }\n\n if (method_exists($this->cellRenderer, 'get_modification_links'))\n {\n $this->setHeaderContents(0, $counter, '');\n }\n }",
"protected function setColumns()\n {\n // choose what columns should be displayed in the table.\n // For table display, we need to specify the column name for the result query.\n\n $this->addCheckableColumn();\n\n $this->columns['id'] = array(\n 'label' => 'ID',\n 'sortable' => true,\n 'table_column' => 'users.id',\n );\n\n $this->columns['username'] = array(\n 'label' => 'Username',\n 'sortable' => true,\n 'table_column' => 'users.username',\n );\n\n $this->columns['email'] = array(\n 'label' => 'Email',\n 'sortable' => true,\n 'classes' => 'some_class some_class2',\n 'table_column' => 'users.email',\n 'thead_attr' => 'style=\"width:200px\" data-some-attr=\"example\"',\n );\n\n $this->columns['created_at'] = array(\n 'label' => 'Created At',\n 'sortable' => true,\n 'table_column' => 'users.created_at',\n );\n\n $this->addActionColumn();\n\n }",
"protected function setColumnHeadings()\n {\n $this->headers = array_values($this->headers);\n // set the column headers\n $this->sheet->fromArray($this->headers,NULL,\"A2\");\n\n $row = $this->sheet->getRowIterator(2)->current();\n $i=0;\n foreach ($row->getCellIterator() as $k => $cell)\n {\n $cell->setValue($this->headers[$i]);\n $this->sheet->getColumnDimension($k)->setAutoSize(true);\n $i++;\n }\n //cell styling is done here\n $this->styleCell( $k );\n }",
"function _buildHeader()\r\n {\r\n $cnt = 0;\r\n foreach ($this->_dg->columnSet as $column) {\r\n //Define Content\r\n $str = $column->columnName;\r\n $this->_worksheet->write(0, $cnt, $str);\r\n $cnt++;\r\n }\r\n }",
"function _buildHeader()\n {\n $cnt = 0;\n foreach ($this->_dg->columnSet as $column) {\n //Define Content\n $str = $column->columnName;\n $this->_worksheet->write(0, $cnt, $str);\n $cnt++;\n }\n }",
"public abstract function getColumnHeaders($optionsToSelectFrom);",
"public function initialize_columns()\n {\n $this->addEntityColumns();\n\n if($this->getAssignmentServiceBridge()->canEditAssignment())\n {\n $this->add_column(new SortableStaticTableColumn(self::PROPERTY_FIRST_ENTRY_DATE));\n $this->add_column(new SortableStaticTableColumn(self::PROPERTY_LAST_ENTRY_DATE));\n $this->add_column(new SortableStaticTableColumn(self::PROPERTY_ENTRY_COUNT));\n $this->add_column(new StaticTableColumn(self::PROPERTY_FEEDBACK_COUNT));\n $this->add_column(new StaticTableColumn(self::PROPERTY_LAST_SCORE));\n }\n }",
"public function config_table_headers()\n\t{\n\t\t\n\t}",
"function sc_add_pt_column_headers() { \n\t\t $new_columns['cb'] = '';\n\t\t $new_columns['id'] = __('ID');\n\t\t $new_columns['title'] = \"Name\";\n\t\t $new_columns['date'] = \"Date Created\";\n\t\t $new_columns['status'] = __('Status');\n\t\t $new_columns['email'] = \"Email or PayPal ID\";\n\t\t $new_columns['shipping_option'] = \"Shipping Option\"; \n\t\t $new_columns['payment_type'] = \"Payment Type\"; \n\t\t $new_columns['address1'] = \"Address1\"; \n\t\t $new_columns['city'] = \"City\"; \n\t\t $new_columns['state'] = \"State\"; \n\t\t $new_columns['zip'] = \"Zip\"; \n\t\t $new_columns['label'] = \"Shipping Label\";\n\t\t $new_columns['tracking_number'] = \"Tracking Number\";\n\t\t $new_columns['phone'] = \"Phone\";\n\t\t $new_columns['carrier'] = \"Carrier\";\n\t\t $new_columns['quote'] = \"Quote\";\n\t\treturn $new_columns; \n\t}",
"public function initialize_columns()\n {\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_LASTNAME));\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_FIRSTNAME));\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_EMAIL));\n $this->add_column(new SortableStaticTableColumn('progress'));\n $this->add_column(new SortableStaticTableColumn('completed'));\n $this->add_column(new SortableStaticTableColumn('started'));\n }",
"public function field_map_table_header() {\n return '<thead>\n <tr>\n <th></th>\n <th></th>\n </tr>\n </thead>';\n }",
"public function initialize_columns()\n {\n $this->add_column(new DataClassPropertyTableColumn(User::class, User::PROPERTY_FIRSTNAME));\n $this->add_column(new DataClassPropertyTableColumn(User::class, User::PROPERTY_LASTNAME));\n\n $this->add_column(\n new DataClassPropertyTableColumn(ExternalToolResult::class, ExternalToolResult::PROPERTY_RESULT)\n );\n }",
"protected function _setCols()\n {\n // all table and calculate column descriptions in the model\n $this->_cols = array_merge(\n $this->_model->table_cols,\n $this->_model->calculate_cols\n );\n }",
"private function setColumns()\n {\n $this->columnList = implode(', ', Base::$headerColumns);\n $this->columnList .= ', csv_row';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds edit count of both users | private function mergeEditcount() {
$dbw = wfGetDB( DB_MASTER );
$dbw->startAtomic( __METHOD__ );
$totalEdits = $dbw->selectField(
'user',
'SUM(user_editcount)',
[ 'user_id' => [ $this->newUser->getId(), $this->oldUser->getId() ] ],
__METHOD__
);
$totalEdits = (int)$totalEdits;
# don't run queries if neither user has any edits
if ( $totalEdits > 0 ) {
# update new user with total edits
$dbw->update( 'user',
[ 'user_editcount' => $totalEdits ],
[ 'user_id' => $this->newUser->getId() ],
__METHOD__
);
# clear old user's edits
$dbw->update( 'user',
[ 'user_editcount' => 0 ],
[ 'user_id' => $this->oldUser->getId() ],
__METHOD__
);
}
$dbw->endAtomic( __METHOD__ );
} | [
"private function mergeEditcount( $newuserID, $olduserID ) {\n\n\t\t$dbw = wfGetDB( DB_MASTER );\n\t\t\n\t\t# old user edit count\n\t\t$result = $dbw->selectField( 'user',\n\t\t\t\t'user_editcount',\n\t\t\t\tarray( 'user_id' => $olduserID ),\n\t\t\t\t__METHOD__\n\t\t\t );\n\t\t$row = $dbw->fetchRow($result);\n\t\t\n\t\t$oldEdits = $row[0];\n\t\t\n\t\t# new user edit count\n\t\t$result = $dbw->selectField( 'user',\n\t\t\t\t'user_editcount',\n\t\t\t\tarray( 'user_id' => $newuserID ),\n\t\t\t\t__METHOD__\n\t\t\t );\n\t\t$row = $dbw->fetchRow($result);\n\t\t$newEdits = $row[0];\n\t\t\n\t\t# add edits\n\t\t$totalEdits = $oldEdits + $newEdits;\n\t\t\n\t\t# don't run querys if neither user has any edits\n\t\tif( $totalEdits > 0 ) {\n\t\t\t# update new user with total edits\n\t\t\t$dbw->update( 'user',\n\t\t\t\tarray( 'user_editcount' => $totalEdits ),\n\t\t\t\tarray( 'user_id' => $newuserID ),\n\t\t\t\t__METHOD__\n\t\t\t);\n\t\t\t\n\t\t\t#clear old users edits\n\t\t\t$dbw->update( 'user',\n\t\t\t\tarray( 'user_editcount' => 0 ),\n\t\t\t\tarray( 'user_id' => $olduserID ),\n\t\t\t\t__METHOD__\n\t\t\t);\n\t\t}\n\t\t\n\t\t// $wgOut->addHTML( wfMsgForContent( 'usermerge-editcount-success', $olduserID, $newuserID ) . \"<br />\\n\" );\n\n\t\treturn true;\n\t}",
"public function updateUserAgencyCount() {\n\t\t$dummyUserCount = array();\n\t\t$dummyUserCount['dummy_user_count'] = 1;\n $dummyUserCount['agency_size'] = 1;\n\t\n\t\t$conditions = array();\n\t\t$conditions['id'] = $this->id;\n\n\t\t$success = ConnectionFactory::updateTableRowRelativeBasic(\"users\", $dummyUserCount, $conditions);\n\t\tif ($success) {\n\t\t\t$this-> dummy_user_count = $this->dummy_user_count + 1;\n $this-> agency_size = $this-> agency_size + 1;\n\t\t}\n\t\treturn $success;\n\t}",
"public function increment_profile_view_counter() {\n $viewer_id = ($this->viewer_user->user_row[\"UserID\"]);\n $viewed_id = ($this->viewed_user->user_row[\"UserID\"]);\n\n // God I hate these sql queries\n $sql_query = 'INSERT INTO ' . Constant::profile_views_database_name . ' VALUES ';\n $sql_query .= '('. $viewer_id . ', ' . $viewed_id . ', 1)';\n $sql_query .= ' ON DUPLICATE KEY UPDATE `ProfileViews` = `ProfileViews` + 1;';\n\n $connection = create_connection();\n\n // process the query\n process_query($sql_query, $connection);\n\n close_connection($connection);\n }",
"function Update_Counts()\n\t{\n\t\tglobal $OPTION;\n\n\t\t// Ensure that we only update current user\n\t\tif ($this->self)\n\t\t{\n\t\t\t// If past recent, update visits\n\t\t\tif (time_offset() - $this->otime > ($OPTION['VisitLength'] > 0 ? $OPTION['VisitLength'] * 86400 : time_offset()))\n\t\t\t\t$this->visits++;\n\n\t\t\t// Always update hits\n\t\t\t$this->hits++;\n\t\t}\n\t}",
"function update_doc_count() {\n\t\tbp_docs_update_doc_count( bp_loggedin_user_id(), 'user' );\n\t}",
"public function updateUserCounterCache() {\n\t\t$list = $this->User->find('list');\n\t\t$users = array_keys($list);\n\t\t$this->out('<warning>Updating ' . count($users) . ' user project counts...</warning>', 0);\n\t\tif (!count($users)) {\n\t\t\t$this->out('nothing to do.');\n\t\t\treturn;\n\t\t}\n\t\tif ($this->params['dry-run']) {\n\t\t\t$this->out('dry-run.. skipping.');\n\t\t\treturn;\n\t\t}\n\t\tforeach ($users as $userId) {\n\t\t\t$this->User->id = $userId;\n\t\t\t$allCount = $this->Project->find('count', array('conditions' => array('Project.user_id' => $userId)));\n\t\t\t$publicCount = $this->Project->find('count', array('conditions' => array('Project.user_id' => $userId, 'Project.public' => Project::PROJ_PUBLIC)));\n\t\t\t$user = array(\n\t\t\t\t'User' => array(\n\t\t\t\t\t'id' => $userId,\n\t\t\t\t\t'project_count' => $allCount,\n\t\t\t\t\t'public_count' => $publicCount,\n\t\t\t\t\t'modified' => false,\n\t\t\t\t)\n\t\t\t);\n\t\t\tif (!$this->User->save($user)) {\n\t\t\t\t$this->out('<error>Error saving count.</error>');\n\t\t\t\tdie();\n\t\t\t} else {\n\t\t\t\t$this->out('.', 0);\n\t\t\t}\n\t\t\tunset($user);\n\t\t}\n\t\t$this->out('done.');\n\t}",
"public function updateNewRequestCount($user_id=0)\n\t\t\t{\n\t\t\t\t$sql = 'UPDATE '.$this->CFG['db']['tbl']['users'].\n\t\t\t\t\t\t' SET new_requests = new_requests + 1'.\n\t\t\t\t\t\t', new_mails = new_mails + 1'.\n\t\t\t\t\t\t' WHERE user_id = '.$this->dbObj->Param('user_id');\n\n\t $stmt = $this->dbObj->Prepare($sql);\n\t $rs = $this->dbObj->Execute($stmt, array($user_id));\n if (!$rs)\n \t trigger_db_error($this->dbObj);\n\t\t\t}",
"function adduserviews($userid){\r\nglobal $stream;\r\nreturn $stream->do_query(\"update evo_users set views = views+1 where id = '$userid'\", \"one\");\r\n}",
"public function upUserPostCount()\n \t{\n \t\t$q = \"UPDATE in_users SET posts_count = posts_count + 1 WHERE id=:user_id\";\n \t\t$vars = array(\n \t\t\t\":user_id\"=>Session::getLoggedInUser()->id\n \t\t\t);\n \t\t$ps = $this->execute($q,$vars);\n \t}",
"protected function set_userCount(){\n $sql = \"SELECT count(u.id) AS `count` FROM users u INNER JOIN role_user ru ON u.id = ru.user_id INNER JOIN roles r ON ru.role_id = r.id WHERE r.id = ?;\";\n $result = Connection::fetchArray($sql, [$this->id]);\n \n $this->userCount = $result[0]['count'];\n }",
"public function edit() {\n\t\t$count = 0;\n\t\t\n\t\tforeach($this->comments as $Comment) {\n\t\t\t$count += $Comment->edit();\n\t\t}\n\t\n\t\treturn $count;\n\t}",
"public function countUsers();",
"function countEditedbySingleUser($from,$to,$user)\n\t {\n\t $sql=\"SELECT COUNT(last_updated_by) As cnt FROM (SELECT last_updated_by,last_updated FROM candidates JOIN be_users ON candidates.last_updated_by=be_users.username WHERE be_users.id ='\".$user.\"' AND is_to_Delete = 0) As sub WHERE last_updated BETWEEN '\".$from.\"' AND '\".$to.\"'\";\n\t $q=$this->db->query($sql);\n\t $row=$q->row();\n\t return $row->cnt;\n\t }",
"function qa_db_uapprovecount_update()\n{\n\tif (qa_should_update_counts() && !QA_FINAL_EXTERNAL_USERS) {\n\t\tqa_db_query_sub(\n\t\t\t\"INSERT INTO ^options (title, content) \" .\n\t\t\t\"SELECT 'cache_uapprovecount', COUNT(*) FROM ^users \" .\n\t\t\t\"WHERE level < # AND NOT (flags & #) \" .\n\t\t\t\"ON DUPLICATE KEY UPDATE content = VALUES(content)\",\n\t\t\tQA_USER_LEVEL_APPROVED, QA_USER_FLAGS_USER_BLOCKED\n\t\t);\n\t}\n}",
"public function update_views($post_id ,$counter_data) {\n $this->db->query(\"UPDATE users SET views = $counter_data+1 WHERE user_id = $post_id\");\n \n \n }",
"public function increase_user_count($user){\n $login_count = $user->getLoginCount();\n $query = 'UPDATE users SET login_count = ? WHERE login_id = ?';\n try{\n $stmt = $this->pdo->prepare($query);\n $stmt->bindValue(1,++$login_count);\n $stmt->bindValue(2,$user->getLoginId());\n $stmt->execute();\n }catch(PDOEXception $e){\n echo $e->getMessage();\n }\n return $login_count;\n }",
"function contribcount ( $user ) {\n\t\t\t$this->checkurl();\n\t\t\t$ret = $this->api->users( $user, 1, null, true );\n\t\t\tif ( $ret !== false ) return $ret[0]['editcount'];\n\t\t\treturn false;\n\t\t}",
"public function countUser();",
"public function updateCreateCount($data) {\n\n try {\n\n $db = Database::getInstance();\n\n $stmt = $db->prepare('UPDATE users SET todos_created = todos_created + 1 WHERE user_id = :user_id');\n $stmt->bindParam(':user_id', $data['user_id']);\n $stmt->execute();\n\n } catch(PDOException $exception) {\n error_log($exception->getMessage());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public helper methods Convert a stage id into a stage path | function getPathFromId($stageId) {
static $stageMapping = array(
WORKFLOW_STAGE_ID_SUBMISSION => WORKFLOW_STAGE_PATH_SUBMISSION,
WORKFLOW_STAGE_ID_INTERNAL_REVIEW => WORKFLOW_STAGE_PATH_INTERNAL_REVIEW,
WORKFLOW_STAGE_ID_EXTERNAL_REVIEW => WORKFLOW_STAGE_PATH_EXTERNAL_REVIEW,
WORKFLOW_STAGE_ID_EDITING => WORKFLOW_STAGE_PATH_EDITING,
WORKFLOW_STAGE_ID_PRODUCTION => WORKFLOW_STAGE_PATH_PRODUCTION
);
if (isset($stageMapping[$stageId])) {
return $stageMapping[$stageId];
} else {
return null;
}
} | [
"public function getStageName($id) {\n \t$row = $this->find($id)->current();\n \tif (!$row) {\n \t\tthrow new Exception(Zend_Registry::get('Zend_Translate')->_('Stage').\" id $id does not exist\");\n \t}\n \treturn $row['stage'];\n }",
"public function idToPath($id);",
"public function idToPath($id)\n {\n return $id['public_id'] . '.' . $id['format'];\n }",
"function getStagePath() {\n\t\treturn $this->_stagePath;\n\t}",
"public function getViewStageScriptPathSpec($script, $stage = null)\n\t{\n\t\tif (!$this->_useStage) {\n\t\t\t$path = $script;\n\t\t} else {\n\t\t\tif (null === $stage){\n\t\t\t\t$stage\t= $this->_viewScript;\n\t\t\t}\n\t\t\n\t\t\t$path\t= $stage . '.' . $this->getViewSuffix();\n\t\t}\n\t\treturn $path;\n\t}",
"public function getStageId()\n {\n return $this->stage_id;\n }",
"public function getStageId()\n {\n return $this->get(self::_STAGE_ID);\n }",
"public function getStage($id)\n {\n $this->validateDigit($id);\n $data = $this->http->get('/stages/' . $id);\n\n return $this->safeReturn($data);\n }",
"private function buildSmartPath($assetId)\n\t{\n\t\t$chars = str_split($assetId);\n\n\t\t$path = '';\n\t\t\n\t\tfor ($i=0; $i<=4; $i++)\n\t\t{\n\t\t\t$path .= '/' . $chars[$i];\n\t\t}\n\t\t\n\t\treturn $path;\n\t}",
"function getStageId() {\n\t\treturn $this->_handlerImplementation->getStageId();\n\t}",
"function getStageId() {\n\t\treturn $this->_stageId;\n\t}",
"public function getPath($id) {\n $iid = $this->_interface->getElementPrefix().'_'.$id;\n return $iid.'_program';\n }",
"private function explodeIdToPath($id)\n {\n $perdir = 4;\n\n $len = strlen($id);\n\n if ($len < $perdir)\n return \"0000\"; // Should match the number of perdir above - all below 1k\n\n $first = substr($id, 0, 1);\n\n $path = $first . \"\";\n\n for ($i = 1; $i < $len; $i++)\n $path .= \"0\";\n\n if ($len <= $perdir)\n {\n return $path;\n }\n else\n {\n return $path . \"/\" . $this->explodeIdToPath(substr($id, 1));\n }\n }",
"protected static function get_stage()\n {\n $stage = '';\n\n if ('Live' === Versioned::get_stage()) {\n $stage = '_Live';\n }\n\n return $stage;\n }",
"public function get_stages_name();",
"function getPathFromId($id = NULL, $path = '')\n {\n $id = isset($id) ? intval($id) : $this->cid;\n $myts =& MyTextSanitizer::getInstance();\n $name = $myts->htmlspecialchars($this->title);\n $path = \"/{$name}{$path}\";\n if ($this->pid != 0) {\n $path = $this->getPathFromId($this->pid, $path);\n }\n return $path;\n }",
"function dataid2path($dataid)\n{\n return 'data/'.substr($dataid,0,2).'/'.substr($dataid,2,2).'/';\n}",
"protected function getPath($id) {\r\n $path = $this->location . DS . $id . '.' . $this->format;\r\n return $path;\r\n }",
"public function getNextStage($id);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for patchDestination Perform a partial update to a data export destination.. | public function testPatchDestination()
{
} | [
"public function testPatchLocation()\n {\n }",
"public function testUpdateExternalShipment()\n {\n }",
"public function testUpdateDataSource1(){\n try{\n/* $and = false;\n $filter['file_name']=\"test\";\n $filter['file_url']=\"test40\";\n $filter['application']=0;\n $filter['visible']=2;\n $filter['add_date']='1980-01-01 00:00:00';\n $res=$this->dataSourceModel->getDataSources($filter,$and);*/\n $dataSource['name']=\"testDataSourceModel\";\n $dataSource['url']=\"testDataSource\";\n $dataSource['appli']=1;\n $dataSource['config']=\"test\";\n $dataSource['visible']=\"test\";\n\t $res=$this->dataSourceModel->getDataSourceID();\n $resul=$this->dataSourceModel->getUserID();\n // $this->assertTrue(!is_null($res),true);\n // $this->assertTrue(count($res)>0,true);\n $resu=$this->dataSourceModel->updateDataSource($res,$resul,$dataSource);\n $this->assertEquals($resu,true);\n }catch(Exception $e) { $this->assertTrue(false); }\n }",
"public function testUpdateDataSuccess()\n {\n $this->markTestIncomplete();\n }",
"function _cloneresource_update($id, $data) {\n /*\n global $user;\n $view = cloneresource_get_view($id);\n $data->id = $id;\n $data->uid = $view->uid;\n $data->timestamp = time();\n \n\n cloneresource_write_view($data);\n */\n _cloneresource_create($data);\n return;\n}",
"public function testPostPackageUpdate()\n {\n }",
"public function testDataSetProcessorUpdate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testAdministrationRestExporterAdministrationUpdateSettings()\n {\n\n }",
"public function testProfilePartialUpdate()\n {\n }",
"public function testTeamPartialUpdate()\n {\n }",
"public function testDataSchemasUpdateFolder()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testFullUpdateFolder()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testPatchOnTable() {\n $sink = new Sink;\n $sink->table('ut_pop');\n $sink->initialize();\n $sink->patch($available, $applied);\n\n $this->assertArrayHasKey('ut_pop', $available);\n $this->assertEquals(2, count($available['ut_pop']));\n\n $this->assertArrayHasKey('ut_pop', $applied);\n $this->assertEquals(2, count($applied['ut_pop']));\n $this->assertTrue($applied['ut_pop'][1]['result']);\n $this->assertTrue($applied['ut_pop'][2]['result']);\n\n $database = Database::instance();\n $columns = $database->list_columns('ut_pop');\n $this->assertArrayHasKey('editor', $columns);\n $this->assertArrayHasKey('modified', $columns);\n $this->assertEquals('int', $columns['editor']['type']);\n $this->assertEquals('string', $columns['modified']['type']);\n $this->assertEquals(32, $columns['modified']['character_maximum_length']);\n }",
"public function test_updateReplenishmentPlanCustomFields() {\n\n }",
"public function testDeleteDestination()\n {\n }",
"public function testAdminMessageUpsertPatchAdminMessages()\n {\n\n }",
"public function testDistributionUpdate()\n {\n }",
"public function testUpdate()\n {\n // Create test data.\n $data = $this->addData('update');\n\n // Modify the entry, not the email in this test.\n for ($i = 0; $i < Configuration::TEST_DATA_SIZE; $i++) {\n $data['params'][$i]['id'] = $data['ids'][$i];\n $data['params'][$i]['fn'] = $data['params'][$i]['fn'] . bin2hex(random_bytes(4));\n $data['params'][$i]['ln'] = $data['params'][$i]['ln'] . bin2hex(random_bytes(4));\n $data['params'][$i]['p'] = $data['params'][$i]['p'] . bin2hex(random_bytes(4));\n\n // *** TEST LINE *** : Call update directly with the modded data.\n $this->object->update($data['params'][$i]);\n // *** TEST LINE ***\n }\n\n // Test the data.\n $this->validateData($data);\n\n // Remove the test data.\n $this->removeData($data);\n }",
"public function testPostDestination()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation bindersBinderComboValuesAsync This call updates the possible values for a combo custom binder field | public function bindersBinderComboValuesAsync($request)
{
return $this->bindersBinderComboValuesAsyncWithHttpInfo($request)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function bindersBinderComboValuesAsyncWithHttpInfo($request)\n {\n $returnType = '';\n $request = $this->bindersBinderComboValuesRequest($request);\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 testBindersBinderComboValues()\n {\n }",
"public function testBindersGetBinderComboValues()\n {\n }",
"protected function bindersBinderComboValuesRequest($request)\n {\n // verify the required parameter 'request' is set\n if ($request === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $request when calling bindersBinderComboValues'\n );\n }\n\n $resourcePath = '/api/Binders/combofieldvalues';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($request)) {\n $_tempBody = $request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('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 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function bindersGetBinderComboValuesAsync($combo_field_id)\n {\n return $this->bindersGetBinderComboValuesAsyncWithHttpInfo($combo_field_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function bindersGetBinderComboValuesAsyncWithHttpInfo($combo_field_id)\n {\n $returnType = 'string[]';\n $request = $this->bindersGetBinderComboValuesRequest($combo_field_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 getValueBinder(): ValueBinder;",
"public function bindersGetBinderComboValuesWithHttpInfo($combo_field_id)\n {\n $returnType = 'string[]';\n $request = $this->bindersGetBinderComboValuesRequest($combo_field_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 'string[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function sanitize_cmb_fields() {\n\t\t$cmb = $this->get_cmb_object();\n\n\t\t$cmb->data_to_save = $_REQUEST;\n\t\t$object_id = $cmb->object_id( $this->button_slug );\n\t\t$cmb->object_type( 'options-page' );\n\n\t\t$cmb->process_fields();\n\n\t\t// output buffer on the action so we don't pollute our JSON response\n\t\tob_start();\n\t\t// Preserve CMB action\n\t\tdo_action( 'cmb2_save_options-page_fields', $object_id, $cmb->cmb_id, $cmb->updated, $cmb );\n\t\tob_end_clean();\n\n\t\t$updated_fields = cmb2_options( $object_id )->get_options();\n\t\t$cmb_config = $this->get_cmb_config();\n\n\t\t$whitelist_keys = wp_list_pluck( $cmb_config['fields'], 'id' );\n\t\t$whitelist = array();\n\t\t// Keep only the form values that correspond to the CMB2 fields\n\t\tforeach ( $whitelist_keys as $key ) {\n\t\t\t$value = isset( $updated_fields[ $key ] ) && ! empty( $updated_fields[ $key ] ) ? $updated_fields[ $key ] : '';\n\n\t\t\t// Don't keep empty values\n\t\t\tif ( $value ) {\n\t\t\t\t// Make checkbox values boolean\n\t\t\t\t$whitelist[ $key ] = 'on' == $value ? true : $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->filter_form_fields( $whitelist, $updated_fields );\n\t}",
"public function addressBookGetAddressBookComboFieldValuesAsync($field_name)\n {\n return $this->addressBookGetAddressBookComboFieldValuesAsyncWithHttpInfo($field_name)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function bindersGetBinderComboValues($combo_field_id)\n {\n list($response) = $this->bindersGetBinderComboValuesWithHttpInfo($combo_field_id);\n return $response;\n }",
"protected function resolveBindings()\n {\n cvd_app()->bindArray($this->platform()->bindings());\n }",
"public function getBindValues()\n {\n return array_merge(parent::getBindValues(), $this->bind_values_bulk);\n }",
"function scrm_option_custom_field_choices( $prefix, $id, $i, $value, $values, $locked = false ) {\n \n $name = sprintf( \"%s[%s][value][%u]\", $prefix, $id, $i );\n scrm_option_custom_field_input( 'Value', $name, 'text', $value );\n \n $values = str_replace( [ '{', ',', '\"', '}' ], [ \"\", \"\\n\", \"\", \"\" ], json_encode( $values ) );\n \n $name = sprintf( \"%s[%s][values][%u]\", $prefix, $id, $i );\n $other = ( $locked ) ? ' readonly=\"\"' : '';\n scrm_option_custom_field_textarea( 'Choices', $name, $values, $other );\n}",
"public function update_combo() {\n $combo_id = $_GET['combo_id'];\n $data['combo_info'] = $this->comboes->getComboByComboId($combo_id);\n $data['combo_branch_location'] = $this->custome_combo->getBranch_location();\n $data['combo_items'] = $this->custome_combo->getItemsByComboId($combo_id);\n $data['items'] = $this->custome_combo->getItems();\n\n $this->load->view('restaurant/comboes/update_combo_modal', $data);\n\n if (isset($_POST['combo_name'])) {\n $comboArray = array(\n 'name' => $_POST['combo_name'],\n 'price' => $_POST['combo_price'],\n 'end_date' => $_POST['combo_endDate'],\n );\n $this->comboes->updateComboData($combo_id, $comboArray);\n if (isset($_POST['item_combo_id_'])) {\n\n $item_array = $_POST['item_combo_id_'];\n\n foreach ($item_array as $key => $val) {\n $item_id = $val;\n $this->combo_items->insert_combo_items($item_id, $combo_id);\n }\n redirect(rest_path('Combo'));\n } else {\n echo 'ERROR';\n }\n\n redirect(rest_path('Combo'));\n }\n }",
"public function boundValues()\n {\n $cls = $this->ext . strtoupper( bcDB::resource( 'EXTENSION' ) );\n $_r = array();\n foreach ( $cls::$_BINDS as $_b ):\n $_r[] = $_b['value'];\n endforeach;\n return $_r;\n }",
"protected function search_engine_client_set_boost_field_values( $boost_field_values ) {\n\n\t\t$this->query_select->getEDisMax()->setBoostQuery( $boost_field_values );\n\t}",
"public function getPicklistValues()\n\t{\n\t\tif (!empty($this->get('picklistValues'))) {\n\t\t\treturn $this->get('picklistValues');\n\t\t}\n\t\t$params = $this->get('field')->getFieldParams();\n\t\t$db = PearDatabase::getInstance();\n\t\t$currentUser = Users_Record_Model::getCurrentUserModel();\n\t\t$fieldInfo = Vtiger_Functions::getModuleFieldInfoWithId($params['field']);\n\t\t$queryGenerator = new QueryGenerator($params['module'], $currentUser);\n\t\t$queryGenerator->setFields([$fieldInfo['columnname']]);\n\t\tif ($params['filterField'] != '-') {\n\t\t\t$queryGenerator->addCondition($params['filterField'], $params['filterValue'], 'e');\n\t\t}\n\t\t$query = $queryGenerator->getQuery();\n\t\t$result = $db->query($query);\n\n\t\t$values = [];\n\t\twhile ($value = $db->getSingleValue($result)) {\n\t\t\t$values[$value] = vtranslate($value, $params['module']);\n\t\t}\n\t\t$this->set('picklistValues', $values);\n\t\treturn $values;\n\t}",
"public function getBindValues()\n {\n return $this->bindValues;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Resolves a user using the given $data and returns it. | public function resolveUser($data)
{
return call_user_func($this->userResolver, $data);
} | [
"protected function resolveUser()\n {\n return call_user_func($this->userResolver);\n }",
"public function resolve_user() {\n global $mt;\n\n // The designated company/institution code for CCSA\n $staff_id = $mt->config('imisadminaccountid');\n\n // Active statuses are: A (Active) and CM (Complimentary)\n $active_statuses = array( 'A', 'CM' );\n\n // Load the user from auth cookie information\n $user =& $mt->auth->user();\n if ( ! isset( $user )) return;\n\n // The user's associated company/institution code\n $u_ccsa_id = $user->get('field.private_ccsa_company_id');\n\n // The user's member type, e.g. 'V' is for vendor\n $u_type = $user->get('field.private_ccsa_member_type');\n\n // The user's CCSA membership status\n $u_status = $user->get('field.private_ccsa_member_status');\n\n // Store the CCSA-specific data in user's properties as an\n // assoc. array namespaced by the key \"ccsa\" to prevent\n // conflicts with native user fields\n $user->set(\n 'ccsa', \n array(\n 'type' => $u_type,\n 'is_vendor' => ( $u_type == 'V' ),\n 'status' => $u_status,\n 'is_staff' => ( $u_ccsa_id == $staff_id ),\n 'is_active' => in_array( $u_status, $active_statuses ),\n )\n );\n return $user;\n }",
"public function decodeUser($data)\n {\n $user = new Paysera_WalletApi_Entity_User();\n\n $this->setProperty($user, 'id', $data['id']);\n if (isset($data['email'])) {\n $this->setProperty($user, 'email', $data['email']);\n }\n if (isset($data['phone'])) {\n $this->setProperty($user, 'phone', $data['phone']);\n }\n if (isset($data['display_name'])) {\n $this->setProperty($user, 'displayName', $data['display_name']);\n }\n if (isset($data['dob'])) {\n $this->setProperty($user, 'dob', $data['dob']);\n }\n if (isset($data['gender'])) {\n $this->setProperty($user, 'gender', $data['gender']);\n }\n if (isset($data['address'])) {\n $this->setProperty($user, 'address', $this->decodeAddress($data['address']));\n }\n if (isset($data['identity'])) {\n $this->setProperty($user, 'identity', $this->decodeIdentity($data['identity']));\n }\n if (isset($data['wallets'])) {\n $this->setProperty($user, 'wallets', $data['wallets']);\n }\n if (isset($data['type'])) {\n $this->setProperty($user, 'type', $data['type']);\n }\n if (isset($data['company_code'])) {\n $this->setProperty($user, 'companyCode', $data['company_code']);\n }\n if (isset($data['identification_level'])) {\n $this->setProperty($user, 'identificationLevel', $data['identification_level']);\n }\n if (isset($data['locale'])) {\n $this->setProperty($user, 'locale', $data['locale']);\n }\n if (isset($data['pep'])) {\n $peps = [];\n foreach ($data['pep'] as $pep) {\n $peps[] = $this->decodePep($pep);\n }\n $this->setProperty($user, 'politicallyExposedPersons', $peps);\n }\n\n return $user;\n }",
"private function _findUser()\n\t{\n\t\t$id = $this->_getParam('id');\n\t\t$username = $this->_getParam('username');\n\n\t\tif (!empty($id)) {\n\t\t\t$user = Doctrine_Core::getTable('Models_Main_Personnel')->findOneByID_number($id);\n\t\t} elseif (!empty($username)) {\n\t\t\t$user = Doctrine_Core::getTable('Models_Main_Personnel')->findOneByUsername($username);\n\t\t}\n\n\t\treturn $user;\n\t}",
"protected function resolveCurrentUserModel()\n {\n if (isset($this->currentUserModelResolver)) {\n return call_user_func($this->currentUserModelResolver);\n }\n\n return new User;\n }",
"public static function fetch_user()\n {\n return self::make_request(\"user\");\n }",
"private function establishUser()\n {\n $site = $this->view->site; /* @var BeMaverick_Site $site */\n\n // If we're exercising grant type password, the user obtained from backend, will be off the username field.\n // Then, supplied username/password here will be matched against the backend.\n if ( isset( $_REQUEST['grant_type'] ) && isset( $_REQUEST['username'] ) && $_REQUEST['grant_type'] == 'password' ) {\n $user = $site->getUserForOAuth( $_REQUEST['username'] );\n \n // Try email address as a backup\n if (!$user) {\n $user = $site->getUserByEmailAddress( $_REQUEST['username'], null );\n }\n\n if ( $user ) {\n return $user;\n } else {\n error_log( 'OAuth Grant Type Password Error. User not found for username: ' . $_REQUEST['username'] );\n }\n }\n\n return null;\n }",
"public function createUserFromOAuth($data)\n {\n $user = $this->createUser();\n $user->setAuthDataByProvider($data['provider'], ['id' => $data['id'], 'token' => $data['token']]);\n $user->setAuthProvider($data['provider']);\n $user->setFirstAuthProvider($data['provider']);\n $user->setUsername($data['email']);\n $user->setEmail($data['email']);\n $user->setPassword('none');\n $user->setEnabled(true);\n $user->setContact(new Contact);\n\n return $user;\n }",
"public function resolveCurrentUser()\n {\n return $this->guard->user();\n }",
"public function getTokenUser()\n {\n // Fetch token\n $tokenStr = $this->tokenFetcher->fetchToken();\n // Get user from token\n $user = $this->tokenRepo->getUser($tokenStr);\n\n return $user;\n }",
"public function user() {\n $r = $this->call(\"user\");\n // add latitudes and longitudes, and extract best guess\n if (isset($r->user->location_hierarchy)) {\n $r->user->best_guess = NULL;\n foreach ($r->user->location_hierarchy as &$loc) {\n\t$c = $loc->geometry->coordinates;\n\tswitch ($loc->geometry->type) {\n\tcase 'Box': // DEPRECATED\n\t $loc->bbox = $c;\n\t $loc->longitude = ($c[0][0] + $c[1][0]) / 2;\n\t $loc->latitude = ($c[0][1] + $c[1][1]) / 2;\n\t $loc->geotype = 'box';\n\t break;\n\tcase 'Polygon':\n\t $loc->bbox = $bbox = $loc->geometry->bbox;\n\t $loc->longitude = ($bbox[0][0] + $bbox[1][0]) / 2;\n\t $loc->latitude = ($bbox[0][1] + $bbox[1][1]) / 2;\n\t $loc->geotype = 'box';\n\t break;\n\tcase 'Point':\n\t list($loc->longitude, $loc->latitude) = $c;\n\t $loc->geotype = 'point';\n\t break;\n\t}\n\tif ($loc->best_guess) $r->user->best_guess = $loc; // add shortcut to get 'best guess' loc\n\tunset($loc);\n }\n }\n \n return $r;\n }",
"private function getUserById($id) {\n\t\t$em = $this->getDoctrine()->getManager()->getRepository('AppBundle\\Entity\\User');\n\n\t\t$user = $em->findOneById($id);\t\n\t\t\n\t\treturn $user;\n\t}",
"public function get_user_by_id($id) {\n\t\t$stmt = $this->database->prepare(\"SELECT * FROM user WHERE entity_id = ?\");\n\t\t$stmt->bind_param('d', $id);\n\t\t$stmt->execute();\n\t\t$result = $stmt->get_result();\n\t\tif($row = $result->fetch_assoc()) {\n\t\t\t$user = new User($row['entity_id'], $row);\n\t\t} else {\n\t\t\tthrow new UserNotFoundException('User does not exist.');\n\t\t}\n\t\t$stmt->close();\n\t\treturn $user;\n\t}",
"function user_match(){\n\t\t# Try to find a matching wp user for the now-authenticated user's oauth identity\n\t\t$matched_user = $this->match_wp_user($this->identity);\n\n\t\t# No WP user by provider id, search by provider email\n\t\tif( empty($matched_user) && ISSET($this->identity) ){\n\t\t\t$matched_user = $this->match_wp_user_by_email($this->identity);\n\n\t\t\t# If we find a match with this method then we need to link the account\n\t \tif(!empty($matched_user)) $this->link_identity($matched_user->ID);\n\t\t}\n\n\t\treturn $matched_user;\n\t}",
"public function user()\n {\n $this->setRedirectUrl();\n\n $response = $this->getAccessTokenResponse($this->getCode());\n $claims = $this->validateIdToken(Arr::get($response, 'id_token'));\n\n return $this->mapUserToObject($claims);\n }",
"public function getUserParameter($dataName, $dataValue)\n {\n $req = \"SELECT id FROM user WHERE $dataName = '$dataValue'\";\n $result = ClassPdo::$monPdo->query($req);\n $value = $result->fetchAll();\n\n if (!isset($value[0]['id'])) {\n return ;\n }\n\n $user = $this->getUser($value[0]['id']);\n\n return $user;\n }",
"public static function getUserResolver()\n {\n /** @var \\Illuminate\\Http\\Request $instance */\n return $instance->getUserResolver();\n }",
"protected function resolveUserFromEmail($email)\n {\n return $this->user->where('email', $email)->first();\n }",
"public function getUserInstance()\n {\n $entity = null;\n\n if ($this instanceof \\User) {\n $entity = $this;\n } elseif ($this instanceof \\PortalUser) {\n $this->setPortalId();\n $entity = $this->getRelated('User');\n } else {\n $entity = $this->getPortalUser()->getRelated('User');\n }\n\n $this->checkJoin($this, $entity);\n\n return $entity;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function pageLoads This function Will be called on each page load and will check for any form submission. Database Tables used in this function are : None Use Instruction : $objPage>pageLoad(); | public function pageLoad() {
$objCore = new Core();
$objWholesaler = new Wholesaler();
//$this->arrShippingList = $objWholesaler->shippingGatewayList();
$this->arrCountryList = $objWholesaler->countryList();
global $objGeneral;
$varPortalFilter = $objGeneral->countryPortalFilter($_SESSION['sessAdminWholesalerIDs'],'pkWholesalerID');
if (isset($_POST['frmHidenEdit']) && $_POST['frmHidenEdit'] == 'edit' && $_GET['type'] == 'edit' && $_GET['id'] != '') {
$varUpdateStatus = $objWholesaler->updateWholesaler($_POST);
if ($varUpdateStatus > 0) {
$objCore->setSuccessMsg(ADMIN_UPDATE_SUCCUSS_MSG);
header('location:wholesaler_manage_uil.php');
die;
} else {
$objCore->setErrorMsg(ADMIN_UPDATE_ERROR_MSG);
header('location:wholesaler_edit_uil.php?type=' . $_GET['type'] . '&id=' . $_GET['id']);
die;
}
} else if (isset($_GET['id']) && $_GET['id'] != '' && ($_GET['type'] == 'edit')) {
$varWhr = $_GET['id'].$varPortalFilter;
$this->arrRow = $objWholesaler->editWholesaler($varWhr);
$varWhrCountry = 'fkCountryId=' . $this->arrRow[0]['CompanyCountry'];
$this->arrRegion = $objWholesaler->regionList($varWhrCountry);
$this->arrWarning = $objWholesaler->warningList($varWhr);
//pre($this->arrWarning);
} else {
$this->getList();
$this->CountryPortal = $objWholesaler->adminUserList();
}
} | [
"public function pageLoad()\n {\n global $objGeneral;\n global $oCache;\n $objCore = new Core();\n $objReport = new Reports();\n $objClassCommon = new ClassCommon();\n \n if(isset($_REQUEST['section']) && $_REQUEST['section'] != ''){ //Requesting for sections\n $sectionName=$_REQUEST['section']; \n if($sectionName=='orders'){ //Orders Section\n $actionName=(isset($_REQUEST['action']) && $_REQUEST['action'] != '') ? $_REQUEST['action']: 'today';\n \n //echo $actionName;\n \n }\n if($sectionName=='visitors'){ //Orders Section\n $this->arrData['content']=$objReport->getUniqueVisitorsData(); \n }\n }else{ //Reuesting for dashboard\n $this->arrData['section']='dashboard';\n $this->arrData['content']=$objReport->getDashboardData();\n }\n \n }",
"public function pageLoad() {\n\n $objCore = new Core();\n $objInvoice = new Invoice();\n global $objGeneral;\n $varPortalFilter = $objGeneral->countryPortalFilter($_SESSION['sessAdminWholesalerIDs']);\n \n if (isset($_GET['iid']) && $_GET['iid'] != '' && ($_GET['type'] == 'view')) {\n $varID = $_GET['iid'];\n $this->arrRow = $objInvoice->viewInvoice($varID,$varPortalFilter);\n //pre($this->arrRow);\n } else if (isset($_POST['Export']) && $_POST['Export'] == 'Export') {\n $this->exportInvoice($_POST);\n } else {\n $this->getList();\n }\n }",
"public function ee_breakouts_page_load() {}",
"public function loadPage() {\n //We have to insert the following pages.\n /*\n * 1. Header\n\t\t *\t-> Admin Ajax / User Ajax\n * 2. Navigation Bar\n\t\t *\t-> Admin navBar / User navBar\n * 3. Main Body\n * 4. Footer\n */\n\t\t//First we decide whether the page is an admin page or not.\n\t\tglobal $session;\n\t\tif(stripos($this->pageName, 'admin') === false)\t{\n\t\t\t$navBarType = 'user';\n\t\t\t$this->setTemplateVar('isadmin', 0);\n\t\t\t//We Load the data for the top fixed infobar.\n\t\t\t$this->setTemplateVar('currentBalance', getCurrentBalance());\n\t\t\t$this->setTemplateVar('prodQueueCount', getProdQueueCount());\n\t\t\t$this->setTemplateVar('username', $session->getUserName());\n\t\t} else {\n\t\t\t$navBarType = 'admin';\n\t\t\t$this->setTemplateVar('isadmin', 1);\n\t\t}\n\t\t\n\t\t//Now we also have to note wheather the user is an admin user or not.\n\t\t$this->setTemplateVar('isAdminUser', ($session->isAdminUser() ? 1 : 0));\n\t\t\n\t\t//Now we load all the pages.\n\t\tinclude $this->rootPath.'templates/header.php';\n\t\tinclude $this->rootPath.'templates/'.$navBarType.'_navbar.php';\n\t\tinclude $this->rootPath.'templates/t_'.$this->pageName.'.php';\n\t\tinclude $this->rootPath.'templates/footer.html';\n }",
"public function pageLoad() {\n global $objGeneral;\n $objCore = new Core();\n $objProduct = new Product();\n $objClassCommon = new ClassCommon();\n\n $this->arrCategoryDropDown = $objClassCommon->getCategories();\n $this->getList();\n }",
"public function pageLoad() {\n $objCore = new Core();\n $objWholesaler = new Wholesaler();\n $wid = $_SESSION['sessUserInfo']['id'];\n\n if (isset($_REQUEST['place']) && $_REQUEST['place'] == 'view' && $_REQUEST['pid'] != '') {\n $pid = $objCore->getFormatValue($_REQUEST['pid']);\n $objWholesaler->reviewsDone($_REQUEST['rid'],$pid);\n $this->arrReviewDetail = $objWholesaler->getWholesalerProductReviewsDetail($wid, $pid);\n $this->paging($this->arrReviewDetail);\n $this->arrReviewDetail = $objWholesaler->getWholesalerProductReviewsDetail($wid, $pid, $this->varLimit);\n } else {\n $this->arrReviews = $objWholesaler->getWholesalerProductReviews($wid);\n $this->paging($this->arrReviews);\n $this->arrReviews = $objWholesaler->getWholesalerProductReviews($wid, $this->varLimit);\n //pre($this->arrReviews);\n }\n }",
"public function load()\n {\n global $connexion;\n $connexion->setReq(\n \"SELECT * FROM page WHERE id_page = '$this->id_page';\"\n );\n if($connexion->query()->ins()===true)\n {\n $obj = $connexion->query()->first(\"Page\");\n $this->name = $obj->getName();\n $this->title = $obj->getTitle();\n $this->file = $obj->getFile();\n $this->path = $obj->getPath();\n }\n }",
"public function loadPage(){\n $this->_strPage = isset($_REQUEST['page']) ? $_REQUEST['page'] : 'index';\n $this->_strType = 'Page';\n \n // check if state name is set and contains only letters\n if(isset($_REQUEST['state']) && ctype_alpha($_REQUEST['state'])){\n $this->_strPage = isset($_REQUEST['state']) ? $_REQUEST['state'] : false;\n $this->_strType = 'State';\n }\n \n // check if page name contains only letters\n if(ctype_alpha($this->_strPage)){\n $strClass = \"Controllers\\\\\".$this->_strType.\"\\\\\".ucfirst($this->_strPage);\n if(class_exists($strClass)){\n $objPage = new $strClass;\n $objPage->loadComponent();\n echo $objPage->loadTemplate();\n } else {\n throw new AppException($this->_strPage.'\\\\'.$this->_strType, 'Page Not Found');\n }\n }\n \n }",
"public function on_page_load(){\n // Stops data handling if no user is logged in\n if(!is_user_logged_in()){ \n return false; \n }\n \n // Verify user permissions, redirect if not authorized\n if(!current_user_can('delete_posts')){\n Inventory::create_admin_notice('warning', 'This account does not have permission to edit inventory.');\n } else {\n // Handle requests\n foreach($this->custom_inventory_objects as $inventory_name => $inventory_object){\n $inventory_object->on_page_load();\n } \n }\n }",
"private function LoadPages() {\n\t\tglobal $wpdb;\n\n\t\t$needsUpdate = false;\n\n\t\t$pagesString = $wpdb->get_var(\"SELECT option_value FROM $wpdb->options WHERE option_name = 'sm_cpages'\");\n\n\t\t//Class sm_page was renamed with 3.0 -> rename it in serialized value for compatibility\n\t\tif(!empty($pagesString) && strpos($pagesString, \"sm_page\") !== false) {\n\t\t\t$pagesString = str_replace(\"O:7:\\\"sm_page\\\"\", \"O:26:\\\"GoogleSitemapGeneratorPage\\\"\", $pagesString);\n\t\t\t$needsUpdate = true;\n\t\t}\n\n\t\tif(!empty($pagesString)) {\n\t\t\t$storedpages = unserialize($pagesString);\n\t\t\t$this->pages = $storedpages;\n\t\t} else {\n\t\t\t$this->pages = array();\n\t\t}\n\n\t\tif($needsUpdate) $this->SavePages();\n\t}",
"protected function postLoad()\n {\n \t\n }",
"function loadFromForm() \n {\t \t \n\t $this->formName = $_REQUEST['form_name']; \t \n\t \n// \t echo 'Inside load_from_form of main page: <pre>'.print_r($this->formValues,true).'</pre><br>';\t \n\t \n\t\tswitch($this->formName) {\n\t\t\t\n\t\t\tcase 'basicStaffForm':\n\t\t\t\t \n\t\t\t\t$this->active_subPage = $this->basic_form;\t\n\t\t\t\tbreak;\n\t\t\tcase 'scheduledActivityForm':\n\n\t\t\t\t$this->active_subPage = $this->optional_sheduled_activity_form;\t \n\t\t\t\tbreak;\t\t\t\n\t\t\tdefault:\n\t\t\t\tdie('VALID FORM NAME **NOT** FOUND; name = '.$this->formName);\n\t\t} \n\t\t$this->active_subPage->loadFromForm(); \n\t\t$this->form_submitted = true; \n \n }",
"function _load() {\n $this->load->helper('flexigrid');\n\n // NOTE: this order has to match the records in ajax_load_page()\n //\n $colModel['id'] = array('id',40,TRUE,'center',2);\n $colModel[''] = array('Edit',40,false,'center',0);\n $colModel['menu'] = array('Page Type',80,TRUE,'left',2);\n $colModel['title'] = array('Title',200,TRUE,'left',2);\n $colModel['status'] = array('Status',40,TRUE,'left',2);\n $colModel['content'] = array('Content',478,TRUE,'left',2);\n $colModel['name'] = array('Name',140,TRUE,'left',2);\n\t\t\n $num_rows = $this->page_model->get_num_rows('fs_page');\n\n $gridParams = array(\n 'width' => 'auto',\n 'height' => 650,\n 'rp' => 50,\n 'rpOptions' => \"[$num_rows / 2, $num_rows]\",\n 'pagestat' => 'Displaying: {from} to {to} of {total} items.',\n 'blockOpacity' => 0.5,\n 'title' => 'Content',\n 'showTableToggleBtn' => false\n );\n\t\t\n $buttons[] = array('Select All','select all','grid_functions');\n $buttons[] = array('DeSelect All','deselect all','grid_functions');\n $buttons[] = array('Delete','delete','grid_functions');\n $buttons[] = array('Export','export','grid_functions');\n $grid_js = build_grid_js('Grid',site_url(\"cms/pages/ajax_load_pages\"),$colModel,'id','desc',$gridParams, $buttons);\n \n return $grid_js;\n }",
"function loadImportData()\n {\n // GROUP 3: SUPER ADMINS ONLY.\n if ( $this->accessPrivManager->hasSitePriv()){\t \n\t \n\t // set the pageCallBack to be without any additional parameters\n\t // (an AdminBox needs this so Language Switching on a page doesn't\n\t // pass a previous operations)\n\t $parameters = array('PERSON_ID'=>$this->PERSON_ID, 'PROVINCE_ID'=>$this->PROVINCE_ID, 'GENDER_ID'=>$this->GENDER_ID, 'STAFF_ID'=>$this->STAFF_ID);//[RAD_CALLBACK_PARAMS]\n\t $pageCallBack = $this->getCallBack(modulecim_hrdb::PAGE_IMPORTDATA, $this->sortBy, $parameters);\n\t $this->setPageCallBack( $pageCallBack );\n\t\n\t\n\t $this->pageDisplay = new page_ImportData( $this->moduleRootPath, $this->viewer );\n\t\n\t $links = array();\n\t\n\t/*[RAD_LINK_INSERT]*/\n\t\n\t $this->pageDisplay->setLinks( $links );\n }\n else\n {\n\t $this->pageDisplay = new page_NotAuthorized($this->moduleRootPath, $this->viewer); \n } \n\n }",
"function preloadPage(){\n\t\treturn true; \n\t}",
"function TablePermission_Loading() {\n\n\t\t//echo \"Table Permission Loading: \" . $this->CurrentUserLevelID() . \"<br>\";\n\t}",
"public function loadPage()\n {\n // Navigation\n $data['nav'] = $this->loadNavigation($this->page);\n $data['pageNow'] = $this->page;\n $data['theme'] = $this->getTheme();\n\n // Home\n if ($this->page == 'home') {\n \\HbgStyleGuide\\View::show('home', $data);\n return true;\n }\n\n // Sections\n $data['docs'] = $this->loadPageDocumentation($this->page);\n \\HbgStyleGuide\\View::show('sections', $data);\n return true;\n }",
"function Page_Loading() {\n\n\t//echo \"Page Loading\";\n}",
"public function importPages() {\n\t\t$this->logFunctionStart(__FUNCTION__);\n\t\t$this->importPostsAsPages($this->_db->getPages());\n\t\t$this->logFunctionEnd(__FUNCTION__);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Registers a user base don email, passwrod, phone number and phone country code | public function register($email, $password, $phoneNumber, $phn_country) {
$password = md5($password);
$sqlQuery = "INSERT INTO user_accounts(user_email, user_passwords, user_phone_number, user_phn_country_code, user_admin)
VALUES ('$email', '$password', '$phoneNumber', '$phn_country', '0')";
$statement = $this->_dbHandle->prepare($sqlQuery);
$statement->execute();
} | [
"public function classic_register()\n\t\t{\n\t\t\t$user_export = new user_no_id();\n\t\t\t\n\t\t\t$user_export->name = $_POST[\"name\"];\n\t\t\t$user_export->email =$_POST[\"email\"];\n\t\t\t$user_export->password = $_POST[\"password\"];\n\t\t\t$user_export->type = \"CLASSIC\";\n\t\t\t\n\t\t\t$this->add_new_user($user_export);\n\t\t\t$this->login_user($user_export);\n\t\t}",
"public function registerUser() {\n $db = new Database();\n $db->insertInto(\"`users` (`ID`, `email`) VALUES (NULL, :email)\", array(\":email\" => $this->email));\n }",
"public function register($status, $email, $phone, $username, $password, $firstname, $lastname, $birthdate, $country, $city, $postal_code, $address, $unique_id, $business_vat);",
"private function register(){\n\t\t\t// Cross validation if the request method is POST else it will return \"Not Acceptable\" status\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\n\t\t\t$email = trim($this->_request['email']);\n\t\t\t$password = trim($this->_request['password']);\n\t\t\t$nombre = trim($this->_request['nombre']);\n\t\t\t$apellidos = trim($this->_request['apellidos']);\n\t\t\t$confirm_password = trim($this->_request['confirm_password']);\n\t\t\t$direccion = trim($this->_request['direccion']);\n\n\t\t\tif(!empty($email) and !empty($password) and !empty($nombre) and !empty($apellidos) and !empty($confirm_password)){\n\t\t\t\tif(filter_var($email, FILTER_VALIDATE_EMAIL) && $password==$confirm_password){\n\t\t\t\t\t$userRepository = $this->em->getRepository('User');\n\t\t\t\t\t$user = $userRepository->findOneBy(array('email' => $email));\n\t\t\t\t\tif($user!=NULL){\n\t\t\t\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Email address allready exist\");\n\t\t\t\t\t\t$this->response($this->json($error), 400);\n\t\t\t\t\t}\n\t\t\t\t\t$u = new User();\n\t\t\t\t\t$u->nombre = $nombre;\n\t\t\t\t\t$u->apellidos = $apellidos;\n\t\t\t\t\t$u->email = $email;\n\t\t\t\t\t$u->password = $password;\n\t\t\t\t\t$u->active = 1;\n $u->registerKey = uniqid();\n $date = new \\DateTime(\"now\");\n $u->fechaRegistro = $date->getTimestamp();\n\t\t\t\t\t$this->em->persist($u);\n\n\t\t\t\t\tif(isset($direccion) && !empty($direccion)){\n\t\t\t\t\t\t$direccion = json_decode($direccion,TRUE);\n\t\t\t\t\t\tif($direccion==NULL){\n\t\t\t\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Direccion Invalid Data\");\n\t\t\t\t\t\t\t$this->response($this->json($error), 400);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$calle = trim($direccion['calle']);\n\t\t\t\t\t\t$referencias = trim($direccion['referencias']);\n\t\t\t\t\t\t$nombre = trim($direccion['nombre']);\n\t\t\t\t\t\t$distrito = trim($direccion['distrito']);\n\t\t\t\t\t\t$numero = trim($direccion['numero']);\n\t\t\t\t\t\t$piso_apt = trim($direccion['piso_apt']);\n\t\t\t\t\t\t$telefono = trim($direccion['telefono']);\n\t\t\t\t\t\tif(!empty($calle) and !empty($referencias) and !empty($nombre) and !empty($distrito) and !empty($numero) and !empty($piso_apt) and !empty($telefono)){\n\t\t\t\t\t\t\t$dir = new Direccion();\n\t\t\t\t\t\t\t$dir->nombre = $nombre;\n\t\t\t\t\t\t\t$dir->calle = $calle;\n\t\t\t\t\t\t\t$dir->referencias = $referencias;\n\t\t\t\t\t\t\t$dir->numero = $numero;\n\t\t\t\t\t\t\t$dir->piso_apt = $piso_apt;\n\t\t\t\t\t\t\t$dir->distrito = $distrito;\n\t\t\t\t\t\t\t$dir->telefono = $telefono;\n\t\t\t\t\t\t\t$dir->user = $u;\n\t\t\t\t\t\t\t$this->em->persist($dir);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$this->em->flush();\n\t\t\t\t\t$this->response($this->json($u),200);\n\t\t\t\t}\n\t\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password do not match\");\n\t\t\t\t$this->response($this->json($error), 400);\n\t\t\t}\n\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Invalid Data\");\n\t\t\t$this->response($this->json($error), 400);\n\t\t}",
"public function register()\n\t{\n\t\t$this->register_registration_fetch_tos = 'SELECT settings_tos FROM %psettings';\n\t\t$this->register_registration_fetch_exists = \"SELECT user_id FROM %pusers WHERE REPLACE(LOWER(user_name), ' ', '')='%s'\";\n\t\t$this->register_registration_fetch_eexists = \"SELECT user_email FROM %pusers WHERE user_email='%s'\";\n\n\t\t$this->register_create = 'INSERT INTO %pusers (user_name, user_password, user_group, user_title, user_joined, user_email, user_skin, user_view_avatars, user_view_emoticons, user_view_signatures, user_language, user_email_show, user_pm, user_timezone, user_regip) VALUES (\\'%s\\', \\'%s\\', %d, \\'%s\\', %d, \\'%s\\', \\'%s\\', %d, %d, %d, \\'%s\\', %d, %d, %d, \\'%s\\')';\n\t\t$this->register_activate = 'UPDATE %pusers SET user_group=%d WHERE user_id=%d';\n\n\n\t\t$this->register_activateUser_fetch_member = \"SELECT user_id, user_group FROM %pusers WHERE MD5(CONCAT(user_email, user_name, user_password, user_joined))='%s' LIMIT 1\";\n\t}",
"public function registeruser() {\n $this->register();\n\n }",
"public function register() \n { \n $user = new User();\n $user->username = Param::get('username');\n $status = \"\";\n\n if ($user->username) {\n try {\n $user->password = Param::get('password');\n $user->fname = Param::get('fname');\n $user->lname = Param::get('lname');\n $user->email = Param::get('email');\n $user->register();\n $status = notify(\"Registered Successfully\");\n } catch (AppException $e) {\n $status = notify($e->getMessage(), \"error\");\n }\n }\n $this->set(get_defined_vars());\n }",
"private function registerNewUser()\n {\n $userName = $_POST['user_name'];\n $userLogin = $_POST['user_login'];\n $userCurso = $_POST['user_curso'];\n $userEmail = $_POST['user_email'];\n $userTelefone = $_POST['user_fone'];\n $userSenha = $_POST['user_senha'];\n $userSenhaRepeat = $_POST['user_senha_repeat'];\n $userMatricula = $_POST['user_matricula'];\n\n\n if (empty($userName)) {\n $this->errors[] = \"Campo nome vazio\";\n } elseif (empty($userSenha) || empty($userSenhaRepeat)) {\n $this->errors[] = \"Campo senha vazio\";\n } elseif ($userSenha != $userSenhaRepeat) {\n $this->errors[] = \"Senhas incompativeis\";\n } elseif (strlen($userSenha) > 6) {\n $this->errors[] = \"A senha deve conter no maximo 6 caracteres\";\n } elseif (strlen($userLogin) > 64 || strlen($userLogin) < 2) {\n $this->errors[] = \"O campo Usuário deve conter no minino 5 caracteres\";\n }elseif (empty($userEmail)) {\n $this->errors[] = \"Campo email vazio\";\n }elseif (empty($userCurso)) {\n $thi->errors[] = \"Campo curso vazio\";\n } elseif (!filter_var($userEmail, FILTER_VALIDATE_EMAIL)) {\n $this->errors[] = \"Formato de email invalido\";\n } elseif (!empty($userName)\n && strlen($userLogin) <= 64\n && preg_match('/^[a-z\\d]{2,64}$/i', $userLogin)\n && !empty($userEmail)\n && filter_var($userEmail, FILTER_VALIDATE_EMAIL)\n && !empty($userSenha)\n && !empty($userSenhaRepeat)\n && ($userSenha === $userSenhaRepeat)\n && !empty($userCurso)\n && !empty($userTelefone)\n && !empty($userMatricula)\n ) {\n // create a database connection\r\n $this->db_connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);\r\n\n // change character set to utf8 and check it\r\n if (!$this->db_connection->set_charset(\"utf8\")) {\r\n $this->errors[] = $this->db_connection->error;\r\n }\r\n\r\n // if no connection errors (= working database connection)\n if (!$this->db_connection->connect_errno) {\n // escaping, additionally removing everything that could be (html/javascript-) code\n //$userLogin = $this->db_connection->real_escape_string(strip_tags($_POST['user_login'], ENT_QUOTES));\n //$userEmail = $this->db_connection->real_escape_string(strip_tags($_POST['user_email'], ENT_QUOTES));\n\n // crypt the user's password with PHP 5.5's password_hash() function, results in a 60 character\n // hash string. the PASSWORD_DEFAULT constant is defined by the PHP 5.5, or if you are using\n // PHP 5.3/5.4, by the password hashing compatibility library\n // $userSenhaRepeat = password_hash($userSenha, PASSWORD_DEFAULT);\n\n // check if user or email address already exists\n $sql = \"SELECT * FROM tbl_usuario WHERE USU_LOGIN = '$userLogin' OR USU_EMAIL ='$userEmail';\";\r\n $query_check_user_name = $this->db_connection->query($sql);\r\n\r\n if ($query_check_user_name->num_rows) {\r\n $this->errors[] = \"Usuário já existe no Banco\";\n } else {\n // write new user's data into database\n $sql = \"INSERT INTO tbl_usuario (USU_NOME,USU_TIPO,USU_MATRICULA, USU_CURSO, USU_EMAIL, USU_FONE, USU_ATIVO, USU_SENHA, USU_LOGIN)\r\n VALUES('$userName', '0' , '$userMatricula','$userCurso', '$userEmail', '$userTelefone', '1', '$userSenhaRepeat', '$userLogin ');\";\r\n $query_new_user_insert = $this->db_connection->query($sql);\n\r\n // if user has been added successfully\r\n if ($query_new_user_insert){\r\n $this->messages[] = \"Bolsista cadastrado com Sucesso!\";\n } else {\n $this->errors[] = \"Desculpe, ocorrou um erro ao cadastrar\";\n }\n }\n } else {\n $this->errors[] = \"Desculpe, Banco não conectado.\";\n }\n }else {\n $this->errors[] = \"Ocorreu um erro desconhecido\";\n //echo \" . mysql_error($this) . \\n\";\n\n }\n }",
"private function registerNewUser()\n {\n if (empty($_POST['user_email'])) {\n $this->errors[] = \"Empty Email\";\n } elseif (empty($_POST['user_password_new']) || empty($_POST['user_password_repeat'])) {\n $this->errors[] = \"Empty Password\";\n } elseif ($_POST['user_password_new'] !== $_POST['user_password_repeat']) {\n $this->errors[] = \"Password and password repeat are not the same\";\n } elseif (strlen($_POST['user_password_new']) < 6) {\n $this->errors[] = \"Password has a minimum length of 6 characters\";\n } elseif (strlen($_POST['user_email']) > 64) {\n $this->errors[] = \"Email cannot be longer than 64 characters\";\n } elseif (!filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)) {\n $this->errors[] = \"Your email address is not in a valid email format\";\n } elseif( preg_match('/^\\S+@(gulls\\.)?salisbury\\.edu$/i', $_POST['user_email']) !== 1) {\n $this->errors[] = \"Email must be from an SU domain.\";\n } elseif (empty($_POST['user_id'])) {\n $this->errors[] = \"No Student ID provided\";\n } elseif (strlen($_POST['user_id']) != 7) {\n $this->errors[] = \"Student ID must have a length of 7 characters\";\n } else {\n\n global $db;\n\n $user_email = strip_tags($_POST['user_email'], ENT_QUOTES);\n $user_password = $_POST['user_password_new'];\n $user_id = $_POST['user_id'];\n\n // crypt the user's password with PHP 5.5's password_hash() function, results in a 60 character\n // hash string. the PASSWORD_DEFAULT constant is defined by the PHP 5.5, or if you are using\n // PHP 5.3/5.4, by the password hashing compatibility library\n $user_password_hash = password_hash($user_password, PASSWORD_DEFAULT);\n\n // Check for existing account\n $db->where('email', $user_email);\n $existing = $db->get('users');\n\n // Check for existing userID\n $db->where('id', $user_id);\n $IDexisting = $db->get('users');\n\n if (count($existing) > 0) {\n $this->errors = array(\"Sorry, that username / email address is already taken.\", print_r($existing[0]));\n }\n elseif (count($IDexisting) > 0) {\n $this->errors[] = \"Student ID is already being used\";\n } else {\n\n $data = array(\n 'id' => $_POST['user_id'],\n 'email' => $user_email,\n 'preferred_email' => $user_email, //temp\n 'password' => $user_password_hash,\n 'name' => $_POST['user_firstname'] . ' ' . $_POST['user_lastname'],\n 'year' => $_POST['user_year'],\n 'major' => $_POST['user_major'],\n 'bio' => \"This user has not yet created a bio.\",\n 'reset_token' => bin2hex(openssl_random_pseudo_bytes(16))\n );\n\n // write new user's data into database\n $id = $db->insert('users', $data);\n\n // if user has been added successfully\n if ($id) {\n $params = ['user' => $data['id'], 'confirm_token' => $data['reset_token']];\n $msg = \"Welcome to the Salisbury University Math & Computer Science Club! To confirm your account, please click the link below:\\n\\nhttp://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]?\" . http_build_query($params);\n $err = Utils::sendMail(\"noreply@sumathcsclub.com\", $user_email, \"SU Math/CS Club Account Confirm\", $msg, [], \"SU Math/CS Club\");\n if ($err) {\n $this->errors[] = $err;\n $db->where('id', $data['id'])->delete('users');\n } else {\n $this->messages[] = \"You have been sent a confirmation email. Please click the link to confirm your account.\";\n $this->registered = true;\n }\n } else {\n $this->errors[] = $db->getLastError();\n }\n }\n }\n }",
"protected function registerUser()\n {\n // add member to tl_member\n $set = array(\n 'tstamp' => time(),\n 'firstname' => $this->userData['firstname'],\n 'lastname' => $this->userData['lastname'],\n 'gender' => $this->userData['gender'],\n 'email' => $this->userData['email'],\n 'participantGewinnspiel' => serialize(array(date('Y'))),\n );\n // mehrmaliges Teilnehmen mit identischer mail-Adresse ermöglichen\n $objMember = $this->Database->prepare('SELECT * FROM tl_member WHERE email LIKE ?')->execute($this->userData['email']);\n if (!$objMember->next()) {\n $set['dateAdded'] = time();\n $objInsert = $this->Database->prepare('INSERT INTO tl_member %s')->set($set)->execute();\n $this->userData['memberId'] = $objInsert->insertId;\n $this->log('Ein neues Mitglied (ID ' . $objInsert->insertId . ') hat sich auf der Webseite registriert.', 'ModuleGewinnspielTeilnehmer registerUser()', TL_ACCESS);\n } else {\n $this->Database->prepare('UPDATE tl_member %s WHERE id = ?')->set($set)->execute($objMember->id);\n $this->userData['memberId'] = $objMember->id;\n $this->log('Ein Mitglied (ID ' . $objMember->id . ') hat seine Kontoangaben geändert.', 'ModuleGewinnspielTeilnehmer registerUser()', TL_ACCESS);\n }\n // add member to tl_avisota_recipient, but only if avisota is installed\n if (in_array('tl_avisota_recipient_list', $this->Database->listTables()) && $this->addUserToAvisotaRecipientList) {\n $objDb = $this->Database->prepare('SELECT * FROM tl_avisota_recipient_list WHERE id = ?')->execute($this->addUserToAvisotaRecipientList);\n if ($objDb->first()) {\n $set = array(\n 'pid' => $this->addUserToAvisotaRecipientList,\n 'tstamp' => time(),\n 'salutation' => $this->userData['gender'] == 'male' ? 'Sehr geehrter Herr {fullname}' : 'Sehr geehrte Frau {fullname}',\n 'firstname' => $this->userData['firstname'],\n 'lastname' => $this->userData['lastname'],\n 'confirmed' => '1',\n 'gender' => $this->userData['gender'],\n 'email' => $this->userData['email'],\n 'addedNotice' => 'Online Gewinnspiel ' . date('Y')\n );\n //Vorhandene Abonnenten im selben Verteiler werden überschrieben\n $objDb = $this->Database->prepare('SELECT * FROM tl_avisota_recipient WHERE pid = ? AND email LIKE ?')->execute($this->addUserToAvisotaRecipientList, $this->userData['email']);\n if (!$objDb->next()) {\n $set['addedOn'] = time();\n $objInsert = $this->Database->prepare('INSERT INTO tl_avisota_recipient %s')->set($set)->execute();\n $this->userData['avisotaRecipientId'] = $objInsert->insertId;\n } else {\n $this->Database->prepare('UPDATE tl_avisota_recipient %s WHERE id = ?')->set($set)->execute($objDb->id);\n $this->userData['avisotaRecipientListId'] = $objDb->id;\n }\n $this->userData['avisotaRecipientListId'] = $this->addUserToAvisotaRecipientList;\n }\n }\n }",
"public function registerUser(){\n $this->setToken(sha1($this->getFirstname().$this->getLastname().$this->getUsername().time()));\n\t\t$query = \"insert into user (firstname,lastname,username,token,birthdate,gender) values (?,?,?,?,?,?)\";\n\t\t$result = queryMysqli($query, array($this->getFirstname(), $this->getLastname(), $this->getUsername(), $this->getToken(), $this->getBirthdate(), $this->getGender()));\n if ($result->rowCount() > 0) {\n return $this->getToken();\n }\n return 'could not register';\n }",
"public function register()\n {\n $data = [\n 'name' => $this->request->get('name'),\n 'email' => $this->request->get('email'),\n 'password' => password_hash($this->request->get('password'), PASSWORD_DEFAULT)\n ];\n\n $user = User::create($data);\n\n $this->success(\n $user->toArray(),\n 'Account Created'\n );\n }",
"function insert_register($username,$password,$name,$type,$user_type=Constant::USER_TYPE_TEACHER,$user_data=false,$send_email=true)\n\t{\n\t\t$username=strip_tags(trim($username));\n \tif(!$username) return array('errorcode'=>false,'user_id'=>0,'student_id'=>0);\n\n\t\t$data=$this->bind_register($username,$password,$name,$type,$user_type,$user_data);\n\t\t$this->db->insert($this->_table,$data);\n\t\t$insert_id = $this->db->insert_id();\n\t\tif($insert_id > 0)\n\t\t{\n\t\t\t$errorcode=true;\t\n\t\t\tif($send_email&&$data['email'])\n\t\t\t{\n\t\t\t\t$this->load->model('login/verify_model');\n $authcode=$this->verify_model->generate_authcode_email($data['email'],Constant::CODE_TYPE_REGISTER,$insert_id,$data['user_type'],false);\n if($authcode['errorcode']) $this->verify_model->send_authcode_email($authcode['authcode'],$data['email'],Constant::CODE_TYPE_REGISTER);\n\t\t\t}\t\n\t\t\t/* thrift insert start */\n\t\t\tif ($type == Constant::INSERT_REGISTER_PHONE)\n\t\t\t{\n\t\t\t\t$this->load->library(\"thrift\");\n\t\t\t\t$response = $this->thrift->add_phone($insert_id, $username);\n\t\t\t\tif ($response != 1)\n\t\t\t\t{\n\t\t\t\t\t//$this->db->delete(\"user\", array(\"id\" => $insert_id));\n\t\t\t\t\t$errorcode = false;\n\t\t\t\t\t//$this->db->where('id',$insert_id);\n\t\t\t\t\t//$this->db->update($this->_table,array('phone_verified'=>0,'phone_mask'=>''));\n\t\t\t\t\tlog_message('error_tizi','200011:Register insert error',array('uid'=>$insert_id,'username'=>$username,'register_type'=>$type,'user_type'=>$user_type));\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* thrift insert over */\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$errorcode=false;\n\t\t}\n\t\tif($errorcode) log_message('info_tizi','20001:Register success',array('uid'=>$insert_id,'username'=>$username,'register_type'=>$type,'user_type'=>$user_type));\n\t\treturn array('user_id'=>$insert_id,'student_id'=>$data['student_id'],'errorcode'=>$errorcode);\n\t}",
"public function actionRegister()\n {\n if (isset($this->request['mobile'])) {\n $mobile = $this->request['mobile'];\n $user = Users::model()->find('username = :mobile', [':mobile' => $mobile]);\n\n $code = Controller::generateRandomInt();\n if (!$user) {\n $user = new Users();\n $user->username = $mobile;\n $user->password = $mobile;\n $user->status = Users::STATUS_PENDING;\n $user->mobile = $mobile;\n }\n\n $user->verification_token = $code;\n if ($user->save()) {\n $userDetails = UserDetails::model()->findByAttributes(['user_id' => $user->id]);\n $userDetails->credit = SiteSetting::getOption('base_credit');\n $userDetails->save();\n }\n\n Notify::SendSms(\"کد فعال سازی شما در آچارچی:\\n\" . $code, $mobile);\n\n $this->_sendResponse(200, CJSON::encode(['status' => true]));\n } else\n $this->_sendResponse(400, CJSON::encode(['status' => false, 'message' => 'Mobile variable is required.']));\n }",
"public function registerUser()\n {\n if (Helper::checkCSRF()) {\n //check if submitted Data is not empty - redirct if Data empty\n foreach ($_POST as $input){\n if(Helper::check($input)==FALSE)\n $_SESSION['missingInputRegistration'] = TRUE;\n header('Location: /register');\n }\n //Validate EmailAddress\n $validEmail = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);\n $emailExists = $this->User->checkIFEmailExists($validEmail);\n if ($validEmail==FALSE) {\n $_SESSION['validEmail'] = FALSE;\n header('Location: /register');\n }\n if($emailExists==TRUE) {\n $_SESSION['emailExists'] = TRUE;\n header('Location: /register');\n }\n $userData = $_POST;\n $userData['password'] = password_hash($_POST['password'],PASSWORD_DEFAULT);\n $userID = $this->User->insertUser($userData);\n $this->User->insertAddress($userData, $userID);\n\n //clear possible flags after successful registration\n unset($_SESSION['UserEmail']);\n unset($_SESSION['emailExists']);\n unset($_SESSION['missingInputRegistration']);\n //Login the User\n $_SESSION['UserID']= $userID;\n $_SESSION['LoginStatus']= TRUE;\n $_SESSION['LoginTime'] = time();\n header('Location: ../basket');\n }else{\n throw new \\Error(\"CSRF Token ivalid\");\n }\n }",
"private function processFacebookRegister(){\n $customer = new Customer();\n $_POST['lastname'] = $customer->lastname = Tools::getValue('lastName');\n $_POST['firstname'] = $customer->firstname = Tools::getValue('firstName');\n $password = rand(100000, 1000000);\n $customer->email = Tools::getValue('email');\n $customer->passwd = Tools::encrypt($password);\n $customer->is_guest = (Tools::isSubmit('is_new_customer') ? !Tools::getValue('is_new_customer', 1) : 0);\n $customer->active = 1;\n $idFacebook = Tools::getValue('idFacebook');\n if($this->getEmail($idFacebook) == ''){\n $this->saveUser($customer, $idFacebook, $password);\n }else{\n $this->processFacebookLogin();\n } \n }",
"public\n function register_account($username,$email,$password){\n $sql_query = \"INSERT INTO `users`(`name`, `email`, `password`) VALUES (\n '\" . $username .\"','\" . $email .\"','\" . $password .\"')\";\n $this->runSQL($sql_query);\n }",
"public function register(){\n\t\tif($this->request->is(\"post\")){\n\t\t\t$username = $_POST['username'];\n\t\t\t$password = $_POST['password'];\n\t\t\t$retype = $_POST['retype'];\n\t\t\t$email\t = $_POST['email'];\n\t\t\t\n\t\t\tif($password != $retype){\n\t\t\t\t$this->Session->setFlash();\n\t\t\t}\n\t\t}\n\t}",
"private function register_user() {\n\n\t\tif ( ! empty( $_POST['affwp_user_name'] ) ) {\n\t\t\t$name = explode( ' ', sanitize_text_field( $_POST['affwp_user_name'] ) );\n\t\t\t$user_first = array_shift( $name );\n\t\t\t$user_last = count( $name ) ? implode( ' ', $name ) : '';\n\t\t} else {\n\t\t\t$user_first = '';\n\t\t\t$user_last = '';\n\t\t}\n\n\t\t$required_registration_fields = affiliate_wp()->settings->get( 'required_registration_fields' );\n\n\t\tif ( isset( $required_registration_fields['password'] ) ) {\n\t\t\t$user_pass = sanitize_text_field( $_POST['affwp_user_pass'] );\n\t\t} else {\n\t\t\t$user_pass = wp_generate_password( 24 );\n\t\t}\n\n\t\tif ( ! is_user_logged_in() ) {\n\n\t\t\t$args = array(\n\t\t\t\t'user_login' => sanitize_text_field( $_POST['affwp_user_login'] ),\n\t\t\t\t'user_email' => sanitize_text_field( $_POST['affwp_user_email'] ),\n\t\t\t\t'user_pass' => $user_pass,\n\t\t\t\t'display_name' => $user_first . ' ' . $user_last\n\t\t\t);\n\n\t\t\t$user_id = wp_insert_user( $args );\n\n\t\t\t// Enable referral notifications by default for new users.\n\t\t\tupdate_user_meta( $user_id, 'affwp_referral_notifications', true );\n\n\t\t} else {\n\n\t\t\t$user_id = get_current_user_id();\n\t\t\t$user = (array) get_userdata( $user_id );\n\t\t\t$args = (array) $user['data'];\n\n\t\t}\n\n\t\t// update first and last name\n\t\twp_update_user( array( 'ID' => $user_id, 'first_name' => $user_first, 'last_name' => $user_last ) );\n\n\t\t// promotion method\n\t\t$promotion_method = isset( $_POST['affwp_promotion_method'] ) ? sanitize_text_field( $_POST['affwp_promotion_method'] ) : '';\n\n\t\tif ( $promotion_method ) {\n\t\t\tupdate_user_meta( $user_id, 'affwp_promotion_method', $promotion_method );\n\t\t}\n\n\t\t// website URL\n\t\t$website_url = isset( $_POST['affwp_user_url'] ) ? sanitize_text_field( $_POST['affwp_user_url'] ) : '';\n\n\t\t$status = affiliate_wp()->settings->get( 'require_approval' ) ? 'pending' : 'active';\n\n\t\t$affiliate_id = affwp_add_affiliate( array(\n\t\t\t'user_id' => $user_id,\n\t\t\t'payment_email' => ! empty( $_POST['affwp_payment_email'] ) ? sanitize_text_field( $_POST['affwp_payment_email'] ) : '',\n\t\t\t'status' => $status,\n\t\t\t'website_url' => $website_url,\n\t\t\t'dynamic_coupon' => ! affiliate_wp()->settings->get( 'require_approval' ) ? 1 : '',\n\t\t) );\n\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\t$this->log_user_in( $user_id, sanitize_text_field( $_POST['affwp_user_login'] ) );\n\t\t}\n\n\t\t// Retrieve affiliate ID. Resolves issues with caching on some hosts, such as GoDaddy\n\t\t$affiliate_id = affwp_get_affiliate_id( $user_id );\n\n\t\t/**\n\t\t * Fires immediately after registering a user.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t * @param int $affiliate_id Affiliate ID.\n\t\t * @param string $status Affiliate status.\n\t\t * @param array $args Data arguments used when registering the user.\n\t\t */\n\t\tdo_action( 'affwp_register_user', $affiliate_id, $status, $args );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
compareSub() Binary safe comparison of this string from an offset, up to length characters to a substring provided for comparison. | public function compareSub( String $string, Integer $offset, Integer $length, Boolean $case = NULL ) {
if( is_null($case) ) $case = new Boolean(false);
switch( $case->bool() ) {
case true:
$equals = (int) substr_compare($this->string, $string, $offset->int(), $length->int(), false);
break;
case false:
$equals = (int) substr_compare($this->string, $string, $offset->int(), $length->int(), true);
break;
}
if( $equals < 0 )
return E_Comparison::LESS_THAN();
elseif( $equals == 0 )
return E_Comparison::EQUAL_TO();
elseif( $equals > 0 )
return E_Comparison::GREATER_THAN();
else
throw new LogicException();
} | [
"function substr_compare ($main_str, $str, $offset, $length = null, $case_insensitivity = null) {}",
"final public static function compare($mainStr, $str, $offset = 0, $length = null) {\n\t\treturn substr_compare($mainStr, $str, $offset = 0, $length);\n\t}",
"public function testSubstr() {\n\n\t\t$str = new ByteArray(self::testStr);\n\n\t\t$this->assertTrue($str->substr(-1)->equals(new ByteArray(\"f\")));\n\t\t$this->assertTrue($str->substr(-3)->equals(new ByteArray(\"ëf\")));\n\t\t$this->assertTrue($str->substr(-4, 1)->equals(new ByteArray(\"D\")));\n\t\t$this->assertTrue($str->substr(0, -1)->equals(new ByteArray(\"a€cDë\")));\n\t\t$this->assertTrue($str->substr(4, -1)->equals(new ByteArray(\"cDë\")));\n\t\t$this->assertTrue($str->substr(5, -4)->equals(new ByteArray(\"\")));\n\t\t$this->assertTrue($str->substr(-4, -1)->equals(new ByteArray(\"Dë\")));\n\t}",
"public function compare($string1, $offset1, $length1, $string2, $offset2, $length2, CompareOptions $options=null) { }",
"function substrEq($str, $sub) {\n return substr($str, 0, strlen($sub)) == $sub;\n}",
"public function regionCompare( $offseta, $str, $offsetb, $length, $ignoreCase = false ) {\n\t\t$a = $this->substring( $offseta );\n\t\t$b = new GString( $str );\n\t\t$b = $b->substring( $offsetb );\n\t\tif ( $ignoreCase == false ) {\n\t\t\treturn strncmp( $a, $b, $length );\n\t\t} else {\n\t\t\treturn strncasecmp( $a, $b, $length );\n\t\t}\n\t}",
"public function testSubstr()\n {\n $this->assertEquals('БГДЖИЛЁ', Str::substr('БГДЖИЛЁ', 0));\n $this->assertEquals('ГДЖИЛЁ', Str::substr('БГДЖИЛЁ', 1));\n $this->assertEquals('Ё', Str::substr('БГДЖИЛЁ', 6));\n $this->assertEquals('', Str::substr('БГДЖИЛЁ', 10));\n\n $this->assertEquals('', Str::substr('БГДЖИЛЁ', 0, 0));\n $this->assertEquals('БГДЖИЛ', Str::substr('БГДЖИЛЁ', 0, -1));\n $this->assertEquals('Б', Str::substr('БГДЖИЛЁ', 0, -6));\n $this->assertEquals('', Str::substr('БГДЖИЛЁ', 0, -10));\n }",
"function isSubSequence($string1, $string2, $lenthOfString1, $lenthOfString2)\n{\n\t// For index of string1\n\t$j = 0;\n\t\n /* \n Traverse string2 and string1, and compare current character of string2 with first unmatched char of string1, \n if matched then move ahead in string1\n */\n\tfor($i = 0; $i < $lenthOfString2 and $j < $lenthOfString1; $i++){\n if ($string1[$j] == $string2[$i]){\n $j++;\n }\n }\n\t// If all characters of string1 were found in string2\n\treturn ($j == $lenthOfString1);\n}",
"public function testSubStringExtendsSubStringToEndOfOriginalStringIfLengthIsNotProvided()\n {\n $subString = $this->create('the brown dog digs')->subString(10);\r\n $this->assertStringObject($subString);\r\n $this->assertEquals('dog digs', $subString->toString());\n }",
"public function testSubStringExtendsSubStringToEndOfOriginalStringIfLengthExceedsOriginalString()\n {\n $subString = $this->create('the brown dog digs')->subString(10, 20);\r\n $this->assertStringObject($subString);\r\n $this->assertEquals('dog digs', $subString->toString());\n }",
"public function rfind($sub, $start = 0, $stop = PHP_INT_MAX)\n {\n $slice = new Slice($start, $stop);\n list($start, $stop, $step) = $slice->indices(count($this));\n if ($sub instanceof self ||\n (is_object($sub) && method_exists($sub, '__toString'))) {\n $sub = strval($sub);\n }\n $pos = mb_strrpos($this->string, $sub, $start, $this->encoding);\n if ($pos === false || $pos > $stop) {\n return -1;\n }\n\n return $pos;\n }",
"function SubString($string1, $string2)\n {\n $string1Lowercase = strtolower($string1);\n $string2Lowercase = strtolower($string2);\n if (strpos($string1Lowercase, $string2Lowercase) != false) {\n return strpos($string1Lowercase, $string2Lowercase);\n } else {\n return -1;\n }\n }",
"function strncmp ($str1, $str2, $len) {}",
"static public function sqliteSubstr($string, $start, $length)\n\t{\n\t\treturn fUTF8::sub($string, $start-1, $length);\n\t}",
"public function find($sub, $start = 0, $stop = PHP_INT_MAX)\n {\n $slice = new Slice($start, $stop);\n list($start, $stop, $step) = $slice->indices(count($this));\n if ($sub instanceof self ||\n (is_object($sub) && method_exists($sub, '__toString'))) {\n $sub = strval($sub);\n }\n $pos = mb_strpos($this->string, $sub, $start, $this->encoding);\n if ($pos === false || $pos > $stop) {\n return -1;\n }\n\n return $pos;\n }",
"function findSubStringInString($string, $subString)\n{\n if (checkString($string) && checkString($subString))\n var_export(!strpos($string, $subString) == false);\n \n}",
"function str_ncmp ($str1, $str2, $len)\n{\n return strncmp($str1, $str2, $len);\n}",
"function UTF8_strncmp($text1, $text2, $maxLen=0) {\n\t$UTF8_text1 = UTF8_str_split($text1);\n\t$UTF8_text2 = UTF8_str_split($text2);\n\tif ($maxLen>0) {\n\t\t$UTF8_text1 = array_slice($UTF8_text1, 0, $maxLen);\n\t\t$UTF8_text2 = array_slice($UTF8_text2, 0, $maxLen);\n\t}\n\n\treturn UTF8_strcmp($UTF8_text1, $UTF8_text2);\n}",
"public function testGetSubstring(): void\n {\n $test = FL\\StringHelper::getInstance(\"This is a nice long sentence to test the substring function\");\n $this->assertEquals($test->getSubString(), \"This is a nice long sentence to test the substring function\");\n $this->assertEquals($test->getSubString(5), \"is a nice long sentence to test the substring function\");\n $this->assertEquals($test->getSubString(5, 4), \"is a\");\n $this->assertEquals($test->getSubString(5, 150), \"is a nice long sentence to test the substring function\");\n $this->assertEquals($test->getSubString(150, 150), \"\"); // you're trying to get a string outside the boundaries of the value, this returns an empty string\n\n $test = Fl\\StringHelper::getInstance(\"Thïŝ is a r³thôr lêng str§ng\"); // multibyte\n $this->assertEquals($test->getSubString(10, 6), \"r³thôr\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test if can get the lookahead token if iterator mode is set to FIFO. | public function testGetLookaheadInFifoMode(TokenStream $stream) {
// user.name.split(" ").join("-")
$stream->setIteratorMode(TokenStream::IT_MODE_FIFO);
$stream->rewind();
$this->assertSame($stream->getLookahead()->getCode(), self::T_POINT);
$this->assertSame($stream->getLookahead(1)->getCode(), self::T_POINT);
$stream->next();
$this->assertSame($stream->getLookahead(1)->getCode(), self::T_NAME);
$stream->next();
$this->assertSame($stream->getLookahead(1)->getCode(), self::T_POINT);
$stream->next();
$this->assertSame($stream->getLookahead(1)->getCode(), self::T_NAME);
$this->assertSame($stream->getLookahead(2)->getCode(), self::T_OPEN_PARENTHESIS);
$this->assertSame($stream->getLookahead(3)->getCode(), self::T_VALUE);
$this->assertSame($stream->getLookahead(4)->getCode(), self::T_CLOSE_PARENTHESIS);
$this->assertSame($stream->getLookahead(5)->getCode(), self::T_POINT);
$this->assertSame($stream->getLookahead(6)->getCode(), self::T_NAME);
$this->assertSame($stream->getLookahead(7)->getCode(), self::T_OPEN_PARENTHESIS);
$this->assertSame($stream->getLookahead(8)->getCode(), self::T_VALUE);
$this->assertSame($stream->getLookahead(9)->getCode(), self::T_CLOSE_PARENTHESIS);
$this->assertNull($stream->getLookahead(10));
} | [
"function yy_is_expected_token($token)\n {\n if ($token === 0) {\n return true; // 0 is not part of this\n }\n $state = $this->yystack[$this->yyidx]->stateno;\n if (in_array($token, self::$yyExpectedTokens[$state], true)) {\n return true;\n }\n $stack = $this->yystack;\n $yyidx = $this->yyidx;\n do {\n $yyact = $this->yy_find_shift_action($token);\n if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\n // reduce action\n $done = 0;\n do {\n if ($done++ == 100) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n // too much recursion prevents proper detection\n // so give up\n return true;\n }\n $yyruleno = $yyact - self::YYNSTATE;\n $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];\n $nextstate = $this->yy_find_reduce_action(\n $this->yystack[$this->yyidx]->stateno,\n self::$yyRuleInfo[$yyruleno]['lhs']);\n if (isset(self::$yyExpectedTokens[$nextstate]) &&\n in_array($token, self::$yyExpectedTokens[$nextstate], true)) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n return true;\n }\n if ($nextstate < self::YYNSTATE) {\n // we need to shift a non-terminal\n $this->yyidx++;\n $x = new VTQL_ParseryyStackEntry;\n $x->stateno = $nextstate;\n $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];\n $this->yystack[$this->yyidx] = $x;\n continue 2;\n } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n if (!$token) {\n // end of input: this is valid\n return true;\n }\n // the last token was just ignored, we can't accept\n // by ignoring input, this is in essence ignoring a\n // syntax error!\n return false;\n } elseif ($nextstate === self::YY_NO_ACTION) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n // input accepted, but not shifted (I guess)\n return true;\n } else {\n $yyact = $nextstate;\n }\n } while (true);\n }\n break;\n } while (true);\n return true;\n }",
"function yy_is_expected_token($token)\n {\n if ($token === 0) {\n return true; // 0 is not part of this\n }\n $state = $this->yystack[$this->yyidx]->stateno;\n if (in_array($token, self::$yyExpectedTokens[$state], true)) {\n return true;\n }\n $stack = $this->yystack;\n $yyidx = $this->yyidx;\n do {\n $yyact = $this->yy_find_shift_action($token);\n if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\n // reduce action\n $done = 0;\n do {\n if ($done++ == 100) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n // too much recursion prevents proper detection\n // so give up\n return true;\n }\n $yyruleno = $yyact - self::YYNSTATE;\n $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];\n $nextstate = $this->yy_find_reduce_action(\n $this->yystack[$this->yyidx]->stateno,\n self::$yyRuleInfo[$yyruleno]['lhs']);\n if (isset(self::$yyExpectedTokens[$nextstate]) &&\n in_array($token, self::$yyExpectedTokens[$nextstate], true)) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n return true;\n }\n if ($nextstate < self::YYNSTATE) {\n // we need to shift a non-terminal\n $this->yyidx++;\n $x = new Haanga_yyStackEntry;\n $x->stateno = $nextstate;\n $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];\n $this->yystack[$this->yyidx] = $x;\n continue 2;\n } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n if (!$token) {\n // end of input: this is valid\n return true;\n }\n // the last token was just ignored, we can't accept\n // by ignoring input, this is in essence ignoring a\n // syntax error!\n return false;\n } elseif ($nextstate === self::YY_NO_ACTION) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n // input accepted, but not shifted (I guess)\n return true;\n } else {\n $yyact = $nextstate;\n }\n } while (true);\n }\n break;\n } while (true);\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n return true;\n }",
"function yy_is_expected_token($token)\r\n {\r\n if ($token === 0) {\r\n return true; // 0 is not part of this\r\n }\r\n $state = $this->yystack[$this->yyidx]->stateno;\r\n if (in_array($token, self::$yyExpectedTokens[$state], true)) {\r\n return true;\r\n }\r\n $stack = $this->yystack;\r\n $yyidx = $this->yyidx;\r\n do {\r\n $yyact = $this->yy_find_shift_action($token);\r\n if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\r\n // reduce action\r\n $done = 0;\r\n do {\r\n if ($done++ == 100) {\r\n $this->yyidx = $yyidx;\r\n $this->yystack = $stack;\r\n // too much recursion prevents proper detection\r\n // so give up\r\n return true;\r\n }\r\n $yyruleno = $yyact - self::YYNSTATE;\r\n $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];\r\n $nextstate = $this->yy_find_reduce_action(\r\n $this->yystack[$this->yyidx]->stateno,\r\n self::$yyRuleInfo[$yyruleno]['lhs']);\r\n if (isset(self::$yyExpectedTokens[$nextstate]) &&\r\n in_array($token, self::$yyExpectedTokens[$nextstate], true)) {\r\n $this->yyidx = $yyidx;\r\n $this->yystack = $stack;\r\n return true;\r\n }\r\n if ($nextstate < self::YYNSTATE) {\r\n // we need to shift a non-terminal\r\n $this->yyidx++;\r\n $x = new TP_yyStackEntry;\r\n $x->stateno = $nextstate;\r\n $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];\r\n $this->yystack[$this->yyidx] = $x;\r\n continue 2;\r\n } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {\r\n $this->yyidx = $yyidx;\r\n $this->yystack = $stack;\r\n if (!$token) {\r\n // end of input: this is valid\r\n return true;\r\n }\r\n // the last token was just ignored, we can't accept\r\n // by ignoring input, this is in essence ignoring a\r\n // syntax error!\r\n return false;\r\n } elseif ($nextstate === self::YY_NO_ACTION) {\r\n $this->yyidx = $yyidx;\r\n $this->yystack = $stack;\r\n // input accepted, but not shifted (I guess)\r\n return true;\r\n } else {\r\n $yyact = $nextstate;\r\n }\r\n } while (true);\r\n }\r\n break;\r\n } while (true);\r\n $this->yyidx = $yyidx;\r\n $this->yystack = $stack;\r\n return true;\r\n }",
"function yy_is_expected_token($token)\n {\n if ($token === 0) {\n return true; // 0 is not part of this\n }\n $state = $this->yystack[$this->yyidx]->stateno;\n if (in_array($token, self::$yyExpectedTokens[$state], true)) {\n return true;\n }\n $stack = $this->yystack;\n $yyidx = $this->yyidx;\n do {\n $yyact = $this->yy_find_shift_action($token);\n if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\n // reduce action\n $done = 0;\n do {\n if ($done++ == 100) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n // too much recursion prevents proper detection\n // so give up\n return true;\n }\n $yyruleno = $yyact - self::YYNSTATE;\n $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];\n $nextstate = $this->yy_find_reduce_action(\n $this->yystack[$this->yyidx]->stateno,\n self::$yyRuleInfo[$yyruleno]['lhs']);\n if (isset(self::$yyExpectedTokens[$nextstate]) &&\n in_array($token, self::$yyExpectedTokens[$nextstate], true)) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n return true;\n }\n if ($nextstate < self::YYNSTATE) {\n // we need to shift a non-terminal\n $this->yyidx++;\n $x = new TP_yyStackEntry;\n $x->stateno = $nextstate;\n $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];\n $this->yystack[$this->yyidx] = $x;\n continue 2;\n } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n if (!$token) {\n // end of input: this is valid\n return true;\n }\n // the last token was just ignored, we can't accept\n // by ignoring input, this is in essence ignoring a\n // syntax error!\n return false;\n } elseif ($nextstate === self::YY_NO_ACTION) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n // input accepted, but not shifted (I guess)\n return true;\n } else {\n $yyact = $nextstate;\n }\n } while (true);\n }\n break;\n } while (true);\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n return true;\n }",
"function yy_is_expected_token($token)\n {\n if ($token === 0) {\n return true; // 0 is not part of this\n }\n $state = $this->yystack[$this->yyidx]->stateno;\n if (in_array($token, self::$yyExpectedTokens[$state], true)) {\n return true;\n }\n $stack = $this->yystack;\n $yyidx = $this->yyidx;\n do {\n $yyact = $this->yy_find_shift_action($token);\n if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\n // reduce action\n $done = 0;\n do {\n if ($done++ == 100) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n // too much recursion prevents proper detection\n // so give up\n return true;\n }\n $yyruleno = $yyact - self::YYNSTATE;\n $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];\n $nextstate = $this->yy_find_reduce_action(\n $this->yystack[$this->yyidx]->stateno,\n self::$yyRuleInfo[$yyruleno]['lhs']);\n if (isset(self::$yyExpectedTokens[$nextstate]) &&\n in_array($token, self::$yyExpectedTokens[$nextstate], true)) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n return true;\n }\n if ($nextstate < self::YYNSTATE) {\n // we need to shift a non-terminal\n $this->yyidx++;\n $x = new block_formal_langs_parser_cpp_languageyyStackEntry;\n $x->stateno = $nextstate;\n $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];\n $this->yystack[$this->yyidx] = $x;\n continue 2;\n } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n if (!$token) {\n // end of input: this is valid\n return true;\n }\n // the last token was just ignored, we can't accept\n // by ignoring input, this is in essence ignoring a\n // syntax error!\n return false;\n } elseif ($nextstate === self::YY_NO_ACTION) {\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n // input accepted, but not shifted (I guess)\n return true;\n } else {\n $yyact = $nextstate;\n }\n } while (true);\n }\n break;\n } while (true);\n $this->yyidx = $yyidx;\n $this->yystack = $stack;\n return true;\n }",
"public function has_current() {\n\t\treturn ( $this->current_position < strlen( $this->input ) );\n\t}",
"public function hasToken()\n {\n return $this->tokenFlag;\n }",
"public function hasMoreTokens() {\n\n if ($this->lookahead !== null) {\n\n return true;\n\n } \n\n return !empty($this->tokens);\n\n }",
"public function hasToken();",
"public function lex() {\n if ($this->lookahead > 0) {\n // The stackPointer, should always be the same as the count of\n // elements in the tokenStack. The stackPointer, can be thought\n // of as pointing to the next token to be added. If however\n // a pushBack() call is made, the stackPointer, will be less than the\n // count, to indicate that we should take that token from the\n // stack, instead of calling nextToken for a new token.\n if ($this->stackPointer < count($this->tokenStack)) {\n\n $this->tokenText = $this->tokenStack[$this->stackPointer]['tokenText'];\n $this->skipText = $this->tokenStack[$this->stackPointer]['skipText'];\n $token = $this->tokenStack[$this->stackPointer]['token'];\n\n // We have read the token, so now iterate again.\n $this->stackPointer++;\n return $token;\n\n }\n else {\n\n // If $tokenStack is full (equal to lookahead), pop the oldest\n // element off, to make room for the new one.\n if ($this->stackPointer == $this->lookahead) {\n // For some reason array_shift and\n // array_pop screw up the indexing, so we do it manually.\n for ($i = 0; $i < (count($this->tokenStack) - 1); $i++) {\n $this->tokenStack[$i] = $this->tokenStack[$i + 1];\n }\n\n // Indicate that we should put the element in\n // at the stackPointer position.\n $this->stackPointer--;\n }\n\n $token = $this->nextToken();\n $this->tokenStack[$this->stackPointer] = array(\n 'token' => $token,\n 'tokenText' => $this->tokenText,\n 'skipText' => $this->skipText\n );\n $this->stackPointer++;\n return $token;\n }\n }\n else {\n return $this->nextToken();\n }\n }",
"public function valid()\n\t{\n\t\treturn isset($this->tokens[$this->position]);\n\t}",
"public function hasMoreTokens()\r\n\t{\r\n\t\treturn ($this->token !== false);\r\n\t}",
"public function hasTokensLeft()\n {\n return $this->tokens_left !== null;\n }",
"public function hasPipedCommand()\n {\n return null !== $this->_next;\n }",
"abstract protected function shouldSkipToken(TokenInterface $token): bool;",
"public function testPeekNextToken()\n {\n \t$expression = \"IntIdentifier eq 123\";\n \t$lexer = new ExpressionLexer($expression);\n \t$token1 = $lexer->peekNextToken();\n \t$lexer->nextToken();\n \t$token2 = $lexer->getCurrentToken();\n \t$this->AssertEquals($token1->Id, $token2->Id);\n \t$this->AssertEquals($token1->Text, $token2->Text);\n \t$this->AssertEquals($token1->Position, $token2->Position);\n }",
"public function peekNext()\n {\n $this->tokenize();\n\n $offset = 0;\n\n do {\n $index = $this->index + ++$offset;\n\n if (!isset($this->tokens[$index])) {\n return null;\n }\n\n $type = $this->tokens[$index]->type;\n } while ($type == Tokens::T_COMMENT || $type == Tokens::T_DOC_COMMENT);\n\n return $type;\n }",
"public abstract function hasMoreTokens();",
"public function hasMoreTokens()\n {\n return ($this->index < $this->count() - 1);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TODO: Implement finTravelLink() method. | function finTravelLink(): ITravelLinkStruct|null {
} | [
"public function findNextLink();",
"public function completeLink(Link $link): Link;",
"function Search_TravelLinks($char_loc,$link_ref) {\r\n\t\tif($char_loc['nlink'] == $link_ref) {\r\n\t\t\treturn FALSE;\r\n\t\t} elseif($char_loc['elink'] == $link_ref) {\r\n\t\t\treturn FALSE;\r\n\t\t} elseif($char_loc['slink'] == $link_ref) {\r\n\t\t\treturn FALSE;\r\n\t\t} elseif($char_loc['wlink'] == $link_ref) {\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\treturn TRUE;\r\n\t}",
"public function testSubmitSelfServiceRecoveryFlowWithLinkMethod()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function getLinkTarget() {return $this->_linktarget;}",
"private function update_linktimes() {\n foreach($this->route_sequence as $linename=>$direction) {\n foreach($direction as $directionid=>$stopid_array) {\n for($i = 0; $i < count($stopid_array) - 1; $i++) {\n\t if(array_key_exists($stopid_array[$i], $this->stop_arrivals) && \n\t array_key_exists($stopid_array[$i+1], $this->stop_arrivals) &&\n\t array_key_exists($linename, $this->stop_arrivals[$stopid_array[$i]]) &&\n\t array_key_exists($linename, $this->stop_arrivals[$stopid_array[$i+1]])) {\n\t $this->extract_linkid_times($linename, $stopid_array[$i], $stopid_array[$i+1]); \n\t }\n\t}\n }\n } \n }",
"function FindLinks()\n {\n /* Housekeeping detail:\n ** Add to every propagate link a pointer back to the state to\n ** which the link is attached. */\n foreach ($this->sorted as $info) {\n $info->key->stp = $info->data;\n }\n \n /* Convert all backlinks into forward links. Only the forward\n ** links are used in the follow-set computation. */\n for ($i = 0; $i < $this->nstate; $i++) {\n $stp = $this->sorted[$i];\n for ($cfp = $stp->data->cfp; $cfp; $cfp = $cfp->next) {\n for ($plp = $cfp->bplp; $plp; $plp = $plp->next) {\n $other = $plp->cfp;\n PHP_ParserGenerator_PropagationLink::Plink_add($other->fplp, $cfp);\n }\n }\n }\n }",
"public function getLinkTarget () {}",
"function goToKostenLink()\n {\n $xpath='//*[@id=\"site-wrapper\"]/header/ul[2]/li[6]/ul/li[3]/a';\n $url = 'https://www.drei.at/selfcare/restricted/prepareCoCo.do';\n $status= $this->pressButtonIf($xpath); // erst den Button für den Link drücken. Wenn nicht erfolgreich\n if ($status===false) return($this->updateUrl($url)); // dann den dahinterliegenden link aufrufen\n return ($status); \n }",
"public function link()\n {\n }",
"public function isLink();",
"function FindLinks()\n {\n /* Housekeeping detail:\n ** Add to every propagate link a pointer back to the state to\n ** which the link is attached. */\n foreach ($this->sorted as $info) {\n $info->key->stp = $info->data;\n }\n\n /* Convert all backlinks into forward links. Only the forward\n ** links are used in the follow-set computation. */\n for ($i = 0; $i < $this->nstate; $i++) {\n $stp = $this->sorted[$i];\n for ($cfp = $stp->data->cfp; $cfp; $cfp = $cfp->next) {\n for ($plp = $cfp->bplp; $plp; $plp = $plp->next) {\n $other = $plp->cfp;\n LemonPlink::Plink_add($other->fplp, $cfp);\n }\n }\n }\n }",
"function travelL(){\n $swim = $this->_last;\n if($swim->next == null){\n echo __CLASS__,'->',__FUNCTION__ ,':No Object exist!<br>';\n return;\n }\n while($swim){\n echo $swim->data.' ';\n $swim = $swim->next;\n }\n }",
"public function MyLink() {\n\n //testing url\n $temp = $this->CountriesPage(); //class\n $temp = $temp->Link(); \n $temp = Director::absoluteBaseURL(); //\n $temp = DataObject::get_one('CountriesPage'); //class\n if ($temp) {\n $temp = $temp->Link('show/' . $this->ID); \n }\n\n $obj = DataObject::get_one('CountriesPage');\n if ($obj) {\n $page = $obj->Link('show/' . $this->ID);\n if ($page) {\n return $page;\n }\n }\n }",
"public function getFePageLink() {\n \n $fePageLink = ''; // (string)\n \n // prepare typolink\n $typolinkConf = $this->classConfigArr['articleSingleViewTypoLink.']; // TS typo link object\n $typolinkConf['returnLast'] = 'url';\n \n // do not link article if GSA-DB field ARTIKEL.WEBADRESSE value is -1\n if (trim($this->webAddress) == '-1') {\n \n $fePageLink = '';\n \n // use TYPO3 page ID or alias from page in GSA-DB field ARTIKEL.WEBADRESSE if the field is not empty (but anything other than -1)\n } elseif (strlen(trim($this->webAddress)) > 0) {\n \n unset($typolinkConf['additionalParams']);\n unset($typolinkConf['additionalParams.']);\n $typolinkConf['parameter'] = tx_pttools_div::htmlOutput($this->webAddress);\n \n $fePageLink = $GLOBALS['TSFE']->cObj->typolink(NULL, $typolinkConf);\n \n // use default article single view page in all other cases (including the GSA-DB field ARTIKEL.WEBADRESSE being empty)\n } else {\n \n $securityHash = md5($this->id . $this->classConfigArr['md5SecurityCheckSalt']); // hash to prevent article single view page from unwanted access\n \n $typolinkConf['additionalParams'] = $GLOBALS['TSFE']->cObj->stdWrap($typolinkConf['additionalParams'], $typolinkConf['additionalParams.']);\n $typolinkConf['additionalParams'] .= '&'.self::ARTICLESINGLEVIEW_CLASS_NAME.'[asv_id]='.intval($this->id);\n $typolinkConf['additionalParams'] .= '&'.self::ARTICLESINGLEVIEW_CLASS_NAME.'[asv_hash]='.$securityHash;\n \n // handle empty typolink parameter as exception\n try {\n $typolinkConf['parameter'] = $GLOBALS['TSFE']->cObj->stdWrap($typolinkConf['parameter'], $typolinkConf['parameter.']);\n tx_pttools_assert::isNotEmptyString($typolinkConf['parameter']);\n \n } catch (tx_pttools_exceptionAssertion $parameterExceptionObj) {\n $parameterExceptionObj->handle();\n }\n \n $fePageLink = $GLOBALS['TSFE']->cObj->typolink(NULL, $typolinkConf);\n \n }\n \n return $fePageLink;\n \n }",
"abstract public function clickLink($locator);",
"function adjacent_post_link($format, $link, $in_same_term = \\false, $excluded_terms = '', $previous = \\true, $taxonomy = 'category')\n{\n}",
"public function getMaplink();",
"function has_next_link(Response $response, &$next_url) : LINK_HEADER\n{\n // find Link Header for remained data\n $link = $response->getHeader('Link');\n\n // no more data\n if (empty($link)) {\n debug('Link header is not exist!', $link);\n\n return LINK_HEADER::NONE();\n }\n\n $ar = preg_split('/,/', $link[0]);\n\n $found = false;\n $next = null;\n\n foreach ($ar as $l) {\n // format: <https://gitlab.example.com/api/v3/projects?page=2&per_page=100>; rel=\"next\"\n //Link: <https://api.github.com/resource?page=2>; rel=\"next\",\n //<https://api.github.com/resource?page=5>; rel=\"last\"\n if (preg_match('/<(.*)>;[ \\t]*rel=\"next\"/', $l, $next) === 1) {\n $next_url = $next[1];\n\n return LINK_HEADER::HAS_NEXT();\n }\n }\n info('we reached last entity! ', $ar);\n\n return LINK_HEADER::REACH_LAST();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieve the Delivery Term An identifier that determines the vendor or customer jurisdiction in which the title transfer of a supply takes place. This is also known as Shipping Terms. Delivery Terms information could be critical to determine the place of supply, for example, in distance selling. To calculate tax when the Physical Origin is in the US and the Destination is in Canada, the deliveryTerm must be "SUP". | public function getDeliveryTerm(); | [
"public function setDeliveryTerm($deliveryTerm);",
"public function getDeliveryTerms() {\n return $this->deliveryTerms;\n }",
"public function getDeliveryTerms()\n {\n return $this->deliveryTerms;\n }",
"public function getTerm() {\n \treturn $this->getOffering()->getTerm();\n\t}",
"public function getTerm()\n {\n return $this->Term;\n }",
"public function getDeliveryCost()\n {\n $deliveryConfig = $this->scopeConfig->getValue(self::DELIVERY_COST, self::STORESCOPE);\n $deliveryCost = preg_replace(\"/[^0-9]/\", \"\", $deliveryConfig);\n $error_delivery_msg = 'Please fill correctly the delivery cost setup field';\n\n if ($deliveryCost) {\n return str_replace(',', '.', $this->scopeConfig->getValue(self::DELIVERY_COST, self::STORESCOPE));\n } else {\n return $error_delivery_msg;\n }\n }",
"public function getFormattedPaymentTerm()\n {\n $dueDuration = $this->getPaymentTerm();\n\n if ($dueDuration > 1) {\n return __('admin::app.admin.system.due-duration-days', ['due-duration' => $dueDuration]);\n }\n\n return $dueDuration\n ? __('admin::app.admin.system.due-duration-day', ['due-duration' => $dueDuration])\n : __('admin::app.admin.system.due-duration-day', ['due-duration' => 0]);\n }",
"public function getTerm() {\n \treturn $this->session->getTermLookupSession()->getTerm($this->getTermId());\n }",
"public function getTerm() {\n\t\treturn $this->term;\n\t}",
"public function getTermId() {\n\t\treturn $this->getOsidIdFromString($this->row['SSBSECT_TERM_CODE'], 'term/');\n }",
"public function getDeliveryText()\n {\n $value = $this->get(self::delivery_text);\n return $value === null ? (string)$value : $value;\n }",
"public function getTerm()\n {\n return $this->term;\n }",
"public function getSpecialDeliveryText() {\n return $this->_specialDeliveryText;\n }",
"function getPaymentTerms();",
"public function getDelivery()\n {\n $value = $this->get(self::delivery);\n return $value === null ? (double)$value : $value;\n }",
"public function getShippingSalesTaxNumber();",
"public function getDeliverySuggestionCode()\n {\n return $this->_deliverySuggestionCode;\n }",
"public function getDocumentProductQtd()\n {\n return (string) $this->document_product_qtd;\n }",
"public function getWeeeTaxDisposition();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function will save new customer reviews | public function actionSaveReview() {
if (Yii::$app->request->isAjax) {
$model_review = new \common\models\CustomerReviews();
if ($model_review->load(Yii::$app->request->post())) {
$model_review->user_id = Yii::$app->user->identity->id;
$model_review->review_date = date('Y-m-d');
$model_review->save();
echo 1;
exit;
}
}
} | [
"private function _saveCustomer() {\n }",
"public function actionAddReview() {\n\n\t\tif (Yii::$app->request->isAjax) {\n\t\t\t$model_review = new \\common\\models\\CustomerReviews();\n\t\t\tif ($model_review->load(Yii::$app->request->post())) {\n\t\t\t\t$model_review->user_id = Yii::$app->user->identity->id;\n\t\t\t\t$model_review->review_date = date('Y-m-d');\n\t\t\t\t$model_review->save();\n\t\t\t}\n\t\t}\n\t}",
"public function save(Customer $customer);",
"function save_review(){\n\n }",
"abstract protected function saveCustomerDetails();",
"public function saveReviews($reviews) {\r\n\t\tforeach ($reviews as $review) {\r\n\t\t\tif ($review[\"status\"] == 'd') {\r\n\t\t\t\t$this->removeReview($review[\"ReviewID\"], $review[\"SubmissionID\"]);\r\n\t\t\t} elseif ($review[\"status\"] == 'e') {\r\n\t\t\t\t$this->editReview($review[\"startLine\"], $review[\"startIndex\"], $review[\"ReviewID\"], $review[\"Comments\"], $review[\"SubmissionID\"], 0);\r\n\t\t\t} elseif ($review[\"status\"] == 'n') {\r\n\t\t\t\t$this->addReview($review, 0);\r\n\t\t\t} elseif ($review[\"status\"] == 'o') {\r\n\t\t\t\t$this->editReview($review[\"startLine\"], $review[\"startIndex\"], $review[\"ReviewID\"], $review[\"Comments\"], $review[\"SubmissionID\"], 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private function transfer_reviews() {\r\n\t\t$res = mysql_query(\"SELECT * FROM `reviews` WHERE 1\", $this->sql);\r\n\t\twhile ($row = mysql_fetch_array($res)) {\r\n\t\t\tif (\r\n\t\t\t\tarray_key_exists($row['restaurant_id'], $this->restaurants)\r\n\t\t\t\t&& array_key_exists($row['location_id'], $this->locations)\r\n\t\t\t) {\r\n\t\t\t\t$row = $this->toText($row);\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t'Review' => array(\r\n\t\t\t\t\t\t'coupon_code' => $row['coupon_code'],\r\n\t\t\t\t\t\t'email' => $row['email'],\r\n\t\t\t\t\t\t'first_name' => $row['first_name'],\r\n\t\t\t\t\t\t'language' => $row['language'],\r\n\t\t\t\t\t\t'last_name' => $row['last_name'],\r\n\t\t\t\t\t\t'location_id' => $this->locations[$row['location_id']],\r\n\t\t\t\t\t\t'rating' => $row['rating'],\r\n\t\t\t\t\t\t'restaurant_id' => $this->restaurants[$row['restaurant_id']],\r\n\t\t\t\t\t\t'review' => $row['review'],\r\n\t\t\t\t\t\t'review_date' => $row['review_date'],\r\n\t\t\t\t\t\t'status' => ($row['status'] == 'active') ? 'active' : 'inactive',\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t\t$this->Review->create();\r\n\t\t\t\t$this->Review->save($data, false);\r\n\t\t\t\t$this->reviews[$row['review_id']] = $this->Review->getLastInsertID();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function massSaveReviewAction()\n {\n $reviewsIds = $this->getRequest()->getParam('reviews');\n $session = Mage::getSingleton('adminhtml/session');\n\n if(!is_array($reviewsIds)) {\n $session->addError(Mage::helper('adminhtml')->__('Please select review(s).'));\n } else {\n $exportedCount = 0;\n try {\n foreach ($reviewsIds as $reviewId) {\n $review = Mage::getModel('review/review')->load($reviewId);\n if (!$review->getCustomerId()) {\n continue;\n } else {\n $model = Mage::getModel('tm_testimonials/data');\n $this->saveReview($model, $review);\n $exportedCount++;\n }\n }\n\n // clear testimonials list block cache after new item(s) was added\n Mage::app()->cleanCache(array('tm_testimonials_list'));\n\n $session->addSuccess(\n Mage::helper('testimonials')->__('Total of %d testimonial(s) have been created.', $exportedCount)\n );\n } catch (Mage_Core_Model_Exception $e) {\n $session->addError($e->getMessage());\n } catch (Mage_Core_Exception $e) {\n $session->addError($e->getMessage());\n } catch (Exception $e) {\n $session->addException($e, Mage::helper('testimonials')->__('An error occurred while exporting review(s).'));\n }\n }\n\n $this->_redirect('*/*/');\n }",
"private function addReviews()\n {\n $this->_doQuery(\n \"\n INSERT INTO \" . $this->_getTableName(\n 'catalog_product_entity_text'\n ) . \" (\n attribute_id,\n store_id,\n entity_id,\n value\n )(\n SELECT\n \" . $this->_getProductAttributeId('reviews')\n . \",\n w.website,\n a.entity_id,\n b.Reviews\n FROM \" . $this->_getTableName(\n 'catalog_product_entity'\n ) . \" a\n INNER JOIN \" . $this->_getTableName(\n 'products_temp'\n ) . \" b\n ON a.store_product_id = b.store_product_id\n INNER JOIN \" . $this->_getTableName(\n 'products_website_temp'\n ) . \" w\n ON a.store_product_id=w.store_product_id\n )\n ON DUPLICATE KEY UPDATE\n value = b.Reviews\n \"\n );\n\n // product Reviews for all web sites\n $this->_doQuery(\n \"\n INSERT INTO \" . $this->_getTableName(\n 'catalog_product_entity_text'\n ) . \" (\n attribute_id,\n store_id,\n entity_id,\n value\n )(\n SELECT\n \" . $this->_getProductAttributeId('reviews')\n . \",\n 0,\n a.entity_id,\n b.Reviews\n FROM \" . $this->_getTableName(\n 'catalog_product_entity'\n ) . \" a\n INNER JOIN \" . $this->_getTableName(\n 'products_temp'\n ) . \" b\n ON a.store_product_id = b.store_product_id\n )\n ON DUPLICATE KEY UPDATE\n value = b.Reviews\n \"\n );\n }",
"public function saveAction()\n\t{\n\t\t$this->_initCustomer();\n\n\t\t// get customer id\n\t\t$id = $this->getRequest()->getParam('customer_id');\n\n\t\t// attempt to load customer\n\t\t$model = Mage::getModel('customer/customer');\n\n\t\t$approve = true;\n\n\n\t\tif ($id = Mage::app()->getRequest()->getPost('customer_id'))\n\t\t{\n\t\t\ttry {\n\t\t\t\t$model->load($id);\n\n\t\t\t\tif (!$model->getId()) {\n\t\t\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('confirmcustomer')->__('This customer no longer exist or invalid customer id'));\n\t\t\t\t\t$approve = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\n\t\t\t\t\t$customerAlreadyApproved = $model->getData('mp_cc_is_approved') == MageParts_ConfirmCustomer_Helper_Data::STATE_APPROVED ? true : false;\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Approve disaprove customer\n\t\t\t\t\t */\n\t\t\t\t\t// approve customer\n\t\t\t\t\t$model->setMpCcIsApproved($this->getRequest()->getPost('mp_cc_is_approved'));\n\n\t\t\t\t\t// send mail to customer confirming approval if the admin is approving the customer and not only changing other data;\n\t\t\t\t\tif (!$customerAlreadyApproved && $this->getRequest()->getPost('mp_cc_is_approved') == MageParts_ConfirmCustomer_Helper_Data::STATE_APPROVED) {\n\t\t\t\t\t\t$model->sendAccountApprovalEmail($model->getStoreId());\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($this->getRequest()->getPost('mp_cc_is_approved') != MageParts_ConfirmCustomer_Helper_Data::STATE_APPROVED)\n\t\t\t\t\t{\n\t\t\t\t\t\t// add error message\n\t\t\t\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('confirmcustomer')->__('The customer has been disapproved'));\n\t\t\t\t\t\t$approve = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Sales Rep\n\t\t\t\t\t */\n\n\t\t\t\t\t//defining commission\n\t\t\t\t\tif (!$model->getCommission() && $model->getCommission() == null) {\n\t\t\t\t\t\t$fixedComissionEnabled = Mage::getStoreConfig('comissions/general/fixed_comission', $model->getStoreId());\n\t\t\t\t\t\tif ($fixedComissionEnabled && $fixedComissionEnabled == 1) {\n\t\t\t\t\t\t\t$fixedComissionValue = Mage::getStoreConfig('comissions/general/fixed_comission_value', $model->getStoreId());\n\t\t\t\t\t\t\tif ($fixedComissionValue) {\n\t\t\t\t\t\t\t\t$model->setCommission($fixedComissionValue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$siteComissionValue = Mage::getStoreConfig('comissions/general/site_comission_value', $model->getStoreId());\n\t\t\t\t\t\t\tif ($siteComissionValue) {\n\t\t\t\t\t\t\t\t$model->setCommission($siteComissionValue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$model->setFvetsSalesrep($this->getRequest()->getPost('fvets_salesrep'));\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Storeview\n\t\t\t\t\t */\n\n\t\t\t\t\t//caso a store não esteja configurada para seleção de storeviews na aprovação, sete no usuário todas as stores do website\n\t\t\t\t\t$websiteId = $model->getWebsiteId();\n\t\t\t\t\t$website = Mage::getModel('core/website')->load($websiteId);\n\t\t\t\t\t$multiStoreWebsites = Mage::getStoreConfig('confirmcustomer/general/store_select');\n\t\t\t\t\tif (!$multiStoreWebsites || !in_array($website->getCode(), explode(',', $multiStoreWebsites))) {\n\t\t\t\t\t\tif (!$customerAlreadyApproved) {\n\t\t\t\t\t\t\t$storeIds = $website->getStoreIds();\n\t\t\t\t\t\t\t$model->setStoreView(implode(',', $storeIds));\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$model->setStoreView($this->getRequest()->getPost('store_view'));\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Hive of activity\n\t\t\t\t\t */\n\n\t\t\t\t\t$model->setHiveOfActivity($this->getRequest()->getPost('hive_of_activity'));\n\n\t\t\t\t\t/**\n\t\t\t\t\t * ID ERP\n\t\t\t\t\t */\n\n\t\t\t\t\t$otherCustomer = Mage::getModel('customer/customer')\n\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t->addAttributeToSelect('id_erp')\n\t\t\t\t\t\t->addAttributeToFilter('id_erp',$this->getRequest()->getPost('id_erp'))\n\t\t\t\t\t\t->addAttributeToFilter('entity_id',array('neq' => $model->getId()))\n\t\t\t\t\t\t->addAttributeToFilter('website_id',$model->getWebsiteId())\n\t\t\t\t\t\t->load()\n\t\t\t\t\t\t->getFirstItem();\n\n\t\t\t\t\tif (!$otherCustomer->getId())\n\t\t\t\t\t{\n\t\t\t\t\t\t$model->setIdErp($this->getRequest()->getPost('id_erp'));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('confirmcustomer')->__('A user already exists with this ID ERP'));\n\t\t\t\t\t\t$approve = false;\n\t\t\t\t\t\t$model->setMpCcIsApproved(MageParts_ConfirmCustomer_Helper_Data::STATE_UNAPPROVED_DUPLICATED);\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Group ID\n\t\t\t\t\t */\n\n\t\t\t\t\t$model->setGroupId($this->getRequest()->getPost('group_id'));\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Restriction Group\n\t\t\t\t\t */\n\n\t\t\t\t\t$restriction_group = (null !== $this->getRequest()->getPost('restriction_group')) ? array_flip($this->getRequest()->getPost('restriction_group')) : array();\n\t\t\t\t\tMage::getResourceSingleton('fvets_catalogrestrictiongroup/catalogrestrictiongroup_customer')->saveCustomerRelation($model, $restriction_group);\n\n\n\t\t\t\t\t$conditions = (null !== $this->getRequest()->getPost('confirm_conditions')) ? \n\t\t\t\t\t\tarray_flip($this->getRequest()->getPost('confirm_conditions')): array();\n\n\t\t\t\t\tMage::getResourceSingleton('fvets_payment/condition_customer')\n\t\t\t\t\t\t->saveCustomerRelation($model,$conditions);\n\t\t\t\t\t\n\t\t\t\t\tif ($approve)\n\t\t\t\t\t{\n\t\t\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('confirmcustomer')->__('The customer has been approved'));\n\t\t\t\t\t}\n\n\t\t\t\t\t$model->save();\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tcatch (Exception $e){\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\n\t\t\t}\n\t\t}\n\n\t\t// redirect back to edit the customer\n\t\t$this->_redirect('*/*/approve', array('customer_id' => $id));\n\t\treturn;\n\t}",
"public function createAReview()\n {\n }",
"public function store(CreateMovieReviewsRequest $request)\n {\n $checkData['movie_id'] = $request->movie_id;\n $checkData['user_id'] = $request->user_id;\n $checkExistData = $this->movieReviewsRepository->checkExistData($checkData);\n if($checkExistData==0){\n $input = $request->all();\n $movieReviews = $this->movieReviewsRepository->create($input);\n Flash::success('Movie Reviews saved successfully.');\n return redirect(route('movieReviews.index'));\n }else{\n Flash::error('Movie Review already exist.');\n return redirect()->back();\n } \n }",
"public function SaveCustomerInfo(){\r\n\r\n\t\t$order_id=$this->CustomerOrder();\r\n\t\t$this->getCustomerOrderCreditCard($order_id);\r\n\t\t$this->SaveNewsLetter();\r\n\r\n\t}",
"public function insertColumnIntoReviews() {\n $query = \"INSERT INTO `reviews` (\n `rev_usr_name`,\n `rev_estimate`,\n `rev_comment`,\n `product_id`,\n `rev_date`\n )\n VALUES (\n :rev_usr_name,\n :rev_estimate,\n :rev_comment,\n :product_id,\n NOW()\n )\";\n\n $args = [\n 'rev_usr_name' => $_POST['rev_usr_name'],\n 'rev_estimate' => $_POST['rev_estimate'],\n 'rev_comment' => $_POST['rev_comment'],\n 'product_id' => intval($_POST['product_id']),\n ];\n\n (new DB)::sql($query, $args);\n\n // update product reviews\n $sql = \"SELECT COUNT(*) cnt FROM `reviews` WHERE product_id=\" . intval($_POST['product_id']);\n $cnt = (new DB)::getValue($sql);\n $sql = \"UPDATE `product` SET `product_review` = \". $cnt .\" WHERE id =\" . intval($_POST['product_id']);\n (new DB)::sql($sql);\n }",
"public function store(CreateClothesReviewRequest $request)\n {\n $input = $request->all();\n $customFields = $this->customFieldRepository->findByField('custom_field_model', $this->clothesReviewRepository->model());\n try {\n $clothesReview = $this->clothesReviewRepository->create($input);\n $clothesReview->customFieldsValues()->createMany(getCustomFieldsValues($customFields, $request));\n\n } catch (ValidatorException $e) {\n Flash::error($e->getMessage());\n }\n\n Flash::success(__('lang.saved_successfully', ['operator' => __('lang.clothes_review')]));\n\n return redirect(route('clothesReviews.index'));\n }",
"function add_review($name, $city, $address, $review, $user, $rating) {\n\t\t$conn = get_db_conn();\n\t\tmysql_query(\"INSERT INTO reviews VALUES(NULL, '\".$name.\"', '\".$city.\"','\".$address.\"','\".$review.\"','\".$user.\"','\".$rating.\"', NOW())\", $conn);\n\t\t//add into club names\n\t\tmysql_query(\"INSERT INTO clubs VALUES(NULL, '\".$name.\"', '\".$city.\"')\", $conn);\n\t}",
"public function newCustomer() {\n\n $customer = new Customer();\n\n if ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n\n $validation = new Validation();\n $validation->required_field('name', \"Name is required.\");\n $validation->required_field('phone', \"Phone is required.\");\n $validation->required_field('address', \"Address is required.\");\n\n //validate the data\n $errors = $validation->run($_POST);\n\n if (count($errors) == 0) {\n $customer->setName($_POST['name']);\n $customer->setPhone($_POST['phone']);\n $customer->setAddress($_POST['address']);\n\n $customer = $this->customer_model->save($customer);\n\n $this->showCustomers();\n\n } else {\n include(\"view/header.php\");\n include(\"view/customer_new.php\");\n include(\"view/footer.php\");\n }\n } else {\n include(\"view/header.php\");\n include(\"view/customer_new.php\");\n include(\"view/footer.php\");\n }\n }",
"function AddShopReview($conn){\n\t\t\n\t\t$customer_id = $_REQUEST['customer_id'];\n\t\t$shop_id = $_REQUEST['shop_id'];\n\t\t$rating = $_REQUEST['rating'];\n\t\t$review = $_REQUEST['review'];\n\t\t\n\t\tif($customer_id!='' && $shop_id!='' && $rating!='' && $review!=''){\n\t\t\t\n\t\t\t$checkExit = $conn->query(\"SELECT * FROM gosaloon_review WHERE shop_id='\".$shop_id.\"' AND customer_id='\".$customer_id.\"'\");\n\t\t\tif($checkExit->num_rows > 0){\n\t\t\t\t\n\t\t\t $data['status']=\"3\"; \n\t\t $data['message']=\"You Have Already Submitted Your Review !!\"; \n\t\t echo json_encode($data);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t\n\t\t\t $InsertReview = $conn->query(\"INSERT INTO gosaloon_review SET shop_id='$shop_id',customer_id='$customer_id',rating='$rating',review='$review',status='1',created_on=Now()\");\n\t\t\t if($InsertReview){\n\t\t\t\t \n\t\t\t\t $data['status']=\"1\"; \n\t\t $data['message']=\"Added Successfully\"; \n\t\t echo json_encode($data);\n\t\t\t\t \n\t\t\t }else{\n\t\t\t\t \n\t\t\t\t $data['status']=\"0\"; \n\t\t $data['message']=\"Something Went Wrong.Please try Again !!\";\n\t\t echo json_encode($data);\n\t\t\t\t \n\t\t\t }\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\t $data['status']=\"2\"; \n\t\t $data['message']=\"Please Check Some Field Are Blank !!\"; \n\t\t echo json_encode($data);\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}",
"public function saveCustomerComment()\n {\n\t$comment = Mage::app()->getRequest()->getParam('comment', null);\n\tif($comment && strlen(trim($comment))) {\n\t $this->_checkoutSession->setData('customer_comment', $comment);\n\t} else {\n\t $this->_checkoutSession->unsetData('customer_comment');\n\t}\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Name: get_tempalte_id Description: Get the ID of the email template used to create the message. This will be assigned as the 'post_parent' ID. | public function get_tempalte_id(){
$template = get_page_by_path( $this->tempalte_slug, OBJECT, 'nnnoticetemplate' );
return ( $template )? $template->ID : 0 ;
} | [
"public function get_template_id() \n {\n return $this->template_id;\n }",
"public function getTemplateId()\n {\n return $this->template_id;\n }",
"function getTemplateRefId()\n\t{\n\t\treturn $this->tref_id;\n\t}",
"public function getTemplateId()\n\t{\n\t\treturn $this->templateId;\n\t}",
"public function getTemplateId()\n {\n return $this->templateId;\n }",
"public function getId()\n {\n return $this->getTemplateId();\n }",
"function get_template_id($template_name) {\r\n\t\tglobal $wpdb;\r\n\t\t\r\n\t\tstatic $templates = array();\r\n\t\tif (!isset($templates[$template_name])) {\r\n\t\t\t$templates[$template_name] = $wpdb->get_var(\"SELECT ID FROM {$wpdb->posts} WHERE post_type='view-template' AND post_name='{$template_name}'\");\r\n\t\t}\r\n\t\tif (!isset($templates[$template_name])) {\r\n\t\t\t$templates[$template_name] = $wpdb->get_var(\"SELECT ID FROM {$wpdb->posts} WHERE post_type='view-template' AND post_title='{$template_name}'\");\r\n\t\t}\r\n\t\t\r\n\t\treturn $templates[$template_name]; \r\n\t}",
"public function getTemplateIdentifier()\n {\n return $this->innerView->getTemplateIdentifier();\n }",
"function zn_get_post_id( $post_title = 'zn_pb_templates' ) {\n\t\t// GET THE POST THAT CONTAINS ALL THE TEMPLATES\n\t\t$zn_pb_template_post = get_page_by_title( $post_title , 'ARRAY_A' , 'zn_pb_templates' );\n\n\t\tif(!isset($zn_pb_template_post['ID']) )\n\t\t{\n\n\t\t\t$post = array(\n\t\t\t\t'post_type' => 'zn_pb_templates',\n\t\t\t\t'comment_status' => 'closed',\n\t\t\t\t'ping_status' => 'closed',\n\t\t\t\t'post_content' => '',\n\t\t\t\t'post_title' => $post_title\n\t\t\t\t);\n\n\t\t\t$post_id = wp_insert_post( $post );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$post_id = $zn_pb_template_post['ID'];\n\t\t}\n\n\t\treturn $post_id;\n\t}",
"public function getParentTemplateId()\n {\n if (array_key_exists(\"parentTemplateId\", $this->_propDict)) {\n return $this->_propDict[\"parentTemplateId\"];\n } else {\n return null;\n }\n }",
"public static function get_active_template_id() {\n\t\t$template = self::get_active_template();\n\n\t\tif ( $template ) {\n\t\t\treturn $template->id;\n\t\t}\n\n\t\treturn self::get_default_template_id();\n\t}",
"public function getGuestTemplateId()\n {\n return $this->getTemplateId();\n }",
"protected function getHandbookTemplateID() {\nglobal $_LW;\nstatic $tid;\nif (!empty($tid)) {\n\treturn $tid;\n};\nif (!empty($_LW->REGISTERED_APPS['handbook']['custom']['handbook_tid'])) {\n\t$tid=$_LW->REGISTERED_APPS['handbook']['custom']['handbook_tid'];\n\treturn $tid;\n};\nif (!empty($_LW->REGISTERED_APPS['handbook']['custom']['handbook_path'])) {\n\tif ($page_id=$_LW->dbo->query('select', 'id', 'livewhale_pages', 'host='.$_LW->escape($_LW->CONFIG['HTTP_HOST']).' AND path='.$_LW->escape($_LW->REGISTERED_APPS['handbook']['custom']['handbook_path']))->firstRow('id')->run()) {\n\t\t$tid=$page_id;\n\t\treturn $tid;\n\t};\n};\nreturn false;\n}",
"public function getSubjectTemplateID() {\n\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\t\t\t$query = \"SELECT template_id FROM webmatrix_page_template WHERE basename = '\".$this->subject_tpl.\"'\"; // Get template ID\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$this->subject_tpl_id = $sql->Record['template_id'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t}",
"public final function get_page_id() {\n\t\treturn self::_get_page_id( $this->get_template() );\n\t}",
"public function get_id(){\n\t\treturn $this->wp_post_obj->ID;\n\t}",
"public function parent_post_id() {\n\t\treturn $this->meta( 'wprm_parent_post_id', 0 );\n\t}",
"function get_email_template( $template_name ) {\n\t$query_args = array(\n\t\t'post_type' => EMAIL_POST_TYPE,\n\t\t'orderby' => 'date',\n\t\t'order' => 'DESC',\n\t\t'numberposts' => 1,\n\t\t'meta_key' => 'wpf-stripe_email-template-name',\n\t\t'meta_value' => $template_name,\n\t);\n\n\t$result = get_posts( $query_args );\n\n\tif ( empty( $result ) ) {\n\t\treturn false;\n\t}\n\n\t$current_template = array_shift( $result );\n\n\treturn $current_template;\n}",
"public function getTemplate()\n {\n return $this->repeatParent;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load a specific locale using a locale code. | public static function loadLocale($locale_code) {
$all_locales = self::loadAllLocales();
$locale = idx($all_locales, $locale_code);
if (!$locale) {
throw new Exception(
pht(
'There is no locale with the locale code "%s".',
$locale_code));
}
return $locale;
} | [
"public function load($code = null, $path = null)\n {\n if (!$code) {\n $code = $this->default['code'];\n }\n \n if (!$path) {\n $path = $this->default['path'];\n }\n\n $file = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $code . '.php';\n\n // can we find the file?\n if (file_exists($file)) {\n // put the locale values into the shared locale array\n $this->trans[$code] = (array) include $file;\n } else {\n // could not find file.\n die(\"locale file: $file not found\");\n }\n }",
"public function load($locale, $filename);",
"public function getLocale($code);",
"private function loadLocale()\n {\n if (! isset($_SESSION['locale'])) {\n $_SESSION['locale'] = Config::get('app.locale');\n }\n\n $this->_locale = $_SESSION['locale'];\n }",
"function useLanguage($code)\n{\n\tglobal $lang, $default_lang;\n\n\tif (strlen($code) != 2)\n\t{\n\t\t$lang = $default_lang;\n\t\treturn;\n\t}\n\n\t$lang = loadLanguage($code);\n}",
"abstract public function getLocaleCode();",
"abstract public function getLocaleFromPath($path);",
"public static function getPrimaryLanguage($locale){}",
"abstract protected function readTranslations($localeCode);",
"private function load(string $lang) {}",
"public function getTranslation($localeCode, $key);",
"function setLocale($locale_code)\n\t{\n\t\t$this->locale_code = $locale_code;\n\t}",
"public static function load ( $lang = \"en-US\" ) {\n\n\t\tif ( empty ( static::$_messages ) ) {\n\t\t\t$locale = @file_get_contents( __DIR__ . DIRECTORY_SEPARATOR . $lang . DIRECTORY_SEPARATOR . $lang . '.json' );\n\n\t\t\tstatic::$_locale = !empty($locale) ? json_decode($locale, true) : static::$_locale;\n\t\t\tstatic::$_domain = static::$_locale['domain'];\n\t\t\tstatic::$_messages = static::$_locale['locale_data'][static::$_domain];\n\n\t\t\tunset (static::$_messages['']);\n\t\t}\n\n\t\treturn static::$_locale;\n\t}",
"public static function lookup(string $locale)\n {\n self::initialize();\n return Arr::get(self::$directory, $locale);\n }",
"function switch_to_locale($locale)\n{\n}",
"public function getLocaleFromPath($path)\n {\n //\n }",
"function loadLocale($localeKey) {\r\n\r\n\t\t$trace = $this->log->getLog('isTraceEnabled');\r\n\t\t$debug = $this->log->getLog('isDebugEnabled');\r\n\r\n\t\tif($trace) {\r\n\t\t\t$this->log->trace( 'Start: PropertyMessageResources->loadLocale('\r\n\t\t\t\t\t\t\t\t\t\t. $localeKey .')' . '[' . __LINE__ . ']' );\r\n\t\t}\r\n\t\tif($debug) {\r\n\t\t\t$this->log->debug(' LocaleKey = \"' . $localeKey . '\" [' . __LINE__ . ']');\r\n\t\t}\r\n\r\n\r\n\t\t// Have we already attempted to load messages for this locale?\r\n\t\tif( array_key_exists($localeKey, $this->locales) )\r\n\t\t\treturn;\r\n\r\n\t\t$this->locales[$localeKey] = $localeKey;\r\n\r\n\t\t// Set up to load the property resource for this locale key, if we can\r\n\t\t// PROVISIONAL CHANGE\r\n\t\t// Note: \r\n\t\t// If the property file path contains any slash characters, we assume this \r\n\t\t// is a fully qualified domain name path and leave the path as-is.\r\n\t\t// Eg: './phpmvc.com\\MyAppResources'\r\n\t\t// If the property file path does not contains any slash characters, we \r\n\t\t// assume this is a Java/Struts type domain name scheme and replace all\r\n\t\t// '.' characters with '/' characters.\r\n\t\t// Eg: 'com.phpmvc.MyAppResources'\r\n\t\tif( (strpos($this->config, '/')) || (strpos($this->config, '\\\\')) ) {\r\n\t\t\t// No transformation of '.' with '/'\r\n\t\t\t$name = $this->config;\r\n\t\t} else {\r\n\t\t\t// Transformation of '.' with '/'\r\n\t\t\t$name = str_replace('.', '/', $this->config); // String\r\n\t\t}\r\n\r\n\t\tif(strlen($localeKey) > 0)\r\n\t\t\t$name .= '_' . $localeKey;\r\n\t\t$name .= '.properties'; // 'actions/LocalStrings_en_AU_QL.properties'\r\n\r\n\t\tif($debug) {\r\n\t\t\t$this->log->debug(' Loading the property resource \"' . \r\n\t\t\t\t\t\t\t\t\t\t$name . '\" [' . __LINE__ . ']');\r\n\t\t}\r\n\r\n\t\t// Load the specified property resource\r\n\t\t$fp = '';\r\n\t\t$fp = @fopen($name, 'r', 1); // using the include_path string variable\r\n\t\tif($fp) {\r\n\t\t\t$delimChar\t= '=';\r\n\t\t\t$maxLineLen\t= 1000;\r\n\t\t\t$messages\t= NULL; // array()\r\n\r\n\t\t\twhile( !feof($fp) ) {\r\n\t\t\t\t$lineCSV = fgetcsv($fp, $maxLineLen, $delimChar);\r\n\t\t\t\tif(trim($lineCSV[0]) == '')\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t// Ignore comment lines\r\n\t\t\t\t// Patch by Michael (mschmitz) - 15-July-2004\r\n\t\t\t\tif (preg_match(\"/^\\S*[#!]/\", $lineCSV[0])) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$msgKey = $lineCSV[0];\r\n\t\t\t\t$localeMsgKey = $this->messageKey($localeKey, $msgKey);\r\n\r\n\t\t\t\t// ['en_AU_QL.hello_world'] = ['Hello Cruel World']\r\n\t\t\t\t$this->messages[$localeMsgKey] = $lineCSV[1];\r\n\t\t\t}\r\n\r\n\t\t\tfclose($fp);\r\n\t\t}\r\n\t}",
"public function switch_to_locale($locale)\n {\n }",
"function locale_get_primary_language($locale){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the incoming entry is a query. | public function isQuery()
{
return $this->type === EntryType::QUERY;
} | [
"public function hasQueryType()\n {\n return $this->query_type !== null;\n }",
"private function isIntrospectionQueryRequest()\n {\n return request() && preg_match(\n '/\\s*__(type|schema|typekind|field|directive|directivelocation|inputvalue|enumvalue)\\s*(\\(|\\{)/i',\n request()->__toString()\n );\n }",
"public function hasQuery();",
"public static function supportsQuery($query): bool;",
"protected function isQueryTypeDirective() : bool\n {\n /** @var GraphQLParserModuleConfiguration */\n $moduleConfiguration = App::getModule(GraphQLParserModule::class)->getConfiguration();\n $directiveKind = $this->getDirectiveKind();\n return $directiveKind === DirectiveKinds::QUERY || $directiveKind === DirectiveKinds::SCHEMA && App::getState('edit-schema') || $directiveKind === DirectiveKinds::INDEXING && $moduleConfiguration->enableComposableDirectives();\n }",
"protected function entryType()\n {\n return EntryType::QUERY;\n }",
"public function is_main_query()\n {\n }",
"public function is_query_exact() {\n\t\treturn $this->flag_query === self::QUERY_EXACT;\n\t}",
"abstract public function supportsQuerying();",
"public function hasQuery() : bool\n {\n return isset($this->query);\n }",
"public function isGraphQuery();",
"protected function isReadQuery() {\n $pattern = '/^\\s*(SELECT|SHOW|DESCRIBE)\\b/i';\n return $this->checkQueryByPattern($pattern);\n }",
"public function getIsMainQuery(): bool\n {\n return $this->isMainQuery;\n }",
"function is_query() {\n\tif( isset($_SERVER['QUERY_STRING']) ) \n\t\treturn $_SERVER['QUERY_STRING'];\n}",
"protected function has_query_var(): bool {\n\t\t\tglobal $wp_query;\n\n\t\t\t// @formatter:off\n\t\t\treturn (\n\t\t\t\tparent::has_query_var() || // parent::has_query_var() && is_singular() ||\n\t\t\t\t(\n\t\t\t\t\t\\is_singular() &&\n\t\t\t\t\tisset( $wp_query->query_vars[ $this->taxonomy ] ) &&\n\t\t\t\t\tisset( $wp_query->query_vars['post_type'] ) &&\n\t\t\t\t\t$this->post_type === $wp_query->query_vars['post_type']\n\t\t\t\t) ||\n\t\t\t\t(\n\t\t\t\t\tisset( $wp_query->query_vars[ $this->post_type ] ) &&\n\t\t\t\t\t'' !== $wp_query->query_vars[ $this->post_type ]\n\t\t\t\t) ||\n\t\t\t\t\\is_post_type_archive( $this->post_type )\n\t\t\t);\n\t\t\t// @formatter:on\n\t\t}",
"public function isGraphQuery()\n {\n return true;\n }",
"public function hasQuery(string $name): bool\n {\n return array_key_exists($name, $this->queries);\n }",
"public function hasQueryString()\n\t{\n\t\treturn !empty($this->_fragments['query']);\n\t}",
"private function hasQueryPermission($query)\n\t{\n\t\tif( $this->type == self::CONNECTION_TYPE_WRITE )\n\t\t\treturn true;\n\n\t\tif( preg_match(\"/(INSERT|UPDATE|DELETE) (.*)/i\", $query) ||\n\t\t\tpreg_match(\"/(?:CREATE|DROP|ALTER|CACHE) (.*)(?:FUNCTION|TABLE|VIEW|EVENT|TRIGGER|INDEX|SERVER|USER|DATABASE|TABLESPACE|PROCEDURE) /i\", $query) )\n\t\t\treturn false;\n\n\t\treturn true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a thumbnail from the given photo. | public static function createFromPhoto(?Photo $photo): ?Thumb
{
$thumb = $photo?->size_variants->getThumb();
if ($thumb === null) {
return null;
}
$thumb2x = $photo->size_variants->getThumb2x();
return new self(
$photo->id,
$photo->type,
$thumb->url,
$thumb2x?->url
);
} | [
"protected function create_thumbnail()\n\t{\n\t\tif ($this->file_data['thumbnail'])\n\t\t{\n\t\t\t$source = $this->file->get('destination_file');\n\t\t\t$destination = $this->file->get('destination_path') . '/thumb_' . $this->file->get('realname');\n\n\t\t\tif (!create_thumbnail($source, $destination, $this->file->get('mimetype')))\n\t\t\t{\n\t\t\t\t$this->file_data['thumbnail'] = 0;\n\t\t\t}\n\t\t}\n\t}",
"public function makeThumbnail()\n {\n Image::make($this->image_path)\n ->fit(360, 270)\n ->save($this->thumbnail_path);\n }",
"function makeThumbnail($photo, $newwidth, $newheight)\r\n{\r\n if ($photo['type'] && $photo['tmp_name']) {\r\n $mime = $photo['type'];\r\n $file = $photo['tmp_name'];\r\n $temp = imagecreatetruecolor($newwidth, $newheight); // temp GD image object\r\n list ($oldwidth, $oldheight) = getimagesize($file); // get current width & height\r\n\r\n ob_start(); // start object buffer to capture image data\r\n\r\n switch ($mime) {\r\n case 'image/jpg':\r\n case 'image/jpeg':\r\n\r\n $image = imagecreatefromjpeg($file); // create GD image from input file\r\n imagecopyresampled($temp, $image, 0, 0, 0, 0, $newwidth, $newheight, $oldwidth, $oldheight); // resize image and save to $temp object\r\n imagejpeg($temp); // output image\r\n break;\r\n\r\n case 'image/png':\r\n\r\n $image = imagecreatefrompng($file); // create GD image from input file\r\n imagecopyresampled($temp, $image, 0, 0, 0, 0, $newwidth, $newheight, $oldwidth, $oldheight); // resize image and save to $temp object\r\n imagepng($temp); // output image\r\n break;\r\n\r\n default:\r\n throw new Exception(\"File Type not supported\");\r\n //break;\r\n }\r\n\r\n $thumbnailData = ob_get_contents(); // send object buffer/image data to variable\r\n ob_end_clean(); // close object buffer\r\n\r\n return $thumbnailData;\r\n } else {\r\n return false;\r\n }\r\n}",
"public function createThumbnail()\n\t{\n\t\treturn $this->resize($this->thumbnailWidth, $this->thumbnailHeight);\n\t}",
"public function makeThumbnail()\n {\n Image::make($this->path)\n ->fit($this->thumbnail_height, $this->thumbnail_width, function ($constraint) {\n $constraint->upsize();\n })->save($this->thumbnail_path);\n }",
"public function makeThumbnail() {\n Image::make($this->filePath())->fit(200)->save($this->thumbnailPath());\n }",
"public function buildThumbnail();",
"function create_thumbnail($original_file, $filename){\r\n // figure dimensions\r\n list($width, $height) = getimagesize($original_file);\r\n if($width > $height){\r\n $small = $height;\r\n } else{\r\n $small = $width;\r\n }\r\n $src_w = $src_h = $small;\r\n $src_x = ($width - $src_w) / 2;\r\n $src_y = ($height - $src_h) / 2;\r\n\r\n // resize image\r\n $src_image = imagecreatefromjpeg($original_file);\r\n $dst = imagecreatetruecolor(300, 300);\r\n imagecopyresampled($dst, $src_image, 0, 0, $src_x, $src_y, 300, 300, $src_w, $src_h);\r\n\r\n // save thumbnail in 'img/tn/' directory\r\n $thumbnail_path = 'img/tn/' . $filename;\r\n $check = imagejpeg($dst, $thumbnail_path);\r\n if($check){\r\n $msg = 'Thumbnail was created and saved';\r\n } else {\r\n $msg = 'Thumbnail could not be created';\r\n }\r\n // free up memory\r\n imagedestroy($dst);\r\n\r\n return $msg;\r\n}",
"abstract protected function createThumbnail(Image $image, $thumbnailWidth, $thumbnailHeight);",
"private function makeThumbnail($filename){\n \n //von dem Bild wird eine image Resource erzeugt\n $image = imagecreatefromjpeg(IMG_DIR.$filename); \n \n //Breite und Hoehe des Bildes werden abgefragt\n $w = imagesx($image); \n $h = imagesy($image);\n \n // eine neue Breite wird festgelegt\n $new_w = 250; \n // anhand der bekannten Masse und der festgelegten neuen Breite wird die neue Hoehe berechnet\n $new_h = floor( $h * ($new_w / $w) ); \n // es wird ein neues Bild mit neuer Hoehe und Breite erstellt, dass noch leer ist\n $tmpImg = imagecreatetruecolor($new_w, $new_h); \n $dst_image = IMG_DIR.\"tn_\".$filename;\n // das Bild wird mit der neuen Groesse erstellt\n $r = imagecopyresized($tmpImg, $image, 0, 0, 0, 0, $new_w, $new_h, $w, $h); \n // Das Bild wird als jpeg gespeichert\n $r = imagejpeg($tmpImg, $dst_image); \n \n}",
"protected function buildThumbnailForUploadedImage()\n {\n $this->image->makeThumbnail($this->getDestinationDirectory(), $this->getImageFilename(), 'thumb_'); \n }",
"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 }",
"protected function makeThumbnail() {\n //dd('error test');\n Image::make($this->path)\n ->fit(200)\n ->save($this->thumbnail_path);\n }",
"function update_thumbnail($content) {\n global $CFG;\n\n require_once($CFG->libdir . '/gdlib.php');\n\n $datalocation = $CFG->dataroot .'/'.$this->data->course.'/'.$CFG->moddata.'/data/'.\n $this->data->id.'/'.$this->field->id.'/'.$content->recordid;\n $originalfile = $datalocation.'/'.$content->content;\n if (!file_exists($originalfile)) {\n return;\n }\n if (!file_exists($datalocation.'/thumb')) {\n mkdir($datalocation.'/thumb', 0777);\n }\n $thumbnaillocation = $datalocation.'/thumb/'.$content->content;\n $imageinfo = GetImageSize($originalfile);\n $image->width = $imageinfo[0];\n $image->height = $imageinfo[1];\n $image->type = $imageinfo[2];\n\n if (!$image->width || !$image->height) { // Should not happen\n return;\n }\n\n switch ($image->type) {\n case 1:\n if (function_exists('ImageCreateFromGIF')) {\n $im = ImageCreateFromGIF($originalfile);\n } else {\n return;\n }\n break;\n case 2:\n if (function_exists('ImageCreateFromJPEG')) {\n $im = ImageCreateFromJPEG($originalfile);\n } else {\n return;\n }\n break;\n case 3:\n if (function_exists('ImageCreateFromPNG')) {\n $im = ImageCreateFromPNG($originalfile);\n } else {\n return;\n }\n break;\n }\n\n // fix for MDL-7270\n $thumbwidth = isset($this->field->param4)?$this->field->param4:'';\n $thumbheight = isset($this->field->param5)?$this->field->param5:'';\n\n if ($thumbwidth || $thumbheight) { // Only if either width OR height specified do we want a thumbnail\n\n $wcrop = $image->width;\n $hcrop = $image->height;\n\n if ($thumbwidth && !$thumbheight) {\n $thumbheight = $image->height * $thumbwidth / $image->width;\n } else if($thumbheight && !$thumbwidth) {\n $thumbwidth = $image->width * $thumbheight / $image->height;\n } else { // BOTH are set - may need to crop if aspect ratio differs\n $hratio = $image->height / $thumbheight;\n $wratio = $image->width / $thumbwidth;\n if ($wratio > $hratio) { // Crop the width\n $wcrop = intval($thumbwidth * $hratio);\n } elseif($hratio > $wratio) { // Crop the height\n $hcrop = intval($thumbheight * $wratio);\n }\n }\n\n // At this point both $thumbwidth and $thumbheight are set, and $wcrop and $hcrop\n if (function_exists('ImageCreateTrueColor') and $CFG->gdversion >= 2) {\n $im1 = ImageCreateTrueColor($thumbwidth,$thumbheight);\n } else {\n $im1 = ImageCreate($thumbwidth,$thumbheight);\n }\n \n // Prevent alpha blending for PNG images\n if ($image->type == 3) {\n imagealphablending($im1, false);\n }\n \n $cx = $image->width / 2;\n $cy = $image->height / 2;\n\n // These \"half\" measurements use the \"crop\" values rather than the actual dimensions\n $halfwidth = floor($wcrop * 0.5);\n $halfheight = floor($hcrop * 0.5);\n\n ImageCopyBicubic($im1, $im, 0, 0, $cx-$halfwidth, $cy-$halfheight,\n $thumbwidth, $thumbheight, $halfwidth*2, $halfheight*2);\n \n // Save alpha transparency for PNG images\n if ($image->type == 3) {\n imagesavealpha($im1, true);\n }\n \n if (function_exists('ImageJpeg') && $image->type != 3) {\n @touch($thumbnaillocation); // Helps in Safe mode\n if (ImageJpeg($im1, $thumbnaillocation, 90)) {\n @chmod($thumbnaillocation, 0666);\n }\n } elseif (function_exists('ImagePng') && $image->type == 3) {\n @touch($thumbnaillocation); // Helps in Safe mode\n if (ImagePng($im1, $thumbnaillocation, 9)) {\n @chmod($thumbnaillocation, 0666);\n } \n }\n\n } else { // Try and remove the thumbnail - we don't want thumbnailing active\n @unlink($thumbnaillocation);\n }\n }",
"private function makeThumbnail() {\n\t\t\t$thumb = \"/tmp/\" . $this->uuid . \".jpg\";\n\t\t\t$command = exec($this->ffmpeg . ' -i ' . \"\\\"/tmp/$this->name\\\"\" . ' -ss 5 -y -f mjpeg -s 240x135 -vframes 1 ' . $thumb .' 2>&1', $output, $return);\n\n\t\t\tif ($return) {\n\t\t\t\theader(\"Location:http://www.videovortex.stream/php/error.php/11\");\n\t\t\t\tdie();\n\t\t\t}\n\t\t}",
"public function createImageFromProfile()\n {\n $this->assertSame($this->image, $this->imageCache->get('test', $this->image));\n $this->assertEquals('jpg', $this->image->getExtension());\n /** @var Image $image */\n $image = $this->imageCache->get('thumb', $this->image);\n $this->assertEquals('jpg', $image->getExtension());\n $this->assertEquals('image/png', $image->getContentType());\n $box = $image->getResourceImage()->getSize();\n $this->assertEquals(32, $box->getHeight());\n $this->assertEquals(32, $box->getWidth());\n $this->codeGuy->seeFileFound('portrait.png', dirname(__DIR__).'/_data/thumb');\n $this->codeGuy->deleteDir(dirname(__DIR__).'/_data/thumb');\n }",
"public static function Thumb_avatar(){\n\t\t$num_aleatorio = mt_rand(0,99999999999);//Numeracion aleatoria\n\t\t\t$temp_foto = $_FILES['foto']['tmp_name'];//Nombre temporal para el servidor\n\t\t\t$nom_foto = $_FILES['foto']['name']; //Nombre original de la imagen \n\t\t\t$nom_foto = trim($_FILES['foto']['name']);//nombre de la imagen quitando espacios u otro tipo de caracteres\n\t\t\t$nom_foto = str_replace(\" \",\"\",$nom_foto);//Esto remplaza los espacios en blanco y los unira\n\t\t\t$nom_foto = $num_aleatorio.'_'.$nom_foto;//Union de numero aleatorio con foto \n\t\t\t$nom_foto = \"img/\". $nom_foto;//Nombre foto unido con la ruta.. Nombre de la carpeta \"img/\"\n\t\t\t$type = $_FILES['foto']['type'];;//Para ver que extencion tiene \n\t\t\t$size = $_FILES['foto']['size'];//El tamaño de la imagen ej: 300kb = 300,000 \n\t\t\tmove_uploaded_file($temp_foto, $nom_foto);//Subimos nuetras imagen a la carpeta\n\t\t\t\n\t\t\t//Revisamos la extension de la imagen y la convertimos\n\t\t\t if($type == \"image/jpeg\" || $type == \"image/jpg\") {\n\t\t $img = imagecreatefromjpeg ($nom_foto);\n\t\t } else if ($type == \"image/gif\") {\n\t\t $img = imagecreatefromgif ($nom_foto);\n\t\t } else if ($type == \"image/png\") {\n\t\t $img = imagecreatefrompng ($nom_foto);\n\t\t }else{\n\t\t \techo \"No puede este formato\";\n\t\t \texit();\n\t\t }\n\t\t \t$wx = imagesx($img); //Ancho original de la imagen siglas width_x\n\t\t\t $hy = imagesy($img); //Altura Original de la imagen sigla height_y \n\t\t\t $nx = 100; //Tamaño que queremos que tenga la imagen\n\t\t\t $ny = floor($hy * ($nx / $wx)); //Formula para una altura proporcionar \n\t\t\t $nm = imagecreatetruecolor($nx, $ny); //Funcion crea una imagen negra con el tamaño dado\n\t\t\t \timagecopyresized($nm, $img, 0,0,0,0,$nx,$ny,$wx,$hy); //Funcion larga hay que explicar mucho simplemente mande asi \n\t\t\t imagejpeg($nm, $nom_foto);//Exporta la imagen a la carpeta\n\n\t}",
"public function makePhoto(){\n\n\t\treturn new Photo([\n\t\t\t\t'name'=>$this->makeFileName()\n\t\t\t]);\n\t}",
"function make_thumbnail_im($thumbname, $image)\n {\n global $smfgSettings;\n \n // Must come back and add auto paths here\n $imconvert = $smfgSettings['im_convert'];\n\n exec($imconvert.' -quality 70 -geometry '.$smfgSettings['thumbnail_resolution'].' '.$image.' '.$thumbname);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the equivalent taxonomy in the specified language. | function bbl_get_taxonomy_in_lang( $taxonomy, $lang_code = null ) {
global $bbl_taxonomies;
return $bbl_taxonomies->get_taxonomy_in_lang( $taxonomy, $lang_code );
} | [
"function custom_taxonomy() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Languages', 'Taxonomy General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'Language', 'Taxonomy Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Language', 'text_domain' ),\n\t\t'all_items' => __( 'All Languages', 'text_domain' ),\n\t\t'parent_item' => __( 'Parent Language', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Language:', 'text_domain' ),\n\t\t'new_item_name' => __( 'New Language Name', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New Language', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Language', 'text_domain' ),\n\t\t'update_item' => __( 'Update Language', 'text_domain' ),\n\t\t'separate_items_with_commas' => __( 'Separate languages with commas', 'text_domain' ),\n\t\t'search_items' => __( 'Search languages', 'text_domain' ),\n\t\t'add_or_remove_items' => __( 'Add or remove languages', 'text_domain' ),\n\t\t'choose_from_most_used' => __( 'Choose from the most used languages', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'hierarchical' => true,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_tagcloud' => false,\n\t);\n\tregister_taxonomy( 'language', 'post', $args );\n\n}",
"private static function _create_relevant_term( $name, $taxonomy, $language ) {\r\n\t\tglobal $polylang;\r\n\r\n\t\t// save_language() does a check_admin_referer() security test\r\n\t\t$_REQUEST['_pll_nonce'] = wp_create_nonce( 'pll_language' );\r\n\t\t$_POST['term_lang_choice'] = $language;\r\n\t\t$_POST['action'] = 'mla';\r\n\t\t$res = wp_insert_term( $name, $taxonomy, array( 'parent' => 0 ) );\r\n\r\n\t\tif ( ( ! is_wp_error( $res ) ) && isset( $res['term_id'] ) ) {\r\n\t\t\tif ( self::$polylang_1dot8_plus ) {\r\n\t\t\t\tPLL()->model->term->set_language( $res['term_id'], $language );\r\n\t\t\t} else {\r\n\t\t\t\t$polylang->model->set_term_language( $res['term_id'], $language );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tunset( $_POST['term_lang_choice'] );\r\n\t\tunset( $_POST['action'] );\r\n\r\n\t\t// Reload the term with all of its new translations\r\n\t\treturn self::_get_relevant_term( 'name', $name, $taxonomy );\r\n\t}",
"function lr_get_post_language($id) {\n\n\t$terms = wp_get_object_terms($id, 'language');\n\t$term = array_shift($terms);\n\n\treturn $term->slug;\n}",
"public function taxonomy() {\n $this->taxonomy = $this->taxonomy ? $this->taxonomy : get_taxonomy( $this->slug );\n return $this->taxonomy;\n }",
"abstract public function get_taxonomy();",
"public function getTranslation($lang);",
"public function get ($term, $lang = null) {\n\n // If we don't receive a language key, use the default\n $lang = isset($lang)? $lang : $this->lang;\n\n // Load the language terms\n if (!isset($this->languages[$lang])) {\n $this->load($lang);\n }\n\n // Return the translated term\n return isset($this->languages[$lang][$term])? $this->languages[$lang][$term] : $term;\n }",
"public function taxonomy() {\n\t\t\t$this->taxonomy = $this->taxonomy ? $this->taxonomy : get_taxonomy( $this->slug );\n\n\t\t\treturn $this->taxonomy;\n\t\t}",
"private static function _create_relevant_translation( $relevant_term, $language ) {\r\n\t\tglobal $polylang;\r\n\t\t\r\n\t\t$source_term = $relevant_term['term']->term_id;\r\n\t\t$name = $relevant_term['term']->name;\r\n\t\t$taxonomy = $relevant_term['term']->taxonomy;\r\n\r\n\t\t// save_language() does a check_admin_referer() security test\r\n\t\t$_REQUEST['_pll_nonce'] = wp_create_nonce( 'pll_language' );\r\n\t\t$_POST['term_lang_choice'] = $language;\r\n\t\t$_POST['action'] = 'mla';\r\n\t\t$res = wp_insert_term( $name, $taxonomy, array( 'parent' => 0 ) );\r\n\r\n\t\tif ( ( ! is_wp_error( $res ) ) && isset( $res['term_id'] ) ) {\r\n\t\t\tif ( self::$polylang_1dot8_plus ) {\r\n\t\t\t\tPLL()->model->term->set_language( $res['term_id'], $language );\r\n\t\t\t} else {\r\n\t\t\t\t$polylang->model->set_term_language( $res['term_id'], $language );\r\n\t\t\t}\r\n\r\n\t\t\t$translations = array( $language => $res['term_id'] );\r\n\t\t\tif (isset( $relevant_term['translations'] ) ) {\r\n\t\t\t\tforeach( $relevant_term['translations'] as $slug => $translation ) {\r\n\t\t\t\t\t$translations[ $slug ] = $translation->element_id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( self::$polylang_1dot8_plus ) {\r\n\t\t\t\tPLL()->model->term->save_translations( $source_term, $translations );\r\n\t\t\t} else {\r\n\t\t\t\t$polylang->model->save_translations( 'term', $source_term, $translations );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tunset( $_POST['term_lang_choice'] );\r\n\t\tunset( $_POST['action'] );\r\n\r\n\t\t// Reload the term with its new translation\r\n\t\treturn self::_get_relevant_term( 'id', $res['term_id'], $taxonomy );\r\n\t}",
"function register_language() {\n\tif (!taxonomy_exists('languages')) {\n\t\tregister_taxonomy(\n\t\t\t'languages', // name/slug of taxonomy\n\t\t\tnull, // don't set custom taxonomies for custom post types; link them later with register_taxonomy_for_object_type()\n\t\t\tarray(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => __( 'Languages' ),\n\t\t\t\t\t'singular_name' => __( 'Language' )\n\t\t\t\t),\n\t\t\t\t'hierarchical' => true,\n\t\t\t\t'query_var' => false, // don't create subpages based on the taxonomy slugs\n\t\t\t\t'rewrite' => false, // same as above\n\t\t\t\t'public' => false,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_admin_column' => true,\n\t\t\t\t'show_in_nav_menus' => true,\n\t\t\t)\n\t\t);\n\n\t\tif ( post_type_exists( 'person' ) ) {\n\t\t\t// link our custom taxonomies and custom post types\n\t\t\t// Better safe than sorry when registering custom taxonomies for custom post types:\n\t\t\t// http://codex.wordpress.org/Function_Reference/register_taxonomy#Usage\n\t\t\tregister_taxonomy_for_object_type( 'languages', 'person' );\n\t\t}\n\t}\n\n}",
"function _nexteuropa_eurovoc_translate_terms() {\n if (!module_exists('locale')) {\n drupal_set_message(t('Locale module must be enabled'), 'error');\n }\n else {\n $languages = locale_language_list('name');\n if ($voc = taxonomy_vocabulary_machine_name_load('eurovoc')) {\n $terms = entity_load('taxonomy_term', FALSE, ['vid' => $voc->vid]);\n // EuroVoc translations handler.\n $tr_handler = new EuroVocTranslations();\n // Load a tree with all available translations in all languages.\n $eurovoc_translations = $tr_handler->getTranslations();\n if (count($terms) && isset($terms)) {\n foreach ($terms as $term) {\n // EMW is unnecessary, these fields are not translatable.\n $eurovoc_id = $term->field_eurovoc_id[LANGUAGE_NONE][0]['value'];\n $eurovoc_level = $term->field_eurovoc_level[LANGUAGE_NONE][0]['value'];\n // For each available language, make translations for the term.\n foreach ($languages as $lang_code => $language) {\n // If available, take the translation for a specific id and level.\n if (isset($eurovoc_translations[$eurovoc_level][$lang_code][$eurovoc_id])) {\n $translation = $eurovoc_translations[$eurovoc_level][$lang_code][$eurovoc_id];\n _nexteuropa_eurovoc_translate_term($term, $translation, $lang_code);\n }\n }\n }\n }\n }\n }\n}",
"public function getTaxonomy($name);",
"public function getTranslations($language);",
"public function languageName();",
"public function get_terms( $lang = NULL, $taxonomy = \"\", $args = array(), $post_id = 0 ) {\n\t\tif ( ! $this->is_wpml ) {\n\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t$terms = array();\n\t\t\t\t$all_terms = get_terms( $taxonomy, $args );\n\t\t\t\tforeach ( $all_terms as $term ) {\n\t\t\t\t\tif ( has_term( absint( $term->term_id ), $taxonomy, $post_id ) ) {\n\t\t\t\t\t\t$terms[] = $term;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn $terms;\n\t\t\t} else {\n\t\t\t\treturn get_terms( $taxonomy, $args );\n\t\t\t}\n\t\t}\n\t\tif ( $lang === NULL ) {\n\t\t\t$this->remove_term_filters();\n\n\t\t\t$all_terms = get_terms( $taxonomy, $args );\n\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t$terms = array();\n\t\t\t\tforeach ( $all_terms as $term ) {\n\t\t\t\t\tif ( has_term( absint( $term->term_id ), $taxonomy, $post_id ) ) {\n\t\t\t\t\t\t$terms[] = $term;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$terms = $all_terms;\n\t\t\t}\n\t\t\t$this->restore_term_filters();\n\t\t} else {\n\t\t\t$terms = array();\n\t\t\t$terms_data = new WPML_Taxonomy_Translation_Screen_Data( $this->sitepress, $taxonomy );\n\t\t\t$terms_data = $terms_data->terms();\n\t\t\tif ( isset( $terms_data['terms'] ) ) {\n\t\t\t\t$terms_data = $terms_data['terms'];\n\t\t\t}\n\n\t\t\tforeach ( $terms_data as $key => $value ) {\n\t\t\t\tif ( isset( $value[ $lang ] ) ) {\n\t\t\t\t\tif ( ! empty( $post_id ) ) {\n\t\t\t\t\t\tif ( has_term( absint( $value[ $lang ]->term_id ), $taxonomy, $post_id ) ) {\n\t\t\t\t\t\t\t$terms[] = $value[ $lang ];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$terms[] = $value[ $lang ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $terms;\n\t}",
"public function translateLabel($label){\n // echo $label . $this->terms[$label][\"Translated\"] . $this->lang;\n if(key_exists($label, $this->terms) && $this->terms->$label->Translated){\n $lang = $this->lang;\n return $this->terms->$label->$lang;\n }else\n return $label;\n }",
"function getLanguageTermId($value='F') {\n\t\t\n\t\t $lan = array('F'=>'Francais','N'=>'Nerderlands');\n\t\t $term_name = $lan[$value];\n\t\t $term_res = taxonomy_get_term_by_name($term_name,'languages');\n\t\t $term_id = '';\n\t\t foreach ($term_res as $result){\n\t\t \t$term_id = $result->tid;\n\t\t }\n\t\t \n\t\t return $term_id;\n\t\t\n\t}",
"public function getLanguage();",
"abstract public function getTranslationIn(string $locale);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the type rs. | public function setTypeRs($typeRs) {
$this->typeRs = $typeRs;
return $this;
} | [
"public function setResType($value)\n {\n return $this->set(self::RES_TYPE, $value);\n }",
"function setType($t){\r\n\t\t\t$this->_type=$t;\r\n\t\t}",
"protected function setQueryType($type) {\n\t$this->QType=$type;\t\n\t}",
"function set_type($val){\n\t\tif(is_object($this->_calendar)){\n\t\t\t$calendar = $this->_calendar;\n\t\t\tif($calendar->isRemoveable($this->field())){\n\t\t\t\t$tablename = $this->avalanche->PREFIX() . \"strongcal_cal_\" . $calendar->getId() . \"_fields\";\n\t\t\t\t$my_id = $this->getId();\n\t \t$sql = \"UPDATE $tablename SET type = '$val' WHERE id = '$my_id'\";\n\t\t\t\t$result = $this->avalanche->mysql_query($sql);\n\t\t\t\tif($result){\n\t\t\t\t\t$this->_type = $val;\n\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function setType($type) {\n $this->type = $type;\n }",
"function setQueryType($type) {\n $this->queryType = strtoupper($type);\n }",
"function SetType($type) {\r\n\t\tglobal $db, $db_name, $prefix;\r\n\t\tif (is_object($type) && strcasecmp(get_class($type), 'type') == 0) $type = $type->GetID();\r\n\t\tif (!is_numeric($type)) return false;\r\n\t\tif (mysql_db_query($db_name, 'UPDATE '.$prefix.\"items SET type=$type WHERE id=\".$this->id, $db)) {\r\n\t\t\t$this->UpdateCache();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse return false;\r\n\t}",
"public function setReturnType($type){\n\t\tif(trim(strtolower($type)) == 'object'){\n\t\t\t$this->returnType = 1;\n\t\t}else{\n\t\t\t$this->returnType = 0;\n\t\t}\n\t}",
"function setResultType($type, $args=\"\")\r\n\t{\r\n\t\t$this->resultType = $type;\r\n\t\t$this->resultTypeArgs = $args;\r\n\t}",
"function type_set(){\n if(is_object($this->value) and in_array('type_set',get_class_methods($this->value)))\n return(call_user_func_array(array(&$this->value,'type_set'),func_get_args()));\n else \n return($this->value = func_get_arg(0));\n }",
"public function setReturnType ($type) {\n\t\tif (trim(strtolower($type)) == 'object') {\n\t\t\t$this->returnType = 1;\n\t\t} else {\n\t\t\t$this->returnType = 0;\n\t\t}\n\t}",
"function setRecordTypes() {\n\t\t$this->recordTypeComplete\t= 0;\n\t\t$this->recordTypeTopic\t\t= 1;\n\t\t$this->recordTypeDate\t\t= 2;\n\n\t\treturn;\n\t}",
"public function setType($query_type = 'select')\n {\n\n }",
"function setDataType( $type )\n {\n if ( get_class( $type ) == \"ezdatatype\" )\n {\n $this->DataTypeID = $type->id(); \n }\n }",
"protected function setType($type)\n {\n $this->resetId();\n $table = $this->currentTable();\n\n switch ($type)\n {\n case \\Yana\\Db\\Queries\\TypeEnumeration::INSERT:\n if ($this->_row === '*' && $this->expectedResult === \\Yana\\Db\\ResultEnumeration::TABLE) {\n if ($table->getColumn($table->getPrimaryKey())->isAutoFill()) {\n $this->expectedResult = \\Yana\\Db\\ResultEnumeration::ROW;\n }\n }\n $this->type = $type;\n break;\n\n case \\Yana\\Db\\Queries\\TypeEnumeration::COUNT:\n if (is_array($this->column) && count($this->column) > 1) {\n // @codeCoverageIgnoreStart\n $message = \"Cannot use query type 'length' with multiple columns.\";\n $level = \\Yana\\Log\\TypeEnumeration::WARNING;\n throw new \\Yana\\Core\\Exceptions\\InvalidArgumentException($message, $level);\n // @codeCoverageIgnoreEnd\n }\n case \\Yana\\Db\\Queries\\TypeEnumeration::UNKNOWN:\n case \\Yana\\Db\\Queries\\TypeEnumeration::SELECT:\n case \\Yana\\Db\\Queries\\TypeEnumeration::UPDATE:\n case \\Yana\\Db\\Queries\\TypeEnumeration::EXISTS:\n $this->type = $type;\n break;\n\n case \\Yana\\Db\\Queries\\TypeEnumeration::DELETE:\n $this->type = $type;\n $this->_limit = 1;\n break;\n\n default:\n $message = \"Argument 1 is invalid. The selected statement type is unknown.\";\n $level = \\Yana\\Log\\TypeEnumeration::WARNING;\n throw new \\Yana\\Core\\Exceptions\\InvalidArgumentException($message, $level);\n }\n return $this;\n }",
"private function setResourceType()\n {\n $uri = $this->getUri();\n\n if (Str::startsWith($uri, '/cp')) {\n $this->resource_type = self::RESOURCE_CP;\n } elseif (Str::startsWith($uri, '/addon')) {\n $this->resource_type = self::RESOURCE_ADDON;\n $this->addon = explode('/', $uri)[2];\n } elseif (Str::startsWith($uri, '/helpers') && !Str::endsWith($uri, '.php')) {\n $this->resource_type = self::RESOURCE_HELPER;\n } else {\n $this->serve404Response();\n }\n }",
"public function setType($type) {\n if (!in_array($type, [\n self::INSERT, self::MULTI_INSERT, self::SELECT, self::UPDATE, self::DELETE,\n self::TRUNCATE, self::CREATE_TABLE, self::CREATE_INDEX, self::DROP_TABLE, self::DROP_INDEX\n ], true)) {\n throw new UnsupportedTypeException(sprintf('Invalid query type %s', $type));\n }\n\n $this->_type = $type;\n\n // Reset data and binds when changing types\n $this->_data = [];\n $this->_bindings = [];\n\n return $this;\n }",
"function setPType($type) {\n\t\t\tglobal $sql_type,$sql_pw,$sql_usr,$sql_socket,$sql_db;\n\t\t\t\t\t\t\t\t\n\t\t\tif (!$link = jz_db_connect())\n \t\tdie (\"could not connect to database.\");\n \t$ptype = jz_db_escape($ptype);\n \t\n \t$path = jz_db_escape($this->getPath(\"String\"));\n \tjz_db_query($link, \"UPDATE jz_nodes SET ptype='$type' WHERE path = '$path'\");\n\t\t}",
"public function setConnectionType();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Set the Actual Min Price of the search and catalog collection | public function setMinPrice(){
if( (isset($_GET['q']) && !isset($_GET['min'])) || !isset($_GET['q'])){
$this->_minPrice = $this->_productCollection->getMinPrice();
$this->_searchSession->setMinPrice($this->_minPrice);
}else{
$this->_minPrice = $this->_searchSession->getMinPrice();
}
} | [
"public function setMinPrice()\n {\n if (\n (isset($_GET['q']) && !isset($_GET['min'])) ||\n ! isset($_GET['q'])\n ) {\n if (Mage::getVersion() < '1.7.0.2') {\n $this->_productCollection->getSelect()->reset('order');\n $this->_productCollection->getSelect()->order('final_price','asc');\n $this->_minPrice = round($this->_productCollection->getFirstItem()->getFinalPrice());\n } else {\n $this->_minPrice = floor($this->_productCollection->getMinPrice());\n }\n\n $this->_searchSession->setMinPrice($this->_minPrice);\n } else {\n $this->_minPrice = $this->_searchSession->getMinPrice();\n }\n }",
"public function updateMinimumPrice(): void\n {\n $this->getProduct()->setMinimumPrice($this->getFinalPrice());\n }",
"public function testFilterMinimumPrice()\n {\n $this->visit('/properties')\n ->type('4500000', '#minPrice')\n ->press('Update results')\n ->see('Victorian townhouse');\n $this->notSee('Five bedroom mill conversion');\n $this->notSee('Shack in the desert');\n }",
"public function getMinprice()\n {\n return $this->minprice;\n }",
"public function setMinPrice($minPrice)\n {\n $this->minPrice = $minPrice;\n }",
"public function UpdatePriceToLowestVariant()\n {\n /** @var TdbShopArticle $product */\n $product = $this->oTable;\n $oLowestPriceVariant = $product->GetLowestPricedVariant();\n if ($oLowestPriceVariant) {\n $aData = array('price' => $oLowestPriceVariant->fieldPriceFormated, 'price_reference' => $oLowestPriceVariant->fieldPriceReferenceFormated);\n $this->SaveFields($aData, false);\n }\n }",
"function osc_search_price_min() {\n return View::newInstance()->_get('search_price_min');\n }",
"private function get_min_price() : float {\n\t\tpreg_match( '/runParams\\.minPrice=\"(.*?)\";/s', $this->request, $matches );\n\t\tif ( empty( $matches[1] ) ) {\n\t\t\treturn 0.0;\n\t\t}\n\t\treturn floatval( $matches[1] );\n\t}",
"public function getMinSaleQty();",
"public static function getMinPrice()\n {\n if (self::$minPrice === null) {\n self::$minPrice = (new Query())->select('min(price)')->from('product')->limit(1)->scalar();\n if (self::$minPrice === null) {\n self::$minPrice = 0;\n }\n }\n return self::$minPrice;\n }",
"public function getPriceMin()\n {\n return $this->pricemin;\n }",
"static function getSiteMinPrice() {\n return self::getMetaValueRange(PostProperty::META_PRICE);\n }",
"public function getSliderMinPrice()\n {\n if (!$this->getPriceRange()['min']) {\n return $this->getProductsMinPrice();\n }\n return $this->getPriceRange()['min'];\n }",
"public function minProductPrice():Float\n {\n return SupplierProduct::min('price');\n }",
"public function addPriceFilter($product, $searchMin, $useRegularPrice = false)\n {\n if ($product->getPriceType() == \\Magento\\Bundle\\Model\\Product\\Price::PRICE_TYPE_DYNAMIC) {\n $this->addPriceData();\n if ($useRegularPrice) {\n $minimalPriceExpression = self::INDEX_TABLE_ALIAS . '.price';\n } else {\n $this->getCatalogRuleProcessor()->addPriceData($this, 'selection.product_id');\n $minimalPriceExpression = 'LEAST(minimal_price, IFNULL(catalog_rule_price, minimal_price))';\n }\n $orderByValue = new \\Zend_Db_Expr(\n '(' .\n $minimalPriceExpression .\n ' * selection.selection_qty' .\n ')'\n );\n } else {\n $connection = $this->getConnection();\n $priceType = $connection->getIfNullSql(\n 'price.selection_price_type',\n 'selection.selection_price_type'\n );\n $priceValue = $connection->getIfNullSql(\n 'price.selection_price_value',\n 'selection.selection_price_value'\n );\n if (!$this->websiteScopePriceJoined) {\n $websiteId = $this->_storeManager->getStore()->getWebsiteId();\n $this->getSelect()->joinLeft(\n ['price' => $this->getTable('catalog_product_bundle_selection_price')],\n 'selection.selection_id = price.selection_id AND price.website_id = ' . (int)$websiteId,\n []\n );\n }\n $price = $connection->getCheckSql(\n $priceType . ' = 1',\n (float) $product->getPrice() . ' * '. $priceValue . ' / 100',\n $priceValue\n );\n $orderByValue = new \\Zend_Db_Expr('('. $price. ' * '. 'selection.selection_qty)');\n }\n\n $this->getSelect()->reset(Select::ORDER);\n $this->getSelect()->order(new \\Zend_Db_Expr($orderByValue . ($searchMin ? Select::SQL_ASC : Select::SQL_DESC)));\n $this->getSelect()->limit(1);\n return $this;\n }",
"public function getMinPrice()\n\t{\n\t\treturn (float) $this->_db->fetchOne('SELECT MIN(`sponge_price`) FROM `cake_prices` WHERE `cake_id` = ?', $this->getCakeId());\n\t}",
"public function testSearchMinPrice()\n {\n $response = $this->postJson('/api/v1/search', ['price_from' => 400000]);\n\n $response->assertOk()\n ->assertJsonFragment(['name' => 'The Como', 'name' => 'The Lucretia'])\n ->assertJsonMissing(['name' => 'The Aspen']);\n }",
"static public function adjustLowestPriceForProducts( $items = false, $verbose = false ) {\n\n $items = $items ? $items : WPLA_ListingQueryHelper::getItemsWithMinMaxAndLowestPrice();\n $changed_product_ids = array();\n $repricing_margin = floatval( get_option('wpla_repricing_margin') );\n $lowest_offer_mode = get_option('wpla_repricing_use_lowest_offer',0);\n $repricing_snh_fee = floatval( get_option('wpla_repricing_shipping') ); // shipping and handling\n\n // loop found listings\n foreach ( $items as $item ) {\n\n // make sure there is a product - and min/max prices are set (0 != NULL)\n if ( ! $item->post_id ) continue;\n if ( ! $item->min_price ) continue;\n if ( ! $item->max_price ) continue;\n if ( ! $item->buybox_price && ! $item->compet_price ) continue;\n \n WPLA()->logger->debug( 'adjustLowestPrice for '. $item->sku );\n\n // build target price from BuyBox and/or competitor price\n if ( $item->buybox_price && ! $item->has_buybox ) {\n \n // decide based on uppricing mode\n if ( $lowest_offer_mode && ( $item->buybox_price != $item->compet_price ) ) {\n\n // apply undercut to competitor price - if competitor price is different from BuyBox price\n $target_price = $item->compet_price - $repricing_margin;\n if ( $verbose ) wpla_show_message( $item->sku.': Other seller has BuyBox at '.$item->buybox_price.', lowest offer at '.$item->compet_price.' - your target price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': Other seller has BuyBox at '.$item->buybox_price.', lowest offer at '.$item->compet_price.' - your target price: '.$target_price );\n\n } else {\n\n // apply undercut to BuyBox price - if there is a BuyBox price and it's not the seller's\n $target_price = $item->buybox_price - $repricing_margin;\n if ( $verbose ) wpla_show_message( $item->sku.': Other seller has BuyBox at '.$item->buybox_price.' - your target price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': Other seller has BuyBox at '.$item->buybox_price.' - your target price: '.$target_price );\n\n }\n \n } elseif ( $item->buybox_price && $item->has_buybox && $item->compet_price ) {\n\n // decide based on uppricing mode\n if ( $lowest_offer_mode && ( $item->buybox_price != $item->compet_price ) ) {\n\n // seller has BuyBox and there is competition - apply undercut to competitor price (beta)\n $target_price = $item->compet_price - $repricing_margin;\n if ( $verbose ) wpla_show_message( $item->sku.': You have the BuyBox, but there is a competitor at '.$item->compet_price.' - new target price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': You have the BuyBox, but there is a competitor at '.$item->compet_price.' - new target price: '.$target_price );\n\n } else {\n\n // seller has BuyBox and there is competition - keep price for now\n $target_price = $item->buybox_price;\n if ( $verbose ) wpla_show_message( $item->sku.': You have the BuyBox - keeping current price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': You have the BuyBox - keeping current price: '.$target_price );\n\n }\n\n } elseif ( $item->buybox_price && $item->has_buybox && ! $item->compet_price ) {\n \n // seller has BuyBox and NO competition - fall back to max_price\n $target_price = $item->max_price;\n if ( $verbose ) wpla_show_message( $item->sku.': You have the BuyBox but there is no competitor - falling back to Max Price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': You have the BuyBox but there is no competitor - falling back to Max Price: '.$target_price );\n\n } elseif ( $item->compet_price ) {\n \n $target_price = $item->compet_price - $repricing_margin;\n if ( $verbose ) wpla_show_message( $item->sku.': No BuyBox price - falling back to next competitor at '.$item->compet_price.' - new target price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': No BuyBox price - falling back to next competitor at '.$item->compet_price.' - new target price: '.$target_price );\n\n } else {\n\n $target_price = $item->max_price;\n if ( $verbose ) wpla_show_message( $item->sku.': No BuyBox price, no competitor - falling back to Max Price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': No BuyBox price, no competitor - falling back to Max Price: '.$target_price );\n\n }\n\n $target_price = apply_filters( 'wpla_before_reprice_item', $target_price, $item );\n\n $target_price = round( $target_price, 2 );\n\n\n // update price\n $price_was_changed = self::updateAmazonPrice( $item, $target_price, $verbose );\n if ( $price_was_changed ) {\n $changed_product_ids[] = $item->post_id;\n WPLA()->logger->info('adjustLowestPriceForProducts() - new price for #'.$item->sku.': '.$target_price);\n }\n\n } // foreach item\n\n // echo \"<pre>\";print_r($changed_product_ids);echo\"</pre>\";#die();\n // echo \"<pre>\";print_r($items);echo\"</pre>\";die();\n\n return $changed_product_ids;\n }",
"public function setMinPriceThreshold($value);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to check if the Min is Bigger than the Max | function isBigger($min, $max){
if ($min > $max){
return true;
}
else{
return false;
}
} | [
"function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }",
"public function isUpperBoundValidator(): bool {\n return $this->min < 0 && $this->max > 0;\n }",
"public function isUpperBoundValidator(): bool {\n return $this->min === null && $this->max > 0;\n }",
"protected function validateMinMax($min, $max) {\n\t\tif (bccomp($min, $max) == 0 || bccomp($min, $max) == 1) {\n\t\t\tshow_error_message(_('Y axis MAX value must be greater than Y axis MIN value.'));\n\t\t\texit;\n\t\t}\n\t}",
"public function testMinAndMax()\n {\n \t// Test type.\n \t$this->assertInternalType('int', $this->mysteryNumberService::MAX_NUMBER);\n \t$this->assertInternalType('int', $this->mysteryNumberService::MIN_NUMBER);\n\n \t// Test numbers interval.\n \t$this->assertTrue($this->mysteryNumberService::MAX_NUMBER - $this->mysteryNumberService::MIN_NUMBER > 1);\n }",
"public static function out($number, $min, $max): bool\n {\n return ($number < $min || $number > $max);\n }",
"public function isLess()\n {\n return $this->value < $this->min;\n }",
"public function testMinMax ()\n {\n //\n $result = (new FloatRule())->setMax(10)->validate(9);\n $this->assertTrue($result);\n\n $result = (new FloatRule())->setMax(10)->validate(11);\n $this->assertFalse($result);\n\n $result = (new FloatRule())->setMin(10)->validate(11);\n $this->assertTrue($result);\n\n $result = (new FloatRule())->setMin(10)->validate(9);\n $this->assertFalse($result);\n }",
"public function isOver()\n {\n return $this->value > $this->max;\n }",
"public function greaterThan($value, $min) {\n require_once 'Zend/Validate/GreaterThan.php';\n $validator = new Zend_Validate_GreaterThan($min);\n $result = $validator->isValid($value);\n return $result;\n }",
"public static function withinRange($value, $min, $max)\n {\n return ($min < $value && $value < $max)?:false;\n }",
"function limit_value($value, $min, $max)\n {\n return min(max($value, $min), $max);\n }",
"private function between(int $value, int $min, int $max): bool\n {\n return $value >= $min && $value <= $max;\n }",
"function between($value, $min, $max)\n {\n return ($min <= $value) && ($value <= $max);\n }",
"function _checkNum($actual, $fieldname, $minmax, $min, $max)\n {\n $len=strlen($actual);\n switch($minmax)\n {\n case \"min\":\n if($len<$min)\n {\n $this->_errors[$this->_counter] = $fieldname.' is too short.';\n $this->_counter++;\n return false;\n }\n else\n {\n return true;\n }\n break;\n case \"max\":\n if($len>$max)\n {\n $this->_errors[$this->_counter] = $fieldname.' is too long.';\n $this->_counter++;\n return false;\n }\n else\n {\n return true;\n }\n break;\n case \"inside\":\n if($len<$min || $len>$max)\n {\n $this->_errors[$this->_counter] = $fieldname.' is outside of value range.';\n $this->_counter++;\n return false;\n }\n break;\n }\n }",
"public function validateBetween($value, $min, $max)\n\t{\n\t\treturn $value > $min && $value < $max;\n\t}",
"function _isInNumericRange($value, $min, $max) {\n\t\treturn ($value >= $min && $value <= $max);\n\t}",
"function between($value, $min, $max) {\n\treturn $min <= $value && $value <= $max;\n}",
"public static function between($n, $min, $max){\r\n\t\treturn isset($n) && intval($n) >= $min && intval($n) < $max;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation managerDocumentDownloadAsyncWithHttpInfo Download Document | public function managerDocumentDownloadAsyncWithHttpInfo($document_id, $business_id, $employee_id, string $contentType = self::contentTypes['managerDocumentDownload'][0])
{
$returnType = '';
$request = $this->managerDocumentDownloadRequest($document_id, $business_id, $employee_id, $contentType);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
return [null, $response->getStatusCode(), $response->getHeaders()];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}
);
} | [
"public function action_doc_quick_download()\n\t{\n\t\t$document_id = $this->request->param('id');\n\t\t$knowledgetree_data = Kohana::$config->load('config')->get('KnowledgeTree');\n\t\t$kt_connection = New KTClient($knowledgetree_data['url']);\n\t\t$kt_connection->initSession($knowledgetree_data['username'], $knowledgetree_data['password']);\n\t\t$kt_connection->downloadDocument($document_id);\n\t}",
"public function downloadDocument() {\n\t \n\t extract($this->requireInput(array('document_id')));\n\t \n\t $this->loadModel('PatientDocument');\n\t $this->params['named']['document_id'] = $document_id;\n\t $this->PatientDocument->execute($this, 'download_file', '');\n\t\t \n\t exit;\n }",
"function downloadDocument($iddepartment, $iddocument) {\n\n\t\t\t$method = DEPARTMENTS . \"/$iddepartment/documents/$iddocument/download/@oauthtoken\";\n\n\t\t\t$verbmethod = \"GET\";\n\n\t\t\t$params = array();\n\n\t\t\t$params = array_filter($params, function($item) { return !is_null($item); });\n\n\t\t\t$response = $this->zyncroApi->callApiDirect($method, $params, $verbmethod);\n\n\t\t\treturn $response;\n\t\t}",
"public function managerDocumentDownloadRequest($document_id, $business_id, $employee_id, string $contentType = self::contentTypes['managerDocumentDownload'][0])\n {\n\n // verify the required parameter 'document_id' is set\n if ($document_id === null || (is_array($document_id) && count($document_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $document_id when calling managerDocumentDownload'\n );\n }\n\n // verify the required parameter 'business_id' is set\n if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $business_id when calling managerDocumentDownload'\n );\n }\n\n // verify the required parameter 'employee_id' is set\n if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $employee_id when calling managerDocumentDownload'\n );\n }\n\n\n $resourcePath = '/api/v2/business/{businessId}/manager/{employeeId}/document/download/{documentId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($document_id !== null) {\n $resourcePath = str_replace(\n '{' . 'documentId' . '}',\n ObjectSerializer::toPathValue($document_id),\n $resourcePath\n );\n }\n // path params\n if ($business_id !== null) {\n $resourcePath = str_replace(\n '{' . 'businessId' . '}',\n ObjectSerializer::toPathValue($business_id),\n $resourcePath\n );\n }\n // path params\n if ($employee_id !== null) {\n $resourcePath = str_replace(\n '{' . 'employeeId' . '}',\n ObjectSerializer::toPathValue($employee_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n [],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getDownloadResponse()\n {\n $fs = new Filesystem();\n if ($fs->exists($this->document->getAbsolutePath())) {\n $response = new Response();\n // Set headers\n $response->headers->set('Cache-Control', 'private');\n $response->headers->set('Content-type', mime_content_type($this->document->getAbsolutePath()));\n $response->headers->set('Content-Disposition', 'attachment; filename=\"' . basename($this->document->getAbsolutePath()) . '\";');\n $response->headers->set('Content-length', filesize($this->document->getAbsolutePath()));\n // Send headers before outputting anything\n $response->sendHeaders();\n // Set content\n $response->setContent(readfile($this->document->getAbsolutePath()));\n\n return $response;\n } else {\n return null;\n }\n }",
"private function loadWebDocumentAsyncWithHttpInfo(Requests\\loadWebDocumentRequest $request) \n {\n $returnType = '\\Aspose\\Words\\Model\\SaveResponse';\n $request = $request->createRequest($this->config);\n\n return $this->client\n ->sendAsync($request, $this->_createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject' || $returnType === 'FILES_COLLECTION') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()));\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, $response->getHeaders()),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) { \n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n\n if ($exception instanceof RepeatRequestException) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n\n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }",
"public function testDownloadDocument() {\n\n $obj = new StorageManager($this->objectManager);\n\n $obj->registerProvider($this->storageProvider);\n\n $this->assertInstanceOf(DocumentInterface::class, $obj->downloadDocument($this->document));\n }",
"public function downloadDoc(){\n\t\t\n\t\t$app \t\t= JFactory::getApplication();\n\t\t\n\t\t$doc_id\t\t= JRequest::getInt( 'id' );\n\t\t\n\t\t$model \t\t= $this->getModel( 'download' );\n\t\t$doc \t\t= $model->getDoc( $doc_id );\n\t\t\n\t\t$file_path\t= JPATH_SITE.DS.'media'.DS.'zbrochure'.DS.'docs'.DS.$doc->doc_bro_id.DS.$doc->doc_filename;\n\t\t\t\t\n\t\theader( 'Pragma: public' ); // required\n\t\theader( 'Expires: 0' );\n\t\theader( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );\n\t\theader( 'Cache-Control: private', false ); // required for certain browsers \n\t\theader( 'Content-Type: application/pdf' );\n\t\theader( 'Content-Disposition: attachment; filename=\"'.urlencode( $doc->doc_filename ).'\";' );\n\t\theader( 'Content-Transfer-Encoding: binary' );\n\t\theader( 'Content-Length: '.filesize( $file_path ) );\n\t\t\n\t\tob_clean();\n\t\tflush();\n\t\t\n\t\treadfile( $file_path );\n\n\t\t$app->close();\n\t\t\n\t}",
"public function testDownloadDocument() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n $this->assertEquals($this->doc1, $obj->downloadDocument($this->doc1));\n\n $res = $obj->downloadDocument($this->dir1);\n $this->assertNotNull($res->getId());\n $this->assertEquals(\"zip\", $res->getExtension());\n $this->assertEquals(\"application/zip\", $res->getMimeType());\n $this->assertContains(\"phpunit-\", $res->getName());\n $this->assertEquals(Document::TYPE_DOCUMENT, $res->getType());\n }",
"public function getDocument()\t{\n\t\t$this->curl->setOption(CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\treturn $this->curl->execute();\n\t}",
"public function getDownload(){\n $file= public_path(). \"/download/info.pdf\";\n $headers = array(\n 'Content-Type: resume/docx',\n );\n return Response::download($file, 'alexandra_gutierrez_resume.pdf', $headers);\n\t}",
"public function actionDownloadDocument($type = null, $companyId = null)\n {\n $document = DocumentFactory::create($type, $companyId);\n if (is_null($document)) {\n Yii::$app->getSession()->setFlash('error', Yii::t('alert', 'DOWNLOAD_DOCUMENT_INVALID_TYPE'));\n exit;\n }\n\n /** @var CompanyDocument $companyDocument */\n $companyDocument = CompanyDocument::findCurrentCompanyByType($type, $document->getCompany()->id);\n $fullPath = $document->getFullPath($companyDocument);\n if (!file_exists($fullPath)) {\n Yii::$app->getSession()->setFlash('error', Yii::t('alert', 'DOWNLOAD_DOCUMENT_FILE_NOT_EXISTS'));\n return $this->redirect([\n '/client/company',\n 'lang' => Yii::$app->language,\n 'id' => $document->getCompany()->id,\n 'tab' => self::TAB_COMPANY_DOCUMENTS,\n ]);\n }\n\n header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');\n header('Cache-Control: post-check=0, pre-check=0', false);\n header('Pragma: no-cache');\n header('Content-Type: ' . CompanyDocument::DOCUMENT_MIME_TYPES);\n header('Content-Disposition: inline; filename=\"' . $document->getName() . '.' . $companyDocument->extension . '\"');\n readfile($fullPath);\n exit;\n }",
"public function testGetDownload()\n {\n //$this->storageApi->getConfig()->setDebug(true);\n $path = \"folder1/FileTest1.pdf\";\n $versionId = null;\n $storage = \"First Storage\";\n $request = new Requests\\GetDownloadRequest($path, $versionId, $storage);\n\n $result = $this->storageApi->getDownload($request);\n Assert::assertNotNull($result, \"Error while downloading document\");\n\n }",
"public function getDocumentDetail_get() {\n extract($_GET);\n $document_id = base64_decode($doc_id);\n $result = $this->document_model->getDocumentDetail($document_id);\n if ($result) {\n return $this->response($result, 200);\n } else {\n return $this->response(NULL, 404);\n }\n }",
"public function download()\r\n {\r\n $this->curlOptions[ CURLOPT_CUSTOMREQUEST ] = 'DOWNLOAD';\r\n $this->curlOptions[ CURLOPT_BINARYTRANSFER ] = true;\r\n $this->curlOptions[ CURLOPT_RETURNTRANSFER ] = false;\r\n\r\n return $this->getResponse();\r\n }",
"public function download(){\n $path = storage_path(\"app\\\\media-references\\\\123.png\");\n $type = Storage::getMimeType(\"media-references/123.png\");\n /*return Response::make(file_get_contents($path), 200, [\n 'Content-Type' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'Content-Disposition' => 'inline'\n ]);*/\n /*return response()->file(\n $path,\n [\n 'Content-Type' => $type,\n 'Content-Disposition' => 'inline'\n ]\n );*/\n\n /*return response()->download($path, 'test.docx', [], 'inline');*/\n }",
"public function downloadAnswerDocument($document_name) {\n\t\t$file_name = PATH_ANSWER_DOCUMENTS . \"/\" . $document_name;\n\t\t\n\t\t//Check that the file exists, if so continue\n\t\tif(!file_exists($file_name)) {\n\t\t\tdie();\n\t\t}\n\n\t\t//If a matching answer file is found in the database, get the details\n\t\t$query = sprintf('\n\t\t\tSELECT *\n\t\t\tFROM %1$s.client_result_answer_file\n\t\t\tWHERE client_result_answer_file.hash = \"%2$s\";\n\t\t',\n\t\t\tDB_PREFIX.'checklist',\n\t\t\t$document_name\n\t\t);\n\n\t\tif($result = $this->db->query($query)) {\n\t\t\twhile($row = $result->fetch_object()) {\n\t\t\t\tif(isset($row->name)) {\n\t\t\t\t\t$document_name = $row->name;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$result->close();\n\t\t}\t\t\t\n\n\t\t//Set the download rate\n\t\t$download_rate = 1000;\n\t header('Cache-control: private');\n\t header('Content-Type: application/octet-stream');\n\t header('Content-Length: '.filesize($file_name));\n\t header('Content-Disposition: filename='.$document_name);\n\n\t flush();\n\t $file = fopen($file_name, \"r\");\n\t while(!feof($file))\n\t {\n\t //Send the current file part to the browser\n\t print fread($file, round($download_rate * 1024));\n\t flush();\n\t sleep(0.5);\n\t }\n\t fclose($file);\n\t die();\t\n\t}",
"public function downloadProtectedDocumentAsyncWithHttpInfo($id, $separateFiles = null)\n {\n $returnType = '\\SplFileObject';\n $request = $this->downloadProtectedDocumentRequest($id, $separateFiles);\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 }",
"function download_document($ids,$document='')\n\t{\n\t\tif (!$document)\n\t\t{\n\t\t\t$document = $this->prefs['default_document'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$document = $this->prefs['document_dir'].'/'.$document;\n\t\t}\n\t\tif (!@egw_vfs::stat($document))\n\t\t{\n\t\t\treturn lang(\"Document '%1' does not exist or is not readable for you!\",$document);\n\t\t}\n\t\trequire_once(EGW_INCLUDE_ROOT.'/addressbook/inc/class.addressbook_merge.inc.php');\n\t\t$document_merge = new addressbook_merge();\n\n\t\treturn $document_merge->download($document,$ids);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Will this box fit in line? (or need to create new one). | public function willFit(Box $box)
{
$childrenWidth = $this->getChildrenWidth();
$availableSpace = $this->getDimensions()->computeAvailableSpace();
$boxWidth = $box->getDimensions()->getWidth();
if (!$boxWidth) {
$boxWidth = $box->getDimensions()->getOuterWidth();
}
return Math::comp(Math::sub($availableSpace, $childrenWidth), $boxWidth) >= 0;
} | [
"private function makeBox()\n {\n $wordBox = imageftbbox($this->fontSize, 0, $this->font, $this->text);\n\n $wordBoxWidth = $wordBox[2];\n $wordBoxHeight = $wordBox[1] + abs($wordBox[7]);\n\n // Setting box properties\n $this->containerWidth = $wordBoxWidth + ($this->padding * 2);\n $this->containerHeight = $wordBoxHeight + ($this->padding * 2);\n $this->textX = $this->padding;\n $this->textY = $this->containerHeight - $this->padding;\n }",
"public function addRectangle($point, $size){}",
"private function _checkBoundary($newBoundary, $newBox) {}",
"public function hasBox(): bool\n {\n return isset($this->box);\n }",
"public function extendToInnerBox($width, $height, $saveAsNewFile = false);",
"public function fitBox()\n {\n // Reset min and max to opposite values\n $this->minRed = $this->minGreen = $this->minBlue = 255;\n $this->maxRed = $this->maxGreen = $this->maxBlue = 0;\n\n for ($i = $this->lowerIndex; $i <= $this->upperIndex; $i++) {\n $color = $this->colorCutQuantizer->getColors()[$i];\n $red = Color::red($color);\n $green = Color::green($color);\n $blue = Color::blue($color);\n\n if ($red > $this->maxRed) {\n $this->maxRed = $red;\n }\n if ($red < $this->minRed) {\n $this->minRed = $red;\n }\n if ($green > $this->maxGreen) {\n $this->maxGreen = $green;\n }\n if ($green < $this->minGreen) {\n $this->minGreen = $green;\n }\n if ($blue > $this->maxBlue) {\n $this->maxBlue = $blue;\n }\n if ($blue < $this->minBlue) {\n $this->minBlue = $blue;\n }\n }\n }",
"public function box()\n {\n }",
"public function testHeighten()\n {\n $box = new RelativeBox(100, 100);\n\n $this->assertEquals(new RelativeBox(200, 200), $box->heighten(200));\n }",
"abstract public function addBox(Box $box);",
"public function isSquare(){\n if($this->length==$this->width){\n return true;\n } else {\n return false;\n }\n }",
"function rectangle($x1, $y1, $width, $height)\n {\n $this->addContent(sprintf(\"\\n%.3F %.3F %.3F %.3F re S\", $x1, $y1, $width, $height));\n }",
"public function isSquare()\n {\n return $this->size->cols == $this->size->rows;\n }",
"public function testGetXWithBoxSet()\n {\n $x = $this->point->setBox($this->box)\n ->getX();\n static::assertEquals($this->width, $x);\n }",
"private function isValidBox(): bool {\n $boxCoordinates = [\n [0,0], [0,1], [0,2],\n [1,0], [1,1], [1,2],\n [2,0], [2,1], [2,2]\n ];\n for($y=0; $y<9; $y+=3) {\n for($x=0; $x<9; $x+=3) {\n $curBox = [];\n for($i=0; $i<9; $i++) {\n $coordinates = $boxCoordinates[$i];\n $coordinates[0] += $y;\n $coordinates[1] += $x;\n if(in_array($this->board[$coordinates[0]][$coordinates[1]], $curBox)){\n return false;\n }\n array_push($curBox, $this->board[$coordinates[0]][$coordinates[1]]);\n }\n }\n }\n return true;\n }",
"private function checkSize() {\n\t\t\t$bottom = $left = 0;\n\t\t\tncurses_getmaxyx(STDSCR, $bottom, $right);\n\t\t\tif ($bottom != $this->lastBottom || $right != $this->lastRight) {\n\t\t\t\tforeach ($this->panels as $p) {\n\t\t\t\t\tncurses_delwin($p);\n\t\t\t\t}\n\t\t\t\t$this->panels = array();\n\t\t\t\t$this->init();\n\t\t\t}\n\t\t}",
"public function extendToOuterBox($width, $height, $saveAsNewFile = false);",
"private function sizeIntoBox(float|int $inWidth = 1, float|int $inHeight = 1, float|int $boxWidth = 1, float|int $boxHeight = 1, string $mode = '', bool|int $rounding = false): bool|array\n {\n //scale using $boxWidth\n $outWidthUsingBoxWidth = $boxWidth;\n $outHeightUsingBoxWidth = ($boxWidth / $inWidth) * $inHeight;\n $outAreaUsingBoxWidth = $outWidthUsingBoxWidth * $outHeightUsingBoxWidth;\n if ($rounding) {\n if (is_int($rounding)) {\n $roundToDigits = $rounding;\n } else {\n $roundToDigits = 0;\n }\n $outHeightUsingBoxWidth = round($outHeightUsingBoxWidth, $roundToDigits);\n }\n\n //scale using $boxHeight\n $outWidthUsingBoxHeight = ($boxHeight / $inHeight) * $inWidth;\n $outHeightUsingBoxHeight = $boxHeight;\n $outAreaUsingBoxHeight = $outWidthUsingBoxHeight * $outHeightUsingBoxHeight;\n if ($rounding) {\n if (is_int($rounding)) {\n $roundToDigits = $rounding;\n } else {\n $roundToDigits = 0;\n }\n $outWidthUsingBoxHeight = round($outWidthUsingBoxHeight, $roundToDigits);\n }\n\n if (strtolower($mode) == 'fit') {\n //select based on min area\n if ($outAreaUsingBoxWidth <= $outAreaUsingBoxHeight) {\n return ['width' => $outWidthUsingBoxWidth, 'height' => $outHeightUsingBoxWidth];\n } else {\n return ['width' => $outWidthUsingBoxHeight, 'height' => $outHeightUsingBoxHeight];\n }\n } elseif (strtolower($mode) == 'fill') {\n //select based on max area\n if ($outAreaUsingBoxWidth >= $outAreaUsingBoxHeight) {\n return ['width' => $outWidthUsingBoxWidth, 'height' => $outHeightUsingBoxWidth];\n } else {\n return ['width' => $outWidthUsingBoxHeight, 'height' => $outHeightUsingBoxHeight];\n }\n } elseif (strtolower($mode) == 'stretch') {\n return ['width' => $boxWidth, 'height' => $boxHeight];\n } else {\n return false;\n }\n }",
"public function hasBoxes()\n {\n return count($this->_boxes)>0;\n }",
"protected function evaluateAvailableBoundingBox( ezcDocumentPdfPage $page, array $styles, $width )\n {\n // Grap the maximum available vertical space\n $space = $page->testFitRectangle( $page->x, $page->y, $width, null );\n if ( $space === false )\n {\n // Could not allocate space, required for even one line\n return false;\n }\n\n // Apply bounding box modifications\n $space->x +=\n $styles['padding']->value['left'] +\n $styles['border']->value['left']['width'] +\n $styles['margin']->value['left'];\n $space->width -=\n $styles['padding']->value['left'] +\n $styles['padding']->value['right'] +\n $styles['border']->value['left']['width'] +\n $styles['border']->value['right']['width'] +\n $styles['margin']->value['left'] +\n $styles['margin']->value['right'];\n $space->y +=\n $styles['padding']->value['top'] +\n $styles['border']->value['top']['width'] +\n $styles['margin']->value['top'];\n $space->height -=\n $styles['padding']->value['top'] +\n $styles['padding']->value['bottom'] +\n $styles['border']->value['top']['width'] +\n $styles['border']->value['bottom']['width'] +\n $styles['margin']->value['top'] +\n $styles['margin']->value['bottom'];\n\n return $space;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle the tenant "creating" event. | public function creating(Model $tenant)
{
$this->setTenantStatus($tenant);
} | [
"public function creating(Tenant $tenant)\n {\n //dd( $tenant );\n }",
"public function postCreate(TenantRequest $request)\n {\n $tenant = $this->tenantServices->registerTenant($request->all());\n\n do_action(BASE_ACTION_AFTER_CREATE_CONTENT, TENANT_MODULE_SCREEN_NAME, $request, $tenant);\n\n if ($request->input('submit') === 'save') {\n return redirect()->route('admin.tenant.list')->with('success_msg', trans('core-base::notices.create_success_message'));\n } else {\n return redirect()->route('admin.tenant.edit', $tenant->id)->with('success_msg', trans('core-base::notices.create_success_message'));\n }\n }",
"public function creating(Tenant $tenant)\n {\n if(empty($tenant->trading_name)) {\n $tenant->trading_name = $tenant->name;\n }\n\n $tenant->uuid = Str::uuid();\n }",
"public function create(ActiveUserPostCreatedEvent $event): void\n {\n }",
"public function handleVoucherCreation(VoucherCreatedEvent $event)\n {\n }",
"public function created(UserTenant $userTenant)\n {\n create_database($userTenant);\n }",
"public function testCreateTenant()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function handleTravelCreated(TravelCreatedEvent $event) {\n $travel = $event->travel;\n $admin = $travel->user;\n if( null != $admin ) {\n $admin->notify(new TravelStatusNotification($travel, 'created'));\n }\n }",
"public final function createTenant(Request $request): JsonResponse {\n $tenant = Tenant::create([\n 'plan' => $request->input('plan', 'free')\n ]);\n\n $tenant->domains()->create([ 'domain' => $request->input('domain') ]);\n\n return $this->getSuccessResponse($tenant);\n }",
"public function add_frontend_tenant()\r\n\t{\r\n\t\t$data = array(\r\n\t\t\t\t'tenant_name'=>ucwords(strtolower($this->input->post('tenant_name'))),\r\n\t\t\t\t'tenant_email'=>$this->input->post('tenant_email'),\r\n\t\t\t\t'tenant_national_id'=>$this->input->post('tenant_national_id'),\r\n\t\t\t\t'tenant_password'=>md5(123456),\r\n\t\t\t\t'tenant_phone_number'=>$this->input->post('tenant_phone_number'),\r\n\t\t\t\t'created'=>date('Y-m-d H:i:s'),\r\n\t\t\t\t'tenant_status'=>1,\r\n\t\t\t\t'created_by'=>$this->session->userdata('personnel_id'),\r\n\t\t\t);\r\n\t\t\t\r\n\t\tif($this->db->insert('tenants', $data))\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t}",
"public function handleOfferCreated(OfferCreated $event)\n { \n $event->tender->user->notify(new OfferWasCreated($event->tender, $event->offer)); \n }",
"public function store(StoreTenantsRequest $request)\n {\n if (! Gate::allows('tenant_create')) {\n return abort(401);\n }\n $tenant = Tenant::create($request->all());\n\n\n\n return redirect()->route('admin.tenants.index');\n }",
"public function create()\n {\n return view('tenantaccounts.create');\n }",
"public function onAdtypeCreating($event)\n {\n }",
"public function store(CreatePaidtenantRequest $request)\n {\n $input = $request->all();\n\n $paidtenant = $this->paidtenantRepository->create($input);\n\n Flash::success('Paidtenant saved successfully.');\n\n return redirect(route('paidtenants.index'));\n }",
"public function store(TenantRequest $request)\n\t{\n\t\t// Validate Data from Form\n\t\t$validData = $request->validated();\n\n\t\t// Create Tenant\n\t\t$tenant = Tenant::create($validData);\n\n\t\t// Set Notifications\n\t\t$tenant->save();\n\t\tif (!$tenant->save()) {\n\t\t\ttoastr()->error('An error has occured please try again.', 'Abigail Says...');\n\t\t} else {\n\t\t\ttoastr()->success('The tenant was saved successfully!', 'Abigail Says...');\n\t\t}\n\n\t\t// Redirect\n\t\treturn redirect()->route('tenants.show', $tenant);\n\t}",
"private function createNewUser()\n {\n\n $name = (string) $this->ask('Name');\n $email = (string) $this->ask('E-Mail');\n $user = config('multi-tenant.user_class')::create([\n 'name' => $name,\n 'email' => $email,\n 'password' => bcrypt('tester'),\n ]);\n\n $add_to_tenant = $this->anticipate('Would you like to assign the user to a tenant?', ['Yes', 'No'], 'Yes');\n\n if ($add_to_tenant == 'Yes') {\n $headers = ['Name', 'ID'];\n $tenants = config('multi-tenant.tenant_class')::all('name', 'id');\n\n if($tenants->count() <= 0) {\n $this->comment($user->email . ' with the password `tester` was created without any tenants');\n } else {\n $this->table($headers, $tenants->toArray());\n\n $tenant_id = (int) $this->ask('Please enter the id of the desired tenant.');\n\n $tenant = config('multi-tenant.tenant_class')::findOrFail($tenant_id);\n\n $tenant->update(['owner_id' => $user->id]);\n\n $this->comment('The user ' . $user->email . ' is now the owner of ' . $tenant->name . ' with the password `tester`');\n }\n }\n else{\n $this->comment($user->email . ' with the password `tester` was created without any tenants');\n }\n\n }",
"public function created(Apartment $apartment)\n {\n //\n }",
"public function created($entity)\n {\n //\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the appliction.encoding without needing to request it from Config::get() each time. | protected static function encoding()
{
return static::$encoding;
} | [
"private function get_encoding()\n {\n return $this->encoding;\n }",
"public function getEncoding() {\n\t\tif ( sizeof( $this->json['encoding'] ) > 1 ) {\n\t\t\tthrow new AppConfigException( sprintf( 'More than one encoding defined (%d)', sizeof( $this->json['encoding'] ) ) );\n\t\t}\n\t\treturn $this->json['encoding'] ? (string)$this->json['encoding'] : null;\n\t}",
"static function GetDefaultEncoding(){}",
"public function get_encoding()\n {\n }",
"public function getEncoding();",
"public function getEncoding(){ }",
"private function getEncoding()\n {\n return $this->encoding;\n }",
"function getEncodingName(){}",
"public static function getGlobalEncoding() {\n return self::$globalEncoding;\n }",
"public function getEncodings();",
"public function getConvertEncoding();",
"public function getEncoding() {\n\t\treturn $this->rfi->getEncoding();\n\t}",
"function getAppEncoder()\n {\n return new MegaAppEncoder();\n }",
"public function getEncoding() {\n\t\treturn $this->babel->getEncoding();\n\t}",
"function getBestEncoding();",
"public static function getEncodings()\n {\n //Method inherited from \\Symfony\\Component\\HttpFoundation\\Request \n return \\Illuminate\\Http\\Request::getEncodings();\n }",
"public function getEncodingFromATutorLangPack() {\n\t\t$charset = '';\n\t\t\n\t\t$lang_file = $this->config->getConfig('LANG_INFO_FILE');\n\t\t$uploadPath = $this->config->getConfig('UPLOAD_PATH');\n\t\t\n\t\t$file = $uploadPath . $lang_file;\n\t\t\n\t\tif(!file_exists($file)) {\n\t\t\tmylog('File ' . $file . ' does not exist', 'getEncodingFromATutorLangPack', true);\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t// read the language file\n\t\t\t$content = file_get_contents($file);\n\t\t\t\n\t\t\t// find the tag which is responsible for charset\n\t\t\t$tag = $this->config->getConfig('LANG_CHARSET_TAG');\n\t\t\t$charset = $this->find_tag_content($content, $tag);\n\t\t\tmylog($charset);\n\t\t\t\n\t\t\treturn $charset;\n\t\t} catch(Exception $e) {\n\t\t\tmylog('Exception caught: ' . $e->getMessage(), 'getEncodingFromATutorLangPack', true);\n\t\t\treturn null;\n\t\t}\n\t}",
"public function getActiveEncodings() : array;",
"protected function _getEncodingTable() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
store ipdc products in xml | private function setXml(){
$uri = str_replace('{action}', 'ZoekProducten', $this->getApi());
$response = \Drupal::httpClient()->get($uri, ['headers' => ['Accept' => 'application/xml'], 'query' => ['_format' => 'xml_extended']]);
if(!empty($response->getBody()) && $response->getStatusCode() == 200)
$this->xml = simplexml_load_string($response->getBody());
} | [
"function createProduct($xml, $s1, $s2, $s3, $s4) {\n\t\n\t/*\n\t * $current_b_tag = $xmlDoc->getElementById ( \"produit\" ); $new_b_tag = $mydoc->createElement ( \"id\" ); $new_b_tag->nodeValue = $s1; $result = $mydoc->getElementById ( \"myBody\" ); $result->replaceChild ( $new_b_tag, $current_b_tag );\n\t */\n\t$id = $xml->createElement ( \"id\" );\n\t$idText = $xml->createTextNode ( $s1 );\n\t$id->appendChild ( $idText );\n\t\n\t$nom = $xml->createElement ( \"nom\" );\n\t$nomText = $xml->createTextNode ( $s2 );\n\t$nom->appendChild ( $nomText );\n\t\n\t$prix = $xml->createElement ( \"prix\" );\n\t$prixText = $xml->createTextNode ( $s3 );\n\t$prix->appendChild ( $prixText );\n\t\n\t$categorie = $xml->createElement ( \"categorie\" );\n\t$categorieText = $xml->createTextNode ( $s4 );\n\t$categorie->appendChild ( $categorieText );\n\t\n\t$retVal = $xml->createElement ( \"produit\" );\n\t$retVal->appendChild ( $id );\n\t$retVal->appendChild ( $nom );\n\t$retVal->appendChild ( $prix );\n\t$retVal->appendChild ( $categorie );\n\t\n\t/*\n\t * $retVal->getElementsByTagName ( \"id\" )->nodeValue = $s1; $retVal->getElementsByTagName ( \"nom\" )->item ( 0 )->nodeValue = \"$s2\"; $retVal->getElementsByTagName ( \"prix\" )->item ( 0 )->nodeValue = \"$s3\"; $retVal->getElementsByTagName ( \"categorie\" )->item ( 0 )->nodeValue = \"$s4\";\n\t */\n\treturn $retVal;\n}",
"public function createproduct()\r\n\t{\r\n\t\t\t \r\n\t\t$query = 'SELECT * FROM items_R044';\r\n\t\t$product_data = $this->_readConnection->fetchAll($query);\r\n\r\n\t\tforeach ($product_data as $key => $value){\r\n\t\t\ttry{\r\n\t\t\t\t$this->createsimpleproduct($value);\r\n\t\t\t}catch(Exception $e){\r\n\t\t\t\tMage::log($e->getMessage(),null,\"CLI_hatco_product_import.log\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"public function writeProduct(Product $product);",
"public function setProduct()\n {\n // get the existing products array\n $products = $this->getProducts();\n // push the new product to the array\n array_push($products, $this);\n $file = fopen($_SERVER['DOCUMENT_ROOT'] . \"/mpm_challenge/problem4/db/db.json\", \"w+\") or die(\"not opened\");\n fwrite($file, json_encode($products));\n fclose($file);\n }",
"public function actionXml_list_product_images()\n\t{\n\n\t\t//set content type and xml tag\n\t\theader(\"Content-type:text/xml\");\t\t\n\t\t\n\t\techo '<data>\n\t\t<item id=\"'.$row->id.'\">\n\t\t\t<filename><![CDATA['.Yii::app()->params['company_logo_file'].'?'.time().']]></filename>\n\t\t\t<print>0</print>\n\t\t</item>c\n\t\t<item id=\"'.$row->id.'\">\n\t\t\t<filename><![CDATA['.Yii::app()->params['company_logo_print_file'].'?'.time().']]></filename>\n\t\t\t<print>1</print>\n\t\t</item>\n\t\t</data>';\n\t}",
"function show_catalog_items(){\n\t$val1=0;\n\t$file = file_get_contents('catalog.xml');\n\t$dom = new DOMDocument();\n\t\n\t// load the XML file\n\t$dom->loadXML($file);\n\t\n\t$all_products= $dom->getElementsByTagName('product');\n\t//echo \"length:\" . $all_products->length;\n\t\t\t\t\t\t\t\n $string= '';\n\techo \"<hr />\";\n\techo \"<h2 class='heading'>CATALOG ITEMS</h2>\";\n\tforeach($all_products as $product){\n\t\n\t\n\t if (isset($_REQUEST['page'])) {\n\t$currentPage = $_REQUEST['page'];\n } else {\n\t$currentPage = 0;\n }\n\t\n\t$description = $product->getElementsByTagName('description');\n\t$price = $product->getElementsByTagName('price');\n\t$quantity = $product->getElementsByTagName('quantity');\n\t$image = $product->getElementsByTagName('image_name');\n\t$sale_price = $product->getElementsByTagName('sale_price');\n\t$desc_value= @$description->item(0)->nodeValue;\n\t$price_value= @$price->item(0)->nodeValue;\n\t$quantity_value= @$quantity->item(0)->nodeValue-1;\n\t$image_value= @$image->item(0)->nodeValue;\n\t$sale_value= @$sale_price->item(0)->nodeValue;\n\t//$quantity_value=$quantity_value-1;\n\t\n\t$product_name= $product->getAttribute('name');\n\tif($sale_value==0){\n echo \"<br />\";\n echo \"<a href='permalink.php?item=$val1'>$product_name</a>\";\n echo \"<br />\";\n echo \"<div class='img'> <img src='images/$image_value' height=150 width=140 alt='product image' /> </div>\";\n \n echo \"<strong>Product description: </strong>$desc_value\";\n echo \"<br />\";\n echo \"<strong>Retail price: </strong>\".\"$\".$price_value;\n echo \"<br />\";\n echo \"<strong>Quantity left: </strong>$quantity_value\";\n echo \"<br />\";\n echo \"<form action='index.php?page=\" . ($currentPage ) . \"' method='POST' > <input type='submit' name='add1' value='Add To Cart' /><input type='hidden' name='item1' value = '$val1' /></form>\";\n \n echo \"<br />\";\n echo \"<br />\";\n echo \"<br />\";\n }\n\t//echo $_GET['item'];\n $val1=$val1+1;\n }\n\t\n\t echo \"<form action='index.php' method='POST'>\";\n echo \"<div id='dropdown'>\";\n\techo \"Select number of items to view: <select name='dropdown'> \n <option value='5'>5</option>\n <option value='6'>6</option>\n <option value='7'>7</option>\n <option value='8'>8</option>\n\n </select>\";\n echo \"<input type='submit' name='select' value='Choose' />\";\n\techo \"</div>\";\n echo \"</form>\";\n\n\t if ( isset( $_POST['add1'] )){\n\t $item1= $_POST['item1'];\n\t //echo $item1;\n\t $file = file_get_contents('catalog.xml');\n\t$dom = new DomDocument();\n\t\n\t// load the XML file\n\t$dom->loadXML($file);\n\t$product= $dom->getElementsByTagName('product')->item($item1);\n\t \t\n\t$description = $product->getElementsByTagName('description');\n\t$price = $product->getElementsByTagName('price');\n\t$quantity = $product->getElementsByTagName('quantity');\n\t$image = $product->getElementsByTagName('image_name');\n\t$sale_price = $product->getElementsByTagName('sale_price');\n\t$desc_value= $description->item(0)->nodeValue;\n\t$price_value= $price->item(0)->nodeValue;\n\t$quantity_value= $quantity->item(0)->nodeValue;\n\t$image_value= $image->item(0)->nodeValue;\n\t$sale_value= $sale_price->item(0)->nodeValue;\n\t\n\t$product_name= $product->getAttribute('name');\n \n \n\techo \"<br />\";\n // create a new DomDocument instance\n\t$file1 = 'cart.xml';\n\t$dom1 = new DomDocument();\n\t$dom1->load($file1);\n \n\n\t$products= $dom1->createElement('products');\n\t$prod= $dom1->createElement('product');\n\t\n\t$prod_name=$dom1->createTextNode($product_name);\n\t$prod->appendChild($prod_name);\n\t$products->appendChild($prod);\n\t//$dom1->documentElement->appendChild($prod);\n\t\n\t// $dom1->appendChild($prod);\n\t\n\t$desc=$dom1->createElement('description');\n\t$desc_val=$dom1->createTextNode($desc_value);\n\t$desc->appendChild($desc_val);\n\t$products->appendChild($desc);\n\t\n\t\n\t$price= $dom1->createElement('price');\n\t$price_val= $dom1->createTextNode($price_value);\n\t$price->appendChild($price_val);\n\t$products->appendChild($price);\n\t\n\t$quan=$dom1->createElement('quantity');\n\t$quan_val= $dom1->createTextNode($quantity_value);\n\t$quan->appendChild($quan_val);\n\t$products->appendChild($quan);\n\t\n\t$img= $dom1->createElement('image_name');\n\t$img_val= $dom1->createTextNode($image_value);\n\t$img->appendChild($img_val);\n\t$products->appendChild($img);\n\t\n\t$sale= $dom1->createElement('sale_price');\n\t$sale_val= $dom1->createTextNode($sale_value);\n\t$sale->appendChild($sale_val);\n\t$products->appendChild($sale);\n\t\n\t$dom1->documentElement->appendChild($products);\n\t\n\t$dom1->save($file1);\n\t\n\t$file = file_get_contents('catalog.xml');\n\t$dom6 = new DomDocument();\n\t\n\t// load the XML file\n\t$dom6->loadXML($file);\n\t$product = $dom6->getElementsByTagName('product')->item($item1); \n\t//echo \"Item no is:\" .$item1;\n\t$quantity_value = $quantity_value-1;\n\tif($quantity_value<=0){\n echo \"<h2 class='message'>Can't add item</h2>\";\n $quantity_value=0;\n }\n\t$product->getElementsByTagName('quantity')->item(0)->nodeValue = $quantity_value;\n\t$dom6->save('catalog.xml');\n }\n\t}",
"public function updateProductsByXml() {\n\n //pobieram wszystkie dodane produkty\n $products = $this->get_products();\n foreach($products as $_products) {\n $sku = $_products->sku;\n $carrier_id = $_products->carrier_id;\n $sku_deliver = $_products->kod_dostawcy;\n //jesli brakuje sku dostawcy to pomijam\n if(!$sku_deliver) { continue; }\n\n //pobieram dane tego produktu z ostatniej synchronizacji\n\n //****dodać zabezpieczenie przed wykonywaniem tej pętli jeśli już został zaktualizowany ostatni xml, moze jakaś zmienna z nazwą pliku xml który ostatnio był przetwarzany?****//\n\n //aktualizuje xml_qty na podstawie xml_history\n $this->update_products_xml_qty($sku,$carrier_id,$sku_deliver);\n\n\n }\n\n }",
"public static function exportXML()\r\n {\r\n $productos = self::findAll();\r\n $xml=\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\";\r\n $xml.=\"<productos>\\n\";\r\n foreach ($productos as $producto) {\r\n $xml.=\"<producto>\\n\";\r\n foreach ($producto as $key=>$value) {\r\n $xml.=\"<$key>\".$value.\"</$key>\\n\"; \r\n } \r\n $xml.=\"</producto>\\n\";\r\n }\r\n $xml .= \"</productos>\";\r\n return $xml;\r\n }",
"public function exportProducts() : void;",
"private function setProductStore()\n {\n $sql = 'insert into ' . DB_PREFIX . 'product_to_store (product_id,store_id) values';\n foreach ($this->sku_data as $goods) $sql .= '(\\'' . $goods['product_id'] . '\\',\\'0\\'),';\n\n $this->db->query(trim($sql, ','));\n }",
"protected function processXml($xml) {\r\n Utils::log(\"Processing products XML input...\");\r\n \r\n $products = new \\Gateway\\DataSource\\Products();\r\n\r\n $step = 0;\r\n\r\n // parent products helper\r\n $parentProducts = array();\r\n\r\n // if attributes mapping (valid attributes specification) is set,\r\n // we load valid attributes that will be passed and/or remapped together\r\n // with product\r\n if (isset($this->connection->mapping['attribute'])) {\r\n $this->validAttributes = array_keys($this->connection->mapping['attribute']);\r\n }\r\n \r\n $logAttrList = count($this->validAttributes) ? implode(\", \", $this->validAttributes) : 'none'; \r\n Utils::log(sprintf(\"Allowed products attribute(s): %s\", $logAttrList));\r\n \r\n foreach ($xml->products as $xmlProduct) {\r\n // product description\r\n $xmlProductDescriptionPattern = '//products_description[@products_id=' . $xmlProduct['products_id'] . ']';\r\n $xmlProductDescription = $xml->xpath($xmlProductDescriptionPattern);\r\n $xmlProductDescription = current($xmlProductDescription);\r\n\r\n // 0 = simple, 1 = configurable\r\n $typeKey = (int) $xmlProduct['products_master_flag'];\r\n $isBundle = (isset($xmlProduct['products_bundle_flag']) && ((int) $xmlProduct['products_bundle_flag'])) ? true : false;\r\n \r\n //$isMaster = isset($xmlProduct['products_master_model']) && (int) $xmlProduct['products_master_model'] ? true : false;\r\n $attributeSet = \"default\"; // FIXME put this information into XML as eg. <attributes products_id=\"13352\" set=\"tshirt\">\r\n\r\n $product = $this->createProduct($typeKey, $isBundle);\r\n $product->id = (int) $xmlProduct['products_id'];\r\n $product->sku = (string) $xmlProduct['products_model'];\r\n $product->price = (string) $xmlProduct['products_regularprice'];\r\n $product->quantity = (string) $xmlProduct['products_quantity'];\r\n $product->isVisible = (string) $xmlProduct['products_visibility']; \r\n $product->weight = (string) $xmlProduct['products_weight'];\r\n $product->isEnabled = ((int) $xmlProduct['products_status']) === 1 ? true : false; // 1 = Enabled, 2 = Disabled\r\n\t\t\t$product->taxClassId = (int) $xmlProduct['products_tax_class_id']; \r\n \r\n // Magento dependent properties so we create dynamic ones\r\n $product->addSpecialProperty('attributeSet', $attributeSet);\r\n //$product->addSpecialProperty('taxClassId', (int) $xmlProduct['products_tax_class_id']);\r\n //$product->addSpecialProperty('taxClassId', 2);\r\n $product->addSpecialProperty('specialPrice', (string) $xmlProduct['products_price']);\r\n $product->addSpecialProperty('shippingTime', (string) $xmlProduct['products_shippingtime']);\r\n $product->addSpecialProperty('ean', (string) $xmlProduct['products_ean']);\r\n \r\n // localized description \r\n $xmlProductDescriptionPattern = '//products_description[@products_id=' . $product->id . ']';\r\n $xmlProductDescription = $xml->xpath($xmlProductDescriptionPattern);\r\n\r\n foreach ($xmlProductDescription as $xmlDesc) {\r\n $lang = \\Gateway\\DataSource\\Entity\\Product\\Attribute::NOT_LOCALIZED;\r\n \r\n // if lang isset, we pass it, else default one is left\r\n if (isset($xmlDesc['language_id'])) {\r\n $lang = (string) $xmlDesc['language_id'];\r\n }\r\n\r\n $description = new \\Gateway\\DataSource\\Entity\\Product\\Description($lang);\r\n $description->name = (string) $xmlDesc['products_name'];\r\n $description->description = trim((string) $xmlDesc['products_description']);\r\n $description->shortDescription = trim((string) $xmlDesc['products_short_description']);\r\n $description->metaTitle = trim((string) $xmlDesc['products_name']); // metaTitle not set in XML\r\n $description->metaDescription = trim(strip_tags((string) $xmlDesc['products_short_description'])); // metaDescription not set in XML\r\n $description->metaKeywords = trim((string) $xmlDesc['products_keywords']);\r\n\r\n $product->addDescription($description);\r\n }\r\n\r\n $this->loadCategories($xml, $xmlProduct, $product);\r\n // searches all current product categories IDs\r\n /*$xmlProductCategoriesPattern = '//products_to_categories[@products_id=' . $xmlProduct['products_id'] . ']/@categories_id';\r\n $productCategoriesIds = $xml->xpath($xmlProductCategoriesPattern);\r\n\r\n // FIXME what if no categories were found? Skip this product?\r\n if ($productCategoriesIds) {\r\n foreach ($productCategoriesIds as $productCategoryId) {\r\n \r\n if ($this->debug['oldCategory']) {\r\n // old not localized\r\n $category = $this->findCategory($productCategoryId, $xml);\r\n $product->addCategory($category);\r\n } else {\r\n $childNode = current($xml->xpath('//categories[@categories_id=' . $productCategoryId . ']'));\r\n $childNodeDescriptions = $xml->xpath('//categories_description[@categories_id=' . $productCategoryId . ']');\r\n\r\n // common attributes for all localized\r\n $category = new \\Gateway\\DataSource\\Entity\\Product\\Category();\r\n $category->id = (int) $productCategoryId;\r\n $category->isActive = ((int) $childNode['categories_status']) > 0 ? true : false;\r\n $category->isVisible = ((int) $childNode['categories_visibility']) > 0 ? true : false; \r\n $category->addSpecialProperty('isAnchor', false);\r\n\r\n // localized values\r\n foreach ($childNodeDescriptions as $childNodeDescription) {\r\n $category->name = (string) $childNodeDescription['categories_name'];\r\n $category->lang = (string) $childNodeDescription['language_id'];\r\n\r\n // build localized parent path\r\n $parentId = (int) $childNode['parent_id'];\r\n\r\n if ($parentId > 0) {\r\n $category->parent = $this->buildPath($parentId, $xml, (string )$childNodeDescription['language_id']);\r\n }\r\n\r\n $product->addCategory(clone $category);\r\n }\r\n }\r\n }\r\n \r\n }*/\r\n \r\n /*\r\n dump($product->getCategories());\r\n exit;*/\r\n\r\n if ($product->type == \\Gateway\\DataSource\\Entity\\IProduct::TYPE_BUNDLE) {\r\n // FIXME currently bundle products are skipped\r\n Utils::log(sprintf(\"Skipping bundle product '%s'.\", $product->sku));\r\n continue;\r\n \r\n Utils::log(sprintf(\"Creating bundle product '%s'.\", $product->sku));\r\n \r\n $xmlProductsSetsPattern = '//products_sets[@products_model_bundle= ' . $product->sku . ']/@products_model';\r\n $xmlProductsSets = $xml->xpath($xmlProductsSetsPattern);\r\n \r\n foreach ($xmlProductsSets as $productSku) {\r\n $productSku = (string) $productSku;\r\n \r\n // configurable product\r\n $associated = $products->get($productSku);\r\n \r\n if ($associated) {\r\n $product->addAssociated($associated);\r\n }\r\n \r\n $parentProducts[$product->sku] = array();\r\n $parentProducts[$product->sku]['product'] = $product;\r\n $parentProducts[$product->sku]['skus'] = $product->getAssociated(true); \r\n }\r\n \r\n Utils::log(sprintf(\"Bundle subproducts skus: '%s'.\", implode(\",\", $product->getAssociated(true))));\r\n }\r\n \r\n // this belongs only to Configurable product \r\n if ($product->type == \\Gateway\\DataSource\\Entity\\IProduct::TYPE_CONFIGURABLE) {\r\n $xmlSimpleProductsPattern = '//products[@products_master_model= ' . $product->sku . ']/@products_model';\r\n $xmlSimpleProductsSkus = $xml->xpath($xmlSimpleProductsPattern);\r\n\r\n // we store products skus to later construct children and parents\r\n $parentProducts[$product->sku] = array();\r\n $parentProducts[$product->sku]['product'] = $product;\r\n $parentProducts[$product->sku]['skus'] = (array) $xmlSimpleProductsSkus;\r\n } //else {\r\n // this is for Simple ones\r\n $xmlProductAttributesPattern = '//product_keys/attributes[@products_id=' . $xmlProduct['products_id'] . ']';\r\n $productAttributes = current($xml->xpath($xmlProductAttributesPattern));\r\n \r\n // creating product attributes objects and adding them to product\r\n if ($productAttributes !== false) {\r\n \r\n $logValid = array();\r\n $logInvalid = array();\r\n \r\n foreach ($productAttributes as $productAttribute) {\r\n $lang = \\Gateway\\DataSource\\Entity\\Product\\Attribute::NOT_LOCALIZED;\r\n $label = isset($productAttribute['label']) ? (string) $productAttribute['label'] : false;\r\n $name = (string) $productAttribute['name'];\r\n $value = (string) $productAttribute['value'];\r\n\r\n // if empty value and empty values are not allowed, skip it\r\n // FIX in XML\r\n if (!$value && !$this->allowAttributeEmptyValues) {\r\n continue;\r\n }\r\n \r\n // if lang isset, we pass it, else default one is left\r\n if (isset($productAttribute['language_id'])) {\r\n $lang = (string) $productAttribute['language_id'];\r\n }\r\n\r\n // pass only valid attributes defined in mapping attribute structure\r\n if (in_array($name, $this->validAttributes)) { \r\n $attr = new \\Gateway\\DataSource\\Entity\\Product\\Attribute($lang, $name, $value, $label); \r\n $product->addAttribute($attr);\r\n \r\n $logValid[$name] = $name;\r\n } else {\r\n // log skipped invalid attributes in XML\r\n $logInvalid[$name] = $name;\r\n }\r\n \r\n }\r\n \r\n $msg = sprintf(\"%s attributes: valid='%s', invalid='%s'\", $product->sku, implode(\", \", $logValid), implode(\", \", $logInvalid));\r\n Utils::log(\\Logger\\ILogger::DEBUG, $msg);\r\n //}\r\n }\r\n\r\n // MANUFACTURER\r\n if (isset($xmlProduct['manufacturers_id']) && $xmlProduct['manufacturers_id']) {\r\n $xmlManufacturerPattern = '//manufacturers[@manufacturers_id=' . $xmlProduct['manufacturers_id'] . ']';\r\n $xmlManufacturer = current($xml->xpath($xmlManufacturerPattern));\r\n\r\n if ($xmlManufacturer) {\r\n $product->manufacturer = (string) $xmlManufacturer['manufacturers_name'];\r\n }\r\n }\r\n\r\n // IMAGES\r\n // images names must be converted from IMAGE_01.jpg[;IMAGE_0n.jpg] to array\r\n $xmlImagesNames = (string) $xmlProduct['products_image'];\r\n \r\n // if images found, we pass them\r\n if ($xmlImagesNames) {\r\n $xmlImagesNames = explode(\";\", $xmlImagesNames);\r\n\r\n foreach ($xmlImagesNames as $index => $image) {\r\n // always the first image is thumbnail, small etc. in XML\r\n if ($index == 0) {\r\n $product->addImage($image, \\Gateway\\DataSource\\Entity\\Product\\IImage::TYPE_PREVIEW);\r\n $product->addImage($image, \\Gateway\\DataSource\\Entity\\Product\\IImage::TYPE_PREVIEW_MEDIUM);\r\n $product->addImage($image, \\Gateway\\DataSource\\Entity\\Product\\IImage::TYPE_PREVIEW_SMALL);\r\n } else {\r\n // the rest is gallery type\r\n $product->addImage($image);\r\n }\r\n }\r\n }\r\n\r\n // RELATED, UPSELL AND CROSS-SELL PRODUCT SKUS\r\n $product->addSpecialProperty('reSkus', (string) $xmlProduct['products_relations_related']);\r\n $product->addSpecialProperty('usSkus', (string) $xmlProduct['products_relations_up']);\r\n $product->addSpecialProperty('csSkus', (string) $xmlProduct['products_relations_cross']);\r\n \r\n // and adding to collection\r\n $products->add($product);\r\n \r\n /*dump($product);\r\n exit;*/\r\n \r\n // debug limit\r\n if ($this->debug['limit'] && ($step++ == $this->debug['limit'])) {\r\n break;\r\n }\r\n }\r\n \r\n Utils::log(\"%s products has been parsed.\", $products->count());\r\n\r\n // FIXME when subproducts does not exists, skip? \r\n // now it is time to put parents and children into this structure \r\n foreach ($parentProducts as $parent) {\r\n // if parent has children, we go through\r\n if (isset($parent['skus']) && count($parent['skus'])) {\r\n Utils::log(\"Updating '%s': adding subproducts of '%s'.\", $parent['product']->sku, implode(\", \", $parent['skus']));\r\n\r\n foreach ($parent['skus'] as $childSku) {\r\n // if child found in products...\r\n $child = $products->get($childSku);\r\n\r\n // ...lets add child its parent and parent its child\r\n if ($child) {\r\n $parent['product']->addAssociated($child);\r\n $child->setParent($parent['product']);\r\n\r\n Utils::log(\"'%s': subproduct of '%s' added.\", $parent['product']->sku, $child->sku);\r\n }\r\n }\r\n }\r\n }\r\n\r\n Utils::log(\"Products DataSource is prepared.\");\r\n\r\n return $products;\r\n }",
"public function exportZirconProductFeed(){\n Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));\n $errorFile = 'iGo_DataFeed_Zircon_Error.log';\n\t \n try {\n $stores = Mage::getModel('core/store')->getCollection();\n\t\t\t\n foreach ($stores as $store) {\n if($store->getName() != \"Default Store View\"){\n $this->_exportDirectory = Mage::getBaseDir().'/feed/iGo/';\n $this->_exportFileName = str_replace(\".com\",\"\", $store->getName());\n $this->_exportFileName = str_replace(\".\",\"\", $this->_exportFileName);\n $this->_exportFileName = $this->_exportFileName.\".txt\";\n $this->_exportFullFileName = $this->_exportDirectory.$this->_exportFileName;\n $exportFileHandler = fopen($this->_exportFullFileName , 'w'); \n $fileLine = \"sku\\tcode\\tname\\ttype\\tprice\\tsale_price\\tavailability\\tlink\\timage1\\timage2\\tcost\\trelease_date\\tcategory\\tauthor_speaker_editor\\tbrand\\tcustom_design\\ttarget_audience\\tskill_level\\ttechnique\\trating\\tstock_status\\tshort_description\\tdescription\";\n fwrite($exportFileHandler,$fileLine); \n fclose($exportFileHandler);\n \n //load all products\n $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect(array('sku', \n 'name',\n 'format',\n 'price',\n 'special_price',\n 'description', \n 'url_key',\n 'warehouse_avail_date', \n 'technique',\n 'short_description',\n 'description',\n 'type_id',\n 'category_ids',\n 'visibility',\n 'sold_by_length',\n 'image'\n ), 'left')\n ->addAttributeToFilter('status','1')\n ->addStoreFilter($store->getId())\n ->joinTable('cataloginventory/stock_item', 'product_id=entity_id', array(\"stock_status\" => \"is_in_stock\", \"manage_stock\" => \"manage_stock\"))\n ->addAttributeToSelect('stock_status')\n ->addAttributeToSelect('manage_stock')\n ->addAttributeToSelect('vote_count')\n ->addAttributeToSelect('vote_value_sum');\n\n Mage::getSingleton('core/resource_iterator')->walk($products->getSelect(), array(array($this, 'callBackZirconProductFeed')),array('storeName' => $store->getName(), 'storeId' => $store->getId()));\n\n try{\n $filesToSend[$this->_exportFileName] = $this->_exportFullFileName;\n unset($products);\n }\n catch(Exception $e){ \n Mage::log(\"iGo Export Error: \".$e->getMessage(),null, $errorFile);\n $this->sendErrorEmail($e->getMessage());\n } \n }\n }\n\n //Send the files\n try{\n $this->ftpFiles($filesToSend,$errorFile);\n unset($products);\n }\n catch(Exception $e){\n Mage::log(\"iGo Export Error: \".$e->getMessage(),null, $errorFile);\n $this->sendErrorEmail($e->getMessage());\n }\n\n } \n catch (Exception $e) {\n Mage::log(\"iGo Export Error: \".$e->getMessage(),null, $errorFile);\n $this->sendErrorEmail($e->getMessage());\n }\n }",
"function exportProdFile() {\n\n $fp = fopen(DIR_FS_CATALOG.'export/'.$this->filename, \"w+\");\n $line = '';\n $headings = array('XTSOL',\n 'p_model',\n 'p_stock',\n 'p_sorting',\n 'p_shipping',\n 'p_tpl',\n 'p_manufacturer',\n 'p_fsk18',\n 'p_priceNoTax');\n foreach($headings as $heading) {\n $line .= $this->encode($heading);\n }\n\n for ($i=1; $i < $this->count_groups; $i++) {\n $line .= $this->encode('p_priceNoTax.'.$this->Groups[$i]['id']);\n }\n if (GROUP_CHECK == 'true') {\n for ($i=0; $i < $this->count_groups; $i++) {\n $line .= $this->encode('p_groupAcc.'.$this->Groups[$i]['id']);\n }\n }\n\n $headings = array('p_tax',\n 'p_status',\n 'p_weight',\n 'p_ean',\n 'p_man',\n 'p_disc',\n 'p_opttpl',\n 'p_vpe',\n 'p_vpe_status',\n 'p_vpe_value');\n foreach($headings as $heading) {\n $line .= $this->encode($heading);\n }\n\n // product images\n for ($i = 1; $i < MO_PICS + 1; $i ++) {\n $line .= $this->encode('p_image.'.$i);\n }\n\n $line .= $this->encode('p_image');\n\n // add lang fields\n for ($i = 0; $i < $this->sizeof_languages; $i ++) {\n $line .= $this->encode('p_name.'.$this->languages[$i]['code']);\n $line .= $this->encode('p_desc.'.$this->languages[$i]['code']);\n $line .= $this->encode('p_shortdesc.'.$this->languages[$i]['code']);\n $line .= $this->encode('p_orderdesc.'.$this->languages[$i]['code']); //added order description\n $line .= $this->encode('p_meta_title.'.$this->languages[$i]['code']);\n $line .= $this->encode('p_meta_desc.'.$this->languages[$i]['code']);\n $line .= $this->encode('p_meta_key.'.$this->languages[$i]['code']);\n $line .= $this->encode('p_keywords.'.$this->languages[$i]['code']);\n $line .= $this->encode('p_url.'.$this->languages[$i]['code']);\n }\n // add categorie fields\n for ($i = 0; $i < $this->catDepth; $i ++) {\n $line .= $this->encode('p_cat.'.$i);\n }\n fputs($fp, $line.\"\\n\");\n\n // content\n $export_query = xtc_db_query('-- admin/includes/classes/import.php export\n SELECT *\n FROM '.TABLE_PRODUCTS\n );\n\n\n while ($export_data = xtc_db_fetch_array($export_query)) {\n $this->counter['prod_exp']++;\n $line = $this->encode('XTSOL');\n $line .= $this->encode($export_data['products_model']);\n $line .= $this->encode($export_data['products_quantity']);\n $line .= $this->encode($export_data['products_sort']);\n $line .= $this->encode($export_data['products_shippingtime']);\n $line .= $this->encode($export_data['product_template']);\n $line .= $this->encode($this->man[$export_data['manufacturers_id']]);\n $line .= $this->encode($export_data['products_fsk18']);\n $line .= $this->encode($export_data['products_price']);\n\n // group prices Qantity:Price::Quantity:Price\n for ($i=1; $i < $this->count_groups; $i++) {\n $price_query = \"SELECT *\n FROM \".TABLE_PERSONAL_OFFERS_BY.$this->Groups[$i]['id'].\"\n WHERE products_id = '\".$export_data['products_id'].\"'\n ORDER BY quantity\";\n\n\n $price_query = xtc_db_query($price_query);\n $groupPrice = '';\n while ($price_data = xtc_db_fetch_array($price_query)) {\n if ($price_data['personal_offer'] > 0) {\n $groupPrice .= $price_data['quantity'].':'.$price_data['personal_offer'].'::';\n }\n }\n $groupPrice .= ':';\n $groupPrice = str_replace(':::', '', $groupPrice);\n if ($groupPrice == ':')\n $groupPrice = \"\";\n\n $line .= $this->encode($groupPrice);\n\n }\n\n // group permissions\n if (GROUP_CHECK == 'true') {\n for ($i=0; $i < $this->count_groups; $i++) {\n $line .= $this->encode($export_data['group_permission_'.$this->Groups[$i]['id']]);\n }\n }\n\n $line .= $this->encode($export_data['products_tax_class_id']);\n $line .= $this->encode($export_data['products_status']);\n $line .= $this->encode($export_data['products_weight']);\n $line .= $this->encode($export_data['products_ean']);\n $line .= $this->encode($export_data['products_manufacturers_model']);\n $line .= $this->encode($export_data['products_discount_allowed']);\n $line .= $this->encode($export_data['options_template']);\n $line .= $this->encode($export_data['products_vpe']);\n $line .= $this->encode($export_data['products_vpe_status']);\n $line .= $this->encode($export_data['products_vpe_value']);\n\n if (MO_PICS > 0) {\n $mo_query = \"SELECT *\n FROM \".TABLE_PRODUCTS_IMAGES.\"\n WHERE products_id = '\".$export_data['products_id'].\"'\";\n\n $mo_query = xtc_db_query($mo_query);\n $img = array ();\n while ($mo_data = xtc_db_fetch_array($mo_query)) {\n $img[$mo_data['image_nr']] = $mo_data['image_name'];\n }\n\n }\n\n // product images\n for ($i = 1; $i < MO_PICS + 1; $i ++) {\n if (isset ($img[$i])) {\n $line .= $this->encode($img[$i]);\n } else {\n $line .= $this->encode('');\n }\n }\n\n $line .= $this->encode($export_data['products_image']);\n\n for ($i = 0; $i < $this->sizeof_languages; $i ++) {\n $lang_query = xtc_db_query(\"SELECT *\n FROM \".TABLE_PRODUCTS_DESCRIPTION.\"\n WHERE language_id = '\".$this->languages[$i]['id'].\"'\n AND products_id = '\".$export_data['products_id'].\"'\n \");\n\n $lang_data = xtc_db_fetch_array($lang_query);\n $lang_data['products_description'] = str_replace(\"\\n\", \"\", $lang_data['products_description']);\n $lang_data['products_short_description'] = str_replace(\"\\n\", \"\", $lang_data['products_short_description']);\n $lang_data['products_order_description'] = str_replace(\"\\n\", \"\", $lang_data['products_order_description']); //added order description\n $lang_data['products_description'] = str_replace(\"\\r\", \"\", $lang_data['products_description']);\n $lang_data['products_short_description'] = str_replace(\"\\r\", \"\", $lang_data['products_short_description']);\n $lang_data['products_order_description'] = str_replace(\"\\r\", \"\", $lang_data['products_order_description']); //added order description\n $lang_data['products_description'] = str_replace(chr(13), \"\", $lang_data['products_description']);\n $lang_data['products_short_description'] = str_replace(chr(13), \"\", $lang_data['products_short_description']);\n $lang_data['products_order_description'] = str_replace(chr(13), \"\", $lang_data['products_order_description']); //added order description\n $line .= $this->encode(stripslashes($lang_data['products_name']));\n $line .= $this->encode(stripslashes($lang_data['products_description']));\n $line .= $this->encode(stripslashes($lang_data['products_short_description']));\n $line .= $this->encode(stripslashes($lang_data['products_order_description'])); //added order description\n $line .= $this->encode(stripslashes($lang_data['products_meta_title']));\n $line .= $this->encode(stripslashes($lang_data['products_meta_description']));\n $line .= $this->encode(stripslashes($lang_data['products_meta_keywords']));\n $line .= $this->encode(stripslashes($lang_data['products_keywords']));\n $line .= $this->encode($lang_data['products_url']);\n }\n\n $cat_query = xtc_db_query(\"SELECT categories_id\n FROM \".TABLE_PRODUCTS_TO_CATEGORIES.\"\n WHERE products_id = '\".$export_data['products_id'].\"'\n \");\n\n\n\n $cat_data = xtc_db_fetch_array($cat_query);\n $line .= $this->buildCAT($cat_data['categories_id']);\n\n\n fputs($fp, $line.\"\\n\");\n }\n\n fclose($fp);\n /*\n if (COMPRESS_EXPORT=='true') {\n $backup_file = DIR_FS_CATALOG.'export/' . $this->filename;\n exec(LOCAL_EXE_ZIP . ' -j ' . $backup_file . '.zip ' . $backup_file);\n unlink($backup_file);\n }\n */\n\n return array (\n 0 => $this->counter, 1 => '',\n 2 => $this->calcElapsedTime($this->time_start)\n );\n }",
"public function formatGoogleProductsXml($items) {\r\n\t\t$this->ci->load->model('inventory/modifier_model');\r\n\t\t$this->ci->load->model('inventory/material_model');\r\n\t\t$this->ci->load->model('utils/lookup_list_model');\r\n\t\t\r\n\t\t$major_classes = $this->ci->lookup_list_model->getMajorClasses();\r\n\t\t\r\n\t\t$rss = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>' . \"\\n\";\r\n\t\t$rss .= '<rss version=\"2.0\"';\r\n\t\t$rss .= ' xmlns:g=\"http://base.google.com/ns/1.0\" xmlns:c=\"http://base.google.com/ns/1.0\" >' . \"\\n\";\r\n\t\t\t$rss .= \"\\t\" . '<channel>' . \"\\n\";\r\n\t\t\t\t$rss .= \"\\t\\t\" . '<title>Google API Online Items</title>' . \"\\n\";\r\n\t\t\t\t$rss .= \"\\t\\t\" . '<link>http://www.langantiques.com</link>' . \"\\n\";\r\n\t\t\t\t$rss .= \"\\t\\t\" . '<description>Lang Antique Estate and Antique Jewelry</description>' . \"\\n\";\r\n\t\t\t\t\r\n\t\t\t\tforeach($items as $item) {\r\n\t\t\t\t\t$rss .= \"\\t\\t\" . '<item>' . \"\\n\";\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<title>' . htmlspecialchars($item['item_name']) . '</title>' . \"\\n\";\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<link>http://www.langantiques.com/products/item/' . $item['item_number'] . '</link>' . \"\\n\";\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<description>' . htmlspecialchars($item['item_description']) . '</description>' . \"\\n\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tforeach($item['image_array']['external_images'] as $image) {\r\n\t\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:image_link>http://www.langantiques.com' . $image['image_location'] . '</g:image_link>' . \"\\n\";\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:price>' . $item['item_price'] . '</g:price>' . \"\\n\";\r\n\t\t\t\t\t\tif($item['api_new_condition'] == 1) {\r\n\t\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:condition>used</g:condition>' . \"\\n\";\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:condition>new</g:condition>' . \"\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($item['item_size'] != null) {\r\n\t\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<c:ring_size type=\"string\">' . $item['item_size'] . '</c:ring_size>' . \"\\n\";\t\r\n\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t\t$material_data = $this->ci->material_model->getAppliedMaterials($item['item_id']);\r\n\t\t\t\t\t\tforeach($material_data as $material) {\r\n\t\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:material>' . htmlspecialchars($material['material_name']) . '</g:material>' . \"\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//List Modifiers (search terms)\r\n\t\t\t\t\t\t$modifier_data = $this->ci->modifier_model->getAppliedModifiers($item['item_id']);\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:product_type> Clothing & Accessories > Jewelry > ' . htmlspecialchars($major_classes[$item['mjr_class_id']]['major_class_name']) . '</g:product_type>' . \"\\n\";\r\n\t\t\t\t\t\tforeach($modifier_data as $modifier) {\r\n\t\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:product_type> Clothing & Accessories > Jewelry > ' . htmlspecialchars($modifier['modifier_name']) . '</g:product_type>' . \"\\n\";\r\n\t\t\t\t\t\t\tif($modifier['modifier_id'] == 5) {\r\n\t\t\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:occasion>Engagement</g:occasion>' . \"\\n\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:quantity>' . $item['item_quantity'] . '</g:quantity>' . \"\\n\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//List payment types\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:payment_accepted>Cash</g:payment_accepted>' . \"\\n\";\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:payment_accepted>Check</g:payment_accepted>' . \"\\n\";\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:payment_accepted>Visa</g:payment_accepted>' . \"\\n\";\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:payment_accepted>MasterCard</g:payment_accepted>' . \"\\n\";\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:payment_accepted>AmericanExpress</g:payment_accepted>' . \"\\n\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:id>' . $item['item_number'] . '</g:id>' . \"\\n\";\r\n\t\t\t\t\t$rss .= \"\\t\\t\" . '</item>' . \"\\n\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t$rss .= \"\\t\" . '</channel>' . \"\\n\";\r\n\t\t$rss .= '</rss>' . \"\\n\";\t\t\r\n\t\t\r\n\t\treturn $rss; //string\t\r\n\t}",
"public static function exportXML()\n {\n $xml = new \\XMLWriter();\n $xml->openMemory();\n $xml->setIndent(true);\n $xml->setIndentString(\"\t\");\n $xml->startDocument(\"1.0\", \"UTF-8\");\n $xml->startElement(\"productos\");\n $productos = self::findAll();\n foreach ($productos as $producto) {\n $xml->startElement(\"producto\");\n $xml->writeAttribute(\"id\", $producto->getId());\n $xml->writeElement(\"nombre\", $producto->getNombre());\n $xml->writeElement(\"descripcion\", $producto->getDescripcion());\n $urlImagen = $producto->getImagen() ? BASE_URL.\"/productos/{$producto->getId()}?image=1\": \"\";\n $xml->writeElement(\"imagen\", $urlImagen);\n if($categoria = $producto->getCategoria()) {\n $xml->startElement(\"categoria\");\n $xml->writeAttribute(\"id\", $categoria->getId());\n $xml->writeElement(\"nombre\", $categoria->getNombre());\n $xml->writeElement(\"descripcion\", $categoria->getDescripcion());\n $xml->endElement();\n }\n $xml->endElement();\n }\n $xml->endElement();\n return $xml->outputMemory();\n }",
"public function send_vb_data_to_atomv2 ($vars = array())\r\n\t{\r\n\t\t$products_list = $this->get_pp_dao()->get_vb_products_xml($vars[\"task_id\"], $vars[\"task_type\"], $vars[\"init_read_datetime\"], \"prod_sku\", \"product_content\", \"lang_id\", TRUE);\r\n\r\n\t\tif ($products_list !== FALSE)\r\n\t\t{\r\n\t\t\t$xml = array();\r\n\t\t\t$xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\r\n\t\t\t$xml[] = '<products task_id=\"' . $vars[\"task_id\"] . '\">';\r\n\r\n\t\t\t$current_sku = '';\r\n\t\t\t$c = 1;\r\n\t\t\tforeach ($products_list as $pc)\r\n\t\t\t{\r\n\t\t\t\tif ($current_sku != '')\r\n\t\t\t\t{\r\n\t\t\t\t\t$xml[] = '</product>';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$xml[] = '<product>';\r\n\t\t\t\t$xml[] = '<prod_sku>' . $pc['prod_sku'] . '</prod_sku>';\r\n\t\t\t\t$xml[] = '<master_sku>' . $pc['master_sku'] . '</master_sku>';\r\n\t\t\t\t$xml[] = '<lang_id>' . $pc['lang_id'] . '</lang_id>';\r\n\t\t\t\t$xml[] = '<prod_name>' . $this->replace_special_chars($pc['prod_name']) . '</prod_name>';\r\n\t\t\t\t$xml[] = '<prod_name_original>' . $this->replace_special_chars( $pc['prod_name_original']) . '</prod_name_original>';\r\n\t\t\t\t$xml[] = '<short_desc>' . $this->replace_special_chars($pc['short_desc']) . '</short_desc>';\r\n\t\t\t\t$xml[] = '<contents>' . $this->replace_special_chars($pc['contents']) . '</contents>';\r\n\t\t\t\t$xml[] = '<contents_original>' . $this->replace_special_chars($pc['contents_original']) . '</contents_original>';\r\n\t\t\t\t//$xml[] = '<series>' . $this->replace_special_chars($pc['series']) . '</series>';\r\n\t\t\t\t$xml[] = '<keywords>' . $this->replace_special_chars($pc['keywords']) . '</keywords>';\r\n\t\t\t\t$xml[] = '<keywords_original>' . $this->replace_special_chars($pc['keywords_original']) . '</keywords_original>';\r\n\t\t\t\t//$xml[] = '<model_1>' . $this->replace_special_chars($pc['model_1']) . '</model_1>';\r\n\t\t\t\t//$xml[] = '<model_2>' . $this->replace_special_chars($pc['model_2']) . '</model_2>';\r\n\t\t\t\t//$xml[] = '<model_3>' . $this->replace_special_chars($pc['model_3']) . '</model_3>';\r\n\t\t\t\t//$xml[] = '<model_4>' . $this->replace_special_chars($pc['model_4']) . '</model_4>';\r\n\t\t\t\t//$xml[] = '<model_5>' . $this->replace_special_chars($pc['model_5']) . '</model_5>';\r\n\t\t\t\t$xml[] = '<detail_desc><![CDATA[' . $this->replace_special_chars( $pc['detail_desc']) . ']]></detail_desc>';\r\n\t\t\t\t$xml[] = '<detail_desc_original>' . $this->replace_special_chars( $pc['detail_desc_original']) . '</detail_desc_original>';\r\n\t\t\t\t$xml[] = '<extra_info>' .$this->replace_special_chars( $pc['extra_info']) . '</extra_info>';\r\n\t\t\t\t$xml[] = '<website_status_long_text>' . $this->replace_special_chars($pc['website_status_long_text']) . '</website_status_long_text>';\r\n\t\t\t\t$xml[] = '<website_status_short_text>' . $this->replace_special_chars($pc['website_status_short_text']) . '</website_status_short_text>';\r\n\t\t\t\t//$xml[] = '<youtube_id_1>' . $this->replace_special_chars($pc['youtube_id_1']) . '</youtube_id_1>';\r\n\t\t\t\t//$xml[] = '<youtube_id_2>' . $this->replace_special_chars($pc['youtube_id_2']) . '</youtube_id_2>';\r\n\t\t\t\t//$xml[] = '<youtube_caption_1>' . $this->replace_special_chars($pc['youtube_caption_1']) . '</youtube_caption_1>';\r\n\t\t\t\t//$xml[] = '<youtube_caption_2>' . $this->replace_special_chars($pc['youtube_caption_2']) . '</youtube_caption_2>';\r\n\t\t\t\t$xml[] = '<is_error>' . $pc['is_error'] . '</is_error>';\r\n\r\n\t\t\t\t$current_sku = $pc['prod_sku'];\r\n\t\t\t}\r\n\t\t\tif ($current_sku != '')\r\n\t\t\t{\r\n\t\t\t\t$xml[] = '</product>';\r\n\t\t\t}\r\n\r\n\t\t\t$xml[] = '</products>';\r\n\r\n\t\t\t$feed = implode(\"\", $xml);\r\n\r\n\t\t\t// header('Content-type: text/xml');\r\n\t\t\t// print $feed;\r\n\t\t\t// exit;\r\n\r\n\t\t\t$feed = $this->send_vb_data_post($feed, $vars[\"task_type\"], $vars[\"task_id\"]);\r\n\r\n\t\t\treturn $feed;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}",
"public function send_vb_data_to_atomv2 ($vars = array())\r\n\t{\r\n\t\t$products_list = $this->get_pp_dao()->get_vb_products_xml($vars[\"task_id\"], $vars[\"task_type\"], $vars[\"init_read_datetime\"], \"sku\", \"product\");\r\n\r\n\t\tif ($products_list !== FALSE)\r\n\t\t{\r\n\t\t\t$xml = array();\r\n\t\t\t$xml[] = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\r\n\t\t\t$xml[] = '<products task_id=\"' . $vars[\"task_id\"] . '\">';\r\n\t\t\t$current_sku = '';\r\n\t\t\tforeach ($products_list as $pc)\r\n\t\t\t{\r\n\t\t\t\tif ($current_sku != '')\r\n\t\t\t\t{\r\n\t\t\t\t\t$xml[] = '</product>';\r\n\t\t\t\t}\r\n\t\t\t\t$xml[] = '<product>';\r\n\t\t\t\t$xml[] = '<sku>' . $pc['sku'] . '</sku>';\r\n\t\t\t\t$xml[] = '<master_sku>' . $pc['master_sku'] . '</master_sku>';\r\n\t\t\t\t$xml[] = '<prod_grp_cd>' . $pc['prod_grp_cd'] . '</prod_grp_cd>';\r\n\t\t\t\t$xml[] = '<colour_id>' . $pc['colour_id'] . '</colour_id>';\r\n\t\t\t\t$xml[] = '<version_id>' . $pc['version_id'] . '</version_id>';\r\n\t\t\t\t$xml[] = '<name>' . str_replace('&', '&', $pc['name']) . '</name>';\r\n\t\t\t\t$xml[] = '<freight_cat_id>' . $pc['freight_cat_id'] . '</freight_cat_id>';\r\n\t\t\t\t$xml[] = '<cat_id>' . $pc['cat_id'] . '</cat_id>';\r\n\t\t\t\t$xml[] = '<sub_cat_id>' . $pc['sub_cat_id'] . '</sub_cat_id>';\r\n\t\t\t\t$xml[] = '<sub_sub_cat_id>' . $pc['sub_sub_cat_id'] . '</sub_sub_cat_id>';\r\n\t\t\t\t$xml[] = '<brand_id>' . $pc['brand_id'] . '</brand_id>';\r\n\t\t\t\t$xml[] = '<clearance>' . $pc['clearance'] . '</clearance>';\r\n\t\t\t\t$xml[] = '<china_oem>' . $pc['china_oem'] . '</china_oem>';\r\n\t\t\t\t$xml[] = '<image>' . $pc['image'] . '</image>';\r\n\t\t\t\t$xml[] = '<ean>' . $pc['ean'] . '</ean>';\r\n\t\t\t\t$xml[] = '<mpn>' . $pc['mpn'] . '</mpn>';\r\n\t\t\t\t$xml[] = '<upc>' . $pc['upc'] . '</upc>';\r\n\t\t\t\t//$xml[] = '<discount>' . $pc['discount'] . '</discount>';\r\n\t\t\t\t$xml[] = '<proc_status>' . $pc['proc_status'] . '</proc_status>';\r\n\t\t\t\t$xml[] = '<website_status>' . $pc['website_status'] . '</website_status>';\r\n\t\t\t\t//$xml[] = '<sourcing_status>' . $pc['sourcing_status'] . '</sourcing_status>';\r\n\t\t\t\t$xml[] = '<expected_delivery_date>' . $pc['expected_delivery_date'] . '</expected_delivery_date>';\r\n\t\t\t\t$xml[] = '<lang_restricted>' . $pc['lang_restricted'] . '</lang_restricted>';\r\n\t\t\t\t$xml[] = '<shipment_restricted_type>' . $pc['shipment_restricted_type'] . '</shipment_restricted_type>';\r\n\t\t\t\t$xml[] = '<comments>' . str_replace('&', '&', $pc['comments']) . '</comments>';\r\n\t\t\t\t$xml[] = '<product_warranty_type>' . $pc['product_warranty_type'] . '</product_warranty_type>';\r\n\t\t\t\t$xml[] = '<accelerator>' . $pc['accelerator'] . '</accelerator>';\r\n\t\t\t\t$xml[] = '<status>' . $pc['status'] . '</status>';\r\n\t\t\t\t$xml[] = '<is_error>' . $pc['is_error'] . '</is_error>';\r\n\r\n\r\n\t\t\t\t$current_sku = $pc['sku'];\r\n\t\t\t}\r\n\t\t\tif ($current_sku != '')\r\n\t\t\t{\r\n\t\t\t\t$xml[] = '</product>';\r\n\t\t\t}\r\n\r\n\t\t\t$xml[] = '</products>';\r\n\r\n\t\t\t$feed = implode(\"\", $xml);\r\n\r\n\t\t\t// header('Content-type: text/xml');\r\n\t\t\t// print $feed;\r\n\t\t\t// exit;\r\n\r\n\t\t\t$feed = $this->send_vb_data_post($feed, $vars[\"task_type\"], $vars[\"task_id\"]);\r\n\r\n\t\t\treturn $feed;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}",
"public function productToXml(array $product, SimpleXMLElement $xml) {\n foreach($product as $code => $value) {\n if(is_array($value)) {\n $node = $xml->addChild($code);\n $this->productToXml($value, $node);\n } else if (is_string($value) || is_numeric($value) || is_bool($value) || is_null($value)) {\n $xml->addChild($code, htmlspecialchars($value));\n }\n }\n }",
"function build_inventory_xml($items) {\r\n\t$xml_text='<?xml version=\"1.0\"?>'.\r\n\t'<InventoryXML>'.\r\n\t\t'<Password>'.$this->password.'</Password>'.\r\n\t\t'<CustomerID>'.$this->customerID.'</CustomerID>';\r\n\t\tforeach($items as $itemID=>$prodWarID){\r\n\t\t$xml_text.='<Item>'.\r\n\t\t'<ItemID>'.$itemID.'</ItemID>'.\r\n\t\t'</Item>';\r\n\t\t}\r\n\r\n\t$xml_text.='</InventoryXML>';\r\n\r\n\treturn $xml_text;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts an amount from the base unit to the micro unit. | public static function baseToMicro($amount): int
{
return $amount ? (int)($amount * 1000000) : 0;
} | [
"protected function convertMilliToMicro($value)\n {\n return $value * 1000;\n }",
"public function setAmountMicrosUnwrapped($var)\n {\n $this->writeWrapperValue(\"amount_micros\", $var);\n return $this;}",
"public function setBillableUnitMicrosUnwrapped($var)\n {\n $this->writeWrapperValue(\"billable_unit_micros\", $var);\n return $this;}",
"public function setMicro($value)\n {\n return $this->set(self::MICRO, $value);\n }",
"public function getTaxAmountMicrosUnwrapped()\n {\n return $this->readWrapperValue(\"tax_amount_micros\");\n }",
"public function getBillableUnitMicros()\n {\n return isset($this->billable_unit_micros) ? $this->billable_unit_micros : 0;\n }",
"public function setCostMicrosUnwrapped($var)\n {\n $this->writeWrapperValue(\"cost_micros\", $var);\n return $this;}",
"public function getBillableUnitMicrosUnwrapped()\n {\n return $this->readWrapperValue(\"billable_unit_micros\");\n }",
"public function setTaxAmountMicros($var)\n {\n GPBUtil::checkInt64($var);\n $this->tax_amount_micros = $var;\n\n return $this;\n }",
"public function toUnit()\n {\n if (in_array($this->currency, $this->zeroDecimalCurrencies)) {\n return $this->amount;\n }\n return round($this->amount / 100, 2);\n }",
"protected static function getMicroTime()\n {\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n }",
"public function setSubtotalAmountMicrosUnwrapped($var)\n {\n $this->writeWrapperValue(\"subtotal_amount_micros\", $var);\n return $this;}",
"public function getAmountMicrosUnwrapped()\n {\n return $this->readWrapperValue(\"amount_micros\");\n }",
"public function getBillableUnitMicros()\n {\n return isset($this->billable_unit_micros) ? $this->billable_unit_micros : null;\n }",
"public static function micrograms(): UnitMass\n\t{\n\t\treturn new static(static::SYMBOL_MICROGRAMS, new UnitConverterLinear(static::COEFFICIENT_MICROGRAMS));\n\t}",
"public abstract function toStandardUnit( $value );",
"public function getAmountMicros()\n {\n return isset($this->amount_micros) ? $this->amount_micros : null;\n }",
"public function getTaxAmountMicros()\n {\n return isset($this->tax_amount_micros) ? $this->tax_amount_micros : 0;\n }",
"public function setTotalAmountMicros($var)\n {\n GPBUtil::checkInt64($var);\n $this->total_amount_micros = $var;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Makes a decision about whether to add info about the scope | protected function _addWhetherScopeInfo()
{
return true;
} | [
"protected function _addWhetherScopeInfo()\n {\n return false;\n }",
"protected function determine_scope()\n {\n }",
"private function determine_scope()\n {\n }",
"function hasScope();",
"protected function _addWhetherScopeInfo()\n {\n $fieldConfig = $this->getFieldConfig();\n $el = $fieldConfig->descend('upload_dir');\n return (!empty($el['scope_info']));\n }",
"public function isScope();",
"protected function hasScope() {\n return !empty($this->scopes);\n }",
"public function checkingScope()\n {\n // Null mengembalikan master admin\n // Tidak null mengembalikan bukan admin\n return Auth::user()->scope_id != null ? false : true;\n }",
"public function scopeExists($scope);",
"public function beforeSave() {\n $this->scope = join(',',$this->scope);\n }",
"protected function checkScope(): void\n {\n if ($this->hasScopeChanged()) {\n $this->swapChangedAttributes();\n if ($this->lowerItem()) {\n $this->decrementPositionsOnLowerItems();\n }\n\n $this->swapChangedAttributes();\n // make this item \"not in the list\" so subsequent call to addToListBottom() works (b/c it only operates on items that have no position)\n $this->setListifyPosition(null);\n $methodName = 'addToList'.$this->addNewAt();\n $this->{$methodName}();\n }\n }",
"protected function hasVariableListifyScope(): bool\n {\n $scope = $this->getScopeName();\n\n return $scope instanceof BelongsTo || is_callable($scope);\n }",
"public function isScopeStore();",
"public function getScopeRequired(): bool\n {\n return $this->isScopeRequired;\n }",
"public function getScope();",
"function getScopeString($get) {\r\r\r\n\t$scope = '';\r\r\r\n\tif(isset($get['scope'])) {\r\r\r\n\t\t$scope = \"?scope=\".$get['scope'];\r\r\r\n\t\tif(isset($get['more'])) {\r\r\r\n\t\t\t$scope .= \"&more=\".$get['more'];\r\r\r\n\t\t\tif(isset($get['even_more'])) {\r\r\r\n\t\t\t\t$scope .= \"&even_more=\".$get['even_more'];\r\r\r\n\t\t\t\treturn $scope;\r\r\r\n\t\t\t}\r\r\r\n\t\t\treturn $scope;\r\r\r\n\t\t}\r\r\r\n\t\treturn $scope;\r\r\r\n\t} else {\r\r\r\n\t\t$user = wp_get_current_user();\r\r\r\n\t\t$user_id = $user->data->ID;\r\r\r\n\t\t$scope = get_field('code_postal', 'user_'.$user_id );\r\r\r\n\t\treturn $scope;\r\r\r\n\t}\r\r\r\n}",
"public function checkScope()\n {\n $this->rules['activity_scope'] = 'required|code_list:Activity,ActivityScope';\n $this->messages['activity_scope.required'] = 'Activity scope is Required.';\n $this->messages['activity_scope.code_list'] = 'Activity scope is not valid.';\n }",
"protected function createScopeEntity()\n\t{\n\t\t$scope = $this->ask('New scope identifier?</question> ');\n\n\t\t$name = $this->ask('New scope name?</question> ');\n\n\t\t$description = $this->ask('New scope description?</question> ');\n\n\t\t$this->blankLine();\n\n\t\tif ( ! $scope or ! $name or ! $description)\n\t\t{\n\t\t\t$this->error('One or more of the questions was not answered. Unable to make new scope.');\n\n\t\t\texit;\n\t\t}\n\n\t\t$scope = $this->storage('scope')->create($scope, $name, $description);\n\n\t\t$this->info('Scope created! JSON representation of new scope:');\n\n\t\t$this->blankLine();\n\n\t\t$this->line(json_encode($scope->getAttributes(), JSON_PRETTY_PRINT));\n\n\t\t$this->blankLine();\n\t}",
"public function scopeParamRequired()\n {\n return $this->requireScopeParam;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
settings OPTIONS : Import or Export settings from/to file [file=] : The settings file to load EXAMPLES wp rocket load_settings file=settings23042.json | public function settings($args = array() , $assoc_args = array())
{
if ( $args[0] == 'import') {
if (!empty($assoc_args['file']))
{
$settings = file_get_contents($assoc_args['file']);
$settings = json_decode($settings, true);
if (null === $settings)
{
WP_CLI::error('Settings import failed: unexpected file content.');
}
if (is_array($settings))
{
$options_api = new WP_Rocket\Admin\Options('wp_rocket_');
$current_options = $options_api->get('settings', []);
$settings['consumer_key'] = $current_options['consumer_key'];
$settings['consumer_email'] = $current_options['consumer_email'];
$settings['secret_key'] = $current_options['secret_key'];
$settings['secret_cache_key'] = $current_options['secret_cache_key'];
$settings['minify_css_key'] = $current_options['minify_css_key'];
$settings['minify_js_key'] = $current_options['minify_js_key'];
$settings['version'] = $current_options['version'];
$options_api->set('settings', $settings);
WP_CLI::success('Settings imported and saved.');
}
}
else
{
WP_CLI::error('You didn\'t specify the "file" argument.');
}
} elseif ( $args[0] == 'export' ) {
WP_CLI::error('Not implemented...');
} else {
WP_CLI::error('You didn\'t specify the "file" argument.');
}
} | [
"private function import_settings()\n {\n }",
"function import($args, $assoc_args)\n {\n $settings = C_NextGen_Settings::get_instance();\n $file_content = file_get_contents($args[0]);\n $json = json_decode($file_content);\n\n if ($json === NULL)\n WP_CLI::error(\"Could not parse JSON file\");\n\n foreach ($json as $key => $value) {\n $settings->set($key, $value);\n }\n\n $settings->save();\n\n WP_CLI::success(\"Settings have been imported from {$args[0]}\");\n }",
"private static function loadSettings() {\n $settingsFile = ROOT . 'config/settings.json';\n\n if (!file_exists($settingsFile)) {\n self::$settings = array();\n return;\n }\n\n self::$settings = json_decode(file_get_contents($settingsFile), TRUE);\n foreach (self::$settings as $key => $value) {\n Template::assign($key, $value);\n }\n }",
"public function settings_import() {\n\t\tif ( empty( $_POST[ 'lp_action' ] ) || 'import_settings' !== esc_html( $_POST[ 'lp_action' ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !wp_verify_nonce( esc_html( $_POST[ 'lp_import_nonce' ] ), 'lp_import_nonce' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$extension = end( explode( '.', $_FILES[ 'import_file' ][ 'name' ] ) );\n\n\t\tif ( $extension !== 'json' ) {\n\t\t\twp_die( __( 'Please upload a valid .json file', LP_TEXTDOMAIN ) );\n\t\t}\n\n\t\t$import_file = $_FILES[ 'import_file' ][ 'tmp_name' ];\n\n\t\tif ( empty( $import_file ) ) {\n\t\t\twp_die( __( 'Please upload a file to import', LP_TEXTDOMAIN ) );\n\t\t}\n\n\t\t// Retrieve the settings from the file and convert the json object to an array.\n\t\t$settings = (array) wp_json_decode( file_get_contents( $import_file ) );\n\n\t\tupdate_option( LP_TEXTDOMAIN . '-settings', get_object_vars( $settings[ 0 ] ) );\n\t\tupdate_option( LP_TEXTDOMAIN . '-settings-second', get_object_vars( $settings[ 1 ] ) );\n\n\t\twp_safe_redirect( admin_url( 'options-general.php?page=' . LP_TEXTDOMAIN ) );\n\t\texit;\n\t}",
"private function plugin_load_settings() {\r\n\t\tif (empty($this->options)) {\r\n\t\t\t$this->options = get_option( $this->options_name );\r\n\t\t}\r\n\t\tif ( !is_array( $this->options ) ) {\r\n\t\t\t$this->options = array();\r\n\t\t}\r\n\t\t$this->options = wp_parse_args($this->options, $this->defaults);\r\n\t}",
"function pwsix_process_settings_import() {\n\n\tif( empty( $_POST['pwsix_action'] ) || 'import_settings' != $_POST['pwsix_action'] )\n\t\treturn;\n\n\tif( ! wp_verify_nonce( $_POST['pwsix_import_nonce'], 'pwsix_import_nonce' ) )\n\t\treturn;\n\n\tif( ! current_user_can( 'manage_options' ) )\n\t\treturn;\n\n\t$extension = end( explode( '.', $_FILES['import_file']['name'] ) );\n\n\tif( $extension != 'json' ) {\n\t\twp_die( __( 'Please upload a valid .json file' ) );\n\t}\n\n\t$import_file = $_FILES['import_file']['tmp_name'];\n\n\tif( empty( $import_file ) ) {\n\t\twp_die( __( 'Please upload a file to import' ) );\n\t}\n\n\t// Retrieve the settings from the file and convert the json object to an array.\n\t$settings = (array) json_decode( file_get_contents( $import_file ) );\n\n\tupdate_option( 'pwsix_settings', $settings );\n\n\twp_safe_redirect( admin_url( 'options-general.php?page=pwsix_settings' ) ); exit;\n\n}",
"function settingsFile() {\n \n // Assign properties to variables\n $company = self::$company;\n $domain = self::$domain;\n $support = self::$support;\n $host = self::$host;\n $name = self::$name;\n $user = self::$user;\n $pass = self::$pass;\n \n \n // Write the settings.json file\n $in\t\t\t= __DIR__.'/settings/settings.json';\n\t $make\t\t= fopen($in, 'w') or die(\"<b>Error creating settings file! Are settings folder permissions 777?</b><br>\");\n\t $inject\t= \"\n\t \n {\n\n \\\"company-name\\\" : \\\"$company\\\",\n \\\"domain-name\\\" : \\\"$domain\\\",\n \\\"support-email\\\" : \\\"$support\\\",\n\n \\\"db-host\\\" : \\\"$host\\\",\n \\\"db-name\\\" : \\\"$name\\\",\n \\\"db-user\\\" : \\\"$user\\\",\n \\\"db-pass\\\" : \\\"$pass\\\"\n \n }\n\t \n \";\n\t\n\t fwrite($make, $inject);\n\t fclose($make);\n\t \n\t return true;\n \n }",
"public static function load_settings_file($filename)\n {\n // Turn on output buffering to prevent accidental output.\n ob_start();\n include($filename);\n ob_get_clean();\n \n // We should now have an array $s with which to merge\n // the current settings.\n if (!empty($s)) {\n static::load_settings($s);\n }\n }",
"public function mvc_action_settings()\n {\n if (array_key_exists('status', $_GET)) {\n if ($_GET['status'] === '1') {\n add_settings_error('import', NULL, sprintf('Successfully imported %s settings.', $this->get_plugin()->get_plugin_data()['Name']), 'updated');\n } else if ($_GET['status'] === '0') {\n add_settings_error('import', NULL, sprintf('Failed to import %s settings.', $this->get_plugin()->get_plugin_data()['Name']), 'error');\n }\n }\n\n // Can we create setting backups?\n $template_redirect_class_name = preg_replace('/_Plugin/', '_Template_Redirect', $this->get_plugin()->get_name());\n $this->put('canbackup', class_exists(sprintf('%s\\%s', $this->get_plugin()->get_namespace(), $template_redirect_class_name), FALSE));\n\n // Last backup date - Do we have a backup of our settings?\n $filename = $this->get_plugin()->get_serialized_settings_filename();\n $this->put('backupdate', file_exists($filename) ? date(\"F dS Y H:i:s\", filemtime($filename)) : FALSE);\n\n // Standard settings page variables\n $page = $this->get_page();\n $this->put('page', $page);\n $this->put('siteurl', site_url());\n $this->put('group', $this->get_plugin()->get_option_group());\n $this->put('adminurl', admin_url(sprintf('%s?page=%s', $this->_is_options_general ? 'options-general.php' : 'admin.php', $this->get_plugin()->get_settings_slug())));\n $this->put('upload-marker', $this->get_plugin()->get_package() . '-import-settings-upload');\n $this->put('nonce', wp_create_nonce($this->get('upload-marker')));\n $section = NULL;\n if (array_key_exists('section', $_REQUEST)) {\n $section = $_REQUEST ['section'];\n } else {\n $settings = $this->_settings->get_settings();\n if (count($settings) === 1) {\n $section = trim(strip_tags($settings[0]['title']));\n }\n }\n $this->put('section', $section);\n $this->put('hasrequired', $this->_settings->get_has_required());\n $this->put('settings', $this->_settings);\n\n // Enqueue WordPress media scripts if required.\n if ($this->_settings->get_has_media() === TRUE) {\n wp_enqueue_media();\n }\n\n $framework_version = $this->get_plugin()->get_framework_plugin_data()['Version'];\n\n // Enqueue WordPress colorpicker scripts if required.\n if ($this->_settings->get_has_color_picker() === TRUE) {\n wp_enqueue_style('wp-color-picker');\n wp_enqueue_script( 'wp-color-picker-alpha', WPMU_PLUGIN_URL . '/hobo-framework/js/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), $framework_version, TRUE );\n }\n\n // Standard settings page javascript\n wp_enqueue_script('hobo-settings', WPMU_PLUGIN_URL . '/hobo-framework/views/js/settings.min.js', array('jquery', 'jquery-ui-core'), $framework_version, TRUE);\n wp_enqueue_script('hobo-standard-form', WPMU_PLUGIN_URL . '/hobo-framework/views/js/standard-form.min.js', array('jquery'), $framework_version, TRUE);\n\n // Standard settings css\n wp_enqueue_style('hobo-settings', WPMU_PLUGIN_URL . '/hobo-framework/css/settings.min.css', NULL, $framework_version);\n }",
"protected function load_settings() {\n\t\t$this->settings = WP_United_Settings::Create();\n\t\t$this->init_style_keys();\n\t}",
"protected function readSettingsFile(){\r\n\t\t$fileContents = file_get_contents(APPLICATION_SETTINGS_FILE);\r\n\t\treturn json_decode($fileContents, true);\r\n\t}",
"private function loadSettings()\n {\n ob_start();\n $this->data = include $this->filePath;\n ob_end_clean();\n }",
"function cldchimp_process_settings_import() {\n\n\tif( empty( $_POST['cldchimp_action'] ) || 'import_settings' != $_POST['cldchimp_action'] )\n\t\treturn;\n\n\tif( ! wp_verify_nonce( $_POST['cldchimp_import_nonce'], 'cldchimp_import_nonce' ) )\n\t\treturn;\n\n\tif( ! current_user_can( 'manage_options' ) )\n\t\treturn;\n\n\t$extension = end( explode( '.', $_FILES['import_file']['name'] ) );\n\n\tif( $extension != 'json' ) {\n\t\twp_die( __( 'Please upload a valid .json file' ) );\n\t}\n\n\t$import_file = $_FILES['import_file']['tmp_name'];\n\n\tif( empty( $import_file ) ) {\n\t\twp_die( __( 'Please upload a file to import' ) );\n\t}\n\n\t// Retrieve the settings from the file and convert the json object to an array.\n\t$newsettings = (array) json_decode( file_get_contents( $import_file ) );\n\t\n\t// Save settings action\n\t$settings = new stdClass();\n\t\n\t// Read post data\n\t$settings->acs_aws_access_key_id = ( !empty( $newsettings[ 'acs_aws_access_key_id' ] ) ) ? wp_kses_post( $newsettings[ 'acs_aws_access_key_id' ] ) : '';\n\t$settings->acs_aws_secret_access_key = ( !empty( $newsettings[ 'acs_aws_secret_access_key' ] ) ) ? wp_kses_post( $newsettings[ 'acs_aws_secret_access_key' ] ) : '';\n\t$settings->acs_aws_region = ( !empty( $newsettings[ 'acs_aws_region' ] ) ) ? wp_kses_post( $newsettings[ 'acs_aws_region' ] ) : '';\n\t$settings->acs_search_endpoint = ( !empty( $newsettings[ 'acs_search_endpoint' ] ) ) ? wp_kses_post( $newsettings[ 'acs_search_endpoint' ] ) : '';\n\t$settings->acs_search_domain_name = ( !empty( $newsettings[ 'acs_search_domain_name' ] ) ) ? wp_kses_post( $newsettings[ 'acs_search_domain_name' ] ) : '';\n\t$settings->acs_frontpage_content_box_type = ( !empty( $newsettings[ 'acs_frontpage_content_box_type' ] ) ) ? wp_kses_post( $newsettings[ 'acs_frontpage_content_box_type' ] ) : 'default';\n\t$settings->acs_frontpage_content_box_value = ( !empty( $newsettings[ 'acs_frontpage_content_box_value' ] ) ) ? wp_kses_post( $newsettings[ 'acs_frontpage_content_box_value' ] ) : '';\n\t$settings->acs_frontpage_use_plugin_search_page = ( !empty( $newsettings[ 'acs_frontpage_use_plugin_search_page' ] ) ) ? 1 : 0;\n\t$settings->acs_frontpage_use_jquery = ( !empty( $newsettings[ 'acs_frontpage_use_jquery' ] ) ) ? 1 : 0;\n\t$settings->acs_frontpage_show_filters = ( !empty( $newsettings[ 'acs_frontpage_show_filters' ] ) ) ? 1 : 0;\n\t$settings->acs_frontpage_custom_css = ( !empty( $newsettings[ 'acs_frontpage_custom_css' ] ) ) ? wp_kses_post( $newsettings[ 'acs_frontpage_custom_css' ] ) : '';\n\t$settings->acs_results_show_fields_sticky = ( !empty( $newsettings[ 'acs_results_show_fields_sticky' ] ) ) ? 1 : 0;\n\t$settings->acs_results_show_fields_formats = ( !empty( $newsettings[ 'acs_results_show_fields_formats' ] ) ) ? 1 : 0;\n\t$settings->acs_results_show_fields_categories = ( !empty( $newsettings[ 'acs_results_show_fields_categories' ] ) ) ? 1 : 0;\n\t$settings->acs_results_show_fields_tags = ( !empty( $newsettings[ 'acs_results_show_fields_tags' ] ) ) ? 1 : 0;\n\t$settings->acs_results_show_fields_comments = ( !empty( $newsettings[ 'acs_results_show_fields_comments' ] ) ) ? 1 : 0;\n\t$settings->acs_results_show_fields_content = ( !empty( $newsettings[ 'acs_results_show_fields_content' ] ) ) ? 1 : 0;\n $settings->acs_results_show_fields_excerpt = ( !empty( $newsettings[ 'acs_results_show_fields_excerpt' ] ) ) ? 1 : 0;\n\t$settings->acs_results_show_fields_custom = ( !empty( $newsettings[ 'acs_results_show_fields_custom' ] ) ) ? 1 : 0;\n\t$settings->acs_results_custom_field = ( !empty( $newsettings[ 'acs_results_custom_field' ] ) ) ? wp_kses_post( $newsettings[ 'acs_results_custom_field' ] ) : '';\n\t$settings->acs_results_show_fields_image = ( !empty( $newsettings[ 'acs_results_show_fields_image' ] ) ) ? 1 : 0;\n\t$settings->acs_results_format_image = ( !empty( $newsettings[ 'acs_results_format_image' ] ) ) ? wp_kses_post( $newsettings[ 'acs_results_format_image' ] ) : '';\n\t$settings->acs_results_show_fields_date = ( !empty( $newsettings[ 'acs_results_show_fields_date' ] ) ) ? 1 : 0;\n\t$settings->acs_results_format_date = ( !empty( $newsettings[ 'acs_results_format_date' ] ) ) ? wp_kses_post( $newsettings[ 'acs_results_format_date' ] ) : '';\n\t$settings->acs_results_show_fields_author = ( !empty( $newsettings[ 'acs_results_show_fields_author' ] ) ) ? 1 : 0;\n\t$settings->acs_results_format_author = ( !empty( $newsettings[ 'acs_results_format_author' ] ) ) ? wp_kses_post( $newsettings[ 'acs_results_format_author' ] ) : '';\n\t$settings->acs_results_no_results_msg = ( !empty( $newsettings[ 'acs_results_no_results_msg' ] ) ) ? stripslashes( wp_kses_post( $newsettings[ 'acs_results_no_results_msg' ] ) ) : __( 'No results', ACS::PREFIX );\n\t$settings->acs_results_no_results_box_value = ( !empty( $newsettings[ 'acs_results_no_results_box_value' ] ) ) ? wp_kses_post( $newsettings[ 'acs_results_no_results_box_value' ] ) : '';\n\t$settings->acs_results_load_more_msg = ( !empty( $newsettings[ 'acs_results_load_more_msg' ] ) ) ? stripslashes( wp_kses_post( $newsettings[ 'acs_results_load_more_msg' ] ) ) : __( 'Load more', ACS::PREFIX );\n\t$settings->acs_filter_sort_field = ( !empty( $newsettings[ 'acs_filter_sort_field' ] ) ) ? wp_kses_post( $newsettings[ 'acs_filter_sort_field' ] ) : ACS::SORT_FIELD_DEFAULT;\n\t$settings->acs_filter_sort_order = ( !empty( $newsettings[ 'acs_filter_sort_order' ] ) ) ? wp_kses_post( $newsettings[ 'acs_filter_sort_order' ] ) : ACS::SORT_ORDER_DEFAULT;\n\t$settings->acs_results_max_items = ( !empty( $newsettings[ 'acs_results_max_items' ] ) ) ? intval( wp_kses_post( $newsettings[ 'acs_results_max_items' ] ) ) : ACS::SEARCH_RETURN_FULL_ITEMS;\n\t$settings->acs_results_field_weights = ( !empty( $newsettings[ 'acs_results_field_weights' ] ) ) ? stripslashes( wp_kses_post( $newsettings[ 'acs_results_field_weights' ] ) ) : '';\n $settings->acs_filter_text_length = ( !empty( $newsettings[ 'acs_filter_text_length' ] ) ) ? intval( wp_kses_post( $newsettings[ 'acs_filter_text_length' ] ) ) : ACS::SEARCH_TEXT_LENGTH;\n $settings->acs_filter_text_length_type = ( !empty( $newsettings[ 'acs_filter_text_length_type' ] ) ) ? wp_kses_post( $newsettings[ 'acs_filter_text_length_type' ] ) : ACS::SEARCH_TEXT_LENGTH_TYPE;\n \t$settings->acs_schema_fields_int = ( !empty( $newsettings[ 'acs_schema_fields_int' ] ) ) ? wp_kses_post( $newsettings[ 'acs_schema_fields_int' ] ) : '';\n \t$settings->acs_schema_fields_double = ( !empty( $newsettings[ 'acs_schema_fields_double' ] ) ) ? wp_kses_post( $newsettings[ 'acs_schema_fields_double' ] ) : '';\n \t$settings->acs_schema_fields_sortable = ( !empty($newsettings[ 'acs_schema_fields_sortable' ] ) ) ? wp_kses_post( $newsettings[ 'acs_schema_fields_sortable' ] ) : '';\n \t$settings->acs_schema_fields_prefix = ( !empty( $newsettings[ 'acs_schema_fields_prefix' ] ) ) ? wp_kses_post( $newsettings[ 'acs_schema_fields_prefix' ] ) : '';\n\t$settings->acs_schema_fields_separator = ( !empty( $newsettings[ 'acs_schema_fields_separator' ] ) ) ? wp_kses_post( $newsettings[ 'acs_schema_fields_separator' ] ) : ACS::FIELD_SEPARATOR_DEFAULT;\n\t$settings->acs_schema_fields_image_size = ( !empty( $newsettings[ 'acs_schema_fields_image_size' ] ) ) ? wp_kses_post( $newsettings[ 'acs_schema_fields_image_size' ] ) : '';\n\t$settings->acs_schema_fields_custom_image_id = ( !empty( $newsettings[ 'acs_schema_fields_custom_image_id' ] ) ) ? wp_kses_post( $newsettings[ 'acs_schema_fields_custom_image_id' ] ) : '';\n \t$settings->acs_schema_prevent_deletion = ( !empty( $newsettings[ 'acs_schema_prevent_deletion' ] ) ) ? 1 : 0;\n\t$settings->acs_network_site_id = ( !empty( $newsettings[ 'acs_network_site_id' ] ) ) ? wp_kses_post( $newsettings[ 'acs_network_site_id' ] ) : '';\n\t$settings->acs_network_blog_id = ( !empty( $newsettings[ 'acs_network_blog_id' ] ) ) ? wp_kses_post( $newsettings[ 'acs_network_blog_id' ] ) : '';\n\t$settings->acs_highlight_type = ( !empty( $newsettings[ 'acs_highlight_type' ] ) ) ? wp_kses_post( $newsettings[ 'acs_highlight_type' ] ) : ACS::HIGHLIGHT_TYPE_DEFAULT;\n \t$settings->acs_highlight_titles = ( !empty( $newsettings[ 'acs_highlight_titles' ] ) ) ? 1 : 0;\n \t$settings->acs_highlight_color_text = ( !empty( $newsettings[ 'acs_highlight_color_text' ] ) ) ? wp_kses_post( $newsettings[ 'acs_highlight_color_text' ] ) : '';\n \t$settings->acs_highlight_color_background = ( !empty( $newsettings[ 'acs_highlight_color_background' ] ) ) ? wp_kses_post( $newsettings[ 'acs_highlight_color_background' ] ) : '';\n \t$settings->acs_highlight_style = ( !empty( $newsettings[ 'acs_highlight_style' ] ) ) ? stripslashes( wp_kses_post( $newsettings[ 'acs_highlight_style' ] ) ) : '';\n \t$settings->acs_highlight_class = ( !empty( $newsettings[ 'acs_highlight_class' ] ) ) ? stripslashes( wp_kses_post( $newsettings[ 'acs_highlight_class' ] ) ) : '';\n \t$settings->acs_suggest_active = ( !empty( $newsettings[ 'acs_suggest_active' ] ) ) ? 1 : 0;\n\t$settings->acs_suggest_only_title = ( !empty( $newsettings[ 'acs_suggest_only_title' ] ) ) ? 1 : 0;\n \t$settings->acs_suggest_selector = ( !empty( $newsettings[ 'acs_suggest_selector' ] ) ) ? stripslashes( wp_kses_post( $newsettings[ 'acs_suggest_selector' ] ) ) : ACS::SUGGEST_DEFAULT_SELECTOR;\n \t$settings->acs_suggest_trigger = ( !empty( $newsettings[ 'acs_suggest_trigger' ] ) ) ? intval( wp_kses_post( $newsettings[ 'acs_suggest_trigger' ] ) ) : ACS::SUGGEST_DEFAULT_TRIGGER;\n \t$settings->acs_suggest_results = ( !empty( $newsettings[ 'acs_suggest_results' ] ) ) ? intval( wp_kses_post( $newsettings[ 'acs_suggest_results' ] ) ) : ACS::SUGGEST_DEFAULT_RESULTS;\n \t$settings->acs_suggest_order = ( !empty( $newsettings[ 'acs_suggest_order' ] ) ) ? wp_kses_post( $newsettings[ 'acs_suggest_order' ] ) : ACS::SUGGEST_ORDER_TYPE_1;\n \t$settings->acs_suggest_click = ( !empty( $newsettings[ 'acs_suggest_click' ] ) ) ? wp_kses_post( $newsettings[ 'acs_suggest_click' ] ) : ACS::SUGGEST_CLICK_TYPE_1;\n \t$settings->acs_suggest_all_font_size = ( !empty( $newsettings[ 'acs_suggest_all_font_size' ] ) ) ? wp_kses_post( $newsettings[ 'acs_suggest_all_font_size' ] ) : ACS::SUGGEST_DEFAULT_ALL_FONT_SIZE;\n \t$settings->acs_suggest_all_color = ( !empty( $newsettings[ 'acs_suggest_all_color' ] ) ) ? wp_kses_post( $newsettings[ 'acs_suggest_all_color' ] ) : ACS::SUGGEST_DEFAULT_ALL_COLOR;\n \t$settings->acs_suggest_all_background = ( !empty( $newsettings[ 'acs_suggest_all_background' ] ) ) ? wp_kses_post( $newsettings[ 'acs_suggest_all_background' ] ) : ACS::SUGGEST_DEFAULT_ALL_BACKGROUND;\n \t$settings->acs_suggest_focused_font_size = ( !empty( $newsettings[ 'acs_suggest_focused_font_size' ] ) ) ? wp_kses_post( $newsettings[ 'acs_suggest_focused_font_size' ] ) : ACS::SUGGEST_DEFAULT_FOCUSED_FONT_SIZE;\n \t$settings->acs_suggest_focused_color = ( !empty( $newsettings[ 'acs_suggest_focused_color' ] ) ) ? wp_kses_post( $newsettings[ 'acs_suggest_focused_color' ] ) : ACS::SUGGEST_DEFAULT_FOCUSED_COLOR;\n \t$settings->acs_suggest_focused_background = ( !empty( $newsettings[ 'acs_suggest_focused_background' ] ) ) ? wp_kses_post( $newsettings[ 'acs_suggest_focused_background' ] ) : ACS::SUGGEST_DEFAULT_FOCUSED_BACKGROUND;\n\t$settings->acs_hide_section_help = ( !empty( $newsettings[ 'acs_hide_section_help' ] ) ) ? 1 : 0;\n\t$settings->acs_hide_section_docs = ( !empty( $newsettings[ 'acs_hide_section_docs' ] ) ) ? 1 : 0;\n\n\t// Remove '.php' occurrences from boxes value\n\t$settings->acs_frontpage_content_box_value = str_replace( '.php', '', $settings->acs_frontpage_content_box_value );\n\t$settings->acs_results_no_results_box_value = str_replace( '.php', '', $settings->acs_results_no_results_box_value );\n\t$settings->acs_frontpage_content_box_value = str_replace( '.PHP', '', $settings->acs_frontpage_content_box_value );\n\t$settings->acs_results_no_results_box_value = str_replace( '.PHP', '', $settings->acs_results_no_results_box_value );\n\n\t$settings->acs_schema_types = ( !empty( $newsettings[ 'acs_schema_types' ] ) ) ? $newsettings[ 'acs_schema_types' ] : array();\n\t$settings->acs_schema_fields = ( !empty( $newsettings[ 'acs_schema_fields' ] ) ) ? $newsettings[ 'acs_schema_fields' ] : array();\n\t$settings->acs_schema_taxonomies = ( !empty( $newsettings[ 'acs_schema_taxonomies' ] ) ) ? $newsettings[ 'acs_schema_taxonomies' ] : array();\n\n\t// Save option on database\n\tupdate_option( ACS::OPTION_SETTINGS, $settings );\n\n\t// Reload settings option to refresh settings data after POST\n\twp_safe_redirect( admin_url( 'options-general.php?page=cldchimp_settings' ) ); exit;\n\n}",
"function _load_settings()\n\t{\n\t\tif ( ! $this->settings)\n\t\t{\n\t\t\t$this->settings = $this->_get_settings();\n\t\t}\n\t}",
"public function import() {\n\t\tcheck_admin_referer( 'kopa-settings' );\n\n\t\tif ( ! isset( $_FILES['kopa_import_file'] ) ) { return; } // We can't import the settings without a settings file.\n\n\t\t$menu = Kopa_Admin_Menus::menu_settings();\n\t\t$url = admin_url( 'themes.php?page='.$menu['menu_slug'].'&tab=backup-manager' );\n\n\t\t/**\n\t\t * Getting Credentials\n\t\t * @see http://codex.wordpress.org/Filesystem_API#Getting_Credentials\n\t\t */\n\t\tif (false === ($creds = request_filesystem_credentials($url, '', false, false, null) ) ) {\n\t\t\treturn false; // stop processing here\n\t\t}\n\n\t\t/**\n\t\t * Initializing WP_Filesystem_Base\n\t\t * @see http://codex.wordpress.org/Filesystem_API#Initializing_WP_Filesystem_Base\n\t\t */\n\t\tif ( ! WP_Filesystem($creds) ) {\n\t\t\trequest_filesystem_credentials($url, '', true, false, null);\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * Using the WP_Filesystem_Base Class to read file\n\t\t * @see http://codex.wordpress.org/Filesystem_API#Using_the_WP_Filesystem_Base_Class\n\t\t */\n\t\tglobal $wp_filesystem;\n\n\t\t$file = $_FILES['kopa_import_file']['tmp_name'];\n\t\t$upload = $wp_filesystem->get_contents( $file );\n\n\t\t// Decode the JSON from the uploaded file\n\t\t$options = json_decode( $upload, true );\n\n\t\t// Check for errors\n\t\tif ( ! $options || $_FILES['kopa_import_file']['error'] ) {\n\t\t\tKopa_Admin_Settings::add_error( __( 'There was a problem importing your settings.', kopa_get_domain() ) );\n\t\t\treturn false;\n\t\t}\n\n\t\t// Make sure this is a valid backup file.\n\t\tif ( ! isset( $options['kopathemes-backup-validator'] ) ) {\n\t\t\tKopa_Admin_Settings::add_error( __( \"The import file you've provided is invalid.\", kopa_get_domain() ) );\n\t\t\treturn false;\n\t\t} else {\n\t\t\tunset( $options['kopathemes-backup-validator'] ); // Now that we've checked it, we don't need the field anymore.\n\t\t}\n\n\t\t$has_updated = false; // If this is set to true at any stage, we add a successful message.\n\n\t\t// Loop through data, import settings\n\t\tforeach ( (array) $options as $key => $settings ) {\n\t\t\t$settings = maybe_unserialize( $settings ); // Unserialize serialized data before inserting it back into the database.\n\t\t\t\n\t\t\t// We can run checks using get_option(), as the options are all cached. See wp-includes/functions.php for more information.\n\t\t\tif ( get_theme_mod( $key ) != $settings ) {\n\t\t\t\tset_theme_mod( $key, $settings );\n\t\t\t\t$has_updated = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( $has_updated ) {\n\t\t\tKopa_Admin_Settings::add_message( __( 'Settings successfully imported.', kopa_get_domain() ) );\n\t\t}\n\n\t\treturn $has_updated;\n\t}",
"function load_settings()\n {\n $this->pua_edit_settings = (array) get_option( $this->edit_puawp_settings_page_key );\n $this->pua_display_settings = (array) get_option( $this->puawp_display_page_key );\n $this->pua_display_usage = (array) get_option( $this->puawp_display_usage_key );\n /* Merge with defaults */\n $this->edit_puawp_settings_page = array_merge( array(\n 'edit_pua_option' => 'Pop Up Archive Settings Page'\n ), $this->pua_edit_settings );\n\n $this->pua_display_settings_page = array_merge( array(\n 'pua_display_option' => 'Manage Audio'\n ), $this->pua_display_settings );\n\n $this->pua_display_usage_page = array_merge( array(\n 'pua_usage_option' => 'Usage Info'\n ), $this->pua_display_usage );\n }",
"public function a2020_import_settings(){\n\t\t\n\t\tif (defined('DOING_AJAX') && DOING_AJAX && check_ajax_referer('admin2020-settings-security-nonce', 'security') > 0) {\n\t\t\t\n\t\t\t$new_options = $this->utils->clean_ajax_input($_POST['settings']); \n\t\t\t\n\t\t\tif(is_array($new_options)){\n\t\t\t\tupdate_option( 'admin2020_settings', $new_options);\n\t\t\t}\n\t\t\t\n\t\t\techo __(\"Settings Imported\",\"admin2020\");\n\t\t\t\n\t\t\t\n\t\t}\n\t\tdie();\t\n\t\t\n\t}",
"private function load_settings()\n {\n $this->columns = DiviRoids_Settings()->get($this->settings_prefix . '-columns', true);\n $this->columns_divilibrary = DiviRoids_Settings()->get($this->settings_prefix . '-columns-divilibrary', true);\n $this->actions = DiviRoids_Settings()->get($this->settings_prefix . '-actions', true);\n }",
"public function render_settings() {\n\t\t\tinclude $this->find_html_file( 'settings.php' );\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
index all classes by classname at aids | private function _index_classes()
{
$ix = array();
$aix = $this->attr_idx;
foreach ($this->attribs as $aid => &$a) {
if (!empty($a['class'])) {
$cl = $a['class'];
if (!is_array($cl)) {
$cl = preg_split('|\\s+|', trim($cl));
}
foreach ($cl as $cl) {
if (isset($ix[$cl])) {
if (!is_array($ix[$cl])) {
$ix[$cl] = array($ix[$cl] => $this->attr_idx[$ix[$cl]]);
}
$ix[$cl][$aid] = $this->attr_idx[$aid];
} else {
$ix[$cl] = $aid;
}
}
}
}
return $this->class_idx = $ix;
} | [
"function classnames_for_block_core_search($attributes)\n {\n }",
"private function createIndices()\n {\n $filePath = Config::ROOT_PATH.'src/indices/implementations';\n $fileNames = scandir($filePath);\n foreach ($fileNames as $fileName) {\n $fileInfo = new SplFileInfo($fileName);\n $fileExtension = pathinfo($fileInfo->getFilename(), PATHINFO_EXTENSION);\n if ($fileExtension == 'php') {\n $fileNameWithoutExtension = $fileInfo->getBasename('.'.$fileExtension);\n $className = '\\publin\\src\\indices\\implementations\\\\'.$fileNameWithoutExtension;\n\n /** @var Index $index */\n $index = new $className($this->db);\n $indexName = $index->getName();\n $this->indices[$indexName] = $index;\n }\n }\n }",
"public function classes() {\n\t\t$this->ApiClass = ClassRegistry::init('ApiGenerator.ApiClass');\n\t\t$classIndex = $this->ApiClass->getClassIndex();\n\t\t$this->set('classIndex', $classIndex);\n\t}",
"public function getClassIndex() {\n\t\treturn $this->find('list', array('fields' => array('slug', 'name'), 'order' => 'ApiClass.name ASC'));\n\t}",
"public static function createIndex()\n\t{\n\t\tif (!isset(self::$tempMap[self::$activeClass]['_']['index']))\n\t\t{\n\t\t\tself::$tempMap[self::$activeClass]['_']['index'] = array();\n\t\t}\n\t\t\n\t\tself::$tempMap[self::$activeClass]['_']['index'][] = func_get_args();\n\t}",
"private function _index_tags()\n {\n $s = $nix = $ix = self::$_ar_;\n $ids = $this->ids;\n foreach ($this->tags as $id => $n) {\n // if(!isset($ix[$n])) $ix[$n] = array();\n $ix[$n][$id] = $ids[$id];\n }\n foreach ($ix as $n => $v) {\n foreach ($v as $id => $e) {\n $this->tags[$id] = $n;\n }\n\n if (isset($nix[$n])) {\n continue;\n }\n\n $_n = strtolower($n);\n if (isset($nix[$_n])) {\n foreach ($v as $id => $e) {\n $nix[$_n][$id] = $e;\n }\n\n $s[] = $_n;\n } else {\n $nix[$_n] = $v;\n }\n }\n foreach ($s as $_n) {\n asort($nix[$_n]);\n }\n\n return $this->tag_idx = $nix;\n }",
"static function get_indexes($class = null, $rebuild = false) {\n\t\tif ($rebuild) { self::$all_indexes = null; self::$indexes_by_subclass = array(); }\n\n\t\tif (!$class) {\n\t\t\tif (self::$all_indexes === null) {\n\t\t\t\t$classes = ClassInfo::subclassesFor('SearchIndex');\n\n\t\t\t\t$concrete = array();\n\t\t\t\tforeach ($classes as $class) {\n\t\t\t\t\t$ref = new ReflectionClass($class);\n\t\t\t\t\tif ($ref->isInstantiable()) $concrete[$class] = singleton($class);\n\t\t\t\t}\n\n\t\t\t\tself::$all_indexes = $concrete;\n\t\t\t}\n\n\t\t\treturn self::$all_indexes;\n\t\t}\n\t\telse {\n\t\t\tif (!isset(self::$indexes_by_subclass[$class])) {\n\t\t\t\t$all = self::get_indexes();\n\n\t\t\t\t$valid = array();\n\t\t\t\tforeach ($all as $indexclass => $instance) {\n\t\t\t\t\tif (is_subclass_of($indexclass, $class)) $valid[$indexclass] = $instance;\n\t\t\t\t}\n\n\t\t\t\tself::$indexes_by_subclass[$class] = $valid;\n\t\t\t}\n\n\t\t\treturn self::$indexes_by_subclass[$class];\n\t\t}\n\t}",
"public function getClassesAndAnnotations() {\n\t\tstatic $classesAndAnnotations;\n\t\tif ($classesAndAnnotations === NULL) {\n\t\t\tforeach (array_keys($this->indexAnnotations) AS $className) {\n\t\t\t\t$classesAndAnnotations[$className] = $this->indexAnnotations[$className]['annotation'];\n\t\t\t}\n\t\t}\n\n\t\treturn $classesAndAnnotations;\n\t}",
"public function indexes();",
"protected function _getClassIndices($class)\n {\n $indices = array ();\n if ($class == self::CLASS_LETTER) {\n $indices = array_merge(\n $this->_getClassIndices(self::CLASS_LOWER),\n $this->_getClassIndices(self::CLASS_UPPER)\n );\n sort($indices);\n } else {\n if (isset ($this->_tokenIndices[$class])) {\n $indices = $this->_tokenIndices[$class];\n }\n }\n\n return $indices;\n }",
"final public function getClassIndex($shape, $classgroup, $numclasses) {}",
"public function indexClasses($classes)\n {\n $this->indexClasses = $classes;\n\n return $this;\n }",
"private function buildFilenameIndex(array $allRelevantClasses): array\n\t{\n\t\t$filenameIndex = [];\n\t\tforeach ($allRelevantClasses as $relevantClass) {\n\t\t\t$filename = $this->getFilenameFromClass($relevantClass);\n\n\t\t\t$filenameIndex[$filename][] = $relevantClass;\n\t\t}\n\n\t\treturn $filenameIndex;\n\t}",
"function uvasomrfdsearch_add_classes( $classes ) {\n\t$classes[] = 'search';\n\treturn $classes;\n}",
"public function getIndices($class = '')\n {\n if (empty($class)) {\n return $this->indices;\n }\n\n if ($this->classMap->has($class)) {\n return $this->classMap[$class];\n }\n\n return collect();\n }",
"#[@test]\n public function classIndexerExists() {\n $t= $this->compile('class ArrayList<T> { public T this[int $offset] { get { } set { } isset { } unset { } }}');\n $this->assertTrue($t->hasIndexer('color'));\n }",
"public function searchByIds($ids = array());",
"function get_attribute_class_index($class_name)\n\t{\n\t\t$class_index = null;\n\t\tforeach($this->attribute_schema as $index=>$attribute_class)\n\t\t\tif($attribute_class[\"name\"] == $class_name)\n\t\t\t\t$class_index = $index;\n\t\treturn $class_index;\n\t}",
"public static function saveClassIndex( )\n {\n\n if (!self::$indexChanged)\n return;\n\n // append class index\n $index = '<?php\n BuizCore::$classIndex = array('.NL;\n\n foreach (self::$classIndex as $class => $path)\n $index .= \" '$class' => '$path',\".NL;\n\n $index .= NL.');'.NL.NL;\n\n // append template index\n $index .= '\n BuizCore::$tplIndex = array('.NL;\n\n foreach (self::$tplIndex as $key => $path)\n $index .= \" '$key' => '$path',\".NL;\n\n $index .= NL.');'.NL.NL;\n\n $keyPath = str_replace('.' , '/' , self::$indexKey );\n $path = PATH_GW.self::$indexCache.$keyPath.'/';\n\n $file = $path.self::$indexKey.'.php';\n\n if (!is_dir($path))\n if (!SFilesystem::mkdir($path))\n return;\n\n file_put_contents($file , $index);\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Combines given labels into 1 file and returns it. When a starting location on the page is chosen, up to 3 locations will be left blank. This allows for reusing of label paper that has 1 or more labels already used. The following are the order of positions per page size: PAGE_SIZE_A4 LOCATION_TOP_LEFT LOCATION_TOP_RIGHT LOCATION_BOTTOM_LEFT LOCATION_BOTTOM_RIGHT PAGE_SIZE_A5 LOCATION_TOP LOCATION_BOTTOM PAGE_SIZE_A6 LOCATION_TOP | public function combineLabels(
array $files,
$pageSize = self::PAGE_SIZE_A4,
$startLocation = self::LOCATION_TOP_LEFT,
$margin = 0
) {
list($labelsPerRow, $labelsPerColumn) = $this->getLabelsPerPage($pageSize);
$labelsPerPage = $labelsPerRow * $labelsPerColumn;
$pdf = new Fpdi(
$this->getOrientation($pageSize),
'pt',
$pageSize === self::PAGE_SIZE_A6
? [self::LABEL_HEIGHT, self::LABEL_WIDTH]
: $pageSize
);
// If we're not starting at position 0, add a page, because it won't be
// added in the loop.
if (($labelPosition = $this->getStartPosition($pageSize, $startLocation)) > 0) {
$pdf->AddPage();
}
foreach ($files as $file) {
// Whenever we the max number of labels is on a page, create a
// new page.
if ($labelPosition % $labelsPerPage === 0) {
$pdf->AddPage();
}
list($x, $y, $width) = $this->calculateDimensions($labelPosition, $labelsPerRow, $labelsPerColumn, $margin);
$formats = $file->getFormats();
$format = reset($formats);
if ($format[FileInterface::FORMAT_MIME_TYPE] !== FileInterface::MIME_TYPE_PDF) {
// Add the image (label) to the pdf.
$pdf->Image($file->getTemporaryFilePath(), $x, $y, $width);
} else {
// Add the page (label) to the pdf.
$pdf->setSourceFile($file->getTemporaryFilePath());
$pageId = $pdf->importPage(1);
$pdf->useTemplate($pageId, $x, $y, $width);
}
$labelPosition++;
}
return (new File())
->addFormat(FileInterface::MIME_TYPE_PDF, 'pdf')
->setBase64Data(
base64_encode($pdf->Output('S')),
FileInterface::MIME_TYPE_PDF
);
} | [
"public function combineLabels(\n array $files,\n string $pageSize = self::PAGE_SIZE_A4,\n int $startLocation = self::LOCATION_TOP_LEFT,\n int $margin = 0\n ): FileInterface;",
"function printLocationProductLabelsAvery5167($pos_location_id, $barcodes, $quantities, $row_offset, $column_offset, $filename)\n{\n\t\n\trequire_once(TCPDF_LANG);\n\trequire_once(TCPDF);\n\t\n\t$pdf_file_name = $filename;\n\t\n\t$subid = array();\n\t$poc_title = array();\n\t$color_price = array();\n\n\tfor($i=0;$i<sizeof($barcodes);$i++)\n\t{\n\t\t$barcode = $barcodes[$i];\n\n\t\t\tfor($qty=0;$qty<$quantities[$i];$qty++)\n\t\t\t{\n\t\t\t\t$subid[] = $barcode;\n\n\t\t\t}\n\n\t\t\n\t\t\n\t}\n\n\t$margin_left = 0;\n\t$margin_right = 0;\n\t$margin_top = 0;\n\t$margin_bottom = 0;\n\n\t$columns = 4;\n\t$rows = 20;\n\t\n\t$title = 'Avery 5167 template';\n\t$subject = 'PO # 123';\n\t$keywords = 'purchase order 123';\n\t$page_orientation = 'P';\n\t$page_format = 'LETTER';\n\t$unit = 'in';\n\t\n\t// create new PDF document\n\t$pdf = new TCPDF($page_orientation, $unit, $page_format, true, 'UTF-8', false);\n\t// set document information\n\t$pdf->SetCreator(getSetting('company_name'));\n\t$pdf->SetAuthor(getUserFullName($_SESSION['pos_user_id']));\n\t$pdf->SetTitle($title);\n\t$pdf->SetSubject($subject );\n\t$pdf->SetKeywords($keywords);\n\t$pdf->setPrintHeader(false);\n\t$pdf->setPrintFooter(false);\n\t$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);\n\t$pdf->SetMargins($margin_left, $margin_top, $margin_right);\n\t$pdf->SetAutoPageBreak(TRUE, $margin_bottom);\n\t$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);\n\t$pdf->setLanguageArray($l);\n\t$preferences = array('PrintScaling' => 'None');\n\t$pdf->setViewerPreferences($preferences);\n\t$pdf->SetFont('helvetica', 'R', 5);\n\t\n\t//$pdf->setCellHeightRatio(3);\n\t$counter = 0;\n\t\n\t//calculating the pages.... how many labels are to be printed on the sheet...\n\t//how many labels are going on the first sheet?\n\t$first_page_number_of_spots = ($rows)*($columns-($column_offset-1)) -($row_offset-1);\n\t$number_of_labels = sizeof($subid);\n\t\n\t//now add on the location label only on the first page...\n\t$number_of_labels = $number_of_labels + 1;\n\t\n\tif($number_of_labels <= $first_page_number_of_spots)\n\t{\n\t\t$pages = 1;\n\t}\n\telse\n\t{\n\t\t$lables_on_first_page = $first_page_number_of_spots;\n\t\t$labels_remaining = $number_of_labels -$lables_on_first_page;\n\t\t$number_of_spots_per_page = $rows*$columns;\n\t\t$pages = ceil($labels_remaining/($number_of_spots_per_page)) + 1;\n\t}\n\t$location_printed=false;\n\tfor($page=0;$page<$pages;$page++)\n\t{\n\t\t$pdf->AddPage();\n\t\tfor($col=$column_offset-1;$col<$columns;$col++)\n\t\t{\n\t\t\tfor($row=$row_offset-1;$row<$rows;$row++)\n\t\t\t{\n\t\t\t\tif($location_printed)\n\t\t\t\t{\n\t\t\t\t\tif($counter< sizeof($subid))\n\t\t\t\t\t{\n\t\t\t\t\t\t$pdf = addProductLabelToPdfAvery5167($pdf, $subid[$counter], $row, $col);\n\t\t\t\t\t}\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$pdf = addLocationLabelToPdfAvery5167($pdf, $pos_location_id, $row, $col);\t\n\t\t\t\t\t$location_printed=true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t$row_offset = 1;\n\t\t}\n\t\t$column_offset = 1;\n\t}\n//Close and output PDF document\n$pdf->Output($pdf_file_name, 'D');\n\n//============================================================+\n// END OF FILE\n//============================================================+\n}",
"function load_page_labels($page, $data=array())\n{\n\t$lines = file(LABEL_DIRECTORY.$page.'.txt', FILE_IGNORE_NEW_LINES);\n\t$labels = array();\n\t\n\tforeach($lines AS $line)\n\t{\n\t\t#Read each variable and its value into the array\n\t\tif( strncmp($line,\">>\",2) == 0) \n\t\t{\n\t\t\t$variable = substr($line, 2, (strpos($line, '=')-2) );\n\t\t\t$labels[$variable] = substr($line, (strpos($line, '=')+1));\n\t\t} \n\t\telse if(!empty($labels[$variable])) \n\t\t{\n\t\t\t$labels[$variable] .= '<br>'.$line;\n\t\t}\n\t}\n\t\n\treturn array_merge($data, $labels);\n}",
"function printLabel() {\n /**\n * <PAGE></PAGE>:\n * Pagination, used to support the printing of multiple different label pages (up to 10 sheets), not using this label means that all elements are only printed on one label page\n *\n * <SIZE>width,height</SIZE>:\n * Set label paper width and height, width label paper width (excluding backing paper), height label paper height (excluding backing paper), unit mm, such as<SIZE>40,30</SIZE>\n *\n * <TEXT x=\"10\" y=\"100\" w=\"1\" h=\"2\" r=\"0\">Text content</TEXT>:\n * Print the text, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute w is the text width magnification ratio 1-10 (default is 1)\n * Attribute h is text height magnification 1-10 (default is 1)\n * The attribute r is the rotation angle of the text (clockwise, the default is 0):\n * 0 0degree\n * 90 90degree\n * 180 180degree\n * 270 270degree\n *\n * <BC128 x=\"10\" y=\"100\" h=\"60\" s=\"1\" n=\"1\" w=\"1\" r=\"0\">1234567</BC128>:\n * Print code128 one-dimensional code, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute h is the height of the barcode (default is 48)\n * Whether the attribute s can be recognized by human eyes: 0 is not recognized, 1 is recognized (default is 1)\n * The attribute n is the width of the narrow bar, expressed in dots (default is 1)\n * The attribute w is the width of bar, expressed in dots (default is 1)\n * The attribute r is the text rotation angle (clockwise, the default is 0):\n * 0 0degree\n * 90 90degree\n * 180 180degree\n * 270 270degree\n *\n * <BC39 x=\"10\" y=\"100\" h=\"60\" s=\"1\" n=\"1\" w=\"1\" r=\"0\">1234567</BC39>:\n * Print code39 one-dimensional code, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute h is the height of the barcode (default is 48)\n * Whether the attribute s can be recognized by human eyes: 0 is not recognized, 1 is recognized (default is 1)\n * The attribute n is the width of the narrow bar, expressed in dots (default is 1)\n * The attribute w is the width of bar, expressed in dots (default is 2)\n * The attribute r is the rotation angle of the text (clockwise, the default is 0):\n * 0 0degree\n * 90 90degree\n * 180 180degree\n * 270 270degree\n *\n * <QR x=\"20\" y=\"20\" w=\"160\" e=\"H\">QR code content</QR>:\n * Print the QR code, where:\n * The attribute x is the coordinate of the starting point in the horizontal direction (default is 0)\n * Attribute y is the starting point coordinate in the vertical direction (default is 0)\n * The attribute w is the width of the QR code (default is 160)\n * Attribute e is the error correction level: L 7% M 15% Q 25% H 30% (the default is H)\n * The label content is a QR code value, and the maximum cannot exceed 256 characters\n * Note: A single order can only print one QR code\n */\n\n //Set size of label paper\n$printContent= <<<EOF\n<SIZE>40,30</SIZE>\nEOF;\n\n \n //print the first label\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"#001\".str_repeat(\" \", 4)\n .\"Table one\".str_repeat(\" \", 4)\n .\"1/3\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"96\\\" w=\\\"2\\\" h=\\\"2\\\" r=\\\"0\\\">\"\n .\"Golden Fried Rice\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"200\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"Miss Wang\".str_repeat(\" \", 4)\n .\"136****3388\"\n .\"</TEXT>\"\n .\"</PAGE>\"\n ;\n\n //print the second label\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"#001\".str_repeat(\" \", 4)\n .\"Table one\".str_repeat(\" \", 4)\n .\"2/3\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"96\\\" w=\\\"2\\\" h=\\\"2\\\" r=\\\"0\\\">\"\n .\"Cucumber salad\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"200\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"Miss Wang\".str_repeat(\" \", 4)\n .\"136****3388\"\n .\"</TEXT>\"\n .\"</PAGE>\"\n ; \n\n //print the third label\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"#001\".str_repeat(\" \", 4)\n .\"Table one\".str_repeat(\" \", 4)\n .\"3/3\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"96\\\" w=\\\"2\\\" h=\\\"2\\\" r=\\\"0\\\">\"\n .\"Boston Lobster\"\n .\"</TEXT>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"200\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"Miss Wang\".str_repeat(\" \", 4)\n .\"136****3388\"\n .\"</TEXT>\"\n .\"</PAGE>\"\n ; \n\n //print a barcode\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"print a barcode: \"\n .\"</TEXT>\"\n .\"<BC128 x=\\\"16\\\" y=\\\"32\\\" h=\\\"32\\\" s=\\\"1\\\" n=\\\"2\\\" w=\\\"2\\\" r=\\\"0\\\">\"\n .\"12345678\"\n .\"</BC128>\"\n .\"</PAGE>\"\n ; \n\n //print a QR code. The minimum width is 128, it will not be able to be scanned if lower than 128\n $printContent = $printContent.\"<PAGE>\"\n .\"<TEXT x=\\\"8\\\" y=\\\"8\\\" w=\\\"1\\\" h=\\\"1\\\" r=\\\"0\\\">\"\n .\"print a QR code: \"\n .\"</TEXT>\"\n .\"<QR x=\\\"16\\\" y=\\\"32\\\" w=\\\"128\\\">\"\n .\"https://www.xpyun.net\"\n .\"</QR>\"\n .\"</PAGE>\"\n ; \n\n $request = new PrintRequest();\n $request->generateSign();\n\n //*Required*: The serial number of the printer\n $request->sn=OK_PRINTER_SN;\n\n //*Required*: The content to be printed can’t exceed 12288 bytes.\n $request->content=$printContent;\n\n //The number of printed copies is 1 by default.\n $request->copies=1;\n\n $result = xpYunPrintLabel($request);\n print $result->content->code.\"\\n\";\n print $result->content->msg.\"\\n\";\n\n //resp.data: Return to order No. correctly \n print $result->content->data.\"\\n\";\t\n}",
"protected function prepareForNextLabel($qty) {\n\t\n\t\t// label number per lines\n $this->_labelNumber++;\n\n //if we exceed page bottom, create new page\n if (mage::getStoreConfig('barcodelabel/pdf/paper_height') > 0) {\n\n\t\t\tif ( (($this->getLabelY() - $this->_labelHeight) < 0) && ($this->_globalLabelNumber < $this->_totalLabelNumber) ) {\n $this->newPage();\n\t\t\t}\n }\n }",
"function get_labeled_sites_seq($sites_info,&$labeled_sites_seq,$pos_text,$label_text,$up_string, $down_string, $main_string, $addspace,$left_pos,$right_pos,$orientation,$join_pos,$sites_name_global,$sites_color_global)\n{\n\tglobal $GENOME_LENGTH;\n//\tglobal $sites_name_global;\n//\tglobal $sites_color_global;\n\t$labeled_sites_seq=\"<FONT style=\\\"background-color:white; font-family:'Courier New'; font-size:14px\\\" color=\\\"black\\\">\";\n//\t$pos_text=\"<FONT style=\\\"background-color:white; font-family:'Courier New'; font-size:14px\\\" color=\\\"black\\\">\";\n//\t$labeled_seq =\"<FONT style=\\\"background-color:white; font-family:'Courier New'; font-size:14px\\\" color=\\\"black\\\">\";\n\t\t$line_len =50;\n\t\t$sep_len = 10;\n\t$sites_left_end=array();$sites_right_end=array();$sites_color=array();$sites_name=array();\n\t\t\n\t$sites_info_num = count($sites_info);\n\t$i = 0;\n\tfor ($k=0; $k<$sites_info_num;$k++)\n\t\t{\n\t\t\t$sites_left_end[$k]=$sites_info[$k][\"left_end\"];\n\t\t\t$sites_right_end[$k]=$sites_info[$k][\"right_end\"];\n\t\t\t\n\t\t\tif(in_array($sites_info[$k][\"name\"],$sites_name_global))\n\t\t\t{\n\t\t\t\t$key = array_search($sites_info[$k][\"name\"],$sites_name_global);\t\t\t\t\n\t\t\t\t$sites_color[$k]=$sites_color_global[$key];\t\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sites_color[$k]= get_random_color();\n\t\t\t\t\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\t$sites_name[$k]=$sites_info[$k][\"name\"];\n\t\t\t\n\t\t}\n\n\t\n\t$stack = array();\n\t$stack_font = array();\n\t\n//\tdraw up string\t\t\n\t$up_str_len = strlen($up_string);\n\t$pad_num = 0; \t\n\t\n\t\n\tif(strlen($up_string)%$line_len!=0)\n\t{\n\t\t$pad_num = $line_len-strlen($up_string)%$line_len;\n\t\t$up_string = str_pad($up_string,strlen($up_string)+$line_len-strlen($up_string)%$line_len, \" \", STR_PAD_LEFT);\n\t}\n\t\n\t$str_len = strlen($up_string);\n\t\t\t\n\tfor ($i=0; $i<strlen($up_string);$i++)\n\t{\n\n\t\tif($i==0){\n\n\t\t\t$labeled_sites_seq = $labeled_sites_seq;\n\t\t}\n\n\n\t\tif (!($i % $line_len)==0 && ($i % $sep_len)==0) {\n\n\t\t\t$labeled_sites_seq = $labeled_sites_seq. \" \";\n\t\t}\n\t\t$abs_pos=0;\n\t\t$keys = array();\n\n\t\tif($i>$pad_num)\n\t\t{\n\n\t\t\tif($orientation==\"Clockwise\")\n\t\t\t{\n\t\t\t\t$abs_pos = intval(-$up_str_len)+intval(-$pad_num)+$left_pos+$i;\n\t\t\t\tif($abs_pos<1)\n\t\t\t\t{\n\t\t\t\t\t$abs_pos = $abs_pos + $GENOME_LENGTH;\n\t\t\t\t}\n\t\t\t\t$keys = array_keys($sites_left_end,$abs_pos);\n\t\t\t\t//\t\t\t\t\tif($keys)\n\t\t\t\t//\t\t\t\techo \"<br>in open\\$abs_pos \".$abs_pos.\"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$abs_pos = intval($up_str_len)+intval($pad_num) + $right_pos -$i;\n\t\t\t\tif($abs_pos > $GENOME_LENGTH)\n\t\t\t\t{\n\t\t\t\t\t$abs_pos = $abs_pos - $GENOME_LENGTH;\n\t\t\t\t}\n\n\t\t\t\t$keys = array_keys($sites_right_end,$abs_pos);\n\t\t\t}\n\n\t\t\tif(count($keys)>0){\n//\t\t\t\tpush_font($keys, $sites_color, $sites_name, $sites_left_end, $sites_right_end, &$stack, &$stack_font, &$labeled_sites_seq);\n\t\t\t\tpush_font($keys, $sites_color, $sites_name, $sites_left_end, $sites_right_end, $stack, $stack_font, $labeled_sites_seq);\n\n\t\t\t}\n\t\t}\n\t\t$labeled_sites_seq = $labeled_sites_seq. $up_string[$i];\n\t\tif($i>$pad_num)\n\t\t{\n\t\t\t$keys = array();\n\n\t\t\tif($orientation==\"Clockwise\")\n\t\t\t{\n\t\t\t\t$keys = array_keys($sites_right_end, $abs_pos);\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\n\t\t\t\t$keys = array_keys($sites_left_end,$abs_pos);\n\t\t\t}\n\n\t\t\tif(count($keys)>0)\n\t\t\t{\n\t\t\t\tpop_font($keys, $stack, $stack_font, $labeled_sites_seq,$sites_name, $sites_left_end, $sites_right_end);\n//\t\t\t\tpop_font($keys, &$stack, &$stack_font, &$labeled_sites_seq,$sites_name, $sites_left_end, $sites_right_end);\n\n\t\t\t}\n\t\t}\n\n\t\tif (((($i+1) % ($line_len))==0) && ($i>0)) {\n\n\t\t\t$labeled_sites_seq = $labeled_sites_seq. \"\\n\";\n\t\t}\n\n\t}\n\n\tif($i>0)\n\t{\n\t\t$labeled_sites_seq = $labeled_sites_seq. \"\\n\";\n\t}\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n//main string here\n\t\t\t$main_str_len = strlen($main_string);\n\t\t\t\t\t\t\n\t\t\tfor ($i=0; $i<$main_str_len;$i++) {\n\n\t\t\t\tif (($i % $line_len)==0) { \n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tif($i>0){\n\t\t\t\t\t\t$labeled_sites_seq = $labeled_sites_seq. \"\\n\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$labeled_sites_seq = $labeled_sites_seq;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif (($i % $sep_len)==0) {\n\n\t\t\t\t\t\t$labeled_sites_seq = $labeled_sites_seq. \" \";\n\t\t\t\t}\t\t\n\t\t\t\t$abs_pos=0;\n\t\t\t\t$keys = array();\t\t\t\t\n\t\t\t\tif($orientation==\"Clockwise\")\n\t\t\t\t{\n\t\t\t\t\t$abs_pos =$left_pos+$i;\n\t\t\t\t\tif($abs_pos > $GENOME_LENGTH)\n\t\t\t\t\t{\n\t\t\t\t\t\t$abs_pos = $abs_pos - $GENOME_LENGTH;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$keys = array_keys($sites_left_end, $abs_pos);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$abs_pos = $right_pos -$i;\n\t\t\t\t\t\n\t\t\t\t\tif($abs_pos<1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$abs_pos = $abs_pos + $GENOME_LENGTH;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$keys = array_keys($sites_right_end,$abs_pos);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(count($keys)>0)\n\t\t\t\t{\n//\t\t\t\t\tpush_font($keys, $sites_color, $sites_name, $sites_left_end, $sites_right_end, &$stack, &$stack_font, &$labeled_sites_seq);\n\t\t\t\t\tpush_font($keys, $sites_color, $sites_name, $sites_left_end, $sites_right_end, $stack, $stack_font, $labeled_sites_seq);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$labeled_sites_seq = $labeled_sites_seq. $main_string[$i];\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t$keys = array();\t\n\t\t\t\t\tif($orientation==\"Clockwise\")\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$keys = array_keys($sites_right_end,$abs_pos);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$keys = array_keys($sites_left_end,$abs_pos);\n\t\t\t\t\t}\n\n\t\t\t\tif(count($keys)>0)\n\t\t\t\t{\n\t\t\t\t\t pop_font($keys, $stack, $stack_font, $labeled_sites_seq,$sites_name, $sites_left_end, $sites_right_end);\n//\t\t\t\t\t pop_font($keys, &$stack, &$stack_font, &$labeled_sites_seq,$sites_name, $sites_left_end, $sites_right_end);\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n//\t\t\tdraw the down string part for clock wise gene\n//\t\t\t or actually up string part counterclockwise gene \n//\t\t\t\n\t\t\t$down_str_len = strlen($down_string);\n\t\t\tif(strlen($down_string)%$line_len!=0)\n\t\t\t{\n\t\t\t\t$down_string = str_pad($down_string,strlen($down_string)+$line_len-strlen($down_string)%$line_len, \" \", STR_PAD_RIGHT);\n\t\t\t}\n\t\t\tif($down_str_len>0)\n\t\t\t{\n\t\t\t\t$labeled_sites_seq = $labeled_sites_seq. \"\\n\";\n\t\t\t}\n\t\t\t\n\t\t\tfor ($i=0; $i<strlen($down_string);$i++) {\n\n\t\t\t\tif (($i % $line_len)==0) {\n\n\t\t\t\t\t$labeled_sites_seq = $labeled_sites_seq. \"\\n\";\n\n\t\t\t\t}\n\t\t\t\telseif (($i % $sep_len)==0 && $i<$down_str_len) {\n\n\t\t\t\t\t$labeled_sites_seq = $labeled_sites_seq. \" \";\n\t\t\t\t}\n\t\t\t\tif($i<$down_str_len)\n\t\t\t\t{\n\t\t\t\t\t$abs_pos=0;\n\t\t\t\t\t$keys = array();\n\t\t\t\t\tif($orientation==\"Clockwise\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$abs_pos =$right_pos+$i+1;\n\t\t\t\t\t\tif($abs_pos > $GENOME_LENGTH)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$abs_pos = $abs_pos - $GENOME_LENGTH;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$keys = array_keys($sites_left_end, $abs_pos);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$abs_pos = $left_pos -$i-1;\n\n\t\t\t\t\t\tif($abs_pos<1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$abs_pos = $abs_pos + $GENOME_LENGTH;\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t$keys = array_keys($sites_right_end, $abs_pos);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(count($keys)>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tpush_font($keys, $sites_color, $sites_name, $sites_left_end, $sites_right_end, $stack, $stack_font, $labeled_sites_seq);\n//\t\t\t\t\t\tpush_font($keys, $sites_color, $sites_name, $sites_left_end, $sites_right_end, &$stack, &$stack_font, &$labeled_sites_seq);\n\t\t\t\t\t}\n//\t\t\t\t}\n\n\t\t\t\t$labeled_sites_seq = $labeled_sites_seq. $down_string[$i];\n\t\t\t\t\n//\t\t\t\tif($i<$down_str_len)\n//\t\t\t\t{\n\t\t\t\t\t$keys = array();\n\t\t\t\t\tif($orientation==\"Clockwise\")\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$keys = array_keys($sites_right_end,$abs_pos);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$keys = array_keys($sites_left_end,$abs_pos);\n\t\t\t\t\t}\n\t\t\t\t\tif(count($keys)>0)\n\t\t\t\t\t{\n//\t\t\t\t\t\tpop_font($keys, &$stack, &$stack_font, &$labeled_sites_seq,$sites_name, $sites_left_end, $sites_right_end);\n\t\t\t\t\t\tpop_font($keys, $stack, $stack_font, $labeled_sites_seq,$sites_name, $sites_left_end, $sites_right_end);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n}",
"public function beginLabelSheet ()\r\n {\r\n $this->label_column = 1;\r\n $this->label_row = 1;\r\n return '\r\n <div class=\"labelpage\">\r\n <div class=\"labelrow\">\r\n <div class=\"labelbody\">';\r\n }",
"public function advanceLabelPage ()\r\n {\r\n $return = '';\r\n $this->label_column = 1;\r\n $this->label_row =1;\r\n ++$this->label_page;\r\n $return .= '\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"labelpage\">\r\n <div class=\"labelrow\">\r\n <div class=\"labelbody\">';\r\n return $return;\r\n }",
"public function plotAddLabel($labels) {\r\n $index = count($labels);\r\n if (!$index)\r\n return; // nothing to do.\r\n\r\n // index into labelLocations:\r\n $labelIndex = 0;\r\n\r\n // apply the labels in reverse order, from bottom up plot upward\r\n while ($index > 0) {\r\n $index--;\r\n // can't proceed unless labelLocations has something here:\r\n if (isset($this->labelLocations[$labelIndex])) {\r\n $loc = $this->labelLocations[$labelIndex];\r\n $key = \"label\" . (string)($index + 1);\r\n $this->plotAttribs[$key] = \"set label '\" . $labels[$index] . \"' at screen \" . (string)$loc[0] . \", \" . (string)$loc[1] . \"\\n\";\r\n $labelIndex++;\r\n }\r\n }\r\n }",
"public function printLabels() {\n \t\t\treturn $this->Index(array('output_format' => 'PDF'));\n\t\t}",
"public function bottomOf($labels, $page = 1, $exact = false)\n\t {\n\t\t$bottom = false;\n\t\tif (is_array($labels) === false)\n\t\t {\n\t\t\t$labels = array($labels);\n\t\t }\n\n\t\tforeach ($labels as $label)\n\t\t {\n\t\t\t$list = $this->_getLabelList($label, $page, $exact);\n\t\t\tforeach ($list as $tag)\n\t\t\t {\n\t\t\t\tif ($bottom !== false)\n\t\t\t\t {\n\t\t\t\t\tif ($bottom < ($tag->getAttribute(\"top\") + $tag->getAttribute(\"height\")))\n\t\t\t\t\t {\n\t\t\t\t\t\t$bottom = ($tag->getAttribute(\"top\") + $tag->getAttribute(\"height\"));\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$bottom = ($tag->getAttribute(\"top\") + $tag->getAttribute(\"height\"));\n\t\t\t\t }\n\t\t\t }\n\t\t } //end foreach\n\n\t\treturn $bottom;\n\t }",
"public function plotAddLabel($labels, $locs) {\n\t\t$count = 0;\n\t\tforeach ($labels as $l) {\n\t\t\t$key = \"label\" . (string)($count + 1);\n\t\t\t$this->plotAtt[$key] = \"set label '\" . $l . \"' at screen \" . (string)$locs[$count][0] . \", \" . (string)$locs[$count][1] . \"\\n\";\n\t\t\t$count++;\n\t\t}\n\t}",
"private function getLabelsFilename() {\n\t\tif ($this->params->labels_multilingual) { // check for language-specific labels file\n\t\t\t$lang = JFactory::getLanguage();\n\t\t\t$labelsfile = JPATH_ROOT.DIRECTORY_SEPARATOR.str_replace('/', DIRECTORY_SEPARATOR, $this->params->folder).DIRECTORY_SEPARATOR.$this->params->labels.'.'.$lang->getTag().'.txt';\n\t\t\tif (is_file($labelsfile)) {\n\t\t\t\treturn $labelsfile;\n\t\t\t}\n\t\t}\n\t\t// default to language-neutral labels file\n\t\t$labelsfile = JPATH_ROOT.DIRECTORY_SEPARATOR.str_replace('/', DIRECTORY_SEPARATOR, $this->params->folder).DIRECTORY_SEPARATOR.$this->params->labels.'.txt'; // filesystem path to labels file\n\t\tif (is_file($labelsfile)) {\n\t\t\treturn $labelsfile;\n\t\t}\n\t\treturn false;\n\t}",
"public function generatePagefiles() {\n $sectors = array ('frontend', 'backend', 'subnavi', 'projects');\n foreach ($sectors as $area) {\n foreach (NavigationHelper::$navArray[$area] as $pagename => $pagetitle) {\n if (!file_exists (__PAGEDIR__ . $pagename . \".php\")) {\n fopen(__PAGEDIR__ . $pagename . \".php\", \"w+\");\n }\n }\n }\n }",
"function curve_label_region($curve,$label_size,$bounds,$rotation)\r\n{\r\n $rectangle_bounds = $bounds;\r\n $rectangle_bounds['rotation'] = 0;\r\n $curve_region_points = curve_points($curve,$bounds);\r\n $curve_region_points_size = sizeof($curve_region_points);\r\n $diagonal_half = rectangle_diagonal($label_size['x'],$label_size['y'])/2;\r\n $angle = M_atan2_polar($label_size['y'],$label_size['x']);\r\n $curve_label_region = [];\r\n $rectangle_margin = D_rectangle_size($label_size['x'],$label_size['y']);\r\n\r\n $angle_left_bottom = M_angle_polar($angle+$rotation);\r\n $angle_left_top = M_angle_polar(-$angle+$rotation);\r\n $angle_right_bottom = M_angle_polar(M_PI-$angle+$rotation);\r\n $angle_right_top = M_angle_polar(M_PI+$angle+$rotation);\r\n\r\n\tfor ($i = 0; $i < $curve_region_points_size; $i++)\r\n {\r\n $center_left_bottom = M_addition($curve_region_points[$i],M_polar_to_cartesian([$diagonal_half,$angle_left_bottom]);\r\n $rectangle_left_bottom = D_rectangle_by_point($center_left_bottom,$rectangle_margin,$rotation);\r\n $is_contained_left_bottom = false;\r\n\r\n $center_left_top = M_addition($curve_region_points[$i],M_polar_to_cartesian([$diagonal_half,$angle_left_top],$keys_coord));\r\n $rectangle_left_top = D_rectangle_by_point($center_left_top,$rectangle_margin,$rotation);\r\n $is_contained_left_top = false;\r\n\r\n $center_right_bottom = M_addition($curve_region_points[$i],M_polar_to_cartesian([$diagonal_half,$angle_right_bottom],$keys_coord));\r\n $rectangle_right_bottom = D_rectangle_by_point($center_right_bottom,$rectangle_margin,$rotation);\r\n $is_contained_right_bottom = false;\r\n\r\n $center_right_top = M_addition($curve_region_points[$i],M_polar_to_cartesian([$diagonal_half,$angle_right_top],$keys_coord));\r\n $rectangle_right_top = D_rectangle_by_point($center_right_top,$rectangle_margin,$rotation);\r\n $is_contained_right_top = false;\r\n\r\n for ($j = 0; $j < $curve_region_points_size && $j != $i; $j++)\r\n {\r\n if (!$is_contained_left_bottom &&\r\n is_contained_rectangle_rectangle($rectangle_left_bottom,$rectangle_bounds) &&\r\n is_contained_point_rectangle($curve_region_points[$j],$rectangle_left_bottom))\r\n {\r\n $is_contained_left_bottom = true;\r\n }\r\n\r\n\r\n if (!$is_contaiend_left_top &&\r\n is_contained_rectangle_rectangle($rectangle_left_top,$rectangle_bounds) &&\r\n is_contained_point_rectangle($curve_region_points[$j],$rectangle_left_top))\r\n {\r\n $is_contaiend_left_top = true;\r\n }\r\n\r\n\r\n if (!$is_contained_right_bottom &&\r\n is_contained_rectangle_rectangle($rectangle_right_bottom,$rectangle_bounds) &&\r\n is_contained_point_rectangle($curve_region_points[$j],$rectangle_right_bottom))\r\n {\r\n $is_contained_right_bottom = true;\r\n }\r\n\r\n if (!$is_contained_right_top &&\r\n is_contained_rectangle_rectangle($rectangle_right_top,$rectangle_bounds) &&\r\n is_contained_point_rectangle($curve_region_points[$j],$rectangle_right_top))\r\n {\r\n $is_contained_right_top = true;\r\n }\r\n\r\n if ($is_contained_left_bottom && $is_contaiend_left_top && $is_contained_right_bottom && $is_contained_right_top)\r\n {\r\n break;\r\n }\r\n\r\n }\r\n\r\n if (!$is_contaiend_left_bottom)\r\n {\r\n $curve_label_region[] = $rectangle_left_bottom;\r\n }\r\n\r\n if (!$is_contaiend_left_top)\r\n {\r\n $curve_label_region[] = $rectangle_left_top;\r\n }\r\n\r\n if (!$is_contaiend_right_bottom)\r\n {\r\n $curve_label_region[] = $rectangle_right_bottom;\r\n }\r\n\r\n if (!$is_contaiend_right_top)\r\n {\r\n $curve_label_region[] = $rectangle_right_top;\r\n }\r\n }\r\n\r\n return sort_region($curve_label_region);\r\n}",
"function combineSeparetePagesIntoPDF($bookName, $pageNumberArray, $newFilename) {\n\n $dir = 'output/' . $newFilename;\n if(is_dir($dir) == false) {\n mkdir($dir);\n }\n\n $pages = array();\n foreach($pageNumberArray as $value) {\n $fileName = 'input/'. $bookName . '-'. $value . '.pdf';\n array_push($pages, $fileName);\n }\n\n $result = ConvertApi::convert('merge', [\n 'Files' => $pages,\n ], 'pdf'\n );\n $result->saveFiles($dir. '/' . $newFilename . '.pdf');\n print('merge finished!');\n}",
"function generate(){\n\n if($this->skipLabels >= $this->settings[\"maxRows\"] * $this->settings[\"maxColumns\"])\n $this->skipLabels = 0;\n\n if($this->settings[\"defaultSortOrder\"] && !$this->sortOrder)\n $this->sortOrder = $this->settings[\"defaultSortOrder\"];\n\n $querystatement = $this->assembleSQL($this->settings[\"queryStatement\"]);\n\n $queryresult = $this->db->query($querystatement);\n\n if(!class_exists(\"phpbmsPDFReport\"))\n include(\"pdfreport_class.php\");\n\n $pdf = new phpbmsPDFReport($this->db, \"P\", \"in\");\n\n $pdf->Open();\n $pdf->SetMargins(0,0);\n\n $pdf->AddPage();\n\n $thex = $this->settings[\"startLeft\"];\n $they = $this->settings[\"startTop\"];\n $rowcount = 1;\n $totalcount = 1;\n $column = 1;\n $textRows = 0;\n\n /**\n * skipping labels\n */\n while($totalcount <= $this->skipLabels){\n\n if($rowcount > $this->settings[\"maxRows\"]){\n\n $column++;\n $they = $this->settings[\"startTop\"];\n $thex += $this->settings[\"labelWidth\"] + $this->settings[\"columnMargin\"];\n $rowcount = 1;\n\n }//endif\n\n $they += $this->settings[\"labelHeight\"];\n $rowcount++;\n $totalcount++;\n\n }//endwhile\n\n $thisCount = $this->db->numRows($queryresult);\n\n while($therecord = $this->db->fetchArray($queryresult)){\n\n //initialize amount of text rows\n if(!$textRows){\n\n $textRows = 0;\n\n foreach($therecord as $key=>$value)\n if(strpos($key, \"rowText\") === 0)\n $textRows++;\n\n }//endif\n\n if($rowcount > $this->settings[\"maxRows\"]){\n\n $column++;\n $they = $this->settings[\"startTop\"];\n $thex += $this->settings[\"labelWidth\"] + $this->settings[\"columnMargin\"];\n $rowcount = 1;\n\n }//endif\n\n if($column > $this->settings[\"maxColumns\"]){\n\n $pdf->AddPage();\n $thex = $this->settings[\"startLeft\"];\n $they = $this->settings[\"startTop\"];\n $rowcount = 1;\n $column = 1;\n\n }//endif\n\n $pdf = $this->printLabel($pdf, $therecord, $thex, $they, $textRows);\n\n $they += $this->settings[\"labelHeight\"];\n $rowcount++;\n\n\n }//endwhile $therecord\n\n $this->reportOutput = $pdf;\n\n }",
"function writeXLabels($format = []) {\r\n $default = [\r\n \"R\" => $this->pDraw->FontColorR,\r\n \"G\" => $this->pDraw->FontColorG,\r\n \"B\" => $this->pDraw->FontColorB,\r\n \"Alpha\" => $this->pDraw->FontColorA,\r\n \"Angle\" => 0,\r\n \"Padding\" => 5,\r\n \"Position\" => LABEL_POSITION_TOP,\r\n \"Labels\" => null,\r\n \"CountOffset\" => 0,\r\n ];\r\n $format = array_merge($default, $format);\r\n\r\n if ( $format['Labels'] != null && !is_array($format['Labels']) ) {\r\n $format['Labels'] = [$format['Labels']];\r\n }\r\n\r\n $x0 = $this->pDraw->GraphAreaX1;\r\n $x_size = ($this->pDraw->GraphAreaX2 - $this->pDraw->GraphAreaX1) / ($this->GridSizeX+1);\r\n\r\n $settings = [\r\n \"R\" => $format['R'],\r\n \"G\" => $format['G'],\r\n \"B\" => $format['B'],\r\n \"Alpha\" => $format['Alpha'],\r\n \"Angle\" => $format['Angle']\r\n ];\r\n\r\n if($format['Position'] == LABEL_POSITION_TOP ) {\r\n $y_pos = $this->pDraw->GraphAreaY1 - $format['Padding'];\r\n $settings[\"Align\"] = $format['Angle'] == 0 ? TEXT_ALIGN_BOTTOMMIDDLE : TEXT_ALIGN_MIDDLELEFT;\r\n } elseif ( $format['Position'] == LABEL_POSITION_BOTTOM ) {\r\n $y_pos = $this->pDraw->GraphAreaY2 + $format['Padding'];\r\n $settings[\"Align\"] = $format['Angle'] == 0 ? TEXT_ALIGN_BOTTOMMIDDLE : TEXT_ALIGN_MIDDLELEFT;\r\n } else {\r\n return -1;\r\n }\r\n\r\n for($x=0; $x <= $this->GridSizeX; $x++) {\r\n $x_pos = floor($x0 + $x * $x_size + $x_size / 2);\r\n\r\n if( $format['Labels'] == null ) {\r\n $value = $x + $format['CountOffset'];\r\n } else {\r\n $value = isset($format['Labels'][$x]) ? $format['Labels'][$x] : $x + $format['CountOffset'];\r\n }\r\n\r\n $this->pDraw->drawText($x_pos, $y_pos, $value, $settings);\r\n }\r\n\r\n return 1;\r\n }",
"private function add_labels(&$store,&$descriptors,$lang_out='')\n\t {\n\t \tif ($this->getSrcDebug()) \n\t\t{\n\t\t\tprint \"<hr>add_labels called with lang_out=$lang_out and with descriptors: <br>\"; var_dump($descriptors);\n\t\t}\n\t\t\n\t\t \t$labels=$new_descriptors=array();\n\t \t\tforeach($descriptors as $desc)\n\t\t\t{\n\t \t\n\t\t\t$QUERY=<<<EOQ\n\tprefix gnd2: <http://d-nb.info/standards/elementset/gnd#>\n\tselect ?x\n\t{\n\t\t{\n\t\t\t<$desc> gnd2:preferredNameForTheCorporateBody ?x .\n\t\t}\n\t\tUNION\n\t\t{\n\t\t\t<$desc> gnd2:variantNameForTheCorporateBody ?x .\n\t\t}\n\t}\nEOQ;\n\t\t\t\tif ($this->getSrcDebug()) \n\t\t\t\t\tprint \"<br><br>add_labels QUERY: <br>\".str_replace(\"\\n\",\"<br>\",htmlentities($QUERY));\n\t\t\t\t\n\n\t\t\t\tif (($rows = $store->query($QUERY, 'rows'))) \n\t\t\t\t{\n\t\t\t\t\tif ($this->getSrcDebug()) \n\t\t\t\t\t{\n\t\t\t\t\t\tprint \"<br>add_labels ($desc) ROWS: <br>\"; var_dump($rows);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$candidate_label_lang='';\n\t\t\t\t\tforeach($rows as $row) \t\n\t\t\t\t\t{\n\t\t\t\t\t\t$candidate_label=$this->cleanupLabel($row['x']); // YES WE MUST DO IT HERE SO: GND CACHES <expressions> in labels\n\t\t\t\t\t\tif ($lang_out) $candidate_label_lang = detect_language($candidate_label);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($this->getSrcDebug()) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($lang_out)\n\t\t\t\t\t\t\t{ //Check lang info in data:\n\t\t\t\t\t\t\t\tif (!$row['x lang']) print \"<br>!!!! NO LANG INFO for \".$candidate_label;\n\t\t\t\t\t\t\t\tprint \"<br> Lang=\".$row['x lang'].\" for \".$candidate_label.\" (lang_out=$lang_out)\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tprint \"<br>label($desc) = \".$candidate_label; //FRI: Pickup concept descr for survista call\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//In case a lang-out is set\n\t\t\t\t\t\t//compute language and see if it coresponds\n\t\t\t\t\t\tif ($lang_out=='' || ($candidate_label_lang==$lang_out))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($candidate_label)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$labels[]= $candidate_label;\n\t\t\t\t\t\t\t\t$new_descriptors[]=$desc;\n\t\t\t\t\t\t\t\tif ($this->getSrcDebug()) \n\t\t\t\t\t\t\t\tprint \" TAKE LABEL! \";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($this->getSrcDebug()) \n\t\t\t\t\t\t\t\tprint \" SKIP LABEL! \";\n\t\t\t\t\t\t}\t\n\t\t\t\t\t} // foreach ($rows)\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif ($this->getSrcDebug()) \n\t\t\t\t\t\tprint \"<br>add_labels ($desc) NO LABLES ROWS !!! \";\n\t\t\t\t}\n\t\t\t} // foreach($descriptors as $desc)\n\t\t\t\n\t\t\t//Return aligned pair ov vectors:\n\t\t\treturn array($new_descriptors,$labels);\t \t\t\t\n\t \t\t\n\t }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find address information using the zip code. | public function findAddressByZipCode($zipCode); | [
"public function getLocationForZip($zipCode);",
"public function zipCodeInfo(){\n\t\t$zip = $_POST['zip'];\n\t\t$url=\"https://maps.googleapis.com/maps/api/geocode/json?address=\".urlencode($zip).\"&sensor=false&key=AIzaSyA863uhw0eIufXkjyziP9nZIo9uJAKo2ZU\";\n\t\t$details=file_get_contents($url);\n\t\t$results=json_decode($details,true);\n\t\tif(!empty($results['results'][0])){\n\t //$city =$results['results'][0]['address_components'][1]['long_name'];\n\t // $address=$results['results'][0]['address_components'][3]['long_name'];\n\t\t\t$formattedAddress=$results['results'][0]['formatted_address'];\n\t\t\tif(!empty($results['results'][0]['address_components'])){\n\t\t\t\t$address=$results['results'][0]['address_components'][3]['long_name'];\n\t\t\t\tdie(json_encode(['success'=>true,'address'=>$formattedAddress]));\n\t\t\t}else{\n\t\t\t\tdie(json_encode(['success'=>true,'address'=>$formattedAddress])); \n\t\t\t}\n\t\t}else{\n\t\t\tdie(json_encode(['success'=>false,'message'=>\"invalid zipcode\"]));\n\t\t}\n\t}",
"function getCoordinatesByZipCode($zip);",
"public function getByZip($zip)\n {\n $this->Behaviors->load('Containable');\n $addresses = $this->find(\n 'all',\n array(\n 'conditions' => array(\n \"zip LIKE\" => $zip . \"%\"\n ),\n 'contain' => \"Neighbourhood.City.State.Country\"\n )\n );\n\n return $addresses;\n }",
"public function admin_zip_search() {\n\t\t$zip = preg_replace( '/[^0-9]/', '', ( $this->input->get( 'zip' ) ?: '' ) );\n\t\tif ( ! preg_match( '/^[0-9]{3,7}$/', $zip ) ) {\n\t\t\twp_send_json( array() );\n\t\t}\n\t\t$address = $this->model->search_from_zip( $zip );\n\t\tif ( ! $address ) {\n\t\t\twp_send_json( array() );\n\t\t}\n\t\t$json = array(\n\t\t\t'prefecture' => $address->prefecture,\n\t\t);\n\t\t$city = get_term_by( 'name', $address->city, $this->model->taxonomy );\n\t\tif ( $city ) {\n\t\t\t$json['city'] = array(\n\t\t\t\t'id' => (int) $city->term_id,\n\t\t\t\t'name' => sprintf( '%s(%s)', $city->name, $city->description ),\n\t\t\t);\n\t\t}\n\t\tif ( false === strpos( $address->town, '以下に掲載' ) ) {\n\t\t\t$json['street'] = $address->town;\n\t\t}\n\t\twp_send_json( $json );\n\t}",
"static function lookup($zip_code = \"\") {\n\t\t$zip = new \\Flux\\Zip();\n\t\t$zip->setZipcode($zip_code);\n\t\t$zip_result = $zip->queryByZipcode();\n\t\treturn $zip_result;\n\t}",
"public function getAddress($zipcode)\n\t{\n\t\t$url =\"https://maps.googleapis.com/maps/api/geocode/json?address=\".$zipcode.\"&key=AIzaSyA3n1_WGs2PVEv2JqsmxeEsgvrorUiI5Es\";\n\t\t$json = json_decode(file_get_contents($url),true);\n\t\t$city = '';\n\t\t$state = '';\n\t\t$country = '';\n\n\t\tif($json['results']==[]){\n\t\t\treturn 'error';\n\t\t}else{\n\t\t\tforeach ($json['results'] as $result) {\n\t\t\t\tforeach($result['address_components'] as $addressPart) {\n\t\t\t\t\tif ((in_array('locality', $addressPart['types'])) && (in_array('political', $addressPart['types'])))\n\t\t\t\t\t\t$city = $addressPart['long_name'];\n\t\t\t\t\telse if ((in_array('administrative_area_level_1', $addressPart['types'])) && (in_array('political', $addressPart['types'])))\n\t\t\t\t\t\t$state = $addressPart['short_name'];\n\t\t\t\t\telse if ((in_array('country', $addressPart['types'])) && (in_array('political', $addressPart['types'])))\n\t\t\t\t\t\t$country = $addressPart['long_name'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$address = array();\n\t\t\t$address['city'] = $city;\n\t\t\t$address['state'] = $state;\n\t\t\t$address['country'] = $country;\n\t\t\treturn $address;\n\t\t}\n\n\n\n\t\t/*get address from IP address*/\n//\t\t$ip = $request->ip();\n//\t\t$details = json_decode(file_get_contents(\"http://ipinfo.io/23.247.115.83/json\"),true);\n//\t\t$city = $details['city'];\n//\t\t$state = $details['region'];\n//\t\t$country = $details['country'];\n//\t\treturn $city.','.$state.','.$country;\n\t}",
"public function getZipCode();",
"public function getAddressByZipCode(string $zipCode)\n {\n if (strlen($zipCode) == 0) \n {\n throw new Exception('$zipCode cannot be an empty string!');\n }\n\n $zipCode = preg_replace('/[^0-9]/im', '', $zipCode);\n\n return (array) json_decode(file_get_contents($this->url . $zipCode . '/json'));\n }",
"public function getLocation($zipcode)\n {\n $url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\" . $zipcode . \"&key=AIzaSyA3n1_WGs2PVEv2JqsmxeEsgvrorUiI5Es\";\n $result = json_decode(file_get_contents($url), true);\n\n if ($result['results'] == []) {\n return 'error';\n } else {\n return $result['results'][0]['geometry']['location'];\n }\n /*get location from IP address*/\n\n//\t\t$ip = $request->ip();\n\n//\t\t$details = json_decode(file_get_contents(\"http://ipinfo.io/{$ip}/json\"),true);\n\n//\t\treturn $details['loc'];\n\n }",
"function getGeo($zip) {\n\t\tif(!empty($zip)){\n\t\t\t//Send request and receive json data by address\n\t\t\t$geocodeFromAddr = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address='.$zip.'&sensor=false');\n\t\t\t$output = json_decode($geocodeFromAddr);\n\t\t\t//Check if it was a valid zipcode\n\t\t\tif(empty($output->results)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//Get latitude and longitute from json data\n\t\t\t$geocode['lat'] = $output->results[0]->geometry->location->lat;\n\t\t\t$geocode['lng'] = $output->results[0]->geometry->location->lng;\n\t\t\t$address_data = $output->results[0]->address_components;\n\t\t\tfor ($i = 0; $i < sizeof($address_data); $i++) {\n\t\t\t\tif ($address_data[$i]->types[0] == \"locality\") {\n\t\t\t\t\t$geocode['city'] = $address_data[$i]->long_name;\n\t\t\t\t}\n\t\t\t\tif ($address_data[$i]->types[0] == \"administrative_area_level_1\") {\n\t\t\t\t\t$geocode['state'] = $address_data[$i]->long_name;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Return latitude and longitude of the given address\n\t\t\tif(!empty($geocode)){\n\t\t\t\treturn $geocode;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function geocode($zip)\n {\n $args = array(\n 'postal' => $zip,\n 'flags' => 'PC',\n 'appId' => YAHOO_APIKEY,\n 'count' => 1,\n 'locale' => 'en_US',\n 'country' => 'USA'\n );\n\n $url = 'http://where.yahooapis.com/geocode?' . http_build_query($args);\n \n $geoData = unserialize($this->_getCurl($url));\n\n _log('Yahoo API: ' . $url);\n\n if ($geoData['ResultSet']['Error'] != 0 || $geoData['ResultSet']['Found'] == 0) {\n throw new Exception('Could not determine location. Please try again.');\n }\n\n $data = array(\n 'lat' => $geoData['ResultSet']['Result'][0]['latitude'],\n 'lng' => $geoData['ResultSet']['Result'][0]['longitude']\n );\n\n _log('Found location at lat: ' . $data['lat'] . ', lng: ' . $data['lng']);\n\n return $data;\n }",
"public function getLnt($zip){\n // Get the API key from Amasty\n $apiKey = $this->_amastyconfigProvider->getApiKey();\n $url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\".$zip.\"&sensor=false&key=\".$apiKey;\n\n $resultString = $this->_curl->get($url);\n $resultString = $this->_curl->getBody();\n\n $result = json_decode($resultString, true);\n if(isset($result['results'][0])) {\n $result1[] = $result['results'][0];\n $result2[] = $result1[0]['geometry'];\n $result3[] = $result2[0]['location'];\n return $result3[0];\n } else {\n return '';\n }\n \n }",
"public function getLnt($zip){\n // Get the API key from Amasty\n $apiKey = $this->_amastyconfigProvider->getApiKey();\n $url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\".$zip.\"&sensor=true&key=\".$apiKey;\n\n $resultString = $this->_curl->get($url);\n $resultString = $this->_curl->getBody();\n\n $result = json_decode($resultString, true);\n if(isset($result['results'][0])) {\n $result1[] = $result['results'][0];\n $result2[] = $result1[0]['geometry'];\n $result3[] = $result2[0]['location'];\n return $result3[0];\n } else {\n return '';\n }\n \n }",
"function find_city_ByZipCode ($cur_zipcode) {\r\n\r\n $radiusSearch = new ZipSearch();\r\n $radiusSearch->set(array('zip_code' => $cur_zipcode));\r\n $serach_city = \"\";\r\n $result = array();\r\n if ($radiusSearch->validates(array('fieldList' => array('zip_code'))))\r\n {\r\n\t\t\t\t\t\tif(\r\n\t\t\t !((!$rs = $radiusSearch->find(\r\n\t\t\t 'first', array(\r\n\t\t\t 'conditions' => array(\r\n\t\t\t 'ZipSearch.zip_code' => $cur_zipcode))))\r\n\t\t\t || (count($rs) == 0))\r\n\t\t\t )\r\n\t\t\t { // if computed zip code from ibDbInfo is in zipsearch table\r\n $result['city'] = $rs['ZipSearch']['city'];\r\n $result['state'] = $rs['ZipSearch']['state_abbr'];\r\n\t\t\t\t\t\t\t//$serach_city = $rs['ZipSearch']['city']; //$radiusSearch->find_city_ByZipCode($cur_zipcode);\r\n //debug($result); die();\r\n\t\t\t\t\t\t}\r\n }\r\n\r\n //debug($result); die();\r\n //return $serach_city;\r\n return $result;\r\n }",
"public function lookup($zipcode)\n {\n try {\n if (false === $this->loaded) {\n $this->load();\n }\n\n if (isset($this->zipCodeList['content'][$zipcode])) {\n $record = $this->zipCodeList['content'][$zipcode];\n $Result = new Result(\n $zipcode,\n $record['city'],\n $record['extraDigit'],\n $record['commune'],\n $record['bfsNr'],\n $record['canton'],\n $record['east'],\n $record['north'],\n true\n );\n } else {\n throw new NotFoundException(\"Zip code $zipcode was not found.\");\n }\n } catch (Exception $e) {\n if ($this->throwExceptions) {\n throw $e;\n }\n\n $Result = new Result($zipcode);\n $Result->error = $e->getMessage();\n }\n\n return $Result->get($this->format);\n }",
"public function findLocationName($zip){\n $zipname = self::find_by_id($zip); \n $zipname1= $zipname->location;\n \n return $zipname1;\n }",
"function vcnuser_get_zipcode_from_url() {\r\n\t$current_path_array = explode(\"/\", $_SERVER['REQUEST_URI']);\r\n\t$find_zip_key = array_search('zip', $current_path_array);\r\n\tif ($find_zip_key) {\r\n\t\t$zipcode_value = $current_path_array[$find_zip_key + 1];\r\n\t} else {\r\n\t\t$zipcode_value = NULL;\r\n\t}\r\n\treturn $zipcode_value;\r\n}",
"public function getLatLong($zip) {\n $url = \"https://maps.googleapis.com/maps/api/geocode/json?key=AIzaSyCrVui1Yeur4NfiHuGWTSuFs1KBd9u8Jg4&address=\".$zip.\"&sensor=false\";\n $result_string = file_get_contents($url);\n $result = json_decode($result_string, true);\n return $result['results'][0]['geometry']['location'];\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of id_ciudad | public function getId_ciudad()
{
return $this->id_ciudad;
} | [
"function getId_ciudad() {\n return $this->id_ciudad;\n }",
"public function getId_ciudad()\n {\n return $this->id_ciudad;\n }",
"public function getIdCiudad()\n {\n return $this->id_ciudad;\n }",
"public function getCiudad(){\r\n\t return($this->ciudad);\r\n\t}",
"public function getCiudad()\r\n {\r\n return $this->ciudad;\r\n }",
"public function getCiudad(){\n return $this->ciudad;\n }",
"public function getCiudad()\n {\n return $this->ciudad;\n }",
"public static function getEstadoByCiudadRef($id){\n\t\t$db=DataBase::getConnect();\n\t\t$select=$db->prepare('SELECT * FROM municipio WHERE idm=:id');//id del municipio \n\t\t$select->bindValue('id',$id);\n\t\t$select->execute();\n\t\t$entidad=$select->fetch();\n\t\treturn $entidad['cve_ent'];\n\t}",
"public function getCiudad( ){\n\t\treturn $this->ciudad;\n\t}",
"public function getCiudad()\n {\n return $this->ciudad;\n }",
"public function getCiudad()\n {\n return $this->Ciudad;\n }",
"function get_ciudad($idCiudad)\n {\n return $this->db->get_where('ciudad',array('idCiudad'=>$idCiudad))->row_array();\n }",
"function get_ciudad($id)\n {\n return $this->db->get_where('ciudad',array('id'=>$id))->row_array();\n }",
"public function getNom_ciudad()\r\r\n {\r\r\n return $this->nom_ciudad;\r\r\n }",
"public function bus_cod_provincia($nom_ciudad,$conexion){\r\n\t\r\n\t\t$cadena\t\t= \"select * from ciudad where nom_ciudad = '$nom_ciudad' \";\r\n\t\t$ejecuta \t= @mysql_query($cadena,$conexion);\r\n\t\t$db_ciu \t= @mysql_fetch_object($ejecuta);\r\n\t\t$cod_prov\t= $db_ciu->cod_provincia;\r\n\t\treturn $cod_prov;\r\n\t}",
"public function getCiudad_origen()\r\r\n {\r\r\n return $this->ciudad_origen;\r\r\n }",
"public function getNombre_ciudad()\n {\n return $this->nombre_ciudad;\n }",
"function get_idC($id){\n $this->DB->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $sql = \"SELECT * FROM carreras where id = ?\";\n $q = $this->DB->prepare($sql);\n $q->execute(array($id));\n $data = $q->fetch(PDO::FETCH_ASSOC);\n return $data;\n }",
"function zona_from_ciudad(lt_form $fo, $ciudad_id, $por_defecto=1)\n{\n\t$zona_id = $por_defecto;\n\t$c = new lt_condicion('ciudad_id', '=', $ciudad_id);\n\tif (($r = lt_registro::crear($fo, 'zonas', 0, FALSE, $c)))\n\t{\n\t\t$zona_id = $r->v->zona_id;\n\t}\n\treturn $zona_id;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the custom field primary key for faster access via redis. | public function getCustomFieldPrimaryKey() : string
{
return Slug::generate(get_class($this) . ' ' . $this->getId());
} | [
"public function primary_key() {\n $field = $this->_primary_key;\n return $this->$field;\n }",
"public static function get_primary_key();",
"public function get_field_key() {\n\t\treturn $this->get_field_attr( 'field_key' );\n\t}",
"function primary_key_value()\n\t{\n\t\treturn( $this->data_id );\n\t\t\n\t}",
"public static function primary_key() {\n\t\treturn static::$_primary_key;\n\t}",
"public function getPrimaryKeyField()\n {\n }",
"function primary_key_value()\n\t{\n\t\treturn( $this->details_id );\n\t\t\n\t}",
"function get_key_from_id_field( $field_id ) {\n\t\tglobal $frmdb, $wpdb;\n\t\tif ( !empty($field_id) && is_numeric($field_id)) {\n\t\t\t$key_from_id = $wpdb->get_var($wpdb->prepare(\"SELECT field_key from $frmdb->fields WHERE id=%s\", $field_id));\n\t\t}\n\t\treturn $key_from_id;\n\t}",
"abstract public function get_primary_key($object);",
"public function get_primary_key() {\n return $this->primary_key;\n }",
"public function getIdKey(): string {}",
"public function getCustomId(): string\n {\n return $this->custom_id;\n }",
"function get_primary_key_value()\r\n\t{\r\n\t\t$name = $this->primary_key();\r\n\t\treturn $this->getReflection()->get_as_mixed($name);\r\n\t}",
"public function getPrimaryKey(): string\n {\n return $this->getMetadata()['primaryKey'];\n }",
"function getPrimaryKey()\n {\n }",
"public function getCustomId()\n {\n return $this->customId;\n }",
"public function ormGetPrimaryKeyValue()\n {\n $p = $this->orm['primaryKey'];\n\n if (isset($this->$p))\n {\n return $this->$p;\n }\n else\n {\n return NULL;\n }\n }",
"function getPrimaryKeyFieldName(): string\n {\n return $this->primaryKeyFieldName ?? 'codigo';\n }",
"public function getCustomId()\n {\n return $this->custom_id;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns first action that was recorded for target | public function findFirst($action, $target); | [
"public function getInitialAction()\n {\n if ($actions = $this->Actions()) {\n return $actions->First();\n }\n }",
"public function getOneAction()\n\t{\n\t\t// do we have any callbacks to pick from?\n\t\tif (count($this->actionsCallbacks) == 0)\n\t\t{\n\t\t\tthrow new E5xx_NoStoryActions($this->getName());\n\t\t}\n\n\t\t// pick one story\n\t\t$i = rand(0, count($this->actionsCallbacks) - 1);\n\n\t\t// return it to the caller\n\t\treturn $this->actionsCallbacks[$i];\n\t}",
"public function requestedAction()\r\n\t{\r\n\t\treturn $this->m_last_action;\r\n\t}",
"public function getCurrentAction();",
"public function getLastAction()\n\t{\n\t\treturn $this->lastAction;\n\t}",
"protected function getCurrentAction()\n {\n if ($this->currentAction) {\n return $this->currentAction;\n }\n $record = $this->getCurrentRecord();\n return $this->currentAction = $this->getRecordAction($record);\n }",
"public function getLastAction()\n {\n if (!empty($this->actions)) {\n return $this->actions[count($this->actions) - 1];\n }\n }",
"protected function getCurrentAction()\n\t{\n\t\tif (!$this->_action)\n\t\t{\n\t\t\t$this->_action = !empty(LSF_Dispatch_Console::$arguments[0]) ? LSF_Dispatch_Console::$arguments[0] : false;\n\t\t\tarray_shift(LSF_Dispatch_Console::$arguments);\n\t\t}\n\t\t\n\t\treturn $this->_action;\n\t}",
"public function getFirstItem() {\n if (sizeOf($this->actionList) == 0) {\n return null;\n }\n return $this->actionList[0];\n }",
"public function getTarget( $action )\r\n\t{\r\n\t\treturn isset($this->transitions[ $action ]) ? $this->transitions[ $action ] : null;\r\n\t}",
"public function get_next_action(){\n return $this->get_info('player_next_action');\n }",
"public function getCurrentAction()\n {\n return $this->sCurrentAction;\n }",
"public function getCurrentAction()\n\t{\n\t\tif (null !== $this->_action_name)\n\t\t\treturn $this->_action_name;\n\t}",
"function getDefaultAction()\n\t{\n\t\t$steps = array_keys($this->steps);\n\t\treturn $steps[0];\n\t}",
"public function get_next_action() {\n\t\treturn $this->nextAction; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar -- Twinfield vaiable name.\n\t}",
"public function getLastCalledAction();",
"public function getAction()\n {\n\t\tif ($this->__blnRestored && empty($this->__blnValid[self::ACTION_FIELD])) {\n\t\t\tthrow new Caller(\"Action was not selected in the most recent query and is not valid.\");\n\t\t}\n\t\treturn $this->strAction;\n\t}",
"public function getLastAction() {\n\t\t$action = get_option( 'wpfc_sm_dates_last_action', SM_DATES_NONE );\n\n\t\tif ( $action !== SM_DATES_NONE ) {\n\t\t\tif ( ! is_numeric( $action ) ) {\n\t\t\t\treturn $this->getAction( $action );\n\t\t\t}\n\t\t}\n\n\t\treturn $action;\n\t}",
"public function getSenderAction() /* : string */;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Perform the check for the database folder. We do this separately, because it can only be done _after_ the other checks, since we need to have the $config, to see if we even _need_ to do this check. | public function doDatabaseCheck()
{
$validator = new Validation\Database();
$validator->setPathResolver($this->config->app['path_resolver']);
$validator->setConfig($this->config->app['config']);
$validator->check();
} | [
"public function doDatabaseCheck($config)\n {\n\n $cfg = $config['general']['database'];\n\n if ($cfg['driver'] != 'sqlite') {\n return;\n }\n\n $filename = isset($cfg['databasename']) ? basename($cfg['databasename']) : \"bolt\";\n if (getExtension($filename)!=\"db\") {\n $filename .= \".db\";\n }\n\n // Check if the app/database folder and .db file are present and writable\n if (!file_exists(__DIR__.'/../database')) {\n $this->lowlevelError(\"The folder <code>app/database/</code> doesn't exist. Make sure it's \" .\n \"present and writable to the user that the webserver is using.\");\n }\n\n if (!is_writable(__DIR__.'/../database/'.$filename) && !is_writable(__DIR__.'/../database') ) {\n $this->lowlevelError(\"The database file <code>app/database/$filename</code> isn't writable. Make sure it's \" .\n \"present and writable to the user that the webserver is using. If the file doesn't exist, make sure the folder is writable and Bolt will create the file.\");\n }\n\n }",
"public function doDatabaseCheck()\n {\n $cfg = $this->config->app['config']->get('general/database');\n if(!isset($cfg['driver'])) {\n return;\n }\n\n if($cfg['driver']=='mysql' || $cfg['driver']=='postgres') {\n if(empty($cfg['password']) && ($cfg['username']==\"root\") ) {\n $this->lowlevelError(\"There is no <code>password</code> set for the database connection, and you're using user 'root'.\" .\n \"<br>That must surely be a mistake, right? Bolt will stubbornly refuse to run until you've set a password for 'root'.\");\n }\n if(empty($cfg['databasename'])) {\n $this->lowlevelError(\"There is no <code>databasename</code> set for your database.\");\n }\n if(empty($cfg['username'])) {\n $this->lowlevelError(\"There is no <code>username</code> set for your database.\");\n }\n }\n\n if($cfg['driver']=='mysql') {\n if (!extension_loaded('pdo_mysql')) {\n $this->lowlevelError(\"MySQL was selected as the database type, but the driver does not exist or is not loaded. Please install the pdo_mysql driver.\");\n }\n return;\n } elseif ($cfg['driver']=='postgres') {\n if (!extension_loaded('pdo_pgsql')) {\n $this->lowlevelError(\"Postgres was selected as the database type, but the driver does not exist or is not loaded. Please install the pdo_pgsql driver.\");\n }\n return;\n } elseif ($cfg['driver']=='sqlite') {\n if (!extension_loaded('pdo_sqlite')) {\n $this->lowlevelError(\"SQLite was selected as the database type, but the driver does not exist or is not loaded. Please install the pdo_sqlite driver.\");\n }\n } else {\n $this->lowlevelError(\"The selected database type is not supported.\");\n }\n\n if(isset($cfg['memory']) && true == $cfg['memory']) {\n return;\n }\n\n $filename = isset($cfg['databasename']) ? basename($cfg['databasename']) : \"bolt\";\n if (getExtension($filename)!=\"db\") {\n $filename .= \".db\";\n }\n\n\n // Check if the app/database folder and .db file are present and writable\n if (!is_writable($this->config->getPath('database'))) {\n $this->lowlevelError(\"The folder <code>\".\n $this->config->getPath('database') .\n \"</code> doesn't exist or it is not writable. Make sure it's \" .\n \"present and writable to the user that the webserver is using.\");\n }\n\n // If the .db file is present, make sure it is writable\n if (file_exists($this->config->getPath('database').\"/\".$filename) && !is_writable($this->config->getPath('database').\"/\".$filename)) {\n $this->lowlevelError(\"The database file <code>app/database/\" .\n htmlspecialchars($filename, ENT_QUOTES) .\n \"</code> isn't writable. Make sure it's \" .\n \"present and writable to the user that the webserver is using. If the file doesn't exist, make sure the folder is writable and Bolt will create the file.\");\n }\n\n }",
"private function checkDBInstallation()\n {\n $configPath = \\Yii::$app->getModule('installation')->getSubdirectories('config');\n\n if (!Filesystem::fileSystem()->has($configPath . '/config-db.php')) {\n // Set this action controller as unique on the system.\n // This way we enforce the system DB configuration\n Yii::$app->catchAll = ['installation/site/database'];\n Yii::$app->urlManager->enablePrettyUrl = TRUE;\n\n return FALSE;\n }\n\n return TRUE;\n }",
"protected function checkDB() {\n }",
"public function dbCheck()\n\t{\n\t\tif(!$this->checked)\n\t\t{\n\t\t\t$this->log[] = \"checking if db exists\";\n\t\t\t$this->checked = dbConnection::getInstance('Logger')->tableExists(Settings::Load()->Get('Logger', 'logtable'));\n\t\t\tif (!$this->checked) \n\t\t\t{\t\n\t\t\t\t$createquery = $this->createqueries[strtolower(Settings::Load()->Get('Logger', 'dbtype'))];\n\t\t\t\t$createquery = str_replace('@logtable@', Settings::Load()->Get('Logger', 'logtable'), $createquery);\n\t\t\t\t$this->checked = dbConnection::getInstance('Logger')->query($createquery);\n\t\t\t\tif(!$this->checked) die( \"Error creating logdatabase\");\n\t\t\t\tLogger::Log(\"Log database created.\");\n\t\t\t}\t\n\t\t}\n\t}",
"public function checkDatabase()\n {\n $path = $this->_dbHelper->getDatabasePath();\n if (!file_exists($path)) {\n return false;\n }\n\n if (filesize($path) < $this->dbMinSize) {\n return false;\n }\n\n return true;\n }",
"private function check_database() {\n if (!Database::is_configured()) {\n return;\n } else if (($db = Database::get_instance(false)) === false) {\n $this->database_connection = -1;\n return;\n }\n\n // Set that the connection is good\n $this->database_connection = 1;\n\n // Check if all tables have been created, if not, create them\n foreach ($this->tables as $table => $object) {\n if (!$this->table_exists($table)) {\n if ($this->create_table($table) === false) {\n $this->tables_created = -1;\n break;\n } else {\n $this->tables_created = 1;\n }\n }\n }\n }",
"public function check_configuration(){\n global $db;\n \n /* Tests the database table by table. Potentially kinda slow, so should not\n * be run if the active user is logged in (implying database works)\n */\n \n $user_query = \"SHOW TABLES LIKE \" . prefix('user');\n \n $res = $db->query($user_query);\n \n }",
"public function checkAndFixDatabase()\n\t{\n\t\t$db = $this->getDbo();\n\n\t\t// Initialise\n\t\t$tableFields = array();\n\t\t$sqlFiles = array();\n\n\t\t// Get a listing of database tables known to Joomla!\n\t\t$allTables = $db->getTableList();\n\t\t$dbprefix = JFactory::getConfig()->get('dbprefix', '');\n\n\t\t// Perform the base check. If any of these tables is missing we have to run the installation SQL file\n\t\tif(!empty($this->dbBaseCheck)) {\n\t\t\tforeach($this->dbBaseCheck['tables'] as $table)\n\t\t\t{\n\t\t\t\t$tableName = $dbprefix . $table;\n\t\t\t\t$check = in_array($tableName, $allTables);\n\t\t\t\tif (!$check) break;\n\t\t\t}\n\n\t\t\tif (!$check)\n\t\t\t{\n\t\t\t\t$sqlFiles[] = JPATH_ADMINISTRATOR . $this->dbFilesRoot . $this->dbBaseCheck['file'];\n\t\t\t}\n\t\t}\n\n\t\t// If the base check was successful and we have further database checks run them\n\t\tif (empty($sqlFiles) && !empty($this->dbChecks)) foreach($this->dbChecks as $dbCheck)\n\t\t{\n\t\t\t// Always check that the table exists\n\t\t\t$tableName = $dbprefix . $dbCheck['table'];\n\t\t\t$check = in_array($tableName, $allTables);\n\n\t\t\t// If the table exists and we have a field, check that the field exists too\n\t\t\tif (!empty($dbCheck['field']) && $check)\n\t\t\t{\n\t\t\t\tif (!array_key_exists($tableName, $tableFields))\n\t\t\t\t{\n\t\t\t\t\t$tableFields[$tableName] = $db->getTableColumns('#__' . $dbCheck['table'], true);\n\t\t\t\t}\n\n\t\t\t\tif (is_array($tableFields[$tableName]))\n\t\t\t\t{\n\t\t\t\t\t$check = array_key_exists($dbCheck['field'], $tableFields[$tableName]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$check = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Something's missing. Add the file to the list of SQL files to run\n\t\t\tif (!$check)\n\t\t\t{\n\t\t\t\tforeach ($dbCheck['files'] as $file)\n\t\t\t\t{\n\t\t\t\t\t$sqlFiles[] = JPATH_ADMINISTRATOR . $this->dbFilesRoot . $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If we have SQL files to run, well, RUN THEM!\n\t\tif (!empty($sqlFiles))\n\t\t{\n\t\t\tJLoader::import('joomla.filesystem.file');\n\t\t\tforeach($sqlFiles as $file)\n\t\t\t{\n\t\t\t\t$sql = JFile::read($file);\n\t\t\t\tif($sql) {\n\t\t\t\t\t$commands = explode(';', $sql);\n\t\t\t\t\tforeach($commands as $query) {\n\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t$db->execute();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function check_for_changes_and_update_db() {\n\t\t/* Get directory encoding file */\n\t\t$directory = ROOT_DIR . 'docs/' . $this->folder;\n\t\t$files = @scandir($directory);\n\t\tif (!$files) die(\"Directory Not Found\");\n\n\t\t/* Generate checksum of directory */\n\t\t$check_string = '';\n\t\tforeach ($files as $file) {\n\t\t\tif (is_file($directory . '/' .$file))\n\t\t\t\t$check_string .= md5_file($directory . '/' .$file);\n\t\t}\n\n\t\t/* Find the associated folder */\n\t\t$folder = ORM::for_table('folder')->where('title', $this->folder)->find_one();\n\t\t$this->folder_id = $folder->id;\n\t\tif (!$folder) {\n\t\t\t/* If no folder, create it and generate pages */\n\t\t\t$folder = ORM::for_table('folder')->create();\n\t\t\t$folder->title = $this->folder;\n\t\t\t$folder->checksum = $check_string;\n\t\t\t$folder->save();\n\t\t\t$this->rebuild_pages($folder->id);\n\t\t} else {\n\t\t\t/* If folder exists but checksum has changed, update folder contents and checksum */\n\t\t\tif ($folder->checksum != $check_string) {\n\t\t\t\t$this->rebuild_pages($folder->id);\n\t\t\t\t$folder->checksum = $check_string;\n\t\t\t\t$folder->save();\n\t\t\t}\n\t\t}\n\t}",
"public static function checkDatabaseConfigFilePermissions()\r\n {\r\n $file = Yii::getAlias('@app/config/db.php');\r\n\r\n $result = touch($file); // Check access file\r\n\r\n return $result;\r\n }",
"public function verifyDB()\n {\n if ( !is_writable(BASE_DIR) || !is_writable(BASE_DIR) ) {\n // The developer must ensure we can read/write to this directory.\n $apache = posix_getpwuid(posix_getuid());\n throw new RuntimeException(\"Please ensure `$apache[name]' has write access to \" . BASE_DIR);\n }\n\n if ( !file_exists(DB_DIR) ) {\n mkdir(DB_DIR, 0755);\n }\n\n if ( !file_exists($this->_db_file) ) {\n touch($this->_db_file, time());\n }\n\n return true;\n }",
"function _loadDbConfig() {\n\t\tif (config ( 'database' ) && class_exists ( 'DATABASE_CONFIG' )) {\n\t\t\t$this->DbConfig = & new DATABASE_CONFIG ();\n\t\t\treturn true;\n\t\t}\n\t\t$this->err ( 'Database config could not be loaded.' );\n\t\t$this->out ( 'Run `bake` to create the database configuration.' );\n\t\treturn false;\n\t}",
"private function verifyDbImplemented() {\n if (!$this->db) {\n $this->error_found = TRUE;\n $this->error_text = \"Database option not enabled in pre.config.php\\n\";\n return FALSE;\n }\n return TRUE;\n }",
"public function testDatabaseDirectory()\n {\n $this->assertEquals($this->path->database().' created successfully', $this->generator->database());\n }",
"private function pre_backup_db_checks(){\n\t\t \t\ttry{\n\t\t\t\t\tif( $this->mysqldump_filename === NULL ){\n\t\t\t\t\t\tthrow new Exception('Filename not supplied. Using default one');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e){\n\t\t\t\t\t\t$this->mysqldump_filename = $this::DEFAULT_MYSQLDUMP_FILENAME;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tif ( !is_writable('.') ) {\n\t\t\t\t\t\tthrow new Exception('Filename is not writable');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e){\n\t\t\t\t\t\techo 'Error: ' . $e->getMessage();\n\t\t\t\t\t\texit;\n\t\t\t\t}\t\n\t\t }",
"function db_check() {\n\t\tif(!is_admin() || !$this->db_option || !$this->db_version || !$this->table_schema) return false;\n\t\tglobal $wpdb;\n\t\t$current_db_version = get_option($this->db_option);\n\t\tif($this->db_version != $current_db_version) {\n\t\t\t$this->db_install_options();\n\t\t\t$this->db_install($sql);\n\t\t}\n\t}",
"public function testCustomDBPath() {\n $dbdata = HermesHelper::getMagentoDBConfig($this->_dbFile);\n $this->assertNotNull((string)$dbdata->host);\n $this->assertNotNull((string)$dbdata->username);\n $this->assertNotNull((string)$dbdata->password);\n $this->assertNotNull((string)$dbdata->dbname);\n\n //From phpunit path, the config file shouldn't be found.\n set_exit_overload(function($message) { Etailers_HermesHelper_Test::setMessage($message); return FALSE; });\n $dbdata = HermesHelper::getMagentoDBConfig();\n unset_exit_overload();\n $this->assertEquals('Unable to load magento db config file.', self::$message);\n }",
"function check_config() {\n\tglobal $we_have_config, $bbs, $app, $globalSettings;\n\n\t$app->getLog()->debug(\"check_config start\");\n\t# No config --> error\n\tif (!$we_have_config) {\n\t\t$app->getLog()->error('No configuration found');\t\n\t\t$app->render('error.html', array(\n\t\t\t'page' => mkPage($globalSettings['langa']['error']), \n\t\t\t'title' => $globalSettings['langa']['error'], \n\t\t\t'error' => $globalSettings['langa']['no_config']));\n\t}\n\n\t# 'After installation' scenario: here is a config DB but no valid connection to Calibre\n\tif ($we_have_config && $globalSettings[CALIBRE_DIR] === '') {\n\t\tif ($app->request()->isPost() && $app->request()->getResourceUri() === '/admin/') {\n\t\t\t# let go through\n\t\t} else {\n\t\t\t$app->getLog()->warn('Calibre library path not configured, showing admin page.');\t\n\t\t\t$app->redirect($app->request()->getRootUri().'/admin');\n\t\t}\n\t}\n\n\t# Setup the connection to the Calibre metadata db\n\t$clp = $globalSettings[CALIBRE_DIR].'/metadata.db';\n\t$bbs->openCalibreDB($clp);\n\tif (!$bbs->libraryOk()) {\n\t\t$app->getLog()->error('Exception while opening metadata db '.$clp.'. Showing admin page.');\t\n\t\t$app->redirect($app->request()->getRootUri().'/admin');\n\t} \t\n\t$app->getLog()->debug(\"check_config end\");\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A basic feature test HasItemInBox. | public function testHasItemInBox()
{
$box = new Box(['cat','toy','torch']);
$this -> assertTrue($box ->has('toy'));
$this -> assertTrue($box ->has('ball'));
} | [
"public function testHasItemInBox()\n {\n $box = new Box(['cat', 'toy', 'torch']);\n //Se espera que para esta entrada se regrese un True como respuesta,\n //puesto que el elemento toy existe.\n $this->assertTrue($box->has('toy'));\n //Se espera que para esta entrada se regrese un False como respuesta,\n //puesto que el elemento ball no existe.\n $this->assertFalse($box->has('ball'));\n }",
"public function testGetInboxes()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testGetAllInboxes()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testGetOrganizationInboxes()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function hasItem($name);",
"public function testGetCollectionItemSupplies()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function Event_Proceedings_Has($item=array())\n {\n $res=FALSE;\n if ($this->Event(\"Contents\")==2)\n {\n $res=TRUE;\n }\n\n return $res;\n }",
"public function testHasUnexpiredItem3() {\n\t\t\n\t\t$fridge = new Fridge();\n\t\t$ingredient = new FridgeIngredient('test', 10, 'grams', '21/10/2016');\n\t\t$fridge->addItem($ingredient);\n\t\t$ingredient = new Ingredient('test', 20, 'grams');\n\t\treturn assert('$fridge->hasUnexpiredItem($ingredient) == false');\n\t}",
"public function testGetCollectionItem()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function has_item(){\n $args = func_get_args();\n $item = $this->get_info('robot_item');\n if (!empty($args[0])){ return $item == $args[0] ? true : false; }\n else { return !empty($item) ? true : false; }\n }",
"function is_item( $value ) {\n if (! $value instanceof Item ) {\n return false;\n }\n \n if ( $value->item_exists() ) {\n return true;\n } else {\n return false;\n }\n}",
"function snax_show_item_voting_box( $post = null ) {\n\t$post \t\t\t\t= get_post( $post );\n\t$post_type \t\t\t= get_post_type( $post );\n\t$allowed_post_types\t= snax_voting_get_post_types();\n\n\t$bool = snax_voting_is_enabled() && in_array( $post_type, $allowed_post_types, true );\n\n\t// Snax item?\n\tif ( snax_is_item( $post ) ) {\n\t\t$parent_id = snax_get_item_parent_id( $post );\n\n\t\t// List items can't be voted.\n\t\tif ( ! snax_is_post_ranked_list( $parent_id ) ) {\n\t\t\t$bool = false;\n\t\t}\n\n\t\t// List items can't be voted anymore.\n\t\tif ( ! snax_is_post_open_for_voting( $parent_id ) ) {\n\t\t\t$bool = false;\n\t\t}\n\t}\n\n\treturn (bool) apply_filters( 'snax_show_item_voting_box', $bool, $post );\n}",
"public function has_item(){\n $args = func_get_args();\n $counter = $this->get_counter('item_disabled');\n $item = empty($counter) ? $this->get_info('robot_item') : '';\n if (!empty($args[0])){ return $item == $args[0] ? true : false; }\n else { return !empty($item) ? true : false; }\n }",
"public function test_show_wp_block_in_menu() {\n\t\tFunctions\\stubTranslationFunctions();\n\n\t\t$args = [];\n\t\t$expected_args = [\n\t\t\t'show_in_menu' => true,\n\t\t\t'menu_position' => 24,\n\t\t\t'menu_icon' => 'dashicons-screenoptions',\n\t\t];\n\t\t\n\t\t$actual_args = Testee\\show_wp_block_in_menu( $args, 'wp_block' );\n\t\t\n\t\tforeach ( $expected_args as $key => $value ) {\n\t\t\t$this->assertArrayHasKey( $key, $actual_args );\n\t\t\t$this->assertSame( $value, $actual_args[ $key ] );\n\t\t}\n\t}",
"public function inListForItemContainedReturnsTrueDataProvider() {}",
"public function testNotEnoughLimitedSupplyBox(): void\n {\n // as above, but remove heavy box as an option\n $this->expectException(NoBoxesAvailableException::class);\n $packer = new Packer();\n $packer->addBox(new LimitedSupplyTestBox('Light box', 100, 100, 100, 1, 100, 100, 100, 100, 2));\n $packer->addItem(new TestItem('Item', 100, 100, 100, 75, TestItem::ROTATION_BEST_FIT), 3);\n\n /** @var PackedBox[] $packedBoxes */\n $packedBoxes = iterator_to_array($packer->pack(), false);\n\n self::assertCount(3, $packedBoxes);\n self::assertEquals('Light box', $packedBoxes[0]->getBox()->getReference());\n self::assertEquals('Light box', $packedBoxes[1]->getBox()->getReference());\n self::assertEquals('Heavy box', $packedBoxes[2]->getBox()->getReference());\n }",
"public function hasBox(): bool\n {\n return isset($this->box);\n }",
"public function hasItem($index);",
"public function testItem()\n {\n $this->specify('The key \"data\" is required.', function () {\n $item = $this->service->item($this->book, $this->transformer)->toArray();\n verify($item)->hasKey('data');\n });\n\n $this->specify('The book title must equal \"Test Book\".', function () {\n $item = $this->service->item($this->book, $this->transformer)->toArray();\n verify($item['data']['title'])->equals('Test Book');\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether image type is GIF. | public final function isGif(): bool
{
return ($this->getMime() == self::MIME_GIF);
} | [
"public function isGIF()\n {\n return $this->extension == 'gif';\n }",
"public final function isGif() : bool\n {\n\n return $this->mimeType == 'image/gif';\n\n }",
"function isGIF()\r\n {\r\n if($this->_graphic_typ == 1) return true;\r\n else return false;\r\n }",
"public function isGif($image)\n {\n if (File::extension($image) === 'gif') {\n return true;\n\n }\n }",
"function isAnimatedGif($image)\n{\n if (!is_file($image)) {\n return false;\n }\n\n $Imagick = new \\Imagick(realpath($image));\n $number = $Imagick->getNumberImages();\n $Imagick->clear();\n unset($Imagick);\n\n if (is_numeric($number)) {\n return $number;\n }\n return false;\n}",
"protected function checkGdLibGifSupport() {\n\t\tif (\n\t\t\tfunction_exists('imagecreatefromgif')\n\t\t\t&& function_exists('imagegif')\n\t\t\t&& (imagetypes() & IMG_GIF)\n\t\t) {\n\t\t\t$imageResource = @imagecreatefromgif(__DIR__ . '/../../Resources/Public/Images/TestInput/Test.gif');\n\t\t\tif (is_resource($imageResource)) {\n\t\t\t\timagedestroy($imageResource);\n\t\t\t\t$status = new OkStatus();\n\t\t\t\t$status->setTitle('PHP GD library has gif support');\n\t\t\t} else {\n\t\t\t\t$status = new ErrorStatus();\n\t\t\t\t$status->setTitle('PHP GD library gif support broken');\n\t\t\t\t$status->setMessage(\n\t\t\t\t\t'GD is loaded, but calling imagecreatefromgif() fails.' .\n\t\t\t\t\t' This must be fixed, TYPO3 CMS won\\'t work well otherwise.'\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\t$status = new ErrorStatus();\n\t\t\t$status->setTitle('PHP GD library gif support missing');\n\t\t\t$status->setMessage(\n\t\t\t\t'GD must be compiled with gif support. This is essential for' .\n\t\t\t\t' TYPO3 CMS to work properly.'\n\t\t\t);\n\t\t}\n\t\treturn $status;\n\t}",
"function is_animated_gif($file){\n $fp = null;\n\n if (is_string($file)) {\n $fp = fopen($file, \"rb\");\n } else {\n $fp = $file;\n\n /* Make sure that we are at the beginning of the file */\n fseek($fp, 0);\n }\n\n if (fread($fp, 3) !== \"GIF\") {\n fclose($fp);\n\n return false;\n }\n\n $frames = 0;\n\n while (!feof($fp) && $frames < 2) {\n if (fread($fp, 1) === \"\\x00\") {\n /* Some of the animated GIFs do not contain graphic control extension (starts with 21 f9) */\n if (fread($fp, 1) === \"\\x21\" || fread($fp, 2) === \"\\x21\\xf9\") {\n $frames++;\n }\n }\n }\n\n fclose($fp);\n\n return $frames > 1;\n}",
"function is_animated_gif($img) {\n if(empty($img)) return false;\n\n $contents = file_get_contents($img);\n $location = 0;\n $count = 0;\n\n if((substr($contents, 0, 6) != 'GIF89a') AND (substr($contents, 0, 6) != 'GIF87a')) {\n return false;\n }\n\n while ($count < 2) {\n $first_occurance = strpos($contents,\"\\x00\\x21\\xF9\\x04\",$location);\n if ($first_occurance === FALSE) {\n break;\n } else {\n $location = $first_occurance+1;\n $second_occurance = strpos($contents,\"\\x00\\x2C\",$location);\n if ($second_occurance === FALSE) {\n break;\n } else {\n if ($first_occurance+8 == $second_occurance) {\n $count++;\n }\n $location = $second_occurance+1;\n }\n }\n }\n return ($count > 1) ? true : false;\n}",
"function _check_image_type($type) {\n try {\n $type = strtolower($type);\n $types = array(\"gif\", \"jpg\", \"jpeg\", \"png\", \"pjpeg\", \"x-png\", \"tiff\", \"x-tiff\");\n $val = in_array($type, $types, true);\n return $val;\n } catch (Exception $exception) {\n echo $exception->getMessage();\n }\n }",
"private function isImage()\n {\n return preg_match('/image/i', $this->type);\n }",
"public function isImage()\n {\n return substr($this->type, 0, 5) == 'image';\n }",
"public function isImage(){\n $ok = true;\n $fileInfo = new finfo(FILEINFO_MIME_TYPE);\n if(false === $ext = array_search($fileInfo->file($this->tmpFile), $this->imgMime, true)){\n $ok = false;\n }\n return $ok;\n }",
"public static function isAnimatedGIF(string $filename): bool\n\t{\n\t\tif (!($fh = @fopen($filename, 'rb')))\n\t\t\treturn false;\n\n\t\t$count = 0;\n\n\t\twhile (!feof($fh) && $count < 2)\n\t\t{\n\t\t\t$chunk = fread($fh, 1024 * 100);\n\t\t\t$count += preg_match_all('#\\x00\\x21\\xF9\\x04.{4}\\x00([,!])#s', $chunk, $matches);\n\t\t}\n\n\t\tfclose($fh);\n\n\t\treturn $count > 1;\n\t}",
"function isGDEditable() \n\t{\n\t\tif(isset($_GET['img']))\n\t\t\t$relative = rawurldecode($_GET['img']);\n\t\telse\n\t\t\tReturn 0;\n\t\tif(IMAGE_CLASS != 'GD')\n\t\t\tReturn 0;\n\n\t\t$fullpath = $this->manager->getFullPath($relative);\n\n\t\t$type = $this->getImageType($fullpath);\n\t\tif($type != 'gif')\n\t\t\tReturn 0;\n\n\t\t// Raymond:fix Gif detection bug\n\t\tif(function_exists('ImageCreateFromGif')\n\t\t\t&& function_exists('imagegif'))\n\t\t\tReturn 1;\n\t\telse\n\t\t\tReturn -1;\n\t}",
"public function isImage()\n {\n return in_array($this->fileextension, [\n 'jpg',\n 'jpeg',\n 'JPG',\n 'JPEG',\n 'png',\n 'PNG',\n 'gif',\n 'GIF',\n ]);\n }",
"protected function isImage()\n {\n \treturn str_contains($this->media->mime_type, 'image');\n\t}",
"public function isImage()\n {\n $meta = $this->getMimeType();\n\n if((substr($meta, 0, 5) == 'image') &&\n ($meta != 'image/tiff')) {\n return true;\n }\n\n return false;\n }",
"public function isImage()\n\t{\n\t\treturn substr($this->mime_type, 0, 5) === 'image';\n\t}",
"public function test_type_and_formats_from_upload_path_and_uploaded_file_for_gif() {\n list($format_type, $formats) = $this->_cut->type_and_formats_from_upload_path_and_uploaded_file(\n __DIR__ . '/img/',\n 'xerxes.gif'\n );\n $this->assertSame('image', $format_type);\n $this->assertNull($formats);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that "timeout" method accepts a DateInterval object. | public function testTimeoutDateInterval()
{
$process = (new Builder)->timeout(
new DateInterval('PT18S')
)->process();
$this->assertEquals(18, $process->getTimeout());
} | [
"public function checkTimeout();",
"public function checkTimeout(){ }",
"public function isTimeoutValid(DateInterval $timeout): void\n {\n if ($timeout->invert === 1 || $timeout->s === 0) {\n throw new ValidationException(\n 'Timeout must be greater than zero.',\n null,\n 'shipengine',\n 'validation',\n 'invalid_field_value'\n );\n }\n }",
"public function testTimeoutInteger()\n {\n $process = (new Builder)->timeout(20)->process();\n\n $this->assertEquals(20, $process->getTimeout());\n }",
"public function testDateTimeInterval()\n {\n //Load a BpmnFile Repository\n $bpmnRepository = new BpmnDocument();\n $bpmnRepository->setEngine($this->engine);\n $bpmnRepository->setFactory($this->repository);\n $bpmnRepository->load(__DIR__ . '/files/Timer_StartEvent_TimeDateInterval.bpmn');\n\n //Load a process from a bpmn repository by Id\n $process = $bpmnRepository->getProcess('Process');\n $timerEventDefinition = $bpmnRepository->getTimerEventDefinition('_9_ED_1');\n\n //Set an date time interval\n $interval = 'PT1H';\n $expression = $this->repository->createFormalExpression();\n $expression->setRepository($this->repository);\n $expression->setProperty('body', $interval);\n $timerEventDefinition->setTimeDuration($expression);\n\n $this->engine->loadProcess($process);\n\n //Get scheduled job information\n $job = $this->jobs[0];\n $duration = $job['timer'];\n\n //Assertion: The duration must be the specified date time interval.\n $expected = new DateInterval($interval);\n $this->assertEquals($expected, $duration);\n }",
"public function testCurlTimeoutOption()\n {\n $client = Client::make('localhost', 9998)->setTimeout(3);\n\n $this->assertEquals(3, $client->getTimeout());\n }",
"public function getTimeout();",
"public function isInTimeout();",
"public function setTimerTimeout($timeout)\n {\n }",
"public function withDefaultTimeout($timeout) {}",
"public function testDefaultTtlInvalidArgumentNegativeDateInterval(): void\n {\n $Today = new \\DateTime('2012-01-02');\n $YesterDay = new \\DateTime('2012-01-01');\n $interval = $Today->diff($YesterDay);\n $interval = $YesterDay->diff($Today);\n $interval->d = \"-1\";\n $this->expectException(\\InvalidArgumentException::class);\n $this->testNotStrict->setDefaultSeconds($interval);\n }",
"public function testRequestTimeout()\n {\n $testTimeout = '1';\n\n EasyPost::setResponseTimeout($testTimeout);\n $connectionTimeout = EasyPost::getResponseTimeout();\n\n $this->assertEquals($testTimeout, $connectionTimeout);\n }",
"public function triggerTimeout(): void\n {\n $this->setTimeout(0.000001);\n $this->isSuccessful = false;\n $this->fakeTimeout = true;\n }",
"public function testIntervalFakeStartPast()\r\n {\r\n $interval = new Web2All_Timer_SleepInterval(1,Web2All_Timer_SleepInterval::OPTION_NEVER_SKIP_INTERVAL);\r\n $interval->initialize(false, time()-2);\r\n $utime = microtime(true);\r\n $res = $interval->sleep();\r\n $timediff = microtime(true) - $utime;\r\n $this->assertTrue(($timediff < 0.01), 'expect no time to have passed but '.$timediff.'s has');\r\n $this->assertEquals(true, $res, 'expect true as no end time is set');\r\n \r\n $res = $interval->sleep();\r\n $timediff = microtime(true) - $utime;\r\n $this->assertTrue(($timediff < 0.01), 'expect no time to have passed but '.$timediff.'s has');\r\n $this->assertEquals(true, $res, 'expect true as no end time is set');\r\n \r\n $res = $interval->sleep();\r\n $timediff = microtime(true) - $utime;\r\n $this->assertTrue(($timediff < 1.01 && $timediff > 0.99), 'expect about one second to have passed but '.$timediff.'s has');\r\n $this->assertEquals(true, $res, 'expect true as no end time is set');\r\n }",
"public function getTimeout()\n {\n }",
"#[@test]\n public function timeouts() {\n $r= $this->suite->runTest(new SimpleTestCase('timeouts'));\n $this->assertEquals(1, $r->failureCount());\n }",
"public function testGetKeepAliveTimeout()\n {\n $this->assertSame(\n $value = 5,\n $this->getServerNodeWithMockedConfiguration($value, 'keepAliveTimeout')->getKeepAliveTimeout()\n );\n }",
"function imap_timeout ($timeout_type, $timeout = null) {}",
"public function testThrowsExceptionWhenConnectTimeoutIsHigherThanAllowed() {\n $handle = 'curlhandle';\n $url = 'http://someurl';\n\n $this->wrapper->expects($this->once())->method('copy')->will($this->returnValue($handle));\n $this->wrapper->expects($this->once())->method('exec')->with($handle)->will($this->returnValue(false));\n $this->wrapper->expects($this->any())->method('getInfo')->will($this->returnCallback(function($opt) {\n if ($opt === CURLINFO_CONNECT_TIME) {\n return 30;\n }\n\n return null;\n }));\n\n $curl = new cURL(array(\n 'connectTimeout' => 20,\n ), array(), $this->wrapper);\n $curl->get($url);\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.