query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
Operation partnerResourceLinksV2GetAsyncWithHttpInfo Get a list of partner resource links.
public function partnerResourceLinksV2GetAsyncWithHttpInfo() { $returnType = '\Swagger\Client\Model\PaginatedResponsePartnerResourceLinkApi'; $request = $this->partnerResourceLinksV2GetRequest(); 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 partnerResourceLinksV2PostAsyncWithHttpInfo($id, $resource_id, $resource_type, $href, $partner_company_name, $partner_system_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\PartnerResourceLinkApi';\n $request = $this->partnerResourceLinksV2PostRequest($id, $resource_id, $resource_type, $href, $partner_company_name, $partner_system_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function getChannelPartnersWithHttpInfo()\n {\n return $this->getChannelPartnersWithHttpInfoRetry(true );\n }", "public function restPropertiesRelationsGetAsyncWithHttpInfo($page = null, $items_per_page = null, $paginate = null, $relation_type_identifier = null, $relation_target_id = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\PropertyRelation[]';\n $request = $this->restPropertiesRelationsGetRequest($page, $items_per_page, $paginate, $relation_type_identifier, $relation_target_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 = (string) $responseBody;\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 partnerResourceLinksV2PutWithHttpInfo($id, $resource_id, $resource_type, $href, $partner_company_name, $partner_system_name, $partner_resource_link_id)\n {\n $returnType = '\\Swagger\\Client\\Model\\PartnerResourceLinkApi';\n $request = $this->partnerResourceLinksV2PutRequest($id, $resource_id, $resource_type, $href, $partner_company_name, $partner_system_name, $partner_resource_link_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string','integer','bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\PartnerResourceLinkApi',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function accountsV2GetWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\PaginatedResponseAccountApi';\n $request = $this->accountsV2GetRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string','integer','bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\PaginatedResponseAccountApi',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function partnerResourceLinksV2DeleteAsyncWithHttpInfo($partner_resource_link_id)\n {\n $returnType = 'object';\n $request = $this->partnerResourceLinksV2DeleteRequest($partner_resource_link_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 getLinkedResources($resourceId) {\n return $this->decodeTranslationLinks($this->babelTv->getValue($resourceId));\n }", "public function getCatalogItemRelationshipsWithHttpInfo($id, $related_resource, $page_cursor = null, $apiKey = null)\n {\n $request = $this->getCatalogItemRelationshipsRequest($id, $related_resource, $page_cursor, $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 200:\n if ('array<string,mixed>' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('array&lt;string,mixed&gt;' !== '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 200:\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 getChannelPartnersAsyncWithHttpInfo()\n {\n $returnType = '\\ultracart\\v2\\models\\ChannelPartnersResponse';\n $request = $this->getChannelPartnersRequest();\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 getEventRelationshipsAsyncWithHttpInfo($id, $related_resource, $apiKey = null)\n {\n $returnType = 'array<string,mixed>';\n $request = $this->getEventRelationshipsRequest($id, $related_resource, $apiKey);\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 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 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 partnerResourceLinksV2PutAsync($id, $resource_id, $resource_type, $href, $partner_company_name, $partner_system_name, $partner_resource_link_id)\n {\n return $this->partnerResourceLinksV2PutAsyncWithHttpInfo($id, $resource_id, $resource_type, $href, $partner_company_name, $partner_system_name, $partner_resource_link_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function restPropertiesRelationsValuesGetAsyncWithHttpInfo()\n {\n $returnType = '\\OpenAPI\\Client\\Model\\PropertyRelationValue[]';\n $request = $this->restPropertiesRelationsValuesGetRequest();\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 = (string) $responseBody;\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 accountsV2Get()\n {\n list($response) = $this->accountsV2GetWithHttpInfo();\n return $response;\n }", "public function getResourcesAsyncWithHttpInfo()\n {\n $returnType = '\\AuthressSdk\\Model\\ResourcePermissionCollection';\n $request = $this->getResourcesRequest();\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 restShopBuilderContentLinksGetWithHttpInfo()\n {\n $request = $this->restShopBuilderContentLinksGetRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\OpenAPI\\Client\\Model\\ContentLink[]' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\ContentLink[]', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\ContentLink[]';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\OpenAPI\\Client\\Model\\ContentLink[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function getListRoutersAsyncWithHttpInfo(): PromiseInterface\n {\n\n $request = new Request('GET', 'router');\n\n return $this->client->sendAsync($request)->then(function ($response) {\n return $response->toArray(RoutersListResponse::class);\n });\n }", "public function accountsV2GetAsync()\n {\n return $this->accountsV2GetAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function getVideoRelationshipsAsyncWithHttpInfo($video_id, $size = '25', $page = '1')\n {\n $returnType = '\\KnetikCloud\\Model\\PageResourceVideoRelationshipResource_';\n $request = $this->getVideoRelationshipsRequest($video_id, $size, $page);\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 listPeersAsyncWithHttpInfo()\n {\n $returnType = '\\Lnd\\Rest\\Model\\LnrpcListPeersResponse';\n $request = $this->listPeersRequest();\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" ] ] } }
Estimate sizes and update the options values for them.
public function imagify_update_estimate_sizes_callback() { imagify_check_nonce( 'update_estimate_sizes' ); if ( ! imagify_get_context( 'wp' )->current_user_can( 'manage' ) ) { imagify_die(); } $raw_total_size_in_library = imagify_calculate_total_size_images_library() + Imagify_Files_Stats::get_overall_original_size(); $raw_average_per_month = imagify_calculate_average_size_images_per_month() + Imagify_Files_Stats::calculate_average_size_per_month(); Imagify_Data::get_instance()->set( array( 'total_size_images_library' => $raw_total_size_in_library, 'average_size_images_per_month' => $raw_average_per_month, ) ); die( 1 ); }
[ "function RecalcSizes(){}", "public function calculateSizes() {\n // Set the original order.\n foreach ($this->items as $key => $value) {\n $value->setOriginalKey($key);\n }\n // Sort array by biggest width.\n usort($this->items, [$this, 'sortByWidth']);\n\n // Init vars.\n $minimum_size = 2;\n $max_size = 3;\n\n // Get the count of items.\n $items_count = count($this->items);\n\n switch ($items_count) {\n case 1:\n $max_size = 5;\n break;\n\n case 2:\n $max_size = 7;\n break;\n\n case 3:\n case 4:\n $max_size = 5;\n break;\n }\n\n // Enfore size if non dynamic.\n if (!$this->isDynamic()) {\n $minimum_size = ceil(12 / $items_count);\n $max_size = $minimum_size;\n }\n\n // Loop over the items.\n $temp_sizes = [];\n /* @var $item DtGalleryItemBase */\n foreach ($this->items as $key => &$item) {\n if (!in_array($max_size, $temp_sizes)) {\n $item->setSize($max_size);\n }\n else {\n // Space per item.\n $space_per_item = (12 - array_sum($temp_sizes)) / ($items_count - count($temp_sizes));\n // Add it to the list.\n $item->setSize($space_per_item > $minimum_size ? ceil($space_per_item) : $minimum_size);\n }\n $temp_sizes[] = $item->getSize();\n }\n\n // Sort back the array by its original key.\n usort($this->items, [$this, 'sortByOriginalKey']);\n }", "function p3_update_sizes_may_2018() {\n\tif (get_option('p3_update_sizes_may_2018')) {\n\t\treturn;\n\t}\n\tupdate_option('medium_size_w', 300);\n\tupdate_option('medium_size_h', 0);\n\tupdate_option('medium_large_size_w', 0);\n\tupdate_option('medium_large_size_h', 0);\n\tupdate_option('p3_update_sizes_may_2018', 1);\n}", "public function recalculate(): void {\n\t\t$this->calculateSizeData();\n\t}", "private function save_font_size_changes() {\n\t\t$new_font_sizes = kalium()->request->input( 'font_sizes' );\n\n\t\t// Get values from defined grup sizes\n\t\t$font_sizes = TypoLab_Font_Sizes::get_font_sizes();\n\n\t\tforeach ( $font_sizes as $i => & $size_group ) {\n\t\t\t$size_group = array_merge( $size_group, $new_font_sizes[ $i ] );\n\t\t}\n\n\t\t// Save Settings\n\t\tself::set_setting( 'font_sizes', $font_sizes );\n\t\tkalium()->helpers->add_admin_notice( 'Font sizes have been saved.', 'success' );\n\n\t\t// Create Group Info\n\t\t$new_group_title = kalium()->request->input( 'new_group_title' );\n\t\t$new_group_description = kalium()->request->input( 'new_group_description' );\n\t\t$new_group_size_alias = kalium()->request->input( 'new_group_size_alias' );\n\t\t$new_group_size_path = kalium()->request->input( 'new_group_size_path' );\n\n\t\t// Delete Font Loading Cache\n\t\tTypoLab_Font_Loader::delete_font_selectors_cache();\n\n\t\t// Add Custom Selectors Group\n\t\tif ( $new_group_title && is_array( $new_group_size_path ) && is_array( $new_group_size_path ) ) {\n\t\t\t$new_selectors = [];\n\n\t\t\tforeach ( $new_group_size_alias as $i => $selector_id ) {\n\t\t\t\tif ( ! empty( $selector_id ) && ! empty( $new_group_size_path[ $i ] ) ) {\n\t\t\t\t\t$new_selectors[ $selector_id ] = $new_group_size_path[ $i ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$custom_font_size_group = [\n\t\t\t\t'title' => $new_group_title,\n\t\t\t\t'description' => $new_group_description,\n\t\t\t\t'selectors' => stripslashes_deep( $new_selectors ),\n\t\t\t\t'builtin' => false,\n\t\t\t\t'sizes' => [],\n\t\t\t];\n\n\t\t\tTypoLab_Font_Sizes::addCustomFontSizeGroup( $custom_font_size_group );\n\n\t\t\tkalium()->helpers->add_admin_notice( 'Font size group has been created.', 'success' );\n\t\t}\n\t}", "protected function normalizeSizeOption(array &$options)\n {\n if (isset($options['size'])) {\n $size = explode('x', $options['size']);\n if (\n isset($size[0]) &&\n isset($size[1]) \n ) {\n list($options['cols'], $options['rows']) = $size;\n }\n unset($options['size']);\n }\n }", "public function setOriginalSize();", "public function image_sizes() {\n\t\t\t\n\t\t\tupdate_option( 'shop_catalog_image_size', array(\n\t\t\t\t'width' \t=> '9999',\n\t\t\t\t'height'\t=> '9999',\n\t\t\t\t'crop'\t\t=> 0\n\t\t\t) );\n\n\t\t\tupdate_option( 'shop_single_image_size', array(\n\t\t\t\t'width' \t=> '9999',\n\t\t\t\t'height'\t=> '9999',\n\t\t\t\t'crop'\t\t=> 0\n\t\t\t) );\n\n\t\t\tupdate_option( 'shop_thumbnail_image_size', array(\n\t\t\t\t'width' \t=> '100',\n\t\t\t\t'height'\t=> '100',\n\t\t\t\t'crop'\t\t=> 1\n\t\t\t) );\n\n\t\t}", "function report_roster_get_options_size() {\n $sizes = array();\n\n foreach (array('small', 'medium', 'large') as $size) {\n $pixels = (int) get_config('report_roster', \"size_$size\");\n $label = get_string(\"size:$size\", 'report_roster');\n\n if ($pixels > 0) {\n $sizes[$pixels] = $label;\n }\n }\n\n return $sizes;\n}", "public function addOnSize() {\n $this->layout = \"hq_dashboard\";\n $merchant_id = $this->Session->read('merchantId');\n if ($this->request->is('post') && !empty($this->request->data['AddonSize']['size'])) {\n $this->request->data = $this->Common->trimValue($this->request->data);\n if ($this->request->data['AddonSize']['store_id'] == 'All') {\n $storeData = $this->Store->getAllStoreByMerchantId($merchant_id);\n if (!empty($storeData)) {\n foreach ($storeData as $store) {\n $this->request->data['AddonSize']['store_id'] = $store['Store']['id'];\n $this->_saveAddOnSize($merchant_id);\n }\n }\n } else {\n $this->_saveAddOnSize($merchant_id);\n }\n $this->request->data = '';\n }\n $this->_addOnSizeList();\n }", "public function set_spacing_sizes()\n {\n }", "function InvalidateBestSize(){}", "public function updateFontSize($size);", "public function setSize() {\n //Available sizes\n $sizes = [\n 'xs' => '16',\n 'sm' => '24',\n 'md' => '32',\n 'lg' => '48',\n 'xl' => '64',\n 'xxl' => '80',\n ];\n\n //Size class\n if(isset($sizes[$this->compParams['size']])) {\n $this->data['classList'][] = $this->getBaseClass().\"--size-\".$this->compParams['size'];\n } else {\n $this->data['classList'][] = $this->getBaseClass() . \"--size-inherit\";\n }\n\n return $this->data;\n }", "public function testUpdateOrderItemSize()\n {\n $order = Order::first();\n $orderItem = $order->items()->first();\n $data = [\n 'size' => $orderItem->size != Product::$sizes[0] ? Product::$sizes[0] : Product::$sizes[1]\n ];\n\n $this->updateOrderItem($order->id, $orderItem->id, $data)\n ->assertRedirect();\n\n $orderItem->refresh();\n\n $this->assertEquals($data['size'], $orderItem->size);\n }", "public function statSizes() {}", "function setPointSize($point_size){}", "private function _setMapSize()\n {\n $this->map_obj->setSize($this->image_size[0], $this->image_size[1]);\n if ($this->_isResize()) {\n $this->map_obj->setSize($this->_download_factor*$this->image_size[0], $this->_download_factor*$this->image_size[1]);\n }\n }", "public function setSizeAdjustment($size) {\n\t\t$this->sizeAdjustment = $size;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Template for the editing view of this option field
public function EditSegment() { return $this->renderWith('EditableFieldOption'); }
[ "public function _editField() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\tif (array_key_exists ( 'cid', $args )) {\n\t\t\t$field_id = $args ['cid'] [0];\n\t\t} else {\n\t\t\t$field_id = @$args [3] ? @$args [3] : $args [1];\n\t\t}\n\t\t\n\t\t$field = $this->getModel ( 'field' );\n\t\t$field->get ( ( int ) $field_id );\n\t\t\n\t\t$this->loadPluginModel ( 'fields' );\n\t\t\n\t\t$this->setView ( 'edit_field' );\n\t\n\t}", "public function edit() {\n return $this->app->html->_('control.text', $this->getControlName('value'), $this->get('value', $this->config->get('default')), 'size=\"60\" maxlength=\"255\"');\n }", "public function getDeviceOptionEditAction() \n {\n $deviceOptionId = intval($this->getRequest()->getParam('device_option_id', 0));\n $deviceOptionsContent = '';\n\n if (0 < $deviceOptionId) {\n $deviceOptionsDb = new DeviceOptions();\n $deviceOption = $deviceOptionsDb->findOptionById($deviceOptionId);\n\n $this->view->assign('device_option_id', $deviceOption->offsetGet('device_option_id'));\n $this->view->assign('device_option_name', $deviceOption->offsetGet('device_option_name'));\n $this->view->assign('device_option_value', $deviceOption->offsetGet('device_option_default_value'));\n $deviceOptionsContent = $this->view->render('loops/device-option-edit.phtml');\n }\n $this->view->assign('deviceOptionsContent', $deviceOptionsContent);\n }", "public function editAction() {\n $value_id = $this->getCurrentOptionValue()->getId();\n\n # Options\n $option_model = new Inbox_Model_Option();\n\n $this->view->option = $option_model->find($value_id, \"value_id\");\n if(!$this->view->option->getId()) {\n $this->view->option\n ->setValueId($value_id)\n ->save();\n }\n\n $limit = 5000;\n if($this->view->option->getLimit()) {\n $limit = $this->view->option->getLimit();\n }\n\n $message_model = new Inbox_Model_CustomerMessage();\n $this->view->messages = $message_model->findByValueId($value_id, $limit);\n\n\n $this->view->form_option = new Inbox_Form_Option();\n $this->view->form_option->setValueId($value_id);\n $this->view->form_option->populate($this->view->option->getData());\n\n # Customers\n $customer_model = new Customer_Model_Customer();\n $this->view->customers = $customer_model->findByAppId($this->getApplication()->getId());\n\n parent::editAction();\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 getShowEdit(){\n\t\t$data=array(\n\t\t\t\"product_id\"=>$_GET['product_id'],\n\t\t\t\"id\"=>$_GET['id'],\n\t\t\t\"key\"=>$_GET['key'],\n\t\t\t\"value\"=>$_GET['value'],\n\t\t\t\"value_type\"=>$_GET['value_type']);\n\t\t$this->setTitle('Edit Meta Data Fields');\n\t\t$this->setContent( $this->getView('shopify/editForm',$data, dirname(__DIR__)) );\n\t}", "protected function edit() {\n\t}", "abstract protected function renderFormEdit(FOFForm &$form, FOFModel $model, FOFInput $input);", "abstract public function getForEdit();", "function on_Edit (){\n $varname = \"tmodule_\" . $this->name;\n $content=\"<select name = \\\"$varname\\\" class=\\\"{$this->form->style}\\\">\";\n foreach ($this->options as $option) {\n $selected = $this->_value==$option ? \"selected=\\\"selected\\\"\" : \"\";\n $content .=\"<option class=\\\"{$this->form->style}\\\" value=\\\"$option\\\" $selected>$option</option>\"; \n }\n $content .= \"</select>\\n\"; \n return ($content);\n }", "public function edit_form()\n {\n return View::make(\"app.edit\");\n }", "public function getEditTemplate()\n {\n return 'SonataBaseApplicationBundle:CRUD:edit.twig.html';\n }", "public function editOption($var, $num, $name = null, $value = null, $image = null)\r\n {\r\n // init vars\r\n $path = $this->app->path->path('elements:imagebox/tmpl/editoption.php');\r\n // render option\r\n return $this->renderLayout($path, compact('var', 'num', 'name', 'value', 'image'));\r\n }", "public function editMode();", "public function executeEdit_field()\n {\n }", "public function edit($id)\n\t{\n\t\t$fieldvalue = FieldValue::find($id);\n\t $service = Service::lists(\"Name\", \"id\")->prepend('Please select', '');\n$field = Field::lists(\"Name\", \"id\")->prepend('Please select', '');\n\n\t \n\t\treturn view('admin.fieldvalue.edit', compact('fieldvalue', \"service\", \"field\"));\n\t}", "protected function _getEditForm()\n {\n }", "public function edit() {\n\n\t\tif ($this->authenticated===false) {\n\t\t\t$this->index();\n\t\t} else {\n\n\t\t\t// Get model type and id\n\t\t\t$this->requestParser();\n\n\t\t\t// Create the helper\n\t\t\t$viewHelper = new View_Admin_Helper($this->model, $this->id);\n\n\t\t\t// Set notice to View if available\n\t\t\t$message = isset($this->message) ? $viewHelper->notice($this->message) : null;\t\t\n\n\t\t\t// Setup the editor View\n\t\t\t$this->data['view'] = $viewHelper->editView();\n\t\t}\n\t}", "public function editAction();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays a Consent Agreement revision.
public function revisionShow($gdpr_consent_agreement_revision) { $gdprConsentAgreement = $this->entityTypeManager ->getStorage('gdpr_consent_agreement') ->loadRevision($gdpr_consent_agreement_revision); $viewBuilder = $this->entityTypeManager ->getViewBuilder('gdpr_consent_agreement'); return $viewBuilder->view($gdprConsentAgreement); }
[ "public function revisionOverview(ConsentAgreement $gdpr_consent_agreement) {\n $account = $this->currentUser();\n /** @var \\Drupal\\gdpr_consent\\ConsentAgreementStorageInterface $storage */\n $storage = $this->entityTypeManager->getStorage('gdpr_consent_agreement');\n\n $build['#title'] = $this->t('Revisions for %title', ['%title' => $gdpr_consent_agreement->title->value]);\n $header = [$this->t('Revision'), $this->t('Operations')];\n\n $revert_permission = $account->hasPermission('manage gdpr agreements');\n $delete_permission = $account->hasPermission('manage gdpr agreements');\n\n $rows = [];\n\n $vids = $storage->revisionIds($gdpr_consent_agreement);\n\n $latest_revision = TRUE;\n\n foreach (\\array_reverse($vids) as $vid) {\n /** @var \\Drupal\\gdpr_consent\\Entity\\ConsentAgreement $revision */\n $revision = $storage->loadRevision($vid);\n\n $username = [\n '#theme' => 'username',\n '#account' => $revision->getRevisionUser(),\n ];\n\n // Use revision link to link to revisions that are not active.\n $date = $this->dateFormatter->format($revision->getRevisionCreationTime(), 'short');\n if ($vid !== $gdpr_consent_agreement->getRevisionId()) {\n $link = Link::fromTextAndUrl($date, new Url('entity.gdpr_consent_agreement.revision', [\n 'gdpr_consent_agreement' => $gdpr_consent_agreement->id(),\n 'gdpr_consent_agreement_revision' => $vid,\n ]))->toRenderable();\n $link = $this->renderer->renderPlain($link);\n }\n else {\n $link = $gdpr_consent_agreement->link($date);\n }\n\n $row = [];\n $column = [\n 'data' => [\n '#type' => 'inline_template',\n '#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class=\"revision-log\">{{ message }}</p>{% endif %}',\n '#context' => [\n 'date' => $link,\n 'username' => $this->renderer->renderPlain($username),\n 'message' => [\n '#markup' => $revision->getRevisionLogMessage(),\n '#allowed_tags' => Xss::getHtmlTagList(),\n ],\n ],\n ],\n ];\n $row[] = $column;\n\n if ($latest_revision) {\n $row[] = [\n 'data' => [\n '#prefix' => '<em>',\n '#markup' => $this->t('Current revision'),\n '#suffix' => '</em>',\n ],\n ];\n foreach ($row as &$current) {\n $current['class'] = ['revision-current'];\n }\n unset($current);\n $latest_revision = FALSE;\n }\n else {\n $links = [];\n if ($revert_permission) {\n $links['revert'] = [\n 'title' => $this->t('Revert'),\n 'url' => Url::fromRoute('entity.gdpr_consent_agreement.revision_revert', [\n 'gdpr_consent_agreement' => $gdpr_consent_agreement->id(),\n 'gdpr_consent_agreement_revision' => $vid,\n ]),\n ];\n }\n\n if ($delete_permission) {\n $links['delete'] = [\n 'title' => $this->t('Delete'),\n 'url' => Url::fromRoute('entity.gdpr_consent_agreement.revision_delete', [\n 'gdpr_consent_agreement' => $gdpr_consent_agreement->id(),\n 'gdpr_consent_agreement_revision' => $vid,\n ]),\n ];\n }\n\n $row[] = [\n 'data' => [\n '#type' => 'operations',\n '#links' => $links,\n ],\n ];\n }\n\n $rows[] = $row;\n }\n\n $build['gdpr_consent_agreement_revisions_table'] = [\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n ];\n\n return $build;\n }", "public function showAction(Revs $rev)\n {\n $deleteForm = $this->createDeleteForm($rev);\n\n return $this->render('@Nusery/revs/show.html.twig', array(\n 'rev' => $rev,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function revisionAction()\n {\n try {\n $scripto = ScriptoPlugin::getScripto();\n $doc = $scripto->getDocument($this->_getParam('item-id'));\n $doc->setPage($this->_getParam('file-id'));\n $revision = $scripto->getRevision($this->_getParam('revision-id'));\n \n // Handle a revert.\n if ($this->_getParam('scripto-page-revert')) {\n if (1 == $this->_getParam('namespace-index')) {\n $doc->editTalkPage($revision['wikitext']);\n } else {\n $doc->editTranscriptionPage($revision['wikitext']);\n }\n $this->_helper->flashMessenger(__('Successfully reverted the page to a previous revision.'), 'success');\n $this->_helper->redirector->gotoRoute(array('item-id' => $doc->getId(), \n 'file-id' => $doc->getPageId(), \n 'namespace-index' => $this->_getParam('namespace-index')), \n 'scripto_history');\n }\n \n } catch (Scripto_Exception $e) {\n $this->_helper->flashMessenger($e->getMessage());\n }\n \n $this->view->scripto = $scripto;\n $this->view->doc = $doc;\n $this->view->revision = $revision;\n $this->view->namespaceIndex = $this->_getParam('namespace-index');\n }", "public function revisionOverview(ContratEntityInterface $contrat_entity) {\n $account = $this->currentUser();\n $langcode = $contrat_entity->language()->getId();\n $langname = $contrat_entity->language()->getName();\n $languages = $contrat_entity->getTranslationLanguages();\n $has_translations = (count($languages) > 1);\n $contrat_entity_storage = $this->entityManager()->getStorage('contrat_entity');\n\n $build['#title'] = $has_translations ? $this->t('@langname revisions for %title', ['@langname' => $langname, '%title' => $contrat_entity->label()]) : $this->t('Revisions for %title', ['%title' => $contrat_entity->label()]);\n $header = [$this->t('Revision'), $this->t('Operations')];\n\n $revert_permission = (($account->hasPermission(\"revert all contrat entity revisions\") || $account->hasPermission('administer contrat entity entities')));\n $delete_permission = (($account->hasPermission(\"delete all contrat entity revisions\") || $account->hasPermission('administer contrat entity entities')));\n\n $rows = [];\n\n $vids = $contrat_entity_storage->revisionIds($contrat_entity);\n\n $latest_revision = TRUE;\n\n foreach (array_reverse($vids) as $vid) {\n /** @var \\Drupal\\contrats\\ContratEntityInterface $revision */\n $revision = $contrat_entity_storage->loadRevision($vid);\n // Only show revisions that are affected by the language that is being\n // displayed.\n if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {\n $username = [\n '#theme' => 'username',\n '#account' => $revision->getRevisionUser(),\n ];\n\n // Use revision link to link to revisions that are not active.\n $date = \\Drupal::service('date.formatter')->format($revision->getRevisionCreationTime(), 'short');\n if ($vid != $contrat_entity->getRevisionId()) {\n $link = $this->l($date, new Url('entity.contrat_entity.revision', ['contrat_entity' => $contrat_entity->id(), 'contrat_entity_revision' => $vid]));\n }\n else {\n $link = $contrat_entity->link($date);\n }\n\n $row = [];\n $column = [\n 'data' => [\n '#type' => 'inline_template',\n '#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class=\"revision-log\">{{ message }}</p>{% endif %}',\n '#context' => [\n 'date' => $link,\n 'username' => \\Drupal::service('renderer')->renderPlain($username),\n 'message' => ['#markup' => $revision->getRevisionLogMessage(), '#allowed_tags' => Xss::getHtmlTagList()],\n ],\n ],\n ];\n $row[] = $column;\n\n if ($latest_revision) {\n $row[] = [\n 'data' => [\n '#prefix' => '<em>',\n '#markup' => $this->t('Current revision'),\n '#suffix' => '</em>',\n ],\n ];\n foreach ($row as &$current) {\n $current['class'] = ['revision-current'];\n }\n $latest_revision = FALSE;\n }\n else {\n $links = [];\n if ($revert_permission) {\n $links['revert'] = [\n 'title' => $this->t('Revert'),\n 'url' => $has_translations ?\n Url::fromRoute('entity.contrat_entity.translation_revert', ['contrat_entity' => $contrat_entity->id(), 'contrat_entity_revision' => $vid, 'langcode' => $langcode]) :\n Url::fromRoute('entity.contrat_entity.revision_revert', ['contrat_entity' => $contrat_entity->id(), 'contrat_entity_revision' => $vid]),\n ];\n }\n\n if ($delete_permission) {\n $links['delete'] = [\n 'title' => $this->t('Delete'),\n 'url' => Url::fromRoute('entity.contrat_entity.revision_delete', ['contrat_entity' => $contrat_entity->id(), 'contrat_entity_revision' => $vid]),\n ];\n }\n\n $row[] = [\n 'data' => [\n '#type' => 'operations',\n '#links' => $links,\n ],\n ];\n }\n\n $rows[] = $row;\n }\n }\n\n $build['contrat_entity_revisions_table'] = [\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n ];\n\n return $build;\n }", "public function actionGetCourseByRevision() {\n $idRevision = Yii::app()->request->getPost('idRevision');\n $courseRev= RevisionCourse::model()->findByPk($idRevision);\n echo $courseRev->id_course;\n }", "public function agreement(){\n\n $agreement=Aggrementqus::get();\n $lastserialnumber = Aggrementqus::select('serial')\n ->orderBy('serial', 'DESC')\n ->first();\n return view('manage.agreement',compact('agreement', 'lastserialnumber'));\n }", "public function showAgreement() {\n return View('pages.frontend.agreement');\n }", "public function revisionShow($ticket_revision) {\n $ticket = $this->entityManager()->getStorage('ticket')->loadRevision($ticket_revision);\n $view_builder = $this->entityManager()->getViewBuilder('ticket');\n\n return $view_builder->view($ticket);\n }", "public function viewRevisionAction()\n {\n $rev = (int) $this->params()->fromRoute('rev');\n $revision = $this->getAuditReader()->findRevision($rev);\n if (!$revision) {\n echo(sprintf('Revision %i not found', $rev));\n }\n $changedEntities = $this->getAuditReader()->findEntitesChangedAtRevision($rev);\n\n return new ViewModel(array(\n 'revision' => $revision,\n 'changedEntities' => $changedEntities,\n 'prefixToIgnore' => $this->getPrefixToIgnore()\n ));\n }", "public function viewRevisionAction() {\r\n $rev = (int) $this->getEvent()->getRouteMatch()->getParam('rev');\r\n $revision = $this->getServiceLocator()->get('auditReader')->findRevision($rev);\r\n if (!$revision) {\r\n throw new \\Exception(sprintf('Revision %i not found', $rev));\r\n }\r\n $changedEntities = $this->getServiceLocator()->get('auditReader')->findEntitesChangedAtRevision($rev);\r\n\r\n return new ViewModel(array(\r\n 'revision' => $revision,\r\n 'changedEntities' => $changedEntities,\r\n 'iconMap' => $this->getIconMap(),\r\n 'routeMap' => $this->getRouteMap(),\r\n 'em' => $this->getServiceLocator()->get('doctrine.entitymanager.orm_default'),\r\n ));\r\n }", "function conduit_views_revision($view) {\n $view = $view->clone_view();\n\n // Change base information.\n $view->name .= '_revision';\n $view->base_table = conduit_views_revision_table($view->base_table);\n $view->human_name .= ' (revision)';\n\n $display = $view->display['default'];\n\n // Change fields and a arguments table.\n foreach ($display->display_options['fields'] as &$field) {\n $field['table'] = conduit_views_revision_table($field['table']);\n }\n foreach ($display->display_options['arguments'] as &$argument) {\n $argument['table'] = conduit_views_revision_table($argument['table']);\n }\n\n // Convert entity_id_raw argument to entity_id.\n $display->display_options['arguments']['entity_id'] = $display->display_options['arguments']['entity_id_raw'];\n $entity_id = &$display->display_options['arguments']['entity_id'];\n $entity_id['id'] = $entity_id['field'] = 'entity_id';\n\n // Add revision ID argument.\n $display->display_options['arguments']['revision_id_raw'] = $display->display_options['arguments']['entity_id_raw'];\n $revision_id = &$display->display_options['arguments']['revision_id_raw'];\n $revision_id['id'] = $revision_id['field'] = 'revision_id_raw';\n $revision_id['validate']['type'] = 'numeric';\n unset($revision_id['validate_options']);\n\n unset($display->display_options['arguments']['entity_id_raw']);\n\n // Convert the page display path.\n $display = $view->display['page'];\n $display->display_options['path'] = str_replace('node/%', 'node/%/revisions/%', $display->display_options['path']);\n\n return $view;\n}", "public function revisionAction()\n {\n $revisionId = (int)$this->getEvent()->getRouteMatch()->getParam('revisionId');\n\n $revision = \\SoliantEntityAudit\\Module::getModuleOptions()->getEntityManager()\n ->getRepository('SoliantEntityAudit\\\\Entity\\\\Revision')\n ->find($revisionId);\n\n if (!$revision)\n return $this->plugin('redirect')->toRoute('audit');\n\n return array(\n 'revision' => $revision,\n );\n }", "public function revisionShow($spent_revision) {\n $spent = $this->entityTypeManager()->getStorage('spent')\n ->loadRevision($spent_revision);\n $view_builder = $this->entityTypeManager()->getViewBuilder('spent');\n\n return $view_builder->view($spent);\n }", "public function revisionShow($chart_entity_revision) {\n $chart_entity = $this->entityTypeManager()->getStorage('chart_entity')\n ->loadRevision($chart_entity_revision);\n $view_builder = $this->entityTypeManager()->getViewBuilder('chart_entity');\n\n return $view_builder->view($chart_entity);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $revisions = $em->getRepository('BoAdminBundle:Revision')->findAll();\n\n return $this->render('revision/index.html.twig', array(\n 'revisions' => $revisions,\n ));\n }", "public function revisionShow($event_content_revision) {\n $event_content = $this->entityManager()->getStorage('event_content')->loadRevision($event_content_revision);\n $view_builder = $this->entityManager()->getViewBuilder('event_content');\n\n return $view_builder->view($event_content);\n }", "public function revisionAction()\r\n {\r\n try {\r\n $message['status'] = 0;\r\n\r\n $iRevisionId = intval($this->_getParam('id'));\r\n $mIsContinue = $this->_getParam('continue');\r\n\r\n $oRevision = AM_Model_Db_Table_Abstract::factory('revision')->findOneBy('id', $iRevisionId);\r\n /* @var $oRevision AM_Model_Db_Revision */\r\n\r\n if (is_null($oRevision)) {\r\n throw new AM_Controller_Exception_BadRequest(sprintf('Revision \"%s\" not found', $iRevisionId));\r\n }\r\n\r\n $oHandler = AM_Handler_Locator::getInstance()->getHandler('export');\r\n /* @var $oHandler AM_Handler_Export */\r\n $oHandler->sendRevisionPackage($oRevision, $mIsContinue);\r\n } catch (Exception $e) {\r\n $this->getResponse()->setHttpResponseCode(500)\r\n ->setBody('Error. Internal Server Error. ' . $e->getMessage())\r\n ->sendResponse();\r\n }\r\n\r\n exit;\r\n }", "public function viewCampaignInvoiceAction()\n {\n $id = $this->request->query->get('id');\n $easyadmin = $this->request->attributes->get('easyadmin');\n $entity = $easyadmin['item'];\n\n return $this->render('easy_admin/Campaign/viewInvoice.html.twig', array(\n 'entity' => $entity\n ));\n }", "public function revisionPageTitle($gdpr_consent_agreement_revision) {\n $gdprConsentAgreement = $this->entityTypeManager\n ->getStorage('gdpr_consent_agreement')\n ->loadRevision($gdpr_consent_agreement_revision);\n return $this->t('Revision of %title from %date', [\n '%title' => $gdprConsentAgreement->label(),\n '%date' => $this->dateFormatter->format($gdprConsentAgreement->getRevisionCreationTime()),\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the fieldIDs to the transaction table with the specified transaction id.
function addFieldsToStewardTransaction($dbLink, $transactionID, $fieldIDs, $userID) { if($fieldIDs && count($fieldIDs) > 0) { $valueClause = ""; for ($i=0 ; $i < count($fieldIDs); $i++) { if($i > 0) { $valueClause .= ","; } $fieldID = $fieldIDs[$i]; $valueClause .= "\n (". mysqli_escape_string($dbLink, $transactionID).",". mysqli_escape_string($dbLink, $fieldID).")"; } } $sql = "INSERT INTO stewardship_purchase_transaction_geo_quadrangle_rel (stewardship_purchase_transaction_id, geo_quadrangle_id) VALUES $valueClause"; $result = mysqli_query($dbLink, $sql) or die("Error in query: \n\n$sql - ".mysqli_error($dbLink)); }
[ "public function getFieldsByTransactionTypeId($id)\n {\n return config('business.transaction_type.fields.'.$id, []);\n }", "public static function add_fields($table, $fields)\n\t{\n\t\treturn static::alter_fields('ADD', $table, $fields);\n\t}", "public function addFields($fields) {\n foreach($fields as $field) {\n $this->columns[] = $field;\n }\n }", "function insertIntoEntityTable($table_name, $module)\n {\n global $current_user, $app_strings;\n $insertion_mode = $this->mode;\n $statusFieldname = $this->table_name . 'status';\n\n $tabid = getTabid($module);\n if ($insertion_mode == 'edit')\n {\n $Fieldsquery = XN_Query::create('Content')->tag('Fields')\n ->filter('type', 'eic', 'fields')\n ->filter('my.tabid', '=', $tabid)\n ->filter('my.presence', 'in', array('0', '2', '3'))\n ->filter('my.displaytype', 'in', array('1', '2', '3'));\n }\n else\n {\n $Fieldsquery = XN_Query::create('Content')->tag('Fields')\n ->filter('type', 'eic', 'fields')\n ->filter('my.tabid', '=', $tabid)\n ->filter('my.presence', 'in', array('0', '2', '3'))\n ->filter('my.displaytype', 'in', array('1', '2', '3', '4', '5'));\n }\n $Fieldsquery->end(-1);\n $result = $Fieldsquery->execute();\n $keyvalus = array();\n\n foreach ($result as $info)\n {\n $fieldname = $info->my->fieldname;\n //$columname = $info->my->columnname;\n $uitype = $info->my->uitype;\n $displaytype = $info->my->displaytype;\n $generatedtype = $info->my->generatedtype;\n $typeofdata = $info->my->typeofdata;\n $typeofdata_array = explode(\"~\", $typeofdata);\n $datatype = $typeofdata_array[0];\n\n if ($uitype == 4 && $insertion_mode != 'edit')\n {\n\n $this->column_fields[$fieldname] = $this->setModuleSeqNumber(\"increment\", $module);\n $fldvalue = $this->column_fields[$fieldname];\n }\n if (isset($this->column_fields[$fieldname]))\n {\n if ($uitype == 56)\n {\n if ($this->column_fields[$fieldname] == 'on' || $this->column_fields[$fieldname] == 1)\n {\n $fldvalue = '1';\n }\n else\n {\n $fldvalue = '0';\n }\n\n }\n elseif ($uitype == 15 || $uitype == 16)\n {\n $fldvalue = $this->column_fields[$fieldname];\n /*\n\t\t\t\t if($this->column_fields[$fieldname] == $app_strings['LBL_NOT_ACCESSIBLE'])\n\t\t\t\t {\n\n\t\t\t\t\t$query = XN_Query::create ( 'Content' ) ->tag($this->table_name)\n\t\t\t\t\t\t->filter ( 'type', 'eic', $this->table_name)\n\t\t\t\t\t\t->filter ( 'my.'.$this->tab_name_index[$this->table_name], '=', $this->id)\n\t\t\t\t\t\t->execute();\n\t\t\t\t\tforeach($query as $info){\n\t\t\t\t\t\t$pick_val = $info->my->$fieldname;\n\t\t\t\t\t}\n\t\t\t\t \t$fldvalue = $pick_val;\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t $fldvalue = $this->column_fields[$fieldname];\n\t\t\t\t }*/\n }\n elseif ($uitype == 33)\n {\n if (is_array($this->column_fields[$fieldname]))\n {\n $field_list = implode(' |##| ', $this->column_fields[$fieldname]);\n }\n else\n {\n $field_list = $this->column_fields[$fieldname];\n }\n $fldvalue = $field_list;\n }\n elseif ($uitype == 5 || $uitype == 6 || $uitype == 23)\n {\n //Added to avoid function call getDBInsertDateValue in ajax save\n if (isset($current_user->date_format))\n {\n $fldvalue = getValidDBInsertDateValue($this->column_fields[$fieldname]);\n }\n else\n {\n $fldvalue = $this->column_fields[$fieldname];\n }\n }\n elseif ($uitype == 7)\n {\n //strip out the spaces and commas in numbers if given ie., in amounts there may be ,\n $fldvalue = str_replace(\",\", \"\", $this->column_fields[$fieldname]);//trim($this->column_fields[$fieldname],\",\");\n\n }\n elseif ($uitype == 26)\n {\n if (empty($this->column_fields[$fieldname]))\n {\n $fldvalue = 1; //the documents will stored in default folder\n }\n else\n {\n $fldvalue = $this->column_fields[$fieldname];\n }\n }\n elseif ($uitype == 28)\n {\n if ($this->column_fields[$fieldname] != null) \n {\n $fldvalue = $this->column_fields[$fieldname];\n }\n }\n elseif ($uitype == 8)\n {\n $this->column_fields[$fieldname] = rtrim($this->column_fields[$fieldname], ',');\n $ids = explode(',', $this->column_fields[$fieldname]);\n $json = new Zend_Json();\n $fldvalue = $json->encode($ids);\n }\n elseif ($uitype == 12)\n {\n $query = XN_Query::create('Content')->tag('Users')\n ->filter('type', 'eic', 'users')\n ->filter('my.profileid', '=', $current_user->id)\n ->execute();\n if (count($query) > 0)\n $fldvalue = $query[0]->my->email1;\n }\n elseif ($uitype == 71 && $generatedtype == 2)\n { // Convert currency to base currency value before saving for custom fields of type currency\n $currency_id = $current_user->currency_id;\n $curSymCrate = getCurrencySymbolandCRate($currency_id);\n $fldvalue = convertToDollar($this->column_fields[$fieldname], $curSymCrate['rate']);\n }\n else if ($fieldname == 'personman' && is_array($this->column_fields[$fieldname]))\n {\n if (count($this->column_fields[$fieldname]) == 0)\n {\n $fldvalue = XN_Profile::$VIEWER;\n }\n else if ($this->column_fields[$fieldname] == array(\"\"))\n {\n $fldvalue = XN_Profile::$VIEWER;\n }\n else\n {\n $fldvalue = $this->column_fields[$fieldname];\n }\n }\n else if ($fieldname == 'personman' && $this->column_fields[$fieldname] == '')\n {\n $fldvalue = XN_Profile::$VIEWER;\n }\n else\n {\n $fldvalue = $this->column_fields[$fieldname];\n }\n if ($uitype != 33 && $uitype != 8)\n $fldvalue = from_html($fldvalue);\n }\n else if ($fieldname == 'personman')\n {\n $fldvalue = XN_Profile::$VIEWER;\n }\n else\n {\n $fldvalue = '';\n }\n\n if ($fldvalue == '')\n {\n $fldvalue = $this->get_column_value($fieldname, $fldvalue, $fieldname, $uitype, $datatype);\n }\n\n if ($insertion_mode == 'edit')\n {\n if ($uitype != 4)\n {\n if ($displaytype == 2 && ($fldvalue != '' || (array_key_exists($fieldname,$this->column_fields) && isset($_REQUEST[$fieldname]))))\n {\n $keyvalus[$fieldname] = $fldvalue;\n }\n else if ($displaytype != 2)\n {\n $keyvalus[$fieldname] = $fldvalue;\n }\n }\n }\n else\n {\n $keyvalus[$fieldname] = $fldvalue;\n }\n\n\n }\n\t\t\n\t\tglobal $global_session; \n\t\t$tabdata = $global_session['tabdata']; \n $optionalapprovals = $tabdata['optionalapprovals'];\n \n if (in_array($tabid, array_keys($optionalapprovals)))\n {\n $keyvalus['optionalapproval'] = $this->column_fields['optionalapproval'];\n }\n\n\n $tag = '';\n if (isset($this->tag) && $this->tag != '')\n {\n $tag = ',' . $this->tag;\n }\n\n $datatype = $this->datatype;\n\n if ($insertion_mode == 'edit')\n {\n if (count($keyvalus) > 0)\n {\n try\n {\n\n if (isset($datatype) && $datatype != '')\n {\n $SaveContent = XN_Content::load($this->id, $this->table_name, $datatype);\n }\n else\n {\n $SaveContent = XN_Content::load($this->id, $this->table_name);\n }\n\n\n foreach ($keyvalus as $columnname => $fieldname)\n {\n $SaveContent->my->$columnname = $fieldname;\n }\n $SaveContent->my->deleted = 0;\n $SaveContent->my->createnew = 0;\n if (isset($this->column_fields['title']) && $this->column_fields['title'] != \"\")\n {\n $SaveContent->title = $this->column_fields['title'];\n }\n $SaveContent->save($this->table_name . ',fulltext,report' . $tag);\n }\n catch (XN_Exception $e)\n {\n }\n }\n }\n else\n {\n if (isset($datatype) && $datatype != '')\n {\n $SaveContent = XN_Content::load($this->id, $this->table_name, $datatype);\n }\n else\n {\n $SaveContent = XN_Content::load($this->id, $this->table_name);\n }\n\n foreach ($keyvalus as $columnname => $fieldname)\n {\n $SaveContent->my->$columnname = $fieldname;\n }\n $SaveContent->my->deleted = 0;\n $SaveContent->my->createnew = 0;\n if (isset($this->column_fields['title']) && $this->column_fields['title'] != \"\")\n {\n $SaveContent->title = $this->column_fields['title'];\n }\n\n\n $SaveContent->save($this->table_name . ',fulltext,report' . $tag);\n }\n }", "public function addIdList($idList) { // OK\n\t\tif (!empty($idList)) {\n\t\t\t$idArray = t3lib_div::trimExplode(',', $idList);\n\t\t\t$idlistsPerTable = array(\n\t\t\t);\n\t\t\t// First assemble a list of all uid's for each table\n\t\t\tforeach ($idArray as $item) {\n\t\t\t\t// Code inspired from t3lib_loadDBGroup\n\t\t\t\t// String is reversed before exploding, to get uid first\n\t\t\t\tlist($uid, $table) = explode('_', strrev($item), 2);\n\t\t\t\t// Exploded parts are reversed back\n\t\t\t\t$uid = strrev($uid);\n\t\t\t\t// If table is not defined, assume it's the main table\n\t\t\t\tif (empty($table)) {\n\t\t\t\t\t$table = $this->mainTable;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$table = strrev($table);\n\t\t\t\t}\n\t\t\t\tif (!isset($idlistsPerTable[$table])) {\n\t\t\t\t\t$idlistsPerTable[$table] = array(\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t$idlistsPerTable[$table][] = $uid;\n\t\t\t}\n\t\t\t// Loop on all tables and add test on list of uid's, if table is indeed in query\n\t\t\tforeach ($idlistsPerTable as $table => $uidArray) {\n\t\t\t\t$condition = '';\n\t\t\t\tforeach ($uidArray as $uid) {\n\t\t\t\t\tif ($condition != '') {\n\t\t\t\t\t\t$condition .= \"|\";\n\t\t\t\t\t}\n\t\t\t\t\t$condition .= $table . '$uid:' . $uid;\n\t\t\t\t}\n\t\t\t\t$this->__requiredfields[] = \"(\" . $condition . \")\";\n\t\t\t\t// Add the uid to the selected fields of the request\n\t\t\t\tif (!in_array($table . '$uid', $this->gquery_getfields)) {\n\t\t\t\t\t$this->gquery_getfields[] = $table . '$uid';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function addField(EcrTableField $field)\n {\n $this->fields[] = $field;\n }", "public function addTransactionFields($data)\n\t{\n\t\t// Handle single string additions\n\t\tif (!is_array($data)) {\n\t\t\t$this->transactionString .= static::wrapper($data);\n\t\t\treturn;\n\t\t}\n\n\t\t// Handle array of strings\n\t\tforeach ($data as $field => $value) {\n\t\t\tif(is_array($value)){\n\t\t\t\t$this->transactionString .= $field . static::TRANS_SEPARATOR . static::wrapper($value[key($value)]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->transactionString .= $field . static::TRANS_SEPARATOR . static::wrapper($value);\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "protected function initTableFields()\r\n {\r\n $this->addField(self::$ID, STRING, \"\");\r\n $this->addField(self::$NAME, STRING, \"\");\r\n $this->addField(self::$PARENT, STRING, \"\");\r\n $this->addField(self::$DESCRIPTION, STRING, \"\");\r\n }", "private function recordAddFieldsMigrations()\n {\n if (count($this->add_fields)) {\n $migrator = new Migrator();\n $columns = [];\n\n foreach ($this->add_fields as $fname => $fdesc) {\n if (! empty($fdesc['type'])) {\n if ($control = Wizard::getAvailControl($fdesc['type'])) {\n if ($control instanceof \\Skvn\\CrudWizard\\Contracts\\WizardableField) {\n if (! $control->wizardIsForRelationOnly() && ! $control->wizardIsForVirtualOnly()) {\n $dbtype = $control->wizardDbType();\n if (! empty($dbtype)) {\n $columns[$fname] = $dbtype;\n }\n }\n }\n }\n }\n }\n\n if (count($columns)) {\n if ($migrator->appendColumns($this->table, $columns)) {\n $this->migrations_created = true;\n }\n }\n }\n }", "public function importTranscripts($id){}", "protected function initTableFields()\r\n {\r\n $this->addField(self::$ID, STRING, \"\");\r\n $this->addField(self::$NAME, STRING, \"\");\r\n $this->addField(self::$PASSWORD, STRING, \"\");\r\n $this->addField(self::$CELL_PHONE, STRING, \"\");\r\n $this->addField(self::$PHONE_NUMBER, STRING, \"\");\r\n $this->addField(self::$E_MAIL, STRING, \"\");\r\n $this->addField(self::$QQ_NUMBER, STRING, \"\");\r\n $this->addField(self::$WECHAT_ID, STRING, \"\");\r\n $this->addField(self::$ACCOUNT_TYPE, INTEGER, ELI_ACCOUNT_TYPE_COMPANY);\r\n $this->addField(self::$STATUS, INTEGER, ELI_ACCOUNT_STATUS_INIT);\r\n $this->addField(self::$BUSINESS_LICENSE, STRING, \"\");\r\n $this->addField(self::$ORGANIZATION_CODE, STRING, \"\");\r\n $this->addField(self::$TAX_REGISTRATION_CERTIFICATE, STRING, \"\");\r\n $this->addField(self::$COMPANY_NAME, STRING, \"\");\r\n $this->addField(self::$COMPANY_ADDRESS, STRING, \"\");\r\n $this->addField(self::$TRADE_LICENSE, STRING, \"\");\r\n $this->addField(self::$INDUSTRY_ID, STRING, \"\");\r\n $this->addField(self::$BUDGET, DOUBLE, 0.0);\r\n $this->addField(self::$SPENT, DOUBLE, 0.0);\r\n $this->addField(self::$CREATE_TIME, STRING, date('Y-m-d H:i:s'));\r\n $this->addField(self::$LAST_MODIFY_TIME, STRING, date('Y-m-d H:i:s'));\r\n $this->addField(self::$CLIENT_IP, STRING, \"\");\r\n }", "public function addField($field_id, array $field) {\n $this->metafields[$field_id] = $field;\n }", "function add_expense_transaction($data_fields)\r\n {\r\n $this->db->trans_start();\r\n $data1 = array(\r\n 'date' => date('Y-m-d'), \r\n 'naration' => $data_fields['memo'], \r\n 'generated_source' => 'expense'\r\n );\r\n\r\n $this->db->insert('mp_generalentry',$data1);\r\n $data_fields['transaction_id'] = $this->db->insert_id();\r\n\r\n $data1 = array(\r\n 'transaction_id' => $data_fields['transaction_id'], \r\n 'total_bill' => $data_fields['total_bill'], \r\n 'total_paid' => $data_fields['total_paid'], \r\n 'date' => $data_fields['date'],\r\n 'user' => $data_fields['user'],\r\n 'method' => $data_fields['payment_method'],\r\n 'description' => $data_fields['memo'],\r\n 'payee_id' => $data_fields['payee_id'],\r\n 'ref_no' => $data_fields['ref_no'],\r\n 'attachment' => $data_fields['attachment']\r\n );\r\n\r\n $this->db->insert('mp_expense',$data1);\r\n $data_fields['expense_id'] = $this->db->insert_id();\r\n\r\n $count_items = count($data_fields['account_head']);\r\n\r\n if($count_items > 0)\r\n {\r\n for ($i = 0; $i < $count_items; $i++) \r\n {\r\n\r\n //1ST ENTRY\r\n $sub_data = array(\r\n 'parent_id' => $data_fields['transaction_id'], \r\n 'accounthead' => $data_fields['account_head'][$i], \r\n 'amount' => $data_fields['amount'][$i], \r\n 'type' => 0\r\n );\r\n $this->db->insert('mp_sub_entry',$sub_data); \r\n\r\n //1ST ENTRY\r\n $sub_data = array(\r\n 'expense_id' => $data_fields['expense_id'] , \r\n 'head_id' => $data_fields['account_head'][$i], \r\n 'description' => $data_fields['description_arr'][$i], \r\n 'price' => $data_fields['amount'][$i]\r\n );\r\n\r\n $this->db->insert('mp_sub_expense',$sub_data);\r\n }\r\n }\r\n\r\n if($data_fields['total_bill'] == $data_fields['total_paid'])\r\n {\r\n //1ST ENTRY\r\n $sub_data = array(\r\n 'parent_id' => $data_fields['transaction_id'], \r\n 'accounthead' => $data_fields['credithead'], \r\n 'amount' => $data_fields['total_bill'], \r\n 'type' => 1\r\n );\r\n $this->db->insert('mp_sub_entry',$sub_data); \r\n }\r\n else if($data_fields['total_bill'] > $data_fields['total_paid'])\r\n {\r\n //1ST ENTRY\r\n $sub_data = array(\r\n 'parent_id' => $data_fields['transaction_id'], \r\n 'accounthead' => $data_fields['credithead'], \r\n 'amount' => $data_fields['total_paid'], \r\n 'type' => 1\r\n );\r\n\r\n $this->db->insert('mp_sub_entry',$sub_data); \r\n\r\n //1ST ENTRY\r\n $sub_data = array(\r\n 'parent_id' => $data_fields['transaction_id'], \r\n 'accounthead' => 5, //AP \r\n 'amount' => $data_fields['total_bill']-$data_fields['total_paid'], \r\n 'type' => 1\r\n );\r\n\r\n $this->db->insert('mp_sub_entry',$sub_data); \r\n }\r\n \r\n\r\n\r\n if($data_fields['credithead'] == 16)\r\n {\r\n //TRANSACTION DETAILS \r\n $sub_data = array(\r\n 'transaction_id' => $data_fields['transaction_id'], \r\n 'bank_id' => $data_fields['bank_id'], \r\n 'method' => $data_fields['payment_method'],\r\n 'total_bill' => $data_fields['total_bill'],\r\n 'total_paid' => $data_fields['total_paid'],\r\n 'ref_no' => $data_fields['ref_no'],\r\n 'transaction_status' => 0,\r\n 'transaction_type' => 'paid'\r\n );\r\n $this->db->insert('mp_bank_transaction',$sub_data);\r\n\r\n //TRANSACTION DETAILS \r\n $sub_data = array(\r\n 'transaction_id' => $data_fields['transaction_id'], \r\n 'payee_id' => $data_fields['payee_id']\r\n\r\n );\r\n $this->db->insert('mp_bank_transaction_payee',$sub_data); \r\n }\r\n\r\n $this->db->trans_complete();\r\n if ($this->db->trans_status() === FALSE)\r\n {\r\n $this->db->trans_rollback();\r\n $data_fields = NULL; \r\n }\r\n else\r\n {\r\n $this->db->trans_commit();\r\n }\r\n\r\n return $data_fields;\r\n }", "function set_fields_for_table($table, $fields) {\n\t\t$this->fields_for_table[$table];\n\t}", "function addInvoiceTransfer($t) {\n\t\t$trans = $this->getInvoiceTransfer($t);\n\t\tif (count($trans) == 0)\n\t\t\t$this->db->insert('invoice_transfer', $t);\n\t\telse {\n\t\t\t$t['date'] = date('Y-m-d H:i:s');\n\t\t\t$this->db->where('inv_id', $t['inv_id']);\n\t\t\t$this->db->where('user_type', $t['user_type']);\n\t\t\t$this->db->update('invoice_transfer', $t);\n\t\t}\n\t}", "public function setTableId($id) {\n $this->tableId = \"id=\\\"$id\\\"\";\n }", "function add_transaction($id, $supplier, $receipt, $date, $type, $dateRecorded, $remarks, $transitems){\n $query = \"\";\n $insertSuccess = false;\n if($id == null){\n $query = \"INSERT INTO `transactions`(\n `tID`,\n `spID`,\n `tNum`,\n `tDate`,\n `tType`,\n `dateRecorded`,\n `tRemarks`\n )\n VALUES(NULL, ?, ?, ?, ?, ?, ?);\";\n $insertSuccess = $this->db->query($query, \n array($supplier, $receipt, $date, $type, $dateRecorded, $remarks));\n $id = $this->db->insert_id();\n }else{\n $query = \"UPDATE transactions \n SET \n spID = ?,\n tNum = ?,\n tDate = ?,\n tType = ?,\n dateRecorded = ?,\n tRemarks = ?\n WHERE\n tID = '?;\";\n $insertSuccess = $this->db->query($query, array($supplier, $receipt, $date, $type, $dateRecorded, $remarks, $id));\n }\n if($insertSuccess){\n $indexes = [];\n $count = 0;\n foreach($transitems as $item){\n if(!$this->addEdit_transactionItem($item, $id, $type)){\n array_push($indexes,$count);\n }\n $count++;\n }\n // echo json_encode(array(\"erredQ\" =>$indexes, \"data\"=> $transitems));\n return true;\n }\n return false;\n }", "private function _addNewField( $table, $field ) {\n \n // pega o schema do campo\n $fieldSchema = $this->newSchema[$table][$field];\n\n // adiciona o campo\n $this->forge->add_column( $table, [ $field => $fieldSchema ] );\n }", "function addEditRecords($table_name, $data_array, $id = \"\")\n {\n if($table_name && is_array($data_array))\n {\n $columns = $this->getTableFields($table_name);\n foreach($columns as $coloumn_data)\n $column_name[]=$coloumn_data['Field'];\n\n foreach($data_array as $key=>$val)\n {\n if(in_array(trim($key),$column_name))\n {\n $data[$key] = $val;\n }\n }\n\n if($id == \"\")\n {\n $builder = $this->db->table($table_name);\n $query = $builder->insert($data);\n }\n else\n {\n $where = array($table_name.\"_id\" => $id);\n $builder = $this->db->table($table_name);\n $builder->where($where);\n $builder->set($data);\n $builder->update();\n//\t\t\t\t$query = $this->db->update($table_name, $data, $where);\n }\n//\t\t\t$this->db->query($query);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns all sessions of a group
public function listSessionsOfGroup($groupID){ return $this->call("listSessionOfGroup", array( "groupID" => $groupID )); }
[ "function listSessionsOfGroup($groupID)\n {\n return $this->HTTPCall(\"listSessionOfGroup\", \"groupID\", $groupID);\n }", "public function getAllSessions();", "public function get_sessions_by_usergroup($id)\n {\n $results = Database::select(\n 'session_id',\n $this->usergroup_rel_session_table,\n array('where' => array('usergroup_id = ?' => $id))\n );\n\n $array = array();\n if (!empty($results)) {\n foreach ($results as $row) {\n $array[] = $row['session_id'];\n }\n }\n\n return $array;\n }", "function getGroupsUser()\n {\n if (empty($_COOKIE[\"i3geocodigologin\"])) {\n return array();\n }\n $nameatual = session_name();\n $idatual = session_id();\n session_write_close();\n session_name(\"i3GeoLogin\");\n session_id($_COOKIE[\"i3geocodigologin\"]);\n session_start();\n $res = $_SESSION[\"gruposusr\"];\n session_write_close();\n session_name(\"$nameatual\");\n session_id($idatual);\n session_start();\n return $res;\n }", "public function test_get_session_with_group() {\n $this->resetAfterTest(true);\n\n // Create a group in our course, and add some students to it.\n $group = new stdClass();\n $group->courseid = $this->course->id;\n $group = $this->getDataGenerator()->create_group($group);\n\n for ($i = 0; $i < 5; $i++) {\n $member = new stdClass;\n $member->groupid = $group->id;\n $member->userid = $this->students[$i]->id;\n $this->getDataGenerator()->create_group_member($member);\n }\n\n // Add a session that's identical to the first, but with a group.\n $midnight = usergetmidnight(time()); // Check if this test is running during midnight.\n $session = clone $this->sessions[0];\n $session->groupid = $group->id;\n $session->sessdate += 1; // Make sure it appears second in the list.\n $this->attendance->add_sessions([$session]);\n\n $courseswithsessions = attendance_handler::get_courses_with_today_sessions($this->teacher->id);\n\n // This test is fragile when running over midnight - check that it is still the same day, if not, run this again.\n // This isn't really ideal code, but will hopefully still give a valid test.\n if (empty($courseswithsessions) && $midnight !== usergetmidnight(time())) {\n $this->attendance->add_sessions([$session]);\n $courseswithsessions = attendance_handler::get_courses_with_today_sessions($this->teacher->id);\n }\n $courseswithsessions = external_api::clean_returnvalue(mod_attendance_external::get_courses_with_today_sessions_returns(),\n $courseswithsessions);\n\n $course = array_pop($courseswithsessions);\n $attendanceinstance = array_pop($course['attendance_instances']);\n $session = array_pop($attendanceinstance['today_sessions']);\n\n $sessioninfo = attendance_handler::get_session($session['id']);\n $sessioninfo = external_api::clean_returnvalue(mod_attendance_external::get_session_returns(),\n $sessioninfo);\n\n $this->assertEquals($session['id'], $sessioninfo['id']);\n $this->assertEquals($group->id, $sessioninfo['groupid']);\n $this->assertEquals(count($sessioninfo['users']), 5);\n }", "public function getAllSessions() {\n $sql = 'SELECT * FROM Sessions\n INNER JOIN Places ON Places.placeID = Sessions.placeID\n WHERE sectionID = :id';\n $args = array(':id' => $this->id);\n $rows = Database::executeGetAllRows($sql, $args);\n return array_map(function ($row) { return new SectionSession($row); }, $rows);\n }", "public function getSessions()\n {\n return $this->sessionRepository->findAll();\n }", "public function retrieveAllGroups();", "function getSessions(): array\n {\n return $this->sessions;\n }", "function wp_get_all_sessions() {\n\t$manager = WP_Session_Tokens::get_instance( get_current_user_id() );\n\treturn $manager->get_all();\n}", "public function getActiveSessions();", "public function getSessions()\n {\n return $this->sessions;\n }", "public function retrieveConcurrentSessions()\n {\n $endpoint = self::$endpoint . '/statistics' . SessionEndpoint::$endpoint;\n return self::sendRequest(Method::GET, $endpoint);\n }", "public function session_list()\n\t{\n\t\t$query=$this->db->get('session');\n\t\treturn $query->result();\n\t}", "public function getUserSessions()\n {\n return $this->storage->getUserSessions();\n }", "function get_all_ci_sessions()\n {\n $this->db->order_by('session_id', 'desc');\n return $this->db->get('ci_sessions')->result_array();\n }", "function get_session_list($obj){\n $sql = \" select \n\t\t\t\t\t\t*\n\t\t\t\t\tfrom school_session \n\t\t\t\t\t\";\n return $this->sys->query($sql)->result();\n\n }", "public function getSessions()\r\n {\r\n return $this->config->getSessions();\r\n }", "public function getSessions(){\n\t\t$list = new ArrayList();\n\n\t\t$col1 = new ArrayList();\n\t\t$col2 = new ArrayList();\n\t\t$col3 = new ArrayList();\n\t\t$col4 = new ArrayList();\n\n\t\t$i = 0;\n\t\t$j = 1;\n\n\t\t// $\n\t\t\n\t\twhile ($i <= 11) {\n\t\t\t$session = MeetingSession::get()->sort($this->SessionsSort, 'DESC')->limit(1, $i)->first();\n\t\t\tif($session) {\n\t\t\t\tswitch ($j) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t$col1->push($session);\n\t\t\t\t\t\t$j++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\t$col2->push($session);\n\t\t\t\t\t\t$j++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\t$col3->push($session);\n\t\t\t\t\t\t$j++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\t$col4->push($session);\n\t\t\t\t\t\t$j = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\n\t\t$list->push(new ArrayData(array('Columns' => $col1)));\n\t\t$list->push(new ArrayData(array('Columns' => $col2)));\n\t\t$list->push(new ArrayData(array('Columns' => $col3)));\n\t\t$list->push(new ArrayData(array('Columns' => $col4)));\n\n\t\treturn $list;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetches a study associated with a particular name.
public static function getStudy(string $name) { return self::where('name', $name)->first()->toArray(); }
[ "public static function loadByName($name) {\n\t\t$db = Site::getDb();\n\t\t$id = $db->findValue('survey_studies', array('name' => $name), 'id');\n\t\treturn self::loadById($id);\n\t}", "public function searchStudy($name) {\n return $this->search_reference($this->_idStudy, $name);\n }", "public function study() {\n return $this->getActiveModule()->courses()->first()->study()->first();\n }", "public function getByName( $name )\n {\n\n\n return SchoolYear::where('name', $name)->first();\n\n\n }", "function FindByName( $name )\n\t{\n\t\treturn array_shift( MyActiveRecord::FindBySql('Sections', \"SELECT a.* FROM sections a WHERE a.name like '\" . $name . \"'\") );\n\t}", "public static function findByString($name)\n {\n return Publication::where('name', $name)->get()->first();\n }", "public function getOneByName (string $name)\r\n {\r\n $sql = \"SELECT * FROM playlist\r\n WHERE name=:name\";\r\n \r\n $this->prepare($sql);\r\n $this->bindParam(':name', $name, \\PDO::PARAM_STR);\r\n $this->execute();\r\n\r\n return $this->fetch();\r\n }", "public static function getByName($name)\n\t{\n\t\treturn self::table(__CLASS__)->selectFirstObject('*', \"vs_name='\".self::escape($name).\"'\");\n\t}", "public function search($name)\n {\n $meds = Med::where('name', 'like', '%'. $name . '%')->get();\n if (count($meds) > 0) {\n return MedResource::collection($meds);\n } else {\n abort(404, 'Medication not found');\n }\n }", "public function getStudy()\n {\n return $this->study;\n }", "public function getByName($name);", "public function getByName($name) {\n return $this->getBehatContext()->getEntityStore()->retrieve_by_name($name);\n }", "protected function get_quiz_by_name(string $name): stdClass {\n global $DB;\n return $DB->get_record('quiz', array('name' => $name), '*', MUST_EXIST);\n }", "public function findRecipeByName($name){\n\n $query = $this->db->prepare('SELECT * FROM recipes WHERE name = ?');\n $query->bind_param(\"s\", $name);\n if(!$query->execute()){\n return NULL;\n }\n $result = $query->get_result();\n\n if(!$result || !$result->num_rows){\n return NULL;\n }\n $recipeRow = $result->fetch_assoc();\n $recipe = $this->recipeFactory->make($recipeRow);\n\n return $recipe;\n }", "function getStudyInfo($connection, $idStudy){\n\t$query = \"SELECT * FROM vStudyWithTypeNames WHERE idStudy =\".$idStudy;\n\treturn fetchRowFromDBOnID($connection, $query, $idStudy, \"study\");\n}", "public function getRecord($name, $data_id);", "public function get_profile_by_scientifc_name($name) \r\n\t{\t\t\r\n\t\t$name = urldecode($name);\r\n\t\t\r\n\t\t$this->db->select('id', FALSE);\r\n\t\t$this->db->from('profiles_fish');\r\n\t\t$this->db->where('scientific_name', $name);\r\n\t\t$this->db->where('deleted', 0);\r\n\t\t$query = $this->db->get();\r\n\r\n\t\tif($query->num_rows()) \r\n\t\t{\r\n\t\t\t$row = $query->row(); \r\n\t\t\t$profile_data = $this->get_profile($row->id);\r\n\r\n\t\t\treturn $profile_data;\r\n\t\t} \r\n\t\telse \r\n\t\t{\r\n\t\t\treturn $this->db->_error_message();\r\n\t\t}\r\n\t}", "public function getDocumentByName($name) {\n\t\t$query = \"SELECT document_id, object_type_id, object_id, document_type_id, version, latest_content_id, created_by_user_id, created_at, name, wiki_name FROM documents where name = ?\";\n\t\t$stmt = $this->mysqli->prepare($query);\n\t\tif ($stmt === false) {\n\t\t\tthrow new RepositoryException($this->mysqli->error, $this->mysqli->errno);\n\t\t}\n\t\t$rc = $stmt->bind_param(\"s\", $name);\n\t\tif ($rc === false) {\n\t\t\tthrow new RepositoryException($stmt->error, $stmt->errno);\n\t\t}\n\t\tif (!$stmt->execute()) {\n\t\t\tthrow new RepositoryException($stmt->error, $stmt->errno);\n\t\t}\n\t\t$a = array();\n\t\t$rc = $stmt->bind_result($a[\"documentId\"], $a[\"objectTypeId\"], $a[\"objectId\"], $a[\"documentTypeId\"], $a[\"version\"], $a[\"latestContentId\"], $a[\"createdByUserId\"], $a[\"createdAt\"], $a[\"name\"], $a[\"wikiName\"]);\n\t\tif ($rc === false) {\n\t\t\tthrow new RepositoryException($stmt->error, $stmt->errno);\n\t\t}\n\t\n\t\tif ($stmt->fetch()) {\n\t\t\treturn Document::CreateModelFromRepositoryArray($a);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "function _getShare($name)\n {\n $stmt = $this->_db->prepare('SELECT * FROM ' . $this->_table . ' WHERE share_name = ?');\n if (is_a($stmt, 'PEAR_Error')) {\n Horde::logMessage($stmt, __FILE__, __LINE__, PEAR_LOG_ERR);\n return $stmt;\n }\n $results = $stmt->execute(array($name));\n if (is_a($results, 'PEAR_Error')) {\n Horde::logMessage($results, __FILE__, __LINE__, PEAR_LOG_ERR);\n return $results;\n }\n $data = $results->fetchRow(MDB2_FETCHMODE_ASSOC);\n if (is_a($data, 'PEAR_Error')) {\n Horde::logMessage($data, __FILE__, __LINE__, PEAR_LOG_ERR);\n return $data;\n } elseif (empty($data)) {\n return PEAR::RaiseError(sprintf(_(\"Share \\\"%s\\\" does not exist.\"), $name));\n }\n $stmt->free();\n $results->free();\n\n // Convert charset\n $data = $this->_fromDriverCharset($data);\n\n // Populate the perms array\n $this->_loadPermissions($data);\n\n return new $this->_shareObject($data);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if an issue has custom section ordering.
function customSectionOrderingExists($issueId) { $result =& $this->retrieve( 'SELECT COUNT(*) FROM custom_section_orders WHERE issue_id = ?', $issueId ); $returner = isset($result->fields[0]) && $result->fields[0] == 0 ? false : true; $result->Close(); unset($result); return $returner; }
[ "protected abstract function has_sections();", "public function isOrderable()\n {\n return $this->getHeader()->isOrderable();\n }", "public function hasOrderings() : bool;", "public function isSection()\n {\n $is_curr = $this->isCurrent();\n $curr = Director::get_current_page();\n\n return $is_curr || (\n ($curr instanceof CatalogueCategory || $curr instanceof CatalogueProduct) && in_array($this->owner->ID, $curr->getAncestors()->column())\n );\n }", "public function isMarkedForOrdering(): bool;", "public function uses_sections() {\n return true;\n }", "public function isOrder();", "public function isSection()\n {\n return true;\n }", "protected function need_restore_numsections() {\n $backupinfo = $this->step->get_task()->get_info();\n $backuprelease = $backupinfo->backup_release;\n $prethreethree = version_compare($backuprelease, '3.3', 'lt');\n if ($prethreethree) {\n // Pre version 3.3 so, yes!\n return true;\n }\n $data = $this->connectionpoint->get_data();\n return (isset($data['tags']['numsections']));\n }", "public function supportsSections() {\n return false;\n }", "public function hasSection($name);", "public function hasOrder()\n {\n return $this->_has('_order');\n }", "public function checkRootlineForIncludeSection() {}", "public function isSection(): bool\n {\n return self::TYPE_SECTION === $this->getType();\n }", "public function has_sections()\n {\n return count($this->get_sections()) > 0;\n }", "public function hasCpSection()\n\t{\n\t\treturn false;\n\t}", "public function hasCpSection()\n {\n return true;\n }", "public function is_specialorder() {\n\t\treturn $this->specialorder == self::SPECIALORDER_SPECIAL;\n\t}", "function check_sections()\n\t{\n\t\t$temp_sections = explode(',',$this->_config['sections']);\n\t\tif($temp_sections[0]=='' && !$this->_config['sections_from_db'])\n\t\t{\n\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all newsletter subscribers from table.
public function getSubscribers() { $query = "SELECT * FROM nl_subscriber"; return $this->getQueryData($query, $this->getConnection()); }
[ "public function getSubscriptions()\n\t{\n\t\t$query = \"SELECT nl.* as sub FROM \" . \n\t\t\t\tNEWSLETTER_TABLE . \" nl \n\t\t\t\tJOIN \" . NEWSLETTER_PERMISSION_TABLE . \" p ON p.newsletter_id = nl.id\n\t\t\t\tJOIN \" . SUBSCRIPTION_TABLE . \" st ON st.newsletter_id = nl.id \n\t\t\t\tJOIN \" . SUBSCRIBER_TABLE . \" s ON s.id = st.subscriber_id\n\t\t\t\tWHERE \n\t\t\t\t\ts.id = {$this->id}\";\n\t\t$subscriptions = SqlQuery::getInstance()->simpleQuery($query);\n\t\t\n\t\treturn $subscriptions;\n\t}", "public static function fetch_subscribers()\n {\n\n return self::make_request(self::$account_id.\"/subscribers\");\n }", "public function GetSubscribers() {\n $result = $this->con->query(\"select * from customers where subscriber_type=1 or subscriber_type=2\");\n return $result;\n }", "public function getSitesubscribers()\n\t{\t\n\t\t$ssmodel = new EasyBlogModelSubscriptions();\n\t\t$result['count']= $ssmodel->getTotal();\t\t\n\t\t$smodel = new EasyBlogModelSubscription();\n\t\t$result['data'] = $smodel->getSiteSubscribers();\n\t\treturn $result;\t\t\n\t}", "public function getSubscribers()\n {\n //global $db;\n\n $sql=\"SELECT * FROM sms.subscriptions WHERE 1 AND last_call<CURDATE();\";\n $q=$this->db->query($sql) or die($db->error);\n $dat=[];\n while ($r=$q->fetch_assoc()) {\n $dat[]=$r;\n }\n return $dat;\n }", "function query_subscribers ($db) {\r\n $query = \"SELECT * FROM subscribers\";\r\n $statement = $db->prepare($query);\r\n $statement->execute();\r\n return $statement->fetchAll();\r\n }", "function query_subscribers ($db) {\n $query = \"SELECT * FROM subscribers\";\n $statement = $db->prepare($query);\n $statement->execute();\n return $statement->fetchAll();\n }", "function sendSubscribers() {\n $space = $this->space;\n if($space)\n return [];\n return Subscriber::find()->all();\n }", "public function newsletterList()\n {\n return $this->ozioma->newsletter->list();\n }", "public function get_subscribed_user_list()\n\t{\n\t\t$result = $this->db->from(\"email_subscribe\")\n\t\t\t\t->where(array(\"suscribe_city_status\" => 1,\"suscribe_status\" => 1,\"category_id !=\" =>\"\" ,\"category_id !=\" =>\"0\" ))\n\t\t\t\t//->join(\"email_subscribe\",\"email_subscribe.user_id\",\"users.user_id\")\n\t\t\t\t->get();\n\t\treturn $result;\n\t}", "public function &GetNewsletterUsers()\n {\n $sql = 'SELECT uid, email, name, lname, company, status FROM '.$this -> mTbUsers.' WHERE active = 1 AND is_deleted = 0';\n $db = $this -> mDbPtr -> query($sql);\n $r = array();\n while ($row = $db -> FetchRow())\n {\n \t$r[] = $row;\n }\n return $r;\n }", "function fue_get_subscribers( $args = array() ) {\n\treturn Follow_Up_Emails::instance()->newsletter->get_subscribers( $args );\n}", "public function listSubscribers() {\n\n try {\n\n // create client object\n $client = new Client([\n 'headers' => $this->headers\n ]);\n\n // get subscribers\n $subscribers = $client->get(env('MAILCHIMP_API_ROUTE'));\n $data = json_decode($subscribers->getBody()->getContents());\n\n $subscribers = [];\n\n // loop through returned data and extract only subscriber emails\n foreach ($data->members as $subscriber) {\n array_push($subscribers, $subscriber->email_address);\n }\n\n // return data\n return $subscribers;\n\n } catch (\\Exception $e) {\n // add log\n $this->logService->setLog('ERROR', 'MailchimpService - listSubscribers: ' . $e->getMessage());\n\n // return empty array if error appears\n return [];\n }\n }", "public function getAll()\n {\n $data = array();\n $rs = parent::findAll(array(\"name\" => \"Newsletter\"));\n foreach ($rs as $k => $v) {\n foreach ($v as $vi) {\n $data[$k] = new Newsletter($v['ID'],$v['EMAIL']);\n }\n }\n return $data;\n }", "public function all()\n {\n return Subscribe::all();\n }", "public function subscriptions() {\n $QueryID = $this->db->get_query_id();\n $UserSubscriptions = $this->cache->get_value(\"subscriptions_user_\" . $this->userId);\n if ($UserSubscriptions === false) {\n $this->db->prepared_query('\n SELECT TopicID\n FROM users_subscriptions\n WHERE UserID = ?\n ', $this->userId\n );\n $UserSubscriptions = $this->db->collect(0);\n $this->cache->cache_value(\"subscriptions_user_\" . $this->userId, $UserSubscriptions, 0);\n }\n $this->db->set_query_id($QueryID);\n return $UserSubscriptions;\n }", "function GetNewsletters()\n\t{\n\t\t$this->GetDb();\n\t\t$userid = intval($this->userid);\n\n\t\t$tableName = SENDSTUDIO_TABLEPREFIX . 'newsletters';\n\t\t$queryCondition = '';\n\n\t\t// Make sure that the object has been \"loaded\" with user\n\t\tif ($userid <= 0) {\n\t\t\ttrigger_error('This function require you to \"Load\" the user details first.', E_USER_NOTICE);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Only restrict the query if this is a regular user\n\t\tif (!$this->Admin()) {\n\t\t\t$queryCondition .= \" WHERE ownerid = {$userid}\";\n\t\t}\n\n\t\t$result = $this->Db->Query(\"SELECT * FROM {$tableName}{$queryCondition}\");\n\t\tif ($result == false) {\n\t\t\tlist($error, $level) = $this->Db->GetError();\n\t\t\ttrigger_error($error, $level);\n\t\t\treturn false;\n\t\t}\n\n\t\t$rows = array();\n\t\twhile ($row = $this->Db->Fetch($result)) {\n\t\t\t$rows[$row['newsletterid']] = $row;\n\t\t}\n\n\t\t$this->Db->FreeResult($result);\n\n\t\treturn $rows;\n\t}", "public function getListSubscribers()\n {\n $data = $this->mailChimpService->getSubscribersDefaultList();\n $this->view->add(\"admin/mailChimpTabs\", [], \"main\");\n\n $this->view->add(\"mailchimp/listsubscribers\", [\n \"data\" => $data,\n \"defaultListData\" => $this->mailChimpService->getDefaultListData()\n ], \"main\");\n $this->pageRender->renderPage([\"title\" => \"MailChimp Subscribers\"]);\n }", "function subscriber_list($parameters){\n\t\t$identifier\t= $this->check_parameters($parameters,\"identifier\");\n\t\t$sql=\"select *\t\t\t\t\n\t\t\t\tfrom newsletter_subscription inner join newsletter_data on newsletter_data.newsletter_identifier = newsletter_subscription.subscriber_newsletter\n\t\t\t\twhere subscriber_newsletter='$identifier' AND subscriber_client = $this->client_identifier order by newsletter_subscription.subscriber_email\";\n\t\t\n\t\tif ($this->module_debug){\n\t\t\t$this->call_command(\"UTILS_DEBUG_ENTRY\",array($this->module_name,\"SQL Statement\",__LINE__,\"[$sql]\"));\n\t\t}\n\t\t$result = $this->call_command(\"DB_QUERY\",array($sql));\n\t\t$r = $this->call_command(\"DB_FETCH_ARRAY\",array($result));\n\t\t$result = $this->call_command(\"DB_QUERY\",array($sql));\n\t\t\t\t\n\t\t$variables = Array();\n//\t\t$variables[\"FILTER\"]\t\t\t= \"\";// $this->filter($parameters);\n\t\t//for paging by Muhammad Imran\n\t\t$variables[\"FILTER\"]\t\t\t= $this->filter_entries($parameters,$this->module_command.\"SUBSCRIBER_LIST\");\n\t\t$variables[\"NUMBER_OF_ROWS\"]\t= 0;\n\t\t$variables[\"START\"]\t\t\t\t= 0;\n\t\t$variables[\"as\"]\t\t\t\t= \"table\";\n\t\t$variables[\"FINISH\"]\t\t\t= 0;\n\t\t$variables[\"CURRENT_PAGE\"]\t\t= 0;\n\t\t$variables[\"NUMBER_OF_PAGES\"]\t= 0;\n\t\t\n\t\t$variables[\"HEADER\"]\t\t\t= MANAGE_SUBSCRIBERS .\" \".strip_tags(html_entity_decode($r['newsletter_label']));\n\t\t$variables[\"PAGE_BUTTONS\"] = Array(\n\t\t\tArray(\"NEWSLETTER_HOME\",$this->module_command.\"LIST\",LOCALE_NEWSLETTER_HOME),\n//\t\t\tArray(\"CANCEL\",$this->module_command.\"LIST\",LOCALE_CANCEL),\n\t\t\tArray(\"ADD\",$this->module_command.\"SUBSCRIBER_ADD\",ADD_NEW,\"subscriber_newsletter=$identifier\")\n\t\t);\n\t\tif ($this->call_command(\"DB_NUM_ROWS\",Array($result))==0){\n\t\t\tif ($this->module_debug){\n\t\t\t\t$this->call_command(\"UTILS_DEBUG_ENTRY\",array($this->module_name,\"SQL Statement\",__LINE__,\"[Records not returned]\"));\n\t\t\t}\n\t\t}else{\n\t\t\tif ($this->module_debug){\n\t\t\t\t$this->call_command(\"UTILS_DEBUG_ENTRY\",array($this->module_name,\"SQL Statement\",__LINE__,\"[Records returned]\"));\n\t\t\t}\n\t\t\t$page = $this->check_parameters($parameters,\"page\",\"1\");\n\t\t\t$number_of_records = $this->call_command(\"DB_NUM_ROWS\",array($result));\n\t\t\t$goto = ((--$page)*$this->page_size);\n\t\t\t\n\t\t\tif (($goto!=0)&&($number_of_records>$goto)){\n\t\t\t\t$pointer = $this->call_command(\"DB_SEEK\",array($result,$goto));\n\t\t\t}\n\t\t\tif ($goto+$this->page_size>$number_of_records){\n\t\t\t\t$finish = $number_of_records;\n\t\t\t}else{\n\t\t\t\t$finish = $goto+$this->page_size;\n\t\t\t}\n\t\t\t$goto++;\n\t\t\t$page++;\n\t\t\t\n\t\t\t$num_pages=floor($number_of_records / $this->page_size);\n\t\t\t$remainder = $number_of_records % $this->page_size;\n\t\t\tif ($remainder>0){\n\t\t\t\t$num_pages++;\n\t\t\t}\n\t\t\t\n\t\t\t$counter=0;\n\t\t\t$variables[\"PAGE_COMMAND\"] \t\t= $this->module_command.\"SUBSCRIBER_LIST\";\n\t\t\t$variables[\"NUMBER_OF_ROWS\"]\t= $number_of_records;\n\t\t\t$variables[\"START\"]\t\t\t\t= $goto;\n\t\t\t$variables[\"FINISH\"]\t\t\t= $finish;\n\t\t\t$variables[\"CURRENT_PAGE\"]\t\t= $page;\n\t\t\t$variables[\"NUMBER_OF_PAGES\"]\t= $num_pages;\n\t\t\t\n\t\t\t$start_page=intval($page/$this->page_size);\n\t\t\t$remainder = $page % $this->page_size;\n\t\t\tif ($remainder>0){\n\t\t\t\t$start_page++;\n\t\t\t}\n\t\t\t\n\t\t\t$variables[\"START_PAGE\"]\t\t= $start_page;\n\t\t\t\n\t\t\tif (($start_page+$this->page_size)>$num_pages)\n\t\t\t$end_page=$num_pages;\n\t\t\telse\n\t\t\t$end_page=$this->page_size;\n\t\t\t\n\t\t\t$variables[\"END_PAGE\"]\t\t\t= $end_page;\n\t\t\t\n\t\t\t$variables[\"RESULT_ENTRIES\"] =Array();\n\t\t\t$counter=0;\n\t\t\twhile (($r = $this->call_command(\"DB_FETCH_ARRAY\",array($result))) && ($counter<$this->page_size)){\n\t\t\t\t$counter++;\n\t\t\t\t$i = count($variables[\"RESULT_ENTRIES\"]);\n//\t\t\t\t$subscriber_group = $r[\"subscriber_group\"];\n\t\t\t\t$subscriber_group = explode(\"|\",$r[\"subscriber_group\"]);\n\t\t\t\t$subscriber_group_name = \"\";\n\t\t\t\tforeach($subscriber_group as $subscriber_group_id){\n\t\t\t\t\t$sql_group = \"select subscriber_group_name from newsletter_subscription_group where subscriber_group_identifier=\".$subscriber_group_id;\n\t\t\t\t\t$result_group = $this->call_command(\"DB_QUERY\",array($sql_group));\n\t\t\t\t\t$r_group = $this->call_command(\"DB_FETCH_ARRAY\",array($result_group));\n\t\t\t\t\t$subscriber_group_name .= $r_group[\"subscriber_group_name\"].\", \";\n\t\t\t\t}\n\t\t\t\t$subscriber_group_name = rtrim($subscriber_group_name,\", \");\n\t\t\t\t$variables[\"RESULT_ENTRIES\"][$i]=Array(\n\t\t\t\t\"identifier\"\t\t=> $r[\"subscriber_identifier\"],\n\t\t\t\t\"ENTRY_BUTTONS\" \t=> Array(),\n\t\t\t\t\"attributes\"\t\t=> Array(\n\t\t\t\t\t\tArray(LOCALE_SUBSCRIBER_LABEL,$r[\"subscriber_name\"],\"TITLE\",\"NO\"),\n\t\t\t\t\t\tArray(LOCALE_SUBSCRIBER_GROUP_LABEL,$subscriber_group_name,\"TITLE\",\"NO\"),\n\t\t\t\t\t\tArray(LOCALE_EMAIL_SUBSCRIBER,$r[\"subscriber_email\"],\"TITLE\",\"NO\")\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$variables[\"RESULT_ENTRIES\"][$i][\"ENTRY_BUTTONS\"][count($variables[\"RESULT_ENTRIES\"][$i][\"ENTRY_BUTTONS\"])]\t=\tArray(\"EDIT\" , $this->module_command.\"SUBSCRIBER_EDIT&amp;subscriber_newsletter=\".$identifier,\tEDIT_EXISTING);\n\n\t\t\t\tif($r[\"subscriber_verified\"] == 1){\n\t\t\t\t\t$variables[\"RESULT_ENTRIES\"][$i][\"ENTRY_BUTTONS\"][count($variables[\"RESULT_ENTRIES\"][$i][\"ENTRY_BUTTONS\"])]\t=\tArray(\"UNSUBSCRIBE\" , $this->module_command.\"SUBSCRIBER_UNSUBSCRIBE\",\t\t\tUNSUBSCRIBE_EXISTING);\n\t\t\t\t}else{\n\t\t\t\t\t$variables[\"RESULT_ENTRIES\"][$i][\"ENTRY_BUTTONS\"][count($variables[\"RESULT_ENTRIES\"][$i][\"ENTRY_BUTTONS\"])]\t=\tArray(\"SUBSCRIBE\" , $this->module_command.\"SUBSCRIBER_SUBSCRIBE\",\t\t\tSUBSCRIBE_EXISTING);\n\t\t\t\t}\n\t\t\t\t$variables[\"RESULT_ENTRIES\"][$i][\"ENTRY_BUTTONS\"][count($variables[\"RESULT_ENTRIES\"][$i][\"ENTRY_BUTTONS\"])]\t=\tArray(\"REMOVE\" , $this->module_command.\"SUBSCRIBER_REMOVE\",\tREMOVE_EXISTING);\n\t\t\t\t\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t$out = $this->generate_list($variables);\n\t\treturn $out;\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register the session manager instance.
protected function registerSessionManager() { $this->royalcms->bindShared('session', function($royalcms) { return new SessionManager($royalcms); }); }
[ "protected function registerSessionManager()\n {\n $this->app->singleton('session', fn ($app) => new SessionManager($app));\n }", "protected function registerSessionManager()\n {\n $this->app->singleton('session', function ($app) {\n $manager = new Manager($app);\n\n $manager->registerTokenRetriever(function () {\n return $this->getAccessToken();\n });\n\n return $manager;\n });\n\n $this->app->terminating(function () {\n if (Session::isStarted()) Session::save();\n });\n\n }", "protected function registerSession() {\n $this->container->set('session', function() {\n $session = new Session();\n $session->start();\n\n return $session;\n });\n }", "protected function registerManager()\n {\n $this->app->singleton('login', function (Container $app) {\n $config = $app['config'];\n $factory = $app['login.factory'];\n\n return new LoginManager($config, $factory);\n });\n\n $this->app->alias('login', LoginManager::class);\n }", "public static function Register() {\n $sessionHandler = self::Get();\n\n return session_set_save_handler(\n array($sessionHandler, \"open\"),\n array($sessionHandler, \"close\"),\n array($sessionHandler, \"read\"),\n array($sessionHandler, \"write\"),\n array($sessionHandler, \"destroy\"),\n array($sessionHandler, \"gc\")\n );\n }", "private function registerManager()\n {\n $class = (app()->environment() === 'testing') ? StacheTestManager::class : Manager::class;\n\n $manager = new $class(\n $this->stache,\n new Loader($this->stache),\n new UpdateManager($this->stache),\n new Persister($this->stache)\n );\n\n $this->app->instance(Manager::class, $manager);\n }", "protected function registerSession()\n {\n $this->app->bind('basket.session', function ($app) {\n $config = $app['config']->get('basket');\n\n return new Storage\\IlluminateSession($app['session.store'], $config['instance'], $config['session_key']);\n });\n }", "protected function registerManager()\n {\n $this->app->singleton('hashids', function (Container $app) {\n $config = $app['config'];\n $factory = $app['hashids.factory'];\n\n return new HashidsManager($config, $factory);\n });\n\n $this->app->alias('hashids', HashidsManager::class);\n }", "protected function registerManager()\n {\n $this->app->singleton('chatapp', function ($app) {\n return tap(new ChatAppManager($app), function ($manager) {\n $this->registerHandlers($manager);\n });\n });\n }", "protected function registerManager()\n {\n $this->app->singleton('httpQueue', function($app) {\n return tap(new HttpQueueManager($app), function($manager) {\n $this->registerParsers($manager);\n });\n });\n\n // Register the manager alias as the class name.\n $this->app->alias('httpQueue', HttpQueueManager::class);\n }", "protected function setupSessionManager(){\r\n\r\n // if the session exist already, then re-use it\r\n if (\\Session::has(Reader::getSessionKeyName()) && is_null($this->getSessionManager())){\r\n $this->setSessionManager(\\Session::get(Reader::getSessionKeyName()));\r\n }\r\n else{\r\n $this->setSessionManager(new SessionManager());\r\n }\r\n }", "public function registerManager(): void\n {\n $this->app->singleton('whmcs', function (Container $app) {\n $config = $app['config'];\n $factory = $app['whmcs.factory'];\n\n return new WhmcsManager($config, $factory);\n });\n\n $this->app->alias('whmcs', WhmcsManager::class);\n }", "protected function registerManager()\n {\n $this->app->singleton('permission', function () { new Manager(); });\n }", "public function registerContainer( SessionContainerInterface $sessionContainer );", "public static function getInstance()\n {\n static $sessionmanager = null;\n if (isset($sessionmanager) === false) {\n $sessionmanager = new SessionManager();\n }//end if\n\n return $sessionmanager;\n }", "protected function registerManager()\n {\n $this->app->singleton('upload', function ($app) {\n return tap(new UploadManager($app), function ($manager) {\n $this->registerHandlers($manager);\n });\n });\n }", "protected function registerSessionDriver()\n {\n $this->app->singleton('session.store', function($app)\n {\n $manager = $app['session'];\n\n return $manager->driver();\n });\n }", "protected function createSessionManager()\n {\n return new SessionManager($this->config['session'], $this->extensions['session']);\n }", "protected function registerManager()\n {\n $this->app->singleton(PolicyManager::class);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cancel the subscription at the end of the billing period.
public function cancel() { $today = Carbon::now('America/Denver'); $billingDay = $this->created_at->day; $billingDate = Carbon::createFromDate($today->year, $today->month, $billingDay)->timezone('America/Denver'); $endingDate = $billingDate; if ($today->gte($endingDate)) { $endingDate = $billingDate->addDays($this->getBillingDays()); } $requestor = new Requestor(); $request = $requestor->prepare((new AnetAPI\ARBCancelSubscriptionRequest())); $request->setSubscriptionId($this->authorize_id); $controller = new AnetController\ARBCancelSubscriptionController($request); $response = $controller->executeWithApiResponse($requestor->env); if (($response != null) && ($response->getMessages()->getResultCode() == "Ok")) { // If the user was on trial, we will set the grace period to end when the trial // would have ended. Otherwise, we'll retrieve the end of the billing period // period and make that the end of the grace period for this current user. if ($this->onTrial()) { $this->ends_at = $this->trial_ends_at; } else { $this->ends_at = $endingDate; } $this->save(); } else { throw new Exception("Response : " . $errorMessages[0]->getCode() . " " .$errorMessages[0]->getText(), 1); } return $this; }
[ "public function cancel()\n {\n $subscription = $this->asPaystackSubscription();\n\n PaystackService::disableSubscription([\n 'token' => $subscription['email_token'],\n 'code' => $subscription['subscription_code'],\n ]);\n // If the user was on trial, we will set the grace period to end when the trial\n // would have ended. Otherwise, we'll retrieve the end of the billing period\n // period and make that the end of the grace period for this current user.\n if ($this->onTrial()) {\n $this->ends_at = $this->trial_ends_at;\n } else {\n $this->ends_at = Carbon::parse(\n $subscription['next_payment_date']\n );\n }\n $this->save();\n return $this;\n }", "public function cancel()\n {\n $subscription = $this->asStripeSubscription();\n\n $subscription->cancel(['at_period_end' => true]);\n\n // If the user was on trial, we will set the grace period to end when the trial\n // would have ended. Otherwise, we'll retrieve the end of the billing period\n // period and make that the end of the grace period for this current user.\n if ($this->onTrial()) {\n $this->ends_at = $this->trial_ends_at;\n } else {\n $this->ends_at = Carbon::createFromTimestamp(\n $subscription->current_period_end\n );\n }\n\n $this->save();\n\n return $this;\n }", "public function cancel($subscription_id) {}", "public function planSubscriptionCancel()\n {\n if ($this->plan_payment_processor == 'paypal') {\n $httpClient = new HttpClient();\n\n $httpBaseUrl = 'https://'.(config('settings.paypal_mode') == 'sandbox' ? 'api-m.sandbox' : 'api-m').'.paypal.com/';\n\n // Attempt to retrieve the auth token\n try {\n $payPalAuthRequest = $httpClient->request('POST', $httpBaseUrl . 'v1/oauth2/token', [\n 'auth' => [config('settings.paypal_client_id'), config('settings.paypal_secret')],\n 'form_params' => [\n 'grant_type' => 'client_credentials'\n ]\n ]\n );\n\n $payPalAuth = json_decode($payPalAuthRequest->getBody()->getContents());\n } catch (BadResponseException $e) {}\n\n // Attempt to cancel the subscription\n try {\n $payPalSubscriptionCancelRequest = $httpClient->request('POST', $httpBaseUrl . 'v1/billing/subscriptions/' . $this->plan_subscription_id . '/cancel', [\n 'headers' => [\n 'Authorization' => 'Bearer ' . $payPalAuth->access_token,\n 'Content-Type' => 'application/json'\n ],\n 'body' => json_encode([\n 'reason' => __('Cancelled')\n ])\n ]\n );\n } catch (BadResponseException $e) {}\n } elseif ($this->plan_payment_processor == 'stripe') {\n $stripe = new \\Stripe\\StripeClient(\n config('settings.stripe_secret')\n );\n\n // Attempt to cancel the current subscription\n try {\n $stripe->subscriptions->update(\n $this->plan_subscription_id,\n ['cancel_at_period_end' => true]\n );\n } catch (\\Exception $e) {}\n }\n\n $this->plan_payment_processor = null;\n $this->plan_recurring_at = null;\n $this->save();\n }", "public function cancelSubscription($subscription_id);", "public function requestCancel(){\n\t\t$this->checkWorkflow(self::STATUS_CANCELED, false);\n\t\tif ($this->hasCancelPeriod()) {\n\t\t\t$this->getSubscription()->setCancelRequest(true);\n\t\t\t$this->save();\n\t\t\t$this->sendCancelRequestEmail();\n\t\t\t$this->getLogger()->info('The cancelation of the subscription was requested.');\n\t\t}\n\t\telse {\n\t\t\t$this->cancel();\n\t\t\t$this->sendCancelEmail();\n\t\t}\n\t}", "public function cancel() {\n\n\t\t$args = array(\n\t\t\t'status' => 'cancelled'\n\t\t);\n\n\t\tif( $this->subs_db->update( $this->id, $args ) ) {\n\n\t\t\tif( is_user_logged_in() ) {\n\n\t\t\t\t$userdata = get_userdata( get_current_user_id() );\n\t\t\t\t$user = $userdata->user_login;\n\n\t\t\t} else {\n\n\t\t\t\t$user = __( 'gateway', 'edd-recurring' );\n\n\t\t\t}\n\n\t\t\t$note = sprintf( __( 'Subscription #%d cancelled by %s', 'edd-recurring' ), $this->id, $user );\n\t\t\t$this->customer->add_note( $note );\n\n\t\t\tdo_action( 'edd_subscription_cancelled', $this->id, $this );\n\n\t\t}\n\n\t}", "public function cancel_subscription(){\n $data = array();\n $stripeSystem = new StripeSystem();\n $stripeSubscription = $this->StripeSubscriptions_model->getSubscription();\n if($stripeSubscription->stripe_id !=\"\"){\n $subscription = $stripeSystem->stripeSubscriptionRetrieve($stripeSubscription->stripe_id);\n $subscription->cancel_at_period_end = true;\n// $subscription->cancel(['cancel_at_period_end' => true]);\n $subscription->save();\n// $subscription->cancel();\n $this->StripeSubscriptions_model->cancelSubscription($subscription);\n $data['result'] =\"success\";\n $data['message'] = \"You cancelled subscription successfully.\";\n }else {\n $data['result'] =\"failed\";\n $data['message'] = \"You didn't have subscription.\";\n }\n echo json_encode($data);\n exit;\n }", "public function cancel($cancel_at_end = false)\n {\n $cancel_at_end = $cancel_at_end ? 'true' : 'false';\n $response = $this->request('POST', sprintf('subscriptions/%s/cancel?cancel_at_end=%s', $this->getId(), $cancel_at_end));\n $this->processResponseAndSave($response);\n }", "public static function cancel_customer_subscription($customer_id, $subscription_id, $at_period_end = TRUE)\n\t\t{\n\t\t\t$input_time = time(); // Initialize.\n\t\t\t$input_vars = get_defined_vars(); // Arguments.\n\n\t\t\tif(!class_exists('Stripe'))\n\t\t\t\trequire_once dirname(__FILE__).'/stripe-sdk/lib/Stripe.php';\n\t\t\tStripe::setApiKey($GLOBALS['WS_PLUGIN__']['s2member']['o']['pro_stripe_api_secret_key']);\n\n\t\t\ttry // Attempt to cancel the subscription for this customer.\n\t\t\t{\n\t\t\t\t$customer = Stripe_Customer::retrieve($customer_id);\n\t\t\t\t$subscription = $customer->subscriptions->retrieve($subscription_id)->cancel(array('at_period_end' => $at_period_end));\n\n\t\t\t\tself::log_entry(__FUNCTION__, $input_time, $input_vars, time(), $subscription);\n\n\t\t\t\treturn $subscription; // Stripe subscription object.\n\t\t\t}\n\t\t\tcatch(exception $exception)\n\t\t\t{\n\t\t\t\tself::log_entry(__FUNCTION__, $input_time, $input_vars, time(), $exception);\n\n\t\t\t\treturn self::error_message($exception);\n\t\t\t}\n\t\t}", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "public function cancel()\n {\n $this->ends_at = $this->current_period_ends_at;\n $this->save();\n }", "public function cancel()\n {\n $response = $this->client->put(InvoiceService::INVOICE_PATH . \"/$this->id/cancel\");\n $this->updateFromArray($response['body_assoc']);\n }", "private function cancelOrder()\n {\n if ($this->orderData->hasInvoices()) {\n $this->invoice = $this->orderData->getInvoiceCollection()->getLastItem();\n $this->invoice->cancel();\n $this->orderData->addRelatedObject($this->invoice);\n }\n\n $orderMessage = __(\n 'Payment failed. %1, please contact our support if you have any questions.',\n ucfirst($this->charge->failure_message)\n );\n $this->orderData->registerCancellation($orderMessage)->save();\n }", "public function getSubscriptionCancel()\n {\n $user = Auth::user();\n if (!$user->payment_subscription_id)\n return back();\n\n $subscription_id = $user->payment_subscription_id;\n $customerId = $user->payment_customer_id;\n\n $subscription = $this->userSubscription($customerId)->cancel($subscription_id);\n\n $user->payment_subscription_id = NULL;\n $user->save();\n\n event(new UserSubscriptionCanceled($user, $subscription_id));\n\n return back()->with('success', 'Automatische incasso gestopt');\n }", "public function cancelSubscription($customerId, $subscriptionId, $atPeriodEnd = null)\n {\n $segments = \"/customers/{$customerId}/subscriptions/{$subscriptionId}\";\n\n $attributes = array('at_period_end' => $atPeriodEnd);\n\n return $this->createRequest($segments, \"delete\", $attributes);\n }", "public function cancelSubscription()\n {\n $user = $this->context->getToken()->getUser();\n $stripeCustomerId = $user->getStripeCustomerId();\n\n $customer = Customer::retrieve($stripeCustomerId);\n\n $customer->cancelSubscription();\n\n $user->setIsStripeCustomerActive(false);\n\n $this->userManager->updateUser($user);\n\n return true;\n }", "function cancelSubscription($subscriptionId) {\n\t // require 'vendor/autoload.php';\n // define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n\t global $wpdb;\n\t \n\t $current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\n // Common Set Up for API Credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n $request = new AnetAPI\\ARBCancelSubscriptionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscriptionId($subscriptionId);\n\n $controller = new AnetController\\ARBCancelSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n $successMessages = $response->getMessages()->getMessage();\n //echo \"SUCCESS : \" . $successMessages[0]->getCode() . \" \" .$successMessages[0]->getText() . \"\\n\";\n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your request has been processed</h2>';\n\t\techo '<p>You have been unsubscribe successfully</p>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<p>Your credit card will not be automatically debited $'.$monthpaid.' a month.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\n\t\t$wpdb->update( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'status' => 'Inactive',\t// string\n\t\t\t\t), \n\t\t\t\tarray( 'subscribe' => $subscriptionId ), \n\t\t\t\tarray( \n\t\t\t\t\t'%s',\t// value1\n\t\t\t\t), \n\t\t\t\tarray( '%d' ) \n\t\t\t);\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\t\n \n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n \n }\n\n return $response;\n\n }", "function paybill_ng_cancelSubscription($params)\n{\n /* // Gateway Configuration Parameters\n $accountId = $params['accountID'];\n $secretKey = $params['secretKey'];\n $testMode = $params['testMode'];\n $dropdownField = $params['dropdownField'];\n $radioField = $params['radioField'];\n $textareaField = $params['textareaField'];\n\n // Subscription Parameters\n $subscriptionIdToCancel = $params['subscriptionID'];\n\n // System Parameters\n $companyName = $params['companyname'];\n $systemUrl = $params['systemurl'];\n $langPayNow = $params['langpaynow'];\n $moduleDisplayName = $params['name'];\n $moduleName = $params['paymentmethod'];\n $whmcsVersion = $params['whmcsVersion'];*/\n\n // perform API call to cancel subscription and interpret result\n\n return array(\n // 'success' if successful, any other value for failure\n 'status' => 'failed',\n // Data to be recorded in the gateway log - can be a string or array\n //'rawdata' => $responseData,\n );\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the public 'Yoast\WP\SEO\Helpers\Image_Helper' shared autowired service.
protected function getImageHelperService() { }
[ "private function getImageHelper()\n {\n if ($this->imageHelper === null) {\n $this->imageHelper = \\Magento\\Framework\\App\\ObjectManager::getInstance()\n ->get(\\Magento\\Catalog\\Helper\\Image::class);\n }\n return $this->imageHelper;\n }", "protected function getImageViewHelperService()\n {\n $instance = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Fluid\\ViewHelpers\\ImageViewHelper::class);\n\n $instance->injectImageService(($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Service\\\\ImageService'] ?? $this->getImageServiceService()));\n\n return $instance;\n }", "protected function getDistributionImageViewHelperService()\n {\n return \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Extensionmanager\\ViewHelpers\\DistributionImageViewHelper::class);\n }", "protected function getImageHelper2Service()\n {\n }", "public function getMarkerImageHelper()\n {\n return $this->markerImageHelper;\n }", "public static function image() {\n return new __image_helper(parent::$param);\n }", "protected function getMainImageService()\n {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Generators\\\\Schema\\\\Main_Image'] = new \\Yoast\\WP\\SEO\\Generators\\Schema\\Main_Image();\n }", "protected function _getImageHelper()\n {\n return Mage::helper('catalog/image');\n }", "protected function getAssetHelperService()\n {\n }", "protected function getUrlHelperService()\n {\n return $this->services['Yoast\\\\WP\\\\SEO\\\\Helpers\\\\Url_Helper'] = new \\Yoast\\WP\\SEO\\Helpers\\Url_Helper();\n }", "protected static function getImageService()\n {\n /** @var ObjectManager $objectManager */\n $objectManager = GeneralUtility::makeInstance(ObjectManager::class);\n return $objectManager->get(ImageService::class);\n }", "protected function getAioseoSocialImagesProviderServiceService()\n {\n }", "protected function getLiipImagine_Templating_HelperService()\n {\n return $this->services['liip_imagine.templating.helper'] = new \\Liip\\ImagineBundle\\Templating\\Helper\\ImagineHelper($this->get('liip_imagine.cache.manager'));\n }", "protected function getLiipImagine_Templating_HelperService()\n {\n return $this->services['liip_imagine.templating.helper'] = new \\Liip\\ImagineBundle\\Templating\\Helper\\ImagineHelper(${($_ = isset($this->services['liip_imagine.cache.manager']) ? $this->services['liip_imagine.cache.manager'] : $this->get('liip_imagine.cache.manager')) && false ?: '_'});\n }", "protected function getTwitterImageGeneratorService()\n {\n }", "protected function getAvatarViewHelperService()\n {\n return \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Backend\\ViewHelpers\\AvatarViewHelper::class);\n }", "protected function getImagesService()\n {\n }", "protected function getSonata_Media_Adapter_Image_GdService()\n {\n return $this->services['sonata.media.adapter.image.gd'] = new \\Imagine\\Gd\\Imagine();\n }", "protected function getImageService()\n {\n return $this->objectManager->get(ImageService::class);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the configuration for the given key path
public function getConfigurationForKeyPath($keyPath, $package = null);
[ "function cfg($key)\n{\n $config = $GLOBALS['config'];\n $seg = explode('/', $key);\n $lastSeg = array_pop($seg);\n foreach($seg as $s)\n {\n if(is_array($config[$s]))\n $config = $config[$s];\n else\n $config = array(); \n }\n\treturn($config[$lastSeg]);\n}", "function getConfig($path) {\r\n\t\t// explode our path\r\n\t\t$path_arr = explode(\".\", $path);\r\n\r\n\t\t// get config as array\r\n\t\t$config= $this->CLASS['config']->toArray();\r\n\r\n\t\t// foreach path element\r\n\t\tforeach($path_arr as $val) {\r\n\t\t\tif(!isset($config[$val])) {\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\r\n\t\t\t$config = $config[$val];\r\n\t\t}\r\n\r\n\t\t// return our value\r\n\t\treturn $config;\r\n\t}", "function config($path) {\r\n\treturn Config::get($path);\r\n}", "function getConfigurationKey() ;", "protected function getFromConfiguration($path) {\n\t\t$path = trim($path, '/');\n\t\t$value = $this->getDefaultValue($path);\n\t\t$configuration = $this->configuration;\n\t\t$segments = explode('/', $path);\n\t\t$segmentCount = count($segments);\n\t\tfor ($currentSegmentNumber = 0; $currentSegmentNumber < $segmentCount; $currentSegmentNumber++) {\n\t\t\t$key = $segments[$currentSegmentNumber];\n\t\t\tif ($currentSegmentNumber < $segmentCount - 1) {\n\t\t\t\t// Must be an array\n\t\t\t\tif (isset($configuration[$key]) && is_array($configuration[$key])) {\n\t\t\t\t\t$configuration = $configuration[$key];\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} elseif (isset($configuration[$key])) {\n\t\t\t\t$value = $configuration[$key];\n\t\t\t}\n\t\t}\n\n\t\treturn $value;\n\t}", "public static function get($path = null){ \n if($path){\n $config = $GLOBALS['config'];\n $path = explode('/',$path); //['mysql','host']\n // explode function turns a string into an arra\n // separated by the first arg char\n\n foreach($path as $bit){\n if(isset($config[$bit])){\n $config = $config[$bit]; // go deeper one level\n }\n }\n }\n return $config;\n }", "public static function get($key) {\n return self::$config[$key];\n }", "public function getConfig($key)\n {\n return $this->config->get('calendar-helper'.CalendarHelperServiceProvider::$configSeparator.$key);\n }", "public static function get($path = null)\n {\n\n // Copy of global config array.\n $config = $GLOBALS['config'];\n\n // Finds value in the global array.\n foreach (explode('/', $path) as $key) {\n if (isset($config[$key])) {\n $config = $config[$key];\n }\n }\n\n // Returns the found value.\n return $config;\n }", "abstract protected static function getConfigFilePathKey(): string;", "public function getCachedConfigPath();", "public function readConfigData($key){\n\t\tglobal $configFileName;\n\t\t$ini_array = parse_ini_file($this->configFileName);\n\t\treturn $ini_array[$key];\n\t}", "public function config_item($key)\n\t{\n\t\t$tester_config = $this->CI->config->item('tester');\n\t\treturn $tester_config[$key];\n\t}", "public function getPathConfig() {\n return $this->path_config;\n }", "public static function get($key)\n {\n if (empty(self::$_config)) {\n self::$_config = require_once APP_CONFIG_FILE;\n }\n return (array_key_exists($key, self::$_config) ? self::$_config[$key] : null);\n }", "public static function conf($key) {\n $key = explode('.', $key);\n $conf = self::$conf;\n \n do {\n $i = array_shift($key);\n \n if (!isset($conf[$i])) {\n continue;\n }\n \n if (empty($key)) {\n return $conf[$i];\n }\n \n $conf = $conf[$i];\n \n } while (!empty($key));\n \n return false;\n }", "function common_config( $key, $file=\"common\" ){\n $config = require base_path( \"common/config/\" . $file . \".php\" );\n\n $iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($config));\n $result = [];\n foreach ($iterator as $leafValue) {\n $keys = array();\n\n foreach (range(0, $iterator->getDepth()) as $depth) {\n $keys[] = $iterator->getSubIterator($depth)->key();\n }\n\n $result[ join('.', $keys) ] = $leafValue;\n }\n\n return isset( $result[ $key ] ) ? $result[ $key ] : null;\n }", "public function getValueFromConfiguration(string $key);", "public function getConfig($path, $default = NULL){\n $path = explode('/', $path);\n if( count($path) < 1 ) return NULL;\n $conf = $this->config;\n foreach ($path as $s){\n if( isset( $conf[$s] ) )$conf = $conf[$s];\n else return $default;\n }\n return $conf;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Allows the user to delete an existing privilege. All the flippers related to this privilege will be removed
public function deleteAction(){ $this->title = 'Delete privilege'; $form = new DeleteForm(); $privilegeModel = new Privilege(); if($this->getRequest()->isPost()){ if($form->isValid($this->getRequest()->getPost())){ $privilegeModel->deleteById($form->getValue('id')); $this->_helper->FlashMessenger( array( 'msg-success' => 'The privilege was successfully deleted.', ) ); //Regenerate Flag and Flippers App_FlagFlippers_Manager::save(); $this->_redirect('/privileges/'); } }else{ $id = $this->_getParam('id'); $row = $privilegeModel->findById($id); if (empty($row)) { $this->_helper->FlashMessenger( array( 'msg-warning' => sprintf('We cannot find privilege with id %s', $id), ) ); $this->_redirect('/privileges/'); } $form->populate($row->toArray()); $this->view->item = $row; } $this->view->form = $form; }
[ "public function deletePrivilegeAction() {\n\n }", "public function delete_prefooter()\n\t{\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect('admin');\n\t\t}else {\n\t\t\t$user_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('id' => $user_id);\n\t\t\t$this->prefooter_model->commonDelete(PREFOOTER,$condition);\n\t\t\t$this->setErrorMessage('success','prefooter deleted successfully');\n\t\t\tredirect('admin/prefooter/display_prefooter_list');\n\t\t}\n\t}", "public function deleteDacl()\n\t{\n\t\t$this->remove();\n\t}", "public function delete()\n {\n if( 'administrator' != bus\\session::self()->get_role()->name &&\n 'administrator' == $this->get_role()->name )\n throw new exc\\permission(\n // fake the operation\n operation::get_operation( 'action', 'access', 'delete' ), __METHOD__ );\n\n parent::delete();\n }", "public function delete()\n {\n $success = false;\n\n // Verify CSRF token\n if (!$this->verifyCSRF()) {\n header('HTTP/1.0 402 Request Failed');\n exit;\n }\n\n // If ID parameter is valid\n if (\n $this->f3->exists('PARAMS.id')\n && intval($this->f3->get('PARAMS.id')) > 0\n ) {\n $id = intval($this->f3->get('PARAMS.id'));\n\n // If the specified user id does not match the current user's id\n // check if they have permission to edit other users\n if ($id !== intval($this->f3->get('SESSION.user_id'))) {\n if ($this->acl->check('page', $this->page_id, ACL_DELETE) === false) {\n // No permission\n header('HTTP/1.0 403 Forbidden');\n echo 'Your group does not have permission to delete users.';\n exit;\n }\n }\n // Delete user\n $this->users->load(array('id = ?', $id));\n if ($this->users->erase()) {\n $success = true;\n }\n $this->users->reset();\n\n // Delete their category\n $this->categories->load(array('user_id = ?', $id));\n $this->categories->erase();\n $this->categories->reset();\n }\n\n if ($success) {\n header('HTTP/1.0 200 OK');\n } else {\n header('HTTP/1.0 402 Request Failed');\n }\n }", "public function delete()\n {\n $database = new Database();\n $database->deleteUser($this->getId());\n }", "function delete() {\r\n global $DB, $Controller, $USER;\r\n if($Controller->alias('userEditor')->may($USER, DELETE)\r\n && $this->ID != NOBODY\r\n && !$this->memberOf(ADMIN_GROUP)) {\r\n Log::write('Deleted user \\'' . $this->username . '\\' (id=' . $this->ID . ')', 20);\r\n $DB->users->delete(array('id' => $this->ID));\r\n $DB->group_members->delete(array('user' => $this->ID), false);\r\n $DB->userinfo->delete(array('id' => $this->ID), false);\r\n parent::delete();\r\n }\r\n }", "public function deleteUser()\n {\n $this->logger->log(\"User Deleted\");\n }", "function deleteUser_PrivilageById($id) {\n\t\t$SQL=\"DELETE FROM user_privilage_tab WHERE id='$id'\";\n\t\t$this->db->executeQuery($SQL);\n\n\t}", "public function delete()\n\t{\n\t\t$this->deletefriend();\n\t}", "function deleteUser(){\n\n // si l'utilisateur n'est pas un administrateur\n if($_SESSION['role'] != ROLE_ADMIN ){\n throw new Exception('You do not have the rights to access this page');\n }\n\n $userNo = $_GET['no'];\n\n // vérifie que l'utilisateur existe\n $user = getUserByID($userNo)->fetch();\n if($user != null) {\n\n // si l'utilsateur à supprimer est différent de celui connecté actuellement\n if($userNo != $_SESSION['no']){\n // appel de la fonction supprimant l'utilisateur de la DB\n dropUser($userNo);\n }\n else {\n $_SESSION['message'] = \"You cannot delete yourself\";\n }\n }\n else {\n $_SESSION['message'] = \"This user does not exist\";\n }\n administration();\n}", "public function deleteMemberAction() {\n\n $this->_helper->layout->setLayout('admin-simple');\n\n //GET PAGE ID.\n $user_id = $this->_getParam('user_id');\n $project_id = $this->_getParam('project_id');\n\n if (!empty($user_id) && !empty($project_id) ) {\n\n Engine_Api::_()->getDbtable('memberships', 'sitecrowdfunding')->delete(\n array(\n 'user_id =?' => $user_id,\n 'resource_id =?' => $project_id,\n 'project_id =?' => $project_id,\n )\n );\n }\n }", "public function eliminar()\n {\n $id = Route::getParams()['id'];\n $astronautas = Usuario::deleteFav($id);\n return;\n }", "public function delete()\n {\n $this->profileFields()->delete();\n parent::delete();\n }", "function _delete_authorize() {\n\t\t$this->Attachment->is_deletable($this->current_user, $this->_project) ? true : $this->deny_access();\n\t}", "public static function delete()\n {\n $GLOBALS['TSFE']->fe_user->removeSessionData();\n }", "public function deleteUser()\n {\n // $logger = new Logger();\n // $logger->log(\"User Created:\");\n $this->logger->log(\"User Deleted\");\n }", "private function delete() {\n\t\tif ( ! isset( $_REQUEST['role'] ) )\n\t\t\treturn;\n\n\t\t\\Podlove\\Modules\\Contributors\\Model\\ContributorRole::find_by_id( $_REQUEST['role'] )->delete();\n\t\t\n\t\tself::redirect( 'index' );\n\t}", "public function delete()\n\t{\n\t\tif (!has_permissions('roles', 'delete'))\n\t\t{\n\t\t\taccess_denied('roles', 'delete');\n\t\t}\n\n\t\t$role_id = $this->input->post('role_id');\n\t\t$users = $this->users->get_many_by(array('role' => $role_id));\n\n\t\tif ($users == NULL)\n\t\t{\n\t\t\t$result = $this->roles->delete($role_id);\n\t\t\tlog_activity(_l('deleted', _l('role')).\" [ID:$role_id]\");\n\t\t\techo 'deleted';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlog_activity(\"Error \"._l('deleted', _l('role')).\" [ID:$role_id]\");\n\t\t\techo 'error';\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Clears files and folders older than $maxAge in $prefix $prefix must be passable so it can clean the orphanage too as it is forced to be the same filesystem.
public function clear(int $maxAge, string $prefix = null): void { $prefix = $prefix ?: $this->prefix; $matches = $this->filesystem->listKeys($prefix); $now = time(); $toDelete = []; // Collect the directories that are old, // this also means the files inside are old // but after the files are deleted the dirs // would remain foreach ($matches['dirs'] as $key) { try { if ($maxAge <= $now - $this->filesystem->mtime($key)) { $toDelete[] = $key; } } catch (FileNotFound $exception) { // ignore } } // The same directory is returned for every file it contains $toDelete = array_unique($toDelete); foreach ($matches['keys'] as $key) { try { if ($maxAge <= $now - $this->filesystem->mtime($key)) { $this->filesystem->delete($key); } } catch (FileNotFound $exception) { // ignore } } foreach ($toDelete as $key) { // The filesystem will throw exceptions if // a directory is not empty try { $this->filesystem->delete($key); } catch (\Exception $e) { continue; } } }
[ "function cleanup($basedir, $age) {\n if (($handle = opendir($basedir))) {\n while (($file = readdir($handle)) !== false) {\n $entry = \"$basedir/$file\";\n if ($file != '.' && $file != '..' && (time() - filemtime($entry) > $age)) {\n if (is_dir($entry)) {\n removeDir($entry);\n } else {\n unlink($entry);\n }\n }\n }\n }\n}", "protected function removeExpiredDirs($path, $maxAge = null) {\n\t\t\n\t\tif(!is_dir($path)) return false;\n\t\tif(!is_int($maxAge)) $maxAge = $this->tempDirMaxAge;\n\t\t\n\t\t$numSubdirs = 0;\n\t\t$oldestAllowedFileTime = time() - $maxAge;\n\t\t$success = true;\n\t\t\n\t\tforeach(new \\DirectoryIterator($path) as $dir) {\n\t\t\t\n\t\t\tif(!$dir->isDir() || $dir->isDot()) continue;\n\t\t\n\t\t\t// if the directory itself is not expired, then nothing in it is either\n\t\t\tif($dir->getMTime() >= $oldestAllowedFileTime) {\n\t\t\t\t$numSubdirs++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// old dir found: check times on files/dirs within that dir\n\t\t\t$pathname = $this->wire('files')->unixDirName($dir->getPathname());\n\t\t\tif(!$this->isTempDir($pathname)) continue;\n\t\t\t\n\t\t\t$removeDir = true;\n\t\t\t$newestFileTime = $this->getNewestModTime($pathname); \n\t\t\tif($newestFileTime >= $oldestAllowedFileTime) $removeDir = false;\n\t\t\n\t\t\tif($removeDir) {\n\t\t\t\tif(!$this->rmdir($pathname, true)) {\n\t\t\t\t\t$this->log(\"Unable to remove (B): $pathname\");\n\t\t\t\t\t$success = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$numSubdirs++;\n\t\t\t}\n\t\t}\n\n\t\tif(!$numSubdirs && $path != $this->classRoot && $this->isTempDir($path)) {\n\t\t\t// if no subdirectories, we can remove the root\n\t\t\tif($this->rmdir($path, true)) {\n\t\t\t\t$success = true;\n\t\t\t} else {\n\t\t\t\t$this->log(\"Unable to remove (A): $path\");\n\t\t\t\t$success = false;\n\t\t\t}\n\t\t}\n\n\t\treturn $success;\n\t}", "public function cleanup() {\n $dirIt = new DirectoryIterator($this->path);\n // Convert days to seconds\n $lifetimeSeconds = self::$lifetime * 3600 * 24;\n /** @var DirectoryIterator $fileInfo */\n foreach ($dirIt as $fileInfo) {\n if ($fileInfo->isDot()) {\n continue;\n }\n $fileAge = time() - $fileInfo->getMTime();\n if ($fileAge > $lifetimeSeconds) {\n $this->deleteFile();\n }\n }\n }", "function clean_directory($directory, $age_in_seconds)\n{\n\n $dir = scandir($directory); \n foreach ($dir as $key => $value) \n { \n if (!is_dir($directory . DIRECTORY_SEPARATOR . $value)) \n { \n \tif (filemtime ($directory . DIRECTORY_SEPARATOR . $value) < (time() - $age_in_seconds) )\n \t{\n \t\tunlink ($directory . DIRECTORY_SEPARATOR . $value);\n \t} \n } \n } \n\n}", "function _clean_cache()\n\t{\n\t\t$expire_count = 0;\n\t\t$dir = $this->caching_options['path'];\n\t\t\n\t\tlog_message('debug','BackendPro->BeP_Assets->_clean_cache : Cleaning out asset cache : ' . $this->caching_options['path']);\n\t\t\n\t\tif(is_dir($dir))\n\t\t{\n\t\t\tif($dh = opendir($dir))\n\t\t\t{\n\t\t\t\twhile (($file = readdir($dh)) !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t// TODO: Put a regex expression here so only certain files are found\n\t\t\t\t\tif($file == '.' || $file == '..')\n\t\t\t\t\t{\n\t\t\t\t\t\t// Don' try to delete the dir links\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Whats the files expire time\n\t\t\t\t\t$created_time = filectime($dir . $file);\n\t\t\t\t\t$expire_time = $created_time + ($this->caching_options['expire_time']*60*60);\n\t\t\t\t\t\n\t\t\t\t\tif($expire_time <= time())\n\t\t\t\t\t{\n\t\t\t\t\t\t// TODO: Check this can work on the Apache Server\n\t\t\t\t\t\t// Its expired, delete it\n\t\t\t\t\t\tif(@unlink($dir . $file))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlog_message('debug',\"BackendPro->BeP_Assets->_clean_cache : File deleted '\" . $dir . $file . \"'\");\n\t\t\t\t\t\t\t$expire_count++;\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\tlog_message('error',\"BackendPro->BeP_Assets->_clean_cache : Could not delete file '\" . $dir . $file . \"'\");\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tclosedir($dh);\n\t\t\t}\n\t\t}\n\t}", "function purgeFiles()\n{\n global $STORE_PATH;\n global $MAX_FILEAGE;\n global $MAX_FILESIZE;\n global $MIN_FILEAGE;\n global $DECAY_EXP;\n\n $numDel = 0; //number of deleted files\n $totalSize = 0; //total size of deleted files\n\n //for each stored file\n foreach (scandir($STORE_PATH) as $file)\n {\n //skip virtual . and .. files\n if ($file == '.' ||\n $file == '..' ||\n $file == '.htaccess' ||\n $file == '.htpasswd')\n {\n continue;\n }\n\n $file = $STORE_PATH . $file;\n\n $fileSize = filesize($file) / (1024*1024); //size in MiB\n $fileAge = (time()-filemtime($file)) / (60*60*24); //age in days\n\n //keep all files below the min age\n if ($fileAge < $MIN_FILEAGE)\n {\n continue;\n }\n\n //calculate the maximum age, in days, for this file\n //minage + (maxage-minage) * (1-(size/maxsize))^exp;\n $fileMaxAge = $MIN_FILEAGE + \n ($MAX_FILEAGE - $MIN_FILEAGE) *\n pow(1-($fileSize/$MAX_FILESIZE),$DECAY_EXP);\n\n //delete if older\n if ($fileAge > $fileMaxAge)\n {\n unlink($file);\n\n printf(\"deleted \\\"%s\\\", %d MiB, %d days old\\n\",\n $file,\n $fileSize,\n $fileAge);\n\n $numDel += 1;\n $totalSize += $fileSize;\n }\n }\n printf(\"Purge finished. Deleted %d files totalling %d MiB\\n\",\n $numDel,\n $totalSize);\n}", "private function cleanup()\n {\n // Remove old temp files\n if (file_exists($this->conf['target_dir']))\n {\n foreach (glob($this->conf['target_dir'] . '/*.part') as $tmpFile)\n {\n if (time() - filemtime($tmpFile) < $this->conf['max_file_age'])\n {\n continue;\n }\n\n if (is_dir($tmpFile))\n {\n self::rrmdir($tmpFile);\n }\n else\n {\n @unlink($tmpFile);\n }\n }\n }\n }", "public function deleteExpiredFiles()\n {\n $this->_garbageCollector->clean();\n }", "function clean_cache() {\n\t\n\t\t// Reduces the amount of cache clearing to save some processor speed\n\t\tif (rand (1, 100) > 10) {\n\t\t\treturn true;\n\t\t}\n\t\n\t\t$files = glob($this->cache_dir . '*', GLOB_BRACE);\n\t\tif (count($files) > $this->cache_max_files) {\n\t\t\t\n\t $yesterday = time () - (24 * 60 * 60);\n\t usort ($files, 'simple_thumbs_filemtime_compare');\n\t $i = 0;\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$i ++;\n\t\n\t\t\t\tif ($i >= $this->cache_max_files_to_delete) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\n\t\t\t\tif (@filemtime ($file) > $yesterday) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\n\t\t\t\tif (file_exists ($file)) {\n\t\t\t\t\tunlink ($file);\n\t\t\t\t}\n\t\n\t\t\t}\n\t\n\t }\n\t\n\t}", "public function clearCache()\n\t{\n\t\t$prefix = preg_replace( \"/^([a-z0-9]+)/\", \"\\\\1\", $this->prefix );\n\t\t$index\t= new FS_File_RegexFilter( $this->pathCache, '/^'.$prefix.'\\w+\\.css$/' );\n\t\tforeach( $index as $file ){\n\t\t\tunlink( $file->getPathname() );\n\t\t}\n\t}", "public function emptyBin( $keepDays = 1 ){\n\n $items = $this->readDir( $this->storageDirectory );\n // Items exclude parent directory!\n $toDelete = $this->generateDeletionList( $keepDays, $items );\n\n if( count( $toDelete ) > 0 ){\n foreach( $toDelete as $itemToDelete){\n $fullPathToDelete = \"{$this->storageDirectory}/{$itemToDelete}\";\n $this->pathSafetyCheck( $fullPathToDelete );\n exec( \"rm -rf {$fullPathToDelete}\" );\n }\n }\n }", "private function clean_files_dir()\n\t{\n\t $dir_name = $this->files_dir();\n\t // Create recursive dir iterator which skips dot folders\n\t $it = new RecursiveDirectoryIterator($dir_name, FilesystemIterator::SKIP_DOTS);\n\n\t // Maximum depth is 1 level deeper than the base folder\n\t //$it->setMaxDepth(1);\n\n\t $oldest = time() - GC_TIME;\n\t // Loop and reap\n\t while($it->valid()) {\n\t\tif ($it->isFile() && filemtime($it->key()) < $oldest) {unlink($it->key());}\n\t\t$it->next();\n\t }\n\t}", "public function clear_old(){\n $getDirectoryContent = scandir(\"$this->xml_directory\");\n foreach ($getDirectoryContent as $file) {\n if ($file != \".\" AND $file != \"..\") {\n $file = \"$this->xml_directory/$file\";\n if ((time()-filemtime(\"$file\") > 7776000)) {\n // delete old files here. The comparision is defaulting to 90 days\n unlink($file);\n }\n }\n }\n }", "protected function cleanupChunks()\n {\n foreach (Storage::disk($this->chunksDisk)->directories($this->chunksDirectory) as $dir) {\n $path = $this->chunksDirectory . DIRECTORY_SEPARATOR . $dir;\n\n if ($time = @filemtime($this->chunksPath . $path)) {\n if (time() - $time > $this->chunksExpireIn) {\n Storage::disk($this->chunksDisk)->deleteDirectory($path);\n }\n }\n }\n }", "function purge() {\n if (is_dir($this->cachedir)) {\n $thisdir = dir($this->cachedir);\n $now = time();\n while( $file=$thisdir->read() ) {\n if ($file!=\".\" && $file!=\"..\") {\n $fname = $this->cachedir . $file;\n\t if (is_dir($fname)) continue;\n $mod = filemtime($fname);\n if ($mod && ($now - $mod > $this->cache_expire)) unlink($fname);\n }\n }\n } elseif (!empty($this->cachedir)) {\n $this->debug_scalar(\"Cache directory (\".$this->cachedir.\") does not exist - purge aborted.\");\n }\n }", "public function removeExpired($maxlifetime);", "public function clearByPrefix($prefix);", "public function clearByPrefix($prefix) {\r\n\t\t$prefix = ( string ) $prefix;\r\n\t\tif ($prefix === '') {\r\n\t\t\tthrow new Exception\\InvalidArgumentException ( 'No prefix given' );\r\n\t\t}\r\n\t\t\r\n\t\t$options = $this->getOptions ();\r\n\t\t$namespace = $options->getNamespace ();\r\n\t\t$nsPrefix = ($namespace === '') ? '' : $namespace . $options->getNamespaceSeparator ();\r\n\t\t$pattern = '/^' . preg_quote ( $nsPrefix . $prefix, '/' ) . '/';\r\n\t\treturn apc_delete ( new BaseApcIterator ( 'user', $pattern, 0, 1, APC_LIST_ACTIVE ) );\r\n\t}", "protected function removeExpiredPathCacheEntries()\n {\n $lastCleanUpFileName = PATH_site . 'typo3temp/realurl_last_clean_up';\n $lastCleanUpTime = @filemtime($lastCleanUpFileName);\n if ($lastCleanUpTime === false || (time() - $lastCleanUpTime >= 6*60*60)) {\n touch($lastCleanUpFileName);\n GeneralUtility::fixPermissions($lastCleanUpFileName);\n /** @noinspection PhpUndefinedMethodInspection */\n $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_realurl_pathcache',\n 'expire>0 AND expire<' . $this->makeExpirationTime());\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists all backups for a specific element.
public function getBackupsByElement($element = null) { return array_filter( $this->all(), function ($backup) use ($element) { return $backup->get('type') == $element; } ); }
[ "public function backupList()\n {\n return $this->getService()->resourceList('Backup', $this->getUrl('backups'), $this);\n }", "function list_backups() {\n\n // Get response from the server.\n $resp = $this->curl_call('act=backups');\n $resp = unserialize($resp);\n return $resp['backups'];\n }", "public function getBackupList () {\r\n\t$this->ensureLoggedIn();\r\n\r\n\treturn $this->request(array('req' => 'getbackuplist'));\r\n\t}", "public function getBackups()\n {\n $this->checkServer();\n\n $response = $this->callApi('get', '/server/'.$this->server);\n $storageId = $response['data']->server->storage_devices->storage_device[0]->storage;\n\n $response = $this->callApi('get', '/storage/'.$storageId);\n $backups = $response['data']->storage->backups->backup;\n\n $index = 1;\n foreach ($backups as $back) {\n $res = $this->callApi('get', '/storage/'.$back);\n $backup = $res['data']->storage;\n if ($backup->origin == $storageId && !empty($storageId)) {\n $output[] = [\n $index,\n date('d-m-Y H:i:s', strtotime($backup->created)),\n ucfirst($backup->access),\n ucfirst($backup->state),\n $backup->title,\n $backup->size,\n '<button class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#confirm-restore\" data-record-id=\"'.$backup->uuid.'\" data-record-title=\"'.$index.'\" ><i class=\"btn-icon fa fa-refresh fa-lg\"></i></button>\n <button class=\"btn btn-danger deleteBackup\" data-record-id=\"'.$backup->uuid.'\" data-record-title=\"'.$index.'\" data-toggle=\"modal\" data-target=\"#confirm-delete\"><i class=\"btn-icon fa fa-trash fa-lg\"></i></button>',\n ];\n ++$index;\n }\n }\n\n $backups['data'] = (!empty($output)) ? $output : [];\n\n return $backups;\n }", "public function getBackups () {\r\n $this->ensureLoggedIn();\r\n\r\n return $this->request(array('req' => 'getbackups'));\r\n }", "public function listBackups(\n $site_env,\n $element = 'all',\n $options = ['format' => 'table']\n ) {\n list(, $env) = $this->getSiteEnv($site_env, 'dev');\n\n switch ($element) {\n case 'all':\n $backup_element = null;\n break;\n case 'db':\n $backup_element = 'database';\n break;\n default:\n $backup_element = $element;\n }\n\n $backups = $env->backups->getFinishedBackups($backup_element);\n $data = [];\n foreach ($backups as $id => $backup) {\n $data[] = [\n 'file' => $backup->get('filename'),\n 'size' => $backup->getSizeInMb(),\n 'date' => $backup->getDate(),\n 'initiator' => $backup->getInitiator(),\n ];\n }\n\n // Return the output data.\n return new RowsOfFields($data);\n }", "public function getBackups()\n\t{\n $data = [];\n \n $req = self::getBdd()->query('SELECT * FROM backup');\n\n while($results = $req->fetch())\n {\n $informations = [\n \"id\" => $results[\"id\"],\n \"date\" => $results[\"dateBackup\"],\n \"comment\" => $results[\"commentBackup\"]\n ];\n\n array_push($data, $informations);\n }\n\n return $data;\n }", "private function list_backup_files() {\n \n // Get backup directory\n $backup_dir = $this->get_backup_directory();\n $backup_dir_url = $this->get_backup_directory( 'url' );\n \n $files = scandir( $backup_dir );\n \n echo '<h3>' . esc_html__( 'List of backups', 'predic-simple-backup' ) . '</h3>';\n \n // Make list of backup files\n echo '<ul>';\n \n foreach ( $files as $file ) {\n \n if ( $file === '.' || $file === '..' ) {\n continue;\n }\n \n $filename = $backup_dir . '/' . $file;\n \n echo '<li>'\n . $file . ' ' . round( filesize( $filename ) / ( 1024 * 1024 ), 2 ) . ' MB '\n . '<a href=\"' . esc_url( $backup_dir_url . '/' . $file ) . '\">' . esc_html__( 'Download', 'predic-simple-backup' ) . '</a> '\n . '<a class=\"ptb-delete-backup\" href=\"' . esc_url( esc_url( admin_url('admin-post.php') ) . '?action=delete_predic_simple_backup&psb_delete_file=' . $file ) . '\">' . esc_html__( 'Delete', 'predic-simple-backup' ) . '</a>'\n . '</li>';\n }\n \n echo '</ul>';\n \n }", "public function getFinishedBackups($element) {\n if ($element != null) {\n $all_backups = $this->getBackupsByElement($element);\n } else {\n $all_backups = $this->all();\n }\n\n if (empty($all_backups)) {\n $message = 'No backups available. Please create one with ';\n $message .= '`terminus site backup create --site={site} --env={env}`';\n throw new TerminusException(\n $message,\n array(\n 'site' => $this->environment->site->get('name'),\n 'env' => $this->environment->get('id')\n ),\n 1\n );\n }\n\n $backups = array_filter(\n $all_backups,\n function($backup) {\n return $backup->backupIsFinished();\n }\n );\n\n return $backups;\n }", "public function getBackups()\n {\n return $this->backups;\n }", "public function getBackups(ProjectDatabaseEntry $database);", "protected function showListOfBackups()\n\t{\n\t\tif( ! $files = File::files($this->destination))\n\t\t\treturn $this->error('No backup files found');\n\n\t\tforeach($files as $key => $file)\n\t\t{\n\t\t\t$date = Carbon::createFromTimeStamp(File::lastModified($file));\n\n\t\t\t$files[$key] = [\n\t\t\t\tbasename($file),\n\t\t\t\t$date->toDateTimeString(),\n\t\t\t\t$date->diffForHumans(),\n\t\t\t\t$this->bytesToHuman(File::size($file)),\n\t\t\t];\n\t\t}\n\n\t\t$this->table(['File', 'Date', 'Age', 'Size'], $files);\n\t}", "public function listBackups($params = [])\n {\n return $this->api->apiRequest('/backup/list', $params);\n }", "public function getBackupsList() {\n $config = $this->getConfig();\n $pattern = '/(backup_([0-9_-]*)_id([0-9]+))\\.(zip|sql)/ui';\n $backups = array();\n\n $dir = @scandir($config['warehouse']);\n\n if (!is_array($dir) || empty($dir)) {\n return array();\n }\n\n foreach ($dir as $file) {\n $backupInfo = $this->getBackupInfoByFilename($file);\n\n if (!empty($backupInfo)) {\n\n $backups[$backupInfo['id']]['ftp'][strtolower($backupInfo['ext'])] = array(\n 'id' => $backupInfo['id'],\n 'name' => $backupInfo['name'],\n 'raw' => $backupInfo['raw'],\n 'ext' => $backupInfo['ext'],\n 'date' => $backupInfo['date'],\n 'time' => $backupInfo['time'],\n );\n }\n }\n krsort($backups);\n return $backups;\n }", "public function getBackups() {\n $this->make(TRUE);\n return $this->imageManager->getBackups();\n }", "function get_archive_list()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n return $this->_get_list(self::FOLDER_BACKUP);\n }", "public function actionAllBackup() {\n\n $dateTime = str_replace(\" \", \"-\", date('Y-m-d h:m:s'));\n $this->doImageBackup($dateTime);\n $this->doImageBackup($dateTime);\n $this->redirect($this->createUrl(\"/backup/default/index\"));\n }", "public function backups()\n {\n return $this->hasMany(AccountBackup::class);\n }", "public function db_backups()\n {\n $backup = $this->services['backups'];\n $backups = $backup->setBackupPath($this->settings['working_directory'])->getAllBackups($this->settings['storage_details']);\n $backup_meta = $backup->getBackupMeta($backups);\n \n $variables = array(\n 'settings' => $this->settings,\n 'backup_meta' => $backup_meta,\n 'backups' => $backups,\n 'errors' => $this->errors,\n 'menu_data' => ee()->backup_pro->get_dashboard_view_menu(),\n 'method' => $this->platform->getPost('method')\n );\n \n ee()->view->cp_page_title = ee()->lang->line('database_backups');\n ee()->jquery->tablesorter('#database_backups table', '{headers: {8: {sorter: false}, 0: {sorter: false}, 1: {sorter: false}, 2: {sorter: false}, 3: {sorter: false}}, widgets: [\"zebra\"], sortList: [[4,1]]}');\n ee()->javascript->compile();\n \n return array(\n 'body' => ee()->load->view('database_backups', $variables, true),\n 'heading' => $this->services['lang']->__('database_backups'),\n 'breadcrumb' => array(\n ee('CP/URL', 'addons/settings/backup_pro')->compile() => lang('backup_pro_module_name'),\n ee('CP/URL', 'addons/settings/backup_pro/index')->compile() => lang('home_bp_dashboard_menu')\n )\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A list of advanced OCR options to finetune OCR behavior. Generated from protobuf field repeated string advanced_ocr_options = 11;
public function getAdvancedOcrOptions() { return $this->advanced_ocr_options; }
[ "public function setAdvancedOcrOptions($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->advanced_ocr_options = $arr;\n\n return $this;\n }", "public function getAdvancedOptions();", "public function LoadAdvancedOptions() {\n return $this->sendRequest('account/loadadvancedoptions', array());\n }", "public function advanced_robots() {\n\t\treturn $this->get_post_advanced_robots( $this->object );\n\t}", "private function getValidAdvancedSettings() {\n return [\n 'bootstrap_mode' => 'manual',\n 'content_replacement_mode' => 'customized',\n 'content_origin' => '08c93130-2e45-45f6-af6d-7c02de8cd90c',\n ];\n }", "public function advanced_robots() {\n\t\t$post = Post::get( Post::get_shop_page_id() );\n\t\t$object = $post->get_object();\n\t\treturn $this->get_post_advanced_robots( $object );\n\t}", "protected function repeated_options() {\n $repeatedoptions = array();\n $repeatedoptions['answerplace']['default'] = '-';\n $repeatedoptions['choices[answer]']['type'] = PARAM_RAW;\n return $repeatedoptions;\n }", "public static function extract_advanced_codes() {\n\n $settings_key = NF_OnepageCRM_Constants::ADVANCED_CODES_KEY;\n\n $advanced_codes_array = array(); //initialize\n\n $nf_settings_array = get_option(' ninja_forms_settings');\n\n if (isset($nf_settings_array[$settings_key])) {\n\n $advanced_codes_setting = $nf_settings_array[$settings_key];\n\n $advanced_codes_array = array_map('trim', explode(',', $advanced_codes_setting));\n }\n\n return $advanced_codes_array;\n }", "public static function get_advanced_robots_defaults() {\n\t\t$screen = get_current_screen();\n\t\t$advanced_robots = Helper::get_settings( 'titles.advanced_robots_global', [] );\n\n\t\tif ( 'post' === $screen->base && Helper::get_settings( \"titles.pt_{$screen->post_type}_custom_robots\" ) ) {\n\t\t\t$advanced_robots = Helper::get_settings( \"titles.pt_{$screen->post_type}_advanced_robots\", [] );\n\t\t}\n\n\t\tif ( 'term' === $screen->base && Helper::get_settings( \"titles.tax_{$screen->taxonomy}_custom_robots\" ) ) {\n\t\t\t$advanced_robots = Helper::get_settings( \"titles.tax_{$screen->taxonomy}_advanced_robots\", [] );\n\t\t}\n\n\t\tif ( in_array( $screen->base, [ 'profile', 'user-edit' ], true ) && Helper::get_settings( 'titles.author_custom_robots' ) ) {\n\t\t\t$advanced_robots = Helper::get_settings( 'titles.author_advanced_robots', [] );\n\t\t}\n\n\t\treturn $advanced_robots;\n\t}", "private function _get_advanced_configuration()\n {\n return <<<EOT\ntheme: \"modern\",\nplugins: [\"table save hr link insertdatetime preview searchreplace print contextmenu fullscreen image imagetools\"],\ntoolbar1: \"cut copy paste | undo redo | searchreplace | alignleft alignjustify alignright | outdent indent | code removeformat | fullscreen\",\ntoolbar2: \"formatselect | bold italic strikethrough subscript superscript | link unlink | bullist numlist | image\",\nextended_valid_elements : \"a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|style],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]\",\nimage_advtab: true,\n{$this->_get_imagetools_configuration()}\nEOT;\n }", "public function setAdditionalOptions($var)\n {\n $arr = GPBUtil::checkMapField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->additional_options = $arr;\n\n return $this;\n }", "public function getAdvancedOptionsConfig()\n {\n return $this->advanced_options_config;\n }", "function &getReviewerRecommendationOptions() {\n\t\t// Bring in reviewer constants\n\t\timport('classes.submission.reviewer.ReviewerSubmission');\n\n\t\tstatic $reviewerRecommendationOptions = array(\n\t\t\t'' => 'common.chooseOne',\n\t\t\tSUBMISSION_REVIEWER_RECOMMENDATION_ACCEPT => 'reviewer.paper.decision.accept',\n\t\t\tSUBMISSION_REVIEWER_RECOMMENDATION_PENDING_REVISIONS => 'reviewer.paper.decision.pendingRevisions',\n\t\t\tSUBMISSION_REVIEWER_RECOMMENDATION_RESUBMIT_ELSEWHERE => 'reviewer.paper.decision.resubmitElsewhere',\n\t\t\tSUBMISSION_REVIEWER_RECOMMENDATION_DECLINE => 'reviewer.paper.decision.decline',\n\t\t\tSUBMISSION_REVIEWER_RECOMMENDATION_SEE_COMMENTS => 'reviewer.paper.decision.seeComments'\n\t\t);\n\t\treturn $reviewerRecommendationOptions;\n\t}", "protected function composeOwlCarouselOptions()\n {\n $defaultOptions = [\n 'id' => $this->owlCarouselId,\n 'class' => $this->owlCarouselClass,\n ];\n $options = ArrayHelper::merge($this->additionalOptions, $defaultOptions);\n return $options;\n }", "protected function getDefaultSearchAppearanceOptions() {\n\t\t// phpcs:disable WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound\n\t\treturn [\n\t\t\t'show' => [ 'type' => 'boolean', 'default' => true ],\n\t\t\t'advanced' => [\n\t\t\t\t'robotsMeta' => [\n\t\t\t\t\t'default' => [ 'type' => 'boolean', 'default' => true ],\n\t\t\t\t\t'noindex' => [ 'type' => 'boolean', 'default' => false ],\n\t\t\t\t\t'nofollow' => [ 'type' => 'boolean', 'default' => false ],\n\t\t\t\t\t'noarchive' => [ 'type' => 'boolean', 'default' => false ],\n\t\t\t\t\t'noimageindex' => [ 'type' => 'boolean', 'default' => false ],\n\t\t\t\t\t'notranslate' => [ 'type' => 'boolean', 'default' => false ],\n\t\t\t\t\t'nosnippet' => [ 'type' => 'boolean', 'default' => false ],\n\t\t\t\t\t'noodp' => [ 'type' => 'boolean', 'default' => false ],\n\t\t\t\t\t'maxSnippet' => [ 'type' => 'number', 'default' => -1 ],\n\t\t\t\t\t'maxVideoPreview' => [ 'type' => 'number', 'default' => -1 ],\n\t\t\t\t\t'maxImagePreview' => [ 'type' => 'string', 'default' => 'large' ]\n\t\t\t\t],\n\t\t\t\t'showDateInGooglePreview' => [ 'type' => 'boolean', 'default' => true ],\n\t\t\t\t'showPostThumbnailInSearch' => [ 'type' => 'boolean', 'default' => true ],\n\t\t\t\t'showMetaBox' => [ 'type' => 'boolean', 'default' => true ]\n\t\t\t]\n\t\t];\n\t\t// phpcs:enable WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound\n\t}", "protected static function allowedOptions() {\n $additional = array(\n 'dir' => 1,\n 'lang' => 1,\n 'xml:lang' => 1,\n 'accept' => 1,\n 'accept-charset' => 1,\n 'enctype' => 1,\n 'target' => 1,\n 'widgetsInContainer' => 2,\n 'captcha' => 2,\n 'type' => 2\n );\n return array_merge(One_Form_Container_Abstract::allowedOptions(), $additional);\n }", "function mfcs_get_reviewer_decision_list_options($option = NULL, $restriction = 0, $hidden = FALSE, $disabled = FALSE) {\n $options = array();\n $options_all = array();\n\n if ($hidden) {\n $options_all[MFCS_REVIEW_DECISION_NONE] = 'None';\n $options_all[MFCS_REVIEW_DECISION_CLOSE] = 'Close';\n $options_all[MFCS_REVIEW_DECISION_CANCEL] = 'Cancel';\n $options_all[MFCS_REVIEW_DECISION_UNCANCEL] = 'Uncancel';\n $options_all[MFCS_REVIEW_DECISION_REASSIGN_COORDINATOR] = 'Re-Assign Venue Coordinator';\n $options_all[MFCS_REVIEW_DECISION_OVERRIDE] = 'Override';\n $options_all[MFCS_REVIEW_DECISION_MOVE] = 'Move';\n $options_all[MFCS_REVIEW_DECISION_REASSIGN_REQUESTER] = 'Re-Assign Requester';\n $options_all[MFCS_REVIEW_DECISION_MANAGER_RECHECK] = 'Manager Recheck';\n $options_all[MFCS_REVIEW_DECISION_AMENDMENT] = 'Amendment';\n }\n\n if ($disabled) {\n $options_all[MFCS_REVIEW_DECISION_WAIVE] = 'Waive';\n }\n\n $options_all[MFCS_REVIEW_DECISION_APPROVE] = 'Approve';\n $options_all[MFCS_REVIEW_DECISION_COMMENT] = 'Comment';\n $options_all[MFCS_REVIEW_DECISION_COMMENT_ALL] = 'Comment';\n $options_all[MFCS_REVIEW_DECISION_DENY] = 'Deny';\n $options_all[MFCS_REVIEW_DECISION_REQUIREMENT] = 'Requirement';\n $options_all[MFCS_REVIEW_DECISION_AVAILABLE] = 'Available';\n $options_all[MFCS_REVIEW_DECISION_UNAVAILABLE] = 'Unavailable';\n $options_all[MFCS_REVIEW_DECISION_ISSUES] = 'Issues';\n $options_all[MFCS_REVIEW_DECISION_ISSUES_NONE] = 'No Issues';\n\n if ($option == 'select' || $option == 'review_step') {\n $options[''] = '- Select -';\n }\n\n if (!is_int($restriction)) {\n $restriction = MFCS_RESTRICTION_DECISION_NONE;\n }\n\n if ($restriction == MFCS_RESTRICTION_DECISION_NONE) {\n foreach ($options_all as $option_id => $option_name) {\n $options[$option_id] = $option_name;\n }\n\n // these options are hidden from the users.\n if ($option == 'review_step') {\n unset($options[MFCS_REVIEW_DECISION_AMENDMENT]);\n unset($options[MFCS_REVIEW_DECISION_WAIVE]);\n }\n\n asort($options);\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_REQUESTER) {\n if (array_key_exists(MFCS_REVIEW_DECISION_COMMENT_ALL, $options_all)) {\n $options[MFCS_REVIEW_DECISION_COMMENT_ALL] = $options_all[MFCS_REVIEW_DECISION_COMMENT_ALL];\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_VENUE_COORDINATOR) {\n foreach (array(MFCS_REVIEW_DECISION_AVAILABLE, MFCS_REVIEW_DECISION_UNAVAILABLE, MFCS_REVIEW_DECISION_COMMENT, MFCS_REVIEW_DECISION_REQUIREMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_REVIEWER) {\n foreach (array(MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_COMMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_APPROVER) {\n foreach (array(MFCS_REVIEW_DECISION_APPROVE, MFCS_REVIEW_DECISION_DENY, MFCS_REVIEW_DECISION_COMMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_MANAGER) {\n foreach (array(MFCS_REVIEW_DECISION_AVAILABLE, MFCS_REVIEW_DECISION_UNAVAILABLE, MFCS_REVIEW_DECISION_APPROVE, MFCS_REVIEW_DECISION_DENY, MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_REQUIREMENT, MFCS_REVIEW_DECISION_COMMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_ADMINISTER) {\n foreach (array(MFCS_REVIEW_DECISION_AVAILABLE, MFCS_REVIEW_DECISION_UNAVAILABLE, MFCS_REVIEW_DECISION_APPROVE, MFCS_REVIEW_DECISION_DENY, MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_REQUIREMENT, MFCS_REVIEW_DECISION_COMMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_COMMENT_ONLY) {\n if (array_key_exists(MFCS_REVIEW_DECISION_COMMENT, $options_all)) {\n $options[MFCS_REVIEW_DECISION_COMMENT] = $options_all[MFCS_REVIEW_DECISION_COMMENT];\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_FINANCER) {\n foreach (array(MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_COMMENT, MFCS_REVIEW_DECISION_REQUIREMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_INSURER) {\n foreach (array(MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_COMMENT, MFCS_REVIEW_DECISION_REQUIREMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n\n\n return $options;\n}", "public function getOptions()\n\t{\n\t\t$options = array(\n\t\t\t1 => JText::_('PLG_FIELDS_TCCHECKBOX_TERMSANDCONDITIONS_ACCETED')\n\t\t);\n\n\t\treturn $options;\n\t}", "private function add_fields_advanced_options() {\n\n add_settings_field(\n $this->get_field_id(PTB_Custom_Taxonomy::IS_HIERARCHICAL), __('Hierarchical', 'ptb'), array($this, 'ctx_is_hierarchical_cb'), $this->slug_admin_ctx, $this->settings_section_ad, array('label_for' => $this->get_field_id(PTB_Custom_Taxonomy::IS_HIERARCHICAL))\n );\n\n $fields = array(\n PTB_Custom_Taxonomy::AD_PUBLICLY_QUERYABLE => __('Publicly Queryable', 'ptb'),\n PTB_Custom_Taxonomy::AD_SHOW_UI => __('Show UI', 'ptb'),\n PTB_Custom_Taxonomy::AD_SHOW_TAG_CLOUD => __('Show Tag Cloud', 'ptb'),\n PTB_Custom_Taxonomy::AD_SHOW_ADMIN_COLUMN => __('Show Admin Column', 'ptb')\n );\n\n foreach ($fields as $key => $label) {\n\n add_settings_field(\n $this->get_field_id($key), $label, array($this, 'add_fields_advanced_options_cb'), $this->slug_admin_ctx, $this->settings_section_ad, array(\n 'label_for' => $this->get_field_id($key),\n 'referrer' => $key\n )\n );\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the argument position (used in the argument chain)
public function incrementArgumentPosition() { $this->argument++; }
[ "public function updatedArguments(): array;", "public function getArgumentPosition()\n {\n return $this->argumentPosition;\n }", "protected function updateDynamicArguments() : void {}", "protected function setArgument() {}", "protected function setArguments()\n {\n }", "function shiftArgs() {\n\t\treturn array_shift($this->args);\n\t}", "function _handleFunction_position($arguments, $context) {\n return $context['pos'];\n }", "public function getArgumentPosition()\n {\n return $this->argument;\n }", "public function incrementPosition()\n {\n ++$this->position;\n }", "public function getArgumentOffset() {\n $offset = 2; \n if (isset($this->route['directory']))\n $offset += count($this->route['directory']);\n return $offset;\n }", "function shiftArgs() {\n if (empty($this->args)) {\n return false;\n }\n unset($this->args[0]);\n $this->args = array_values($this->args);\n return true;\n }", "function setArguments($value) {\n $this->arguments = $value;\n }", "public function getArgumentOrder() {\n return $this->argN;\n }", "public static function setArgument($name,$value)\n\t{\n\t\tself::$currentArguments[$name]=$value;\n\t}", "public function testArgumentsRewriting(): void\n {\n $isOverwritten = $this->command->getThird()->isIndicated();\n\n self::assertTrue($isOverwritten);\n }", "private function markArgumentDefined($position)\r\n {\r\n $this->definedArguments[$position] = true;\r\n }", "public function setArguments($arguments) { }", "public function increase(): void\n {\n $args = func_get_args();\n\n foreach ($args as $arg) {\n if (is_array($arg) || $arg instanceof Traversable) {\n foreach ($arg as $element) {\n $this->increase($element);\n }\n } else {\n $this->copy($this->add($arg));\n }\n }\n }", "public function arg_pos($p){\n\t\t$p -= 1;\n\t\tif(isset($this->args[$p]) and !empty($this->args[$p])){\n\t\t\treturn $this->args[$p];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'distributionGroupsAddApps'
protected function distributionGroupsAddAppsRequest($org_name, $distribution_group_name, $apps) { // verify the required parameter 'org_name' is set if ($org_name === null || (is_array($org_name) && count($org_name) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $org_name when calling distributionGroupsAddApps' ); } // verify the required parameter 'distribution_group_name' is set if ($distribution_group_name === null || (is_array($distribution_group_name) && count($distribution_group_name) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $distribution_group_name when calling distributionGroupsAddApps' ); } // verify the required parameter 'apps' is set if ($apps === null || (is_array($apps) && count($apps) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $apps when calling distributionGroupsAddApps' ); } $resourcePath = '/v0.1/orgs/{org_name}/distribution_groups/{distribution_group_name}/apps'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($org_name !== null) { $resourcePath = str_replace( '{' . 'org_name' . '}', ObjectSerializer::toPathValue($org_name), $resourcePath ); } // path params if ($distribution_group_name !== null) { $resourcePath = str_replace( '{' . 'distribution_group_name' . '}', ObjectSerializer::toPathValue($distribution_group_name), $resourcePath ); } // body params $_tempBody = null; if (isset($apps)) { $_tempBody = $apps; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { $httpBody = \GuzzleHttp\json_encode($httpBody); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); } } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-API-Token'); if ($apiKey !== null) { $headers['X-API-Token'] = $apiKey; } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "protected function distributionGroupsCreateRequest($owner_name, $app_name, $distribution_group)\n {\n // verify the required parameter 'owner_name' is set\n if ($owner_name === null || (is_array($owner_name) && count($owner_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $owner_name when calling distributionGroupsCreate'\n );\n }\n // verify the required parameter 'app_name' is set\n if ($app_name === null || (is_array($app_name) && count($app_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $app_name when calling distributionGroupsCreate'\n );\n }\n // verify the required parameter 'distribution_group' is set\n if ($distribution_group === null || (is_array($distribution_group) && count($distribution_group) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $distribution_group when calling distributionGroupsCreate'\n );\n }\n\n $resourcePath = '/v0.1/apps/{owner_name}/{app_name}/distribution_groups';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($owner_name !== null) {\n $resourcePath = str_replace(\n '{' . 'owner_name' . '}',\n ObjectSerializer::toPathValue($owner_name),\n $resourcePath\n );\n }\n // path params\n if ($app_name !== null) {\n $resourcePath = str_replace(\n '{' . 'app_name' . '}',\n ObjectSerializer::toPathValue($app_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($distribution_group)) {\n $_tempBody = $distribution_group;\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\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-API-Token');\n if ($apiKey !== null) {\n $headers['X-API-Token'] = $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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function deploymentgroupsAddRequest($organization, $body, $project, $apiVersion)\n {\n // verify the required parameter 'organization' is set\n if ($organization === null || (is_array($organization) && count($organization) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $organization when calling deploymentgroupsAdd'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling deploymentgroupsAdd'\n );\n }\n // verify the required parameter 'project' is set\n if ($project === null || (is_array($project) && count($project) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $project when calling deploymentgroupsAdd'\n );\n }\n // verify the required parameter 'apiVersion' is set\n if ($apiVersion === null || (is_array($apiVersion) && count($apiVersion) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $apiVersion when calling deploymentgroupsAdd'\n );\n }\n\n $resourcePath = '/{organization}/{project}/_apis/distributedtask/deploymentgroups';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($apiVersion !== null) {\n $queryParams['api-version'] = ObjectSerializer::toQueryValue($apiVersion);\n }\n\n // path params\n if ($organization !== null) {\n $resourcePath = str_replace(\n '{' . 'organization' . '}',\n ObjectSerializer::toPathValue($organization),\n $resourcePath\n );\n }\n // path params\n if ($project !== null) {\n $resourcePath = str_replace(\n '{' . 'project' . '}',\n ObjectSerializer::toPathValue($project),\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 \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token) OR HTTP Basic Authentication with personal access token\n if ($this->config->getAccessToken() !== null) {\n\t\t\t$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n\t\t}\n\n\t\tif ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n\t\t\t$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n\t\t}\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function distributionGroupsGetRequest($owner_name, $app_name, $distribution_group_name)\n {\n // verify the required parameter 'owner_name' is set\n if ($owner_name === null || (is_array($owner_name) && count($owner_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $owner_name when calling distributionGroupsGet'\n );\n }\n // verify the required parameter 'app_name' is set\n if ($app_name === null || (is_array($app_name) && count($app_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $app_name when calling distributionGroupsGet'\n );\n }\n // verify the required parameter 'distribution_group_name' is set\n if ($distribution_group_name === null || (is_array($distribution_group_name) && count($distribution_group_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $distribution_group_name when calling distributionGroupsGet'\n );\n }\n\n $resourcePath = '/v0.1/apps/{owner_name}/{app_name}/distribution_groups/{distribution_group_name}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($owner_name !== null) {\n $resourcePath = str_replace(\n '{' . 'owner_name' . '}',\n ObjectSerializer::toPathValue($owner_name),\n $resourcePath\n );\n }\n // path params\n if ($app_name !== null) {\n $resourcePath = str_replace(\n '{' . 'app_name' . '}',\n ObjectSerializer::toPathValue($app_name),\n $resourcePath\n );\n }\n // path params\n if ($distribution_group_name !== null) {\n $resourcePath = str_replace(\n '{' . 'distribution_group_name' . '}',\n ObjectSerializer::toPathValue($distribution_group_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-API-Token');\n if ($apiKey !== null) {\n $headers['X-API-Token'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function AddDistributionGroupToImList($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "public function addUserGroupServiceGroupsRequest($options)\n {\n // unbox the parameters from the associative array\n $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null;\n $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null;\n\n // verify the required parameter 'user_group_id' is set\n if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $user_group_id when calling addUserGroupServiceGroups'\n );\n }\n\n $resourcePath = '/user-groups/{user_group_id}/service-groups';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($user_group_id !== null) {\n $resourcePath = str_replace(\n '{' . 'user_group_id' . '}',\n ObjectSerializer::toPathValue($user_group_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 ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($request_body)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($request_body));\n } else {\n $httpBody = $request_body;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\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 $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function listAppsRequest()\n {\n\n $resourcePath = '/v2/apps';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($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 $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 }", "protected function taskgroupsAddRequest($organization, $body, $project, $apiVersion)\n {\n // verify the required parameter 'organization' is set\n if ($organization === null || (is_array($organization) && count($organization) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $organization when calling taskgroupsAdd'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling taskgroupsAdd'\n );\n }\n // verify the required parameter 'project' is set\n if ($project === null || (is_array($project) && count($project) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $project when calling taskgroupsAdd'\n );\n }\n // verify the required parameter 'apiVersion' is set\n if ($apiVersion === null || (is_array($apiVersion) && count($apiVersion) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $apiVersion when calling taskgroupsAdd'\n );\n }\n\n $resourcePath = '/{organization}/{project}/_apis/distributedtask/taskgroups';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($apiVersion !== null) {\n $queryParams['api-version'] = ObjectSerializer::toQueryValue($apiVersion);\n }\n\n // path params\n if ($organization !== null) {\n $resourcePath = str_replace(\n '{' . 'organization' . '}',\n ObjectSerializer::toPathValue($organization),\n $resourcePath\n );\n }\n // path params\n if ($project !== null) {\n $resourcePath = str_replace(\n '{' . 'project' . '}',\n ObjectSerializer::toPathValue($project),\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 \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token) OR HTTP Basic Authentication with personal access token\n if ($this->config->getAccessToken() !== null) {\n\t\t\t$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n\t\t}\n\n\t\tif ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n\t\t\t$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n\t\t}\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function driveGroupsAddRequest($drive_group, $raw = false, $x_apideck_consumer_id = null, $x_apideck_app_id = null, $x_apideck_service_id = null)\n {\n // verify the required parameter 'drive_group' is set\n if ($drive_group === null || (is_array($drive_group) && count($drive_group) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $drive_group when calling driveGroupsAdd'\n );\n }\n\n $resourcePath = '/file-storage/drive-groups';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($raw !== null) {\n if('form' === 'form' && is_array($raw)) {\n foreach($raw as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['raw'] = $raw;\n }\n }\n\n // header params\n if ($x_apideck_consumer_id !== null) {\n $headerParams['x-apideck-consumer-id'] = ObjectSerializer::toHeaderValue($x_apideck_consumer_id);\n }\n // header params\n if ($x_apideck_app_id !== null) {\n $headerParams['x-apideck-app-id'] = ObjectSerializer::toHeaderValue($x_apideck_app_id);\n }\n // header params\n if ($x_apideck_service_id !== null) {\n $headerParams['x-apideck-service-id'] = ObjectSerializer::toHeaderValue($x_apideck_service_id);\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($drive_group)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($drive_group));\n } else {\n $httpBody = $drive_group;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = $this->config->getDefaultHeaders();\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 groupAdminsCreateRequest($group_id, $group_admins_create_request)\n {\n // verify the required parameter 'group_id' is set\n if ($group_id === null || (is_array($group_id) && count($group_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $group_id when calling groupAdminsCreate'\n );\n }\n // verify the required parameter 'group_admins_create_request' is set\n if ($group_admins_create_request === null || (is_array($group_admins_create_request) && count($group_admins_create_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $group_admins_create_request when calling groupAdminsCreate'\n );\n }\n\n $resourcePath = '/groups/{groupId}/admins';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($group_id !== null) {\n $resourcePath = str_replace(\n '{' . 'groupId' . '}',\n ObjectSerializer::toPathValue($group_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 ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($group_admins_create_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($group_admins_create_request));\n } else {\n $httpBody = $group_admins_create_request;\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 OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createAffinityGroup(Request $request){\r\n\tAffinityGroup::create(\r\n\t\t\t['name' => $request->input('name'),\r\n\t\t\t 'description' => $request->input('description')\r\n \t\t\t]);\r\n\treturn $this->getAdminManagement();\r\n}", "function create_groupings() {\n print \"MailChimp::create_groupings() start\\n\";\n\n // Get id of 'programs' grouping, creating if necessary.\n $interest_groupings = $this->run_api_query('listInterestGroupings', array($this->list_id));\n if ($this->verbose) {\n // $this->util->printr($interest_groupings, 'interest_groupings', true);\n }\n\n // Iterate through existing groupings to find 'programs'\n if (isset($interest_groupings)) {\n foreach ($interest_groupings as $interest_grouping) {\n if ($interest_grouping['name'] == self::GROUPING_PROGRAMS) {\n\t $this->programs_grouping_id = $interest_grouping['id'];\n\t}\n }\n }\n\n // Create 'programs' interest grouping if necessary.\n if (!$this->programs_grouping_id) {\n $params = array($this->list_id, self::GROUPING_PROGRAMS, 'hidden', array(self::EMPTY_GROUP));\n $this->programs_grouping_id = $this->run_api_query('listInterestGroupingAdd', $params);\n print \"MailChimp::create_groupings(): Creating groupings '\" . self::GROUPING_PROGRAMS . \"'\\n\";\n }\n print \"MailChimp::create_groupings() end\\n\";\n }", "protected function addAppRequest($body = null)\n {\n\n $resourcePath = '/v2/apps';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\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 = \\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('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 $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function appManagementPolicies(): AppManagementPoliciesRequestBuilder {\n return new AppManagementPoliciesRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public function createAServiceGroupRequest($options)\n {\n // unbox the parameters from the associative array\n $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null;\n\n\n $resourcePath = '/service-groups';\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($request_body)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($request_body));\n } else {\n $httpBody = $request_body;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\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 $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function addAction()\n {\n $apiApp = new Ot_Model_DbTable_ApiApp();\n\n $form = new Ot_Form_ApiApp();\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n $data = array(\n 'name' => $form->getValue('name'),\n 'description' => $form->getValue('description'),\n 'website' => $form->getValue('website'),\n 'accountId' => $this->_userData['accountId'],\n );\n\n $apiApp->insert($data);\n\n $this->_helper->messenger->addSuccess('ot-apiapp-add:successfullyRegistered');\n\n $this->_helper->redirector->gotoRoute(array('tab' => 'apps', 'accountId' => $this->_userData['accountId']), 'account', true);\n\n } else {\n $this->_helper->messenger->addError('ot-apiapp-add:problemSubmitting');\n }\n }\n\n $this->_helper->pageTitle('ot-apiapp-add:title');\n\n $this->view->assign(array(\n 'form' => $form,\n ));\n\n }", "public function groupSubscriptionAction()\n {\n $layout = $this->layout();\n $layout->setTemplate('layout/simple');\n $request = $this->getRequest();\n $data = array();\n if($request->isPost())\n {\n $post = $request->getPost()->toArray();\n $data = $this->getStructureBuilderTable()->subscribeApplication($post);\n }\n print json_encode($data);\n exit;\n }", "public function create_new_api_app() {\n \n (new MidrubBaseAdminCollectionSettingsHelpers\\Oauth)->create_new_api_app();\n \n }", "public function testAddAppFromApi()\n {\n $result = $this->algoliaHelper->addAppFromApi(\n $this->getSampleApplicationWithMissingName()\n );\n $this->assertArrayHasKey('errors', $result);\n\n $result = $this->algoliaHelper->addAppFromApi(\n $this->getSampleApplicationWithNonNumericRank()\n );\n $this->assertArrayHasKey('errors', $result);\n }", "public function postApplications()\n {\n return '{\n \"id\": \"3aad1e92-3255-461b-8129-854025a5e7ab\",\n \"name\": \"Im testing an app\",\n \"description\": \"With some kind of description\",\n \"pushApplicationID\": \"dc5df3f3-2609-4547-9cc5-a844fc3b09e3\",\n \"masterSecret\": \"3faf2c75-72eb-4fc1-bc01-edb3206ec58b\",\n \"developer\": \"user\",\n \"variants\": []\n}';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load district by id
public function loadById($districtId);
[ "public function loadByName($name, $districtId);", "public function findById($id)\n {\n return $this->district->findOrFail($id);\n }", "function getCleverDistrict($id){\n\t\treturn $this->ping(new \\CleverDistrict($id), \"refresh\");\n\t\t// return \\CleverDistrict::retrieve($id);\n\t}", "function db_load_district_list()\r\n {\r\n $this->districts = array();\r\n $dbmgr = new DB_Mgr(\"sites\");\r\n $select = \"SELECT * FROM SI_DISTRICT ORDER BY region_num, district_num\";\r\n $dbmgr->query($select);\r\n while($row = $dbmgr->get_a_row())\r\n {\r\n $tmp = new District($row[0], $row[2], $row[3], $row[1]);\r\n array_push($this->districts, $tmp);\r\n }\r\n }", "public function get_district_list($id){\n\t\t$this->set('districtList', $this->Client->load_district_post($id));\n\t}", "public function district($id)\n {\n $districts = SenatorialDistrict::where('state_id', $id)->orderBy('senatorial_district')->get();\n\n return view('partials.district')->with(['districts' => $districts]);\n }", "public function getDistrictById($id)\n\t{\n\t\t$district = $this->getContent($this->geoDomain . 'api/districts/' . $id);\n\n\t\treturn $district;\n\t}", "public function show($id)\n {\n $district = District::find($id);\n // Check if district is not in the DB\n if ($district === null) {\n return response()->json([\n 'action' => 'show',\n 'status' => 'FAIL',\n 'entity' => NULL,\n 'type' => 'district',\n 'user' => Config::get('apiuser')\n ], 404);\n }\n else {\n // List the details of a specific district\n DistrictResource::WithoutWrapping();\n return new DistrictResource(District::find($id));\n }\n }", "public function getDistrictId();", "public function loadDiaNode($id);", "public function load($id)\n {\n // SELECT query on database\n $this->data = $this->db->query('SELECT ' . $this->db->fieldName('id') . ', ' . $this->db->fieldName('name') . ', ' . $this->db->fieldName('owner_id') . ', ' . $this->db->fieldName('creationdate') . ' FROM ' . $this->db->tableName('guilds') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . (int) $id)->fetch();\n }", "public function load($id)\n {\n // SELECT query on database\n $this->data = $this->db->query('SELECT ' . $this->db->fieldName('id') . ', ' . $this->db->fieldName('player_id') . ', ' . $this->db->fieldName('date') . ', ' . $this->db->fieldName('level') . ' FROM ' . $this->db->tableName('player_deaths') . ' WHERE ' . $this->db->fieldName('id') . ' = ' . (int) $id)->fetch();\n }", "public function getDistrict ($division_id) \n {\n $districts = District::select(\"id\",\"name\")->where(\"division_id\",$division_id)->get();\n\n $dataList = array(\n 'districts' => $districts,\n );\n\n $appendDistrict = view('abasvumi.ajax_html.district', $dataList)->render();\n\n return response()->json([\n 'districts' => $appendDistrict\n ]);\n }", "public function loadOne($id)\n {\n }", "public function district()\n {\n return $this->hasOne('App\\District','id','district_id');\n }", "public function ajaxselectdistrictAction()\r\n {\r\n $cityId = isset($_GET['cityId']) ? $_GET['cityId'] : 0;\r\n $dataDistricts = $this->objectimmoRepository->getDistricts($cityId);\r\n $districts = $this->selectDistricts($dataDistricts);\r\n\r\n $this->view->setTemplatePathAndFilename('typo3conf/ext/' .$this->request->getControllerExtensionKey() .'/Resources/Private/Templates/Ajaxselectdistrict.html');\r\n $ajaxcontent = $this->view->assign('districts', $districts);\r\n }", "function getDivisionIdFromDistrictId($id) {\n if(!$id > 0){\n return \"\";\n }\n $sql = \"SELECT * FROM dghshrml4_districts WHERE id = $id AND is_active LIKE 1\";\n $result = mysql_query($sql) or die(mysql_error() . \"<p><b>Code:getDivisionNameFromid || Query:</b><br />___<br />$sql</p>\");\n\n $data = mysql_fetch_assoc($result);\n\n if (mysql_num_rows($result) > 0) {\n return $data['division_id'];\n } else {\n return \"\";\n } \n}", "public function get_district($district_id,$province_lang){\n\n\t\t$str_select=$this->_table.\".*\";\n\t\t$arr_where=array($this->_table.'.district_id'=>$district_id,'province.province_lang'=>$province_lang);\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->join('province',$this->_table.'.province_id=province.province_id');\n\t\t$this->db->where($arr_where);\n\n\t\t$query=$this->db->get($this->_table);\n\t\treturn $query->row_array();\n\n\t}", "public function LoadByID($id) {\n\t\t$this->ID = $id;\n\t\t$this->loadFullDetails();\n\t\t$this->hasLoadedFullDetails = true;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a injector as a callable having the signature function(TraceContext $context, &$carrier): void The injector replaces a propagated field with the given value so it is very important the carrier is being passed by reference.
public function getInjector(Setter $setter): callable;
[ "public static function inject(Baggage $context, &$carrier, PropagationSetter $setter) : void;", "public static function extract($carrier, PropagationGetter $getter): SpanContext;", "public static function wrap_( $value ) {\n return function() use( $value ) { return $value; };\n }", "abstract public function inject(Span $span, $format, &$carrier);", "public function decorate($value) {\n foreach ($this->chain as $decorator) {\n $value = $decorator->decorate($value);\n }\n\n return $value;\n }", "protected static function resolveFunction(self &$target)\n {\n return function ($value = null) use (&$target) {\n if ($target !== null) {\n $target->settle(resolve($value, $target->sharedData));\n $target = null;\n }\n };\n }", "public function setCaller(?Endpoint $value): void {\n $this->getBackingStore()->set('caller', $value);\n }", "public function setInjectOrSetMethod($value)\n {\n $this->injectOrSetMethod = 'set';\n }", "public function inject(SpanContext $context, $container);", "private function createInjectionProvider($value): InjectionProvider\n {\n return NewInstance::of(InjectionProvider::class)\n ->returns(['get' => $value]);\n }", "public function injectContextToRequest($context, &$request)\n {\n $injector = $this->getTracing()->getPropagation()->getInjector(new RequestHeaders());\n $injector($context, $request);\n }", "protected function requestRebinder()\n {\n return function ($app, $request) {\n $app['url']->setRequest($request);\n };\n }", "public function setInjector($injector);", "protected function resolveMiddlewarePipeline(string $value): callable\n\t{\n\t\t$value = strstr($value, '|', true);\n\t\t$instantiator = $this->instantiator;\n\t\t$middleware = $instantiator(\\Weave\\Middleware\\Middleware::class);\n\t\treturn function (Request $request, $response = null) use ($middleware, $value) {\n\t\t\treturn $middleware->chain($value, $request, $response);\n\t\t};\n\t}", "public function toConstant($value): IDIBindTo;", "public function resolveField(FieldValue $value)\n {\n $directive = $this->fieldDirective($value->getField(), $this->name());\n $resolver = $this->getResolver($value, $directive);\n $method = $this->getResolverMethod($directive);\n $data = $this->argValue(collect($directive->arguments)->first(function ($arg) {\n return 'args' === data_get($arg, 'name.value');\n }));\n\n return $value->setResolver(function ($root, array $args, $context = null, $info = null) use ($resolver, $method, $data) {\n $instance = app($resolver);\n\n return call_user_func_array(\n [$instance, $method],\n [$root, array_merge($args, ['directive' => $data]), $context, $info]\n );\n });\n }", "public function provideReplacement();", "public function __invoke($value);", "protected function getDebug_LogProcessorService()\n {\n return $this->privates['debug.log_processor'] = new \\Symfony\\Bridge\\Monolog\\Processor\\DebugProcessor(($this->services['request_stack'] ?? ($this->services['request_stack'] = new \\Symfony\\Component\\HttpFoundation\\RequestStack())));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the Currency object with $iso4217
public function getByIso4217(string $iso4217){ return Currency::where('iso_4217', $iso4217)->first(); }
[ "function iban_country_get_currency_iso4217($iban_country) {\n return _iban_country_get_info($iban_country,'currency_iso4217');\n}", "public function getCurrency();", "public function getCurrencyConverter();", "public function getBaseCurrency();", "public function getBaseCurrencyCode();", "function currGetCurrencyByISO3( $iso3 ){\r\n\t\r\n\t$row = db_phquery_fetch( DBRFETCH_ROW, \"SELECT * FROM ?#CURRENCY_TYPES_TABLE WHERE currency_iso_3=?\", $iso3);\r\n\tif (!$row)$row = NULL;\r\n\telse LanguagesManager::ml_fillFields(CURRENCY_TYPES_TABLE, $row);\r\n\t\r\n\treturn $row;\r\n}", "public function getCurrencyCode();", "public function getIso4217(){\n return $this->iso_4217;\n }", "public function getById($id): Currency;", "public function getCurrency()\n {\n }", "public function getToCurrency();", "public function getCurrencyPair(): CurrencyPair;", "public static function currency()\n {\n try {\n return new Currency(setting('units.currency', 'USD'));\n } catch (\\OutOfBoundsException $e) {\n return new Currency('USD');\n }\n }", "public function getSourceCurrency();", "public function testCanSetGetIso4217(){\n $currency = new Currency;\n $currency->setIso4217('SEK');\n $this->assertTrue($currency->getIso4217() === 'SEK');\n }", "public function getProductCurrency();", "private static function getISO4217(): ISO4217Interface\n {\n if (self::$iso4217 === null) {\n self::$iso4217 = new ISO4217();\n }\n\n return self::$iso4217;\n }", "public function getCurrencyPair();", "public function getDefaultCurrency(): string;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
We call this to bootstrap the CMS. Typically we put this in the index.php file. We pass in the vendor path so we can find our php framework and kick off the app. We return the path to included from the index.php require '../vendor/autoload.php'; include_once CMS::boostrap('../vendor');
public static function boostrap($vendor = '../') { // Set defines define('ENVIRONMENT', 'development'); define('VENDOR_PATH', $vendor); // Setup paths self::$_root_path = getcwd(); // We set the default CMS prefix because the frameworks will not do this. CMS\Libraries\Config::set('table_base', 'CMS_'); // If we passed in a file we also load that. // A file passed in trumps everything. CMS\Libraries\Config::load_configs_from_file(); return $vendor . '/cloudmanic/cloudmanic-cms/src/start.php'; }
[ "protected function includeAndStartCoreBootstrap() {}", "public function bootstrap()\n\t{\n\t\t$this->fireBootingCallbacks();\n\t\t\n\t\trequire config('ghost.bootstrap', app_path('Http/Lib/bootstrap.php'));\n\t\t\n//\t\t$this->addAdminAssets();\n\t\t\n\t\t$this->fireBootedCallbacks();\n\t}", "private function Bootstrap() {\n\t\t// let's get Config setup\n\t\t$appRoot = dirname(__FILE__);\n\t\tinclude_once $appRoot . '/Config.php';\n\n\t\t// some dependencies: make sure base classes are included first...\n\t\tinclude_once $appRoot . '/classes/SiteUser.php';\n\t\tinclude_once $appRoot . '/viewmodels/_base_Vm.php';\n\t\tinclude_once $appRoot . '/builders/_base_Vmb.php';\n\n\t\tConfig::Init();\n\n\t\tforeach (array('classes', 'viewmodels', 'builders') as $directory) {\n\t\t\tforeach (glob($appRoot . '/' . $directory . '/*.php') as $filename) {\n\t\t\t\tinclude_once $filename;\n\t\t\t}\n\t\t}\n\n\t}", "protected function getBootstrap(){\n \n $this->tmpl->setField('author',sprintf('Auto-generated by %s on %s',get_class($this),date(DATE_RFC822)));\n \n $framework_class_name = get_class($this->framework);\n $this->tmpl->setField('framework_class_name',$framework_class_name);\n \n // find all the framework paths...\n $rframework = new \\ReflectionClass($framework_class_name);\n \n $framework_parent_list = array();\n $framework_interface_list = array();\n \n $framework_parent_list[] = $rframework->getFileName();\n \n $rparent = $rframework->getParentClass();\n do{\n \n if($rparent = $rparent->getParentClass()){\n \n $framework_parent_list[] = $rparent->getFileName();\n \n }//if\n \n }while(!empty($rparent));\n \n foreach($rframework->getInterfaces() as $rinterface){\n \n $framework_interface_list[] = $rinterface->getFileName();\n \n }//foreach\n \n $this->tmpl->setField(\n 'framework_path_list',\n array_merge(\n $framework_interface_list,\n array_reverse($framework_parent_list)\n )\n );\n \n $this->tmpl->setField('app_path',$this->framework_config->getAppPath());\n \n $temp_file = new Path(sys_get_temp_dir(),'bootstrap.php');\n \n // write out the bootsrap to the temp file...\n $temp_file->set($this->tmpl->render('bootstrap.php'));\n \n return $temp_file;\n \n }", "function __loadBootstrap()\n {\n $_this =& Configure::getInstance();\n $modelPaths = null;\n $viewPaths = null;\n $controllerPaths = null;\n require APP_PATH.'config'.DS.'bootstrap.php';\n $_this->__buildModelPaths($modelPaths);\n $_this->__buildViewPaths($viewPaths);\n $_this->__buildControllerPaths($controllerPaths);\n }", "public function execBootstrap()\n {\n $package = strtr($this->path.'/bootstrap', '/', '.');\n \n // FIXME: el BS a ejecutar debe depender del modo de ejecucion\n YuppLoader::getInstance()->loadScript($package, 'Bootstrap');\n }", "public function bootstrap($bootstrap){}", "public function loadComposer()\n {\n if ($ownVendor = $this->tryPath('vendor/', BootLoader::RELATIVE | BootLoader::VALIDATE)) {\n $this->autoLoader = require $ownVendor . 'autoload.php';\n } else {\n // when bootstrapping is inside a dependency of another project\n $this->autoLoader = require $this->getPath('../../', BootLoader::RELATIVE | BootLoader::VALIDATE) . 'autoload.php';\n }\n }", "public function customBootstrap();", "public static function getBootstrap()\n {\n echo '<link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css\" integrity=\"sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk\" crossorigin=\"anonymous\">';\n echo '<script src=\"https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js\" integrity=\"sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI\" crossorigin=\"anonymous\"></script>';\n }", "protected function bootFramework()\n {\n $autoloadFile = $this->workDir('bootstrap/autoload.php');\n if (!file_exists($autoloadFile)) {\n $this->error('Unable to load bootstrap file for framework from \"' . $autoloadFile . '\".');\n return;\n }\n\n require $autoloadFile;\n\n $appFile = $this->workDir('bootstrap/app.php');\n if (!file_exists($appFile)) {\n $this->error('Unable to load application initialization file for framework from \"' . $appFile . '\".');\n return;\n }\n\n $app = require_once $appFile;\n $kernel = $app->make('Illuminate\\Contracts\\Console\\Kernel');\n $kernel->bootstrap();\n }", "protected function bootstrap(){\n\t\t$this->frameworkAdapter->bootstrap();\n\t\t$this->output->bootstrap();\n\t}", "static public function bootstrapLaravel($path = null) {\n if ($path === null) {\n $path = getcwd();\n }\n $root = substr($path,0,1) === '/' ? '' : $_ENV[\"CATALOGUE_DIR\"];\n\n\n // Dont set globals, might mess up modules that try to bootstrap this.\n // $_SERVER['SCRIPT_NAME'] = \"{$baseUrl}index.php\";\n // $_SERVER['PATH_INFO'] = $baseUrl;\n // $_SERVER['SCRIPT_FILENAME'] = \"/VIRTUAL_ROOT/{$baseUrl}index.php\";\n // $_SERVER['APP_URL'] = $_ENV['APP_URL'] = $_SERVER[\"SERVER_URL\"] . $baseUrl;\n\n require_once $root . \"/$path/vendor/autoload.php\";\n $app = require_once $root . \"/$path/bootstrap/app.php\";\n \n $app->bootstrapWith([\n \\Illuminate\\Foundation\\Bootstrap\\LoadEnvironmentVariables::class,\n \\Illuminate\\Foundation\\Bootstrap\\LoadConfiguration::class,\n \\Illuminate\\Foundation\\Bootstrap\\HandleExceptions::class,\n \\Illuminate\\Foundation\\Bootstrap\\RegisterFacades::class,\n \\Illuminate\\Foundation\\Bootstrap\\SetRequestForConsole::class,\n \\Illuminate\\Foundation\\Bootstrap\\RegisterProviders::class,\n \\Illuminate\\Foundation\\Bootstrap\\BootProviders::class\n ]);\n \n if (isset($_SERVER['SERVER_URL'])) {\n $baseUrl = \"/\" . ltrim($_ENV['BOS_ENVIRONMENT_URL'] ?? '',\"/\") . \"/\" . basename($path);\n \n // But do change UrlGenerator root\n $app->get(\\Illuminate\\Routing\\UrlGenerator::class)->forceRootUrl($_SERVER[\"SERVER_URL\"] . $baseUrl);\n }\n restore_error_handler();\n restore_exception_handler();\n \n return $app;\n }", "function bootstrap() {\n\t\t$includes = array(\n\t\t\tTHE_CORE . 'basics.php',\n\t\t\tTHE_CORE . 'config'.DS.'paths.php',\n\t\t\tTHE_CORE . 'dispatcher.php',\n\t\t\tTHE_CORE . 'scripts'.DS.'templates'.DS.'skel'.DS.'config'.DS.'core.php'\n\t\t);\n\n\t\tforeach ($includes as $inc) {\n\t\t\tif (!@include_once($inc)) {\n\t\t\t\t$this->stdout(\"Failed to load Cake core file {$inc}\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$libraries = array('session', 'configure', 'inflector', 'model'.DS.'connection_manager', 'debugger', 'security', 'controller' . DS . 'controller');\n\t\tforeach ($libraries as $inc) {\n\t\t\tif (!file_exists(LIBS.$inc.'.php')) {\n\t\t\t\t$this->stdout(\"Failed to load Cake core class \" . ucwords($inc));\n\t\t\t\t$this->stdout(\"(\" . LIBS.$inc.\".php)\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tuses($inc);\n\t\t}\n\t\tConfigure::getInstance(file_exists(CONFIGS . 'bootstrap.php'));\n\t\tConfigure::write('debug', 1);\n\t\treturn true;\n\t}", "public function setupBootstrap()\n\t{\n\t\tif ($this->debug) \n\t\t\tprint __METHOD__.\"\\n\";\n\t\tif (null !== $this->input->getOption(self::BOOTSTRAP_FILE)) {\n\t\t\tif ($this->debug) print \"bootstrap from options\\n\";\n\t\t\t$this->bootstrap_file = \n\t\t\t\t$this->tests_relative_to \n\t\t\t\t.\"/\"\n\t\t\t\t. $this->input->getOption(self::BOOTSTRAP_FILE);\n\n\t\t} elseif (isset($this->config->bootstrap)) {\n\t\t\tif ($this->debug) print \"bootstrap from config \\n\";\n\t\t\t$this->bootstrap_file = $this->cwd. \"/\". $this->config->bootstrap;\n\t\t\tif ($this->debug) print __METHOD__.\"[{$this->bootstrap_file}] \\n\";\n\t\t} else {\n\t\t\tif ($this->debug) print \"no bootstrap \\n\";\n\t\t\t$this->bootstrap_file = null;\n\t\t}\n\t\tif ($this->debug) \n\t\t\tprint __METHOD__.\"\\n\";\n\t}", "private function bootstrap() {\n if ($this->requirementsMet($this->required_php_version, $this->required_wp_version)) {\n require_once('lib/utils.php');\n require_once('lib/module.php');\n require_once('lib/admin.php');\n require_once('lib/dashboard_widget.php');\n require_once('modules.php');\n $modules = new Square\\Modules();\n } else {\n add_action('admin_notices', [$this, 'requirementsError']);\n }\n }", "public function includeBootstrap()\n {\n // return Bootstrap files using CDN\n return '<link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css\" />';\n }", "private function includes()\n {\n require_once __DIR__. '/lib/coingate/vendor/autoload.php';\n }", "public function bootstrap();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Post completion hook for the hostingtask Drush command.
function drush_hosting_post_hosting_task($task) { $task = &drush_get_context('HOSTING_TASK'); $hook = sprintf("post_hosting_%s_task", str_replace('-', '_', $task->task_type)); drush_log(dt('Invoking :hook hooks.', array(':hook' => $hook))); module_invoke_all($hook, $task, drush_get_context('HOSTING_DRUSH_OUTPUT')); }
[ "function drush_drushd() {\n drush_log(dt('drush_drushd() was called. You probably want to create your own process method in your DrushDaemon extension.'), 'warning'); \n}", "function drush_devshop_projects_pre_hosting_task()\n{\n\n $task =& drush_get_context('HOSTING_TASK');\n\n // For all tasks\n if ($task->ref->type == 'site' || $task->ref->type == 'platform' || $task->ref->type == 'project') {\n $drush_aliases = new Provision_Config_ProjectAliases($task->ref->project->name, $task->ref->project);\n }\n \n // Only write drush aliases if project name was found.\n if (!empty($drush_aliases->data['name'])) {\n $drush_aliases->write();\n drush_log(dt('Drush aliases written for %name project.', [\n '%name' => $drush_aliases->data['name'],\n ]), 'p_log');\n }\n \n\n // Passing options for Download task. This should go in aegir_download.drush.inc but I can't get that hook working right now.\n if ($task->task_type == 'download') {\n drush_log('[AEGIR DEVSHOP_PROJECTS] Download package enabled...', 'ok');\n\n $task->options['packages'] = $task->task_args['packages'];\n $task->options['commit'] = $task->task_args['update'];\n $task->options['message'] = $task->task_args['message'];\n $task->options['update'] = $task->task_args['update'];\n }\n \n // Verify Platform\n // Here is where we hook in and clone the site\n // @TODO: This can be removed once hosting_git migration is complete.\n// if ($task->ref->type == 'platform' && $task->task_type == 'verify' && !empty($task->ref->project->git_url)) {\n// drush_devshop_platform_verify();\n// }\n \n // Pull\n if ($task->ref->type == 'project' && $task->task_type == 'devshop-pull') {\n $task->args['environments'] = $task->task_args['environments'];\n $task->options['update'] = $task->task_args['update'];\n $task->options['revert'] = !empty($task->task_args['revert']);\n $task->options['cache'] = $task->task_args['cache'];\n $task->options['force'] = FALSE;\n }\n\n // Deploy\n if ($task->ref->type == 'site' && $task->task_type == 'devshop-deploy') {\n\n // The git_ref is the only argument\n $task->args['git_ref'] = $task->task_args['git_ref'];\n\n // Just load in all of the task_args as options(they come from the task form.)\n if (is_array($task->task_args)) {\n foreach ($task->task_args as $arg => $value) {\n $task->options[$arg] = $value;\n }\n }\n }\n\n // Run tests\n if ($task->ref->type == 'site' && $task->task_type == 'test') {\n\n $task->options['tests-to-run'] = $task->task_args['tests_to_run'];\n $task->options['test-type'] = $task->task_args['test_type'];\n }\n\n // On every task triggered by devshop, set this option.\n $task->options['is-devshop'] = TRUE;\n}", "function devshop_dothooks_post_hosting_sync_task($task, $data) {\n devshop_dothooks_run_hook('sync', $task->ref);\n}", "function terminus_drush_command() {\n $items = array();\n\n $items['pantheon-logout'] = array(\n 'description' => \"Clear any stored session data.\",\n 'examples' => array(\n 'drush plogout',\n ),\n 'aliases' => array('plogout'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-auth'] = array(\n 'description' => \"Authenticate against the Pantheon dashboard. Required before doing anything else.\",\n 'arguments' => array(\n 'email' => 'Email address of dashboard account',\n ),\n 'options' => array(\n 'password' => array(\n 'description' => 'Optional: include password for script-friendly use.',\n 'example-value' => 'mypassword',\n ),\n ),\n 'examples' => array(\n 'drush pauth josh@getpantheon.com --password=mypassword' => 'Get authentication token.',\n ),\n 'aliases' => array('pauth'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-sites'] = array(\n 'description' => 'List your Pantheon sites.',\n 'examples' => array(\n 'drush psites --nocache' => 'Get a fresh list of sites.',\n ),\n 'aliases' => array('psites'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-attributes'] = array(\n 'description' => 'Get attributes for a particular site.',\n 'aliases' => array('psite-attr'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n 'arguments' => array(\n 'site' => 'The site UUID in question.',\n ),\n 'options' => array(\n 'attribute' => array(\n 'description' => 'Specific attribute that you want to get.',\n 'example-value' => 'label',\n ),\n ),\n );\n\n $items['pantheon-site-branch-list'] = array(\n 'description' => 'List Git branches for a particular site.',\n 'aliases' => array('psite-blist'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n 'arguments' => array(\n 'site' => 'The site UUID in question.',\n ),\n );\n\n $items['pantheon-site-branch-create'] = array(\n 'description' => 'Create Git branch of master for a particular site.',\n 'aliases' => array('psite-bcreate'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n 'arguments' => array(\n 'site' => 'The site UUID in question.',\n ),\n 'options' => array(\n 'name' => array(\n 'description' => 'Branch name to be created.',\n 'example-value' => 'feature-123',\n ),\n ),\n );\n\n $items['pantheon-site-branch-delete'] = array(\n 'description' => 'Delete a Git branch from a particular site.',\n 'aliases' => array('psite-bdel'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n 'arguments' => array(\n 'site' => 'The site UUID in question.',\n ),\n 'options' => array(\n 'name' => array(\n 'description' => 'Branch name to be deleted.',\n 'example-value' => 'feature-123',\n ),\n ),\n );\n\n $items['pantheon-hostname-add'] = array(\n 'description' => \"Add a hostname to a site you control.\",\n 'arguments' => array(\n 'site' => 'The site UUID you are working on.',\n 'environment' => 'The environment (e.g. \"live\").',\n 'hostname' => 'The hostname (e.g. \"www.mysite.com\")',\n ),\n 'aliases' => array('psite-hostname-add', 'psite-ha'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-hostname-remove'] = array(\n 'description' => \"Remove a hostname from a site you control.\",\n 'arguments' => array(\n 'site' => 'The site UUID you are working on.',\n 'environment' => 'The environemnt (e.g. \"live\").',\n 'hostname' => 'The hostname (e.g. \"www.mysite.com\")',\n ),\n 'aliases' => array('psite-hostname-remove', 'psite-hr'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-hostname-list'] = array(\n 'description' => dt('List all hostnames associated with a site.'),\n 'arguments' => array(\n 'site' => 'The site UUID you are working on.',\n 'environment' => 'The environemnt (e.g. \"live\").',\n ),\n 'aliases' => array('psite-hostname-list', 'psite-hl'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-products'] = array(\n 'description' => \"Get the list of available Drupal product start-states.\",\n 'aliases' => array('pproducts'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-create'] = array(\n 'description' => \"Create a new site on Pantheon\",\n 'arguments' => array(\n 'name' => 'Short name of the site to create. Will be part of the URL.',\n ),\n 'options' => array(\n 'label' => array(\n 'description' => 'Human-friendly site label.',\n ),\n 'product' => array(\n 'description' => 'UUID of the product you want to start with (see pantheon-products).',\n ),\n 'organization' => array(\n 'description' => 'UUID of an organization you want the site to be a part of.',\n ),\n 'nopoll' => array(\n 'description' => 'Do not hang around and wait for the site to be ready. Useful for scripting a lot of spin-ups.',\n ),\n ),\n 'aliases' => array('psite-create'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-import'] = array(\n 'description' => \"Import an existing site to Pantheon\",\n 'arguments' => array(\n 'name' => 'Short name of the site to create. Will be part of the URL.',\n 'url' => 'URL of Drush Archive.',\n ),\n 'options' => array(\n 'label' => array(\n 'description' => 'Human-friendly site label.',\n ),\n 'organization' => array(\n 'description' => 'UUID of an organization you want the site to be a part of.',\n ),\n 'nopoll' => array(\n 'description' => 'Do not hang around and wait for the site to be ready. Useful for scripting a lot of spin-ups.',\n ),\n ),\n 'aliases' => array('psite-import'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-delete'] = array(\n 'description' => \"Delete a site from Pantheon.\",\n 'arguments' => array(\n 'site' => 'UUID of the site you want to delete.',\n ),\n 'aliases' => array('psite-delete'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-backups'] = array(\n 'description' => \"List site backups (and exports).\",\n 'arguments' => array(\n 'site' => 'UUID of the site you want to get backups for.',\n 'environment' => 'The environment (e.g. \"live\") you want to back up.',\n ),\n 'aliases' => array('psite-backups'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-get-backup'] = array(\n 'description' => \"Get a download link to a specific site backup.\",\n 'arguments' => array(\n 'site' => 'UUID of the site you want to get backups for.',\n 'environment' => 'The environment (e.g. \"live\") you want to back up.',\n 'bucket' => 'Bucket for the backup.',\n 'element' => 'Which part of the backup do you want?',\n ),\n 'aliases' => array('psite-get-backup'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-make-backup'] = array(\n 'description' => \"Trigger an on-demand backup for a site/environment.\",\n 'arguments' => array(\n 'site' => 'UUID of the site you want to make a backup for.',\n 'environment' => 'The environment (e.g. \"live\") you want to back up.',\n ),\n 'aliases' => array('psite-backup'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-download-backup'] = array(\n 'description' => \"Download a backup file from a specific site.\",\n 'arguments' => array(\n 'site' => 'UUID of the site you want to get backups for.',\n 'environment' => 'The environment (e.g. \"live\") you want to download a backup from.',\n 'bucket' => 'Bucket for the backup. Use \"latest\" for the most recent.',\n 'element' => 'Which part of the backup do you want? (e.g. database, files, code)',\n 'destination' => 'Where would you like the backup?'\n ),\n 'aliases' => array('psite-dl-backup'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-load-backup'] = array(\n 'description' => \"Load db with a backup file from a specific site.\",\n 'arguments' => array(\n 'site' => 'UUID or name of the site you want to get backups for.',\n 'environment' => 'The environment (e.g. \"live\") you want to use a backup from.',\n 'bucket' => 'Bucket for the backup. Use \"latest\" for the most recent.',\n ),\n 'aliases' => array('psite-load-backup'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-connection-mode'] = array(\n 'description' => \"Set or retrieve the connection mode of a specific site/environment.\",\n 'arguments' => array(\n 'site' => 'UUID or name of the site.',\n 'environment' => 'The dev or multidev environment you would like to target.',\n 'mode' => 'Connection mode like to set (e.g., \"sftp\" or \"git\"). Leave blank to retrieve the current mode.',\n ),\n 'aliases' => array('psite-cmode'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-commit'] = array(\n 'description' => 'Commit changes in an on-server-dev environment.',\n 'arguments' => array(\n 'site' => 'UUID or name of the site.',\n 'environment' => 'Environment to commit: a dev or multidev environment',\n ),\n 'options' => array(\n 'message' => 'Commit message',\n ),\n 'aliases' => array('psite-commit'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-diffstat'] = array(\n 'description' => 'Get a list of changes (diffstat) to be commited in a remote on-server-dev environment.',\n 'arguments' => array(\n 'site' => 'UUID or name of the site.',\n 'environment' => 'Environment to commit: a dev or multidev environment',\n ),\n 'aliases' => array('psite-diffs'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-environment-list'] = array(\n 'description' => 'Get a list of site environments.',\n 'arguments' => array(\n 'site' => 'UUID or name of the site.',\n ),\n 'aliases' => array('psite-elist'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-environment-create'] = array(\n 'description' => 'Create a new multidev site environment.',\n 'arguments' => array(\n 'site' => 'UUID or name of the site.',\n 'environment' => 'Name of multidev site environment. If branch does not exist, it will be created.',\n ),\n 'options' => array(\n 'source' => 'The source environment (e.g. \"live\") from which content will be cloned. If omitted, will default to dev.',\n ),\n 'aliases' => array('psite-ecreate'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-environment-delete'] = array(\n 'description' => 'Delete a multidev site environment.',\n 'arguments' => array(\n 'site' => 'UUID or name of the site.',\n 'environment' => 'Name of multidev site environment.',\n ),\n 'aliases' => array('psite-edelete'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-environment-lock'] = array(\n 'description' => dt('Lock a site environment.'),\n 'arguments' => array(\n 'site' => dt('UUID or name of the site.'),\n 'environment' => dt('Name of site environment.'),\n 'username' => dt('Username for HTTP Basic Auth'),\n 'password' => dt('Password for HTTP Basic Auth'),\n ),\n 'aliases' => array('psite-elo'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-environment-unlock'] = array(\n 'description' => dt('Unlock a site environment.'),\n 'arguments' => array(\n 'site' => dt('UUID or name of the site.'),\n 'environment' => dt('Name of site environment.'),\n ),\n 'aliases' => array('psite-eul'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-environment-lock-info'] = array(\n 'description' => dt('Get information about whether a site environment is locked.'),\n 'arguments' => array(\n 'site' => dt('UUID or name of the site.'),\n 'environment' => dt('Name of site environment.'),\n ),\n 'aliases' => array('psite-eli'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-notifications'] = array(\n 'description' => dt('Get a list of notifications for a site.'),\n 'arguments' => array(\n 'site' => dt('UUID of the site.'),\n ),\n 'options' => array(\n 'count' => dt('Number of notifications to show'),\n 'type' => dt('Filter notifications by type'),\n ),\n 'aliases' => array('psite-notifications'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-jobs'] = array(\n 'description' => dt('Get a list of jobs for a site.'),\n 'arguments' => array(\n 'site' => dt('UUID of the site.'),\n ),\n 'options' => array(\n 'environment' => array(\n 'description' => dt('Filter jobs by environment'),\n 'example-value' => 'dev',\n ),\n 'slot' => array(\n 'description' => dt('Filter by slot'),\n 'example-value' => 'cache_clear',\n ),\n ),\n 'aliases' => array('psite-jobs'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-uuid'] = array(\n 'description' => \"Get the site UUID based on the name.\",\n 'arguments' => array(\n 'sites' => 'A list of site names.',\n ),\n 'examples' => array(\n 'drush psite-uuid mysite --nocache' => 'Get the UUID of your site.',\n ),\n 'options' => array(\n 'compact' => 'Output only uuid. Useful for scripting.',\n ),\n 'required-arguments' => TRUE,\n 'aliases' => array('psite-uuid'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-name'] = array(\n 'description' => dt('Get the site name from UUID.'),\n 'arguments' => array(\n 'uuid' => dt('UUID of the site.'),\n ),\n 'examples' => array(\n 'drush psite-name 12345678-1234-abcd-9876-fedcba09 --nocache' => dt('Get the name of your site.'),\n ),\n 'required-arguments' => TRUE,\n 'aliases' => array('psite-name'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-dashboard'] = array(\n 'description' => \"Get the dashboard link for a site.\",\n 'arguments' => array(\n 'site' => 'UUID of the site.',\n ),\n 'examples' => array(\n 'drush psite-dash mysite -y' => 'Open the dashboard for a site.',\n ),\n 'aliases' => array('psite-dash'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-service-level'] = array(\n 'description' => \"Update the service level for the site.\",\n 'arguments' => array(\n 'site' => 'UUID of the site.',\n 'service-level' => 'Service level to upgrade to.',\n ),\n 'examples' => array(\n 'drush psite-upgrade <site> <service-level>' => 'Open the dashboard for a site.',\n ),\n 'aliases' => array('psite-upgrade'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-environment-redis-clear'] = array(\n 'description' => 'Clear redis cache of a site environment.',\n 'arguments' => array(\n 'site' => 'UUID or name of the site.',\n 'environment' => 'Name of site environment.',\n ),\n 'aliases' => array('psite-erc'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n /**\n * Site team functions.\n */\n $items['pantheon-site-team'] = array(\n 'description' => \"Get the team for a site.\",\n 'arguments' => array(\n 'site' => 'uuid of the site',\n ),\n 'examples' => array(\n 'drush psite-team 12345678-1234-abcd-9876-fedcba09 --nocache' => 'Get the team of your site.',\n ),\n 'aliases' => array('psite-team'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-team-add'] = array(\n 'description' => \"Add someone to the team for a site.\",\n 'arguments' => array(\n 'site' => 'uuid of the site',\n 'user' => 'user you would like to make a part of the team: uuid or email',\n ),\n 'examples' => array(\n 'drush psite-team-add mysite josh@getpantheon.com' => 'Add josh to your site team.',\n ),\n 'aliases' => array('psite-team-add'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-team-remove'] = array(\n 'description' => \"Remove someone from the team for a site.\",\n 'arguments' => array(\n 'site' => 'uuid of the site',\n 'user' => 'user you would like to remove: uuid or email',\n ),\n 'examples' => array(\n 'drush psite-team-remove mysite josh@getpantheon.com' => 'Remove josh to your site team.',\n ),\n 'aliases' => array('psite-team-remove'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-change-owner'] = array(\n 'description' => \"Change the owner of a site.\",\n 'arguments' => array(\n 'site' => 'uuid of the site',\n 'user' => 'team member you would like to make the new owner: uuid or email',\n ),\n 'examples' => array(\n 'drush psite-set-owner mysite josh@getpantheon.com' => 'Make josh the site owner.',\n ),\n 'aliases' => array('psite-change-owner'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n /**\n * Organization-scope functions.\n */\n $items['pantheon-organizations'] = array(\n 'description' => \"List your organization affiliations.\",\n 'examples' => array(\n 'drush porgs --nocache' => 'Get a fresh list of sites.',\n ),\n 'aliases' => array('porgs'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-organization-sites'] = array(\n 'description' => \"List the sites for an organization. Org admins only.\",\n 'arguments' => array(\n 'organization' => 'UUID of the organization you want to use.',\n ),\n 'examples' => array(\n 'drush porg-sites' => 'Get a fresh list of sites.',\n ),\n 'aliases' => array('porg-sites'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-organization-site-add'] = array(\n 'description' => \"Add a site to an organization. Org admins only.\",\n 'arguments' => array(\n 'organization' => 'UUID of the organization.',\n 'site' => 'UUID of the organization.',\n ),\n 'examples' => array(\n 'drush porg-site-add <org> <site>' => 'Add a site to an organization.',\n ),\n 'aliases' => array('porg-site-add'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-organization-site-remove'] = array(\n 'description' => \"Remove a site from an organization. Org admins only.\",\n 'arguments' => array(\n 'organization' => 'UUID of the organization.',\n 'site' => 'UUID of the organization.',\n ),\n 'examples' => array(\n 'drush porg-site-remove <org> <site>' => 'Add a site to an organization.',\n ),\n 'aliases' => array('porg-site-remove'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n /**\n * Tunnel Functions.\n */\n $items['pantheon-site-tunnels'] = array(\n 'description' => \"Get a list of open tunnels.\",\n 'aliases' => array('psite-tunnels'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-tunnel'] = array(\n 'description' => \"Opens a tunnel to a specific site/environment/service.\",\n 'arguments' => array(\n 'site' => 'UUID or name of the site.',\n 'environment' => 'The target environment (e.g. \"live\").',\n 'service' => 'The service (e.g., \"mysql\" or \"redis\") to open a tunnel for. Defaults to \"mysql\".',\n 'port' => 'Local port to connect to.',\n ),\n 'aliases' => array('psite-tunnel'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-tunnel-close'] = array(\n 'description' => \"Closes the tunnel to a specific site/environment/service.\",\n 'arguments' => array(\n 'site' => 'UUID or name of the site. If left empty, all tunnels will be closed.',\n 'environment' => 'The target environment (e.g. \"live\"). If left empty, all site tunnels will be closed.',\n 'service' => 'The service (e.g., \"mysql\" or \"redis\") to open a tunnel for. If empty, all site/environment tunnels will be closed.'\n ),\n 'aliases' => array('psite-tclose'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-mount'] = array(\n 'description' => \"Mounts an environment file system to a local directory.\",\n 'arguments' => array(\n 'site' => 'UUID or name of the site. If left empty, all tunnels will be closed.',\n 'environment' => 'The target environment (e.g. \"live\"). If left empty, all site tunnels will be closed.',\n 'destination' => 'Where would you like to mount the file system?'\n ),\n 'aliases' => array('psite-mount'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n /**\n * Workflow.\n */\n $items['pantheon-site-clone'] = array(\n 'description' => 'Clone content from one site environment to another.',\n 'arguments' => array(\n 'site' => 'UUID of the site containing content.',\n 'source' => 'The source environment (e.g. \"live\") from which content will be cloned.',\n 'target' => 'The target environment (e.g. \"live\") to which content will be cloned.',\n ),\n 'options' => array(\n 'db' => 'Clone database content.',\n 'files' => 'Clone files content.',\n 'update' => 'Run update.php after cloning database.',\n ),\n 'examples' => array(\n 'drush psite-clone SITE_UUID dev test' => 'Clone both database and files from dev to test.',\n 'drush psite-clone SITE_UUID dev test --db --update' => 'Clone only database from dev to test, then run update.php.',\n 'drush psite-clone SITE_UUID dev test --files' => 'Clone only user files from dev to test.',\n ),\n 'aliases' => array('psite-clone'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-deploy'] = array(\n 'description' => 'Deploy code to a particular environment.',\n 'arguments' => array(\n 'site' => 'UUID of the site.',\n 'target' => 'The target environment (e.g. \"live\") to which code will be deployed.',\n ),\n 'options' => array(\n 'update' => 'Run update.php after deploying code.',\n 'cc' => 'Clear cache after deploying code.',\n ),\n 'examples' => array(\n 'drush psite-deploy SITE_UUID live' => 'Deploy latest code changes to live.',\n 'drush psite-deploy SITE_UUID test --update --cc' => 'Deploy latest code changes to test, the run update.php and clear cache.',\n ),\n 'aliases' => array('psite-deploy'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-upstream-info'] = array(\n 'description' => 'Get the upstream info for a site.',\n 'arguments' => array(\n 'site' => 'UUID of the site.',\n ),\n 'examples' => array(\n 'drush psite-upstream-info SITE_UUID' => 'See if there are upstream udpates available.',\n ),\n 'aliases' => array('psite-upstream-info'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-upstream-updates'] = array(\n 'description' => 'Get available upstream update status for a site.',\n 'arguments' => array(\n 'site' => 'UUID of the site.',\n ),\n 'examples' => array(\n 'drush psite-upstream-updates SITE_UUID' => 'See if there are upstream udpates available.',\n ),\n 'aliases' => array('psite-upstream-updates'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-upstream-updates-apply'] = array(\n 'description' => 'Apply available upstream update status for a site.',\n 'arguments' => array(\n 'site' => 'UUID of the site.',\n ),\n 'options' => array(\n 'overwrite' => 'Allow upstream changes to overwrite if there are conflicts.',\n 'updatedb' => 'Run a \"drush updatedb\" after deploying code.',\n ),\n 'examples' => array(\n 'drush psite-upstream-updates-apply SITE_UUID --overwrite --updatedb' => 'Apply available upstream updates .',\n ),\n 'aliases' => array('psite-upstream-updates-apply'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-environment-content-wipe'] = array(\n 'description' => 'Wipe the content from a particular environment.',\n 'arguments' => array(\n 'site' => 'UUID of the site.',\n 'environment' => 'The target environment (e.g. \"live\") to which code will be deployed.',\n ),\n 'examples' => array(\n 'drush psite-ewipe SITE_UUID dev' => 'Wipe the database and files from the dev environment.',\n ),\n 'aliases' => array('psite-ewipe'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n /**\n * Utility Functions.\n */\n $items['pantheon-aliases'] = array(\n 'description' => \"Update the Pantheon Drush alias file at ~/.drush/pantheon.aliases.drushrc.php.\",\n 'options' => array(\n 'destination' => array(\n 'description' => 'Specify the destination to save the alias file.',\n ),\n ),\n 'aliases' => array('paliases'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-site-info'] = array(\n 'description' => dt('Get Pantheon metadata on a site'),\n 'aliases' => array('psite-info'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n 'arguments' => array(\n 'site' => dt('UUID or name of the site.'),\n ),\n 'options' => array(\n 'json' => array(\n 'description' => dt('If set, will output in JSON format.'),\n ),\n ),\n );\n\n $items['pantheon-site-nr-info'] = array(\n 'description' => dt('Get New Relic metadata on a site'),\n 'aliases' => array('psite-nri'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n 'arguments' => array(\n 'site' => dt('UUID or name of the site.'),\n ),\n 'options' => array(\n 'json' => array(\n 'description' => dt('If set, will output in JSON format.'),\n ),\n ),\n );\n\n $items['pantheon-site-wake'] = array(\n 'description' => 'Ensure a site environment is online and not suspended due to inactivity.',\n 'aliases' => array('psite-wake'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n 'arguments' => array(\n 'site' => 'UUID or name of the site.',\n 'environment' => 'The target environment (e.g. \"live\").',\n ),\n );\n\n $items['pantheon-pp'] = array(\n 'description' => \"Direct pseudo-proxy interface. JSON only. For debugging.\",\n 'arguments' => array(\n 'realm' => 'Are you asking about users or sites?',\n 'uuid' => 'The unique id of the thing you want to know about.',\n 'path' => 'Optional: path extension for more specific commands.',\n ),\n 'aliases' => array('pp'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n /**\n * SSH Key manipulation.\n */\n $items['pantheon-get-ssh-keys'] = array(\n 'description' => \"Get all ssh keys associated with your Pantheon Account.\",\n 'aliases' => array('pgetkeys'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-add-ssh-key'] = array(\n 'description' => \"Add an ssh key to your Pantheon Account.\",\n 'examples' => array(\n 'drush paddkey \"PUBLIC_KEY\"' => 'Add a public SSH Key to your account. Remember to put quotes around the key string.',\n ),\n 'arguments' => array(\n 'key' => dt('The SSH key to add.'),\n ),\n 'aliases' => array('paddkey'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-delete-ssh-key'] = array(\n 'description' => \"Remove an ssh key from your Pantheon Account.\",\n 'arguments' => array(\n 'key' => dt(\"The UUID of the SSH key to Remove.\"),\n ),\n 'examples' => array(\n 'drush pdeletekey KEY_UUID' => \"Delete an SSH Key from your account. You can get the UUID of all your keys by using 'drush pantheon-get-ssh-keys'\",\n ),\n 'aliases' => array('pdeletekey'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n $items['pantheon-delete-all-ssh-keys'] = array(\n 'description' => \"Remove all ssh keys from your Pantheon Account.\",\n 'aliases' => array('pdeleteallkeys'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,\n );\n\n // Include standard options for all commands:\n $common = array(\n 'nocache' => array(\n 'description' => 'Force a refresh of cached authentication session.',\n ),\n 'json' => array('description' => 'Return raw JSON if possible.'),\n 'onebox' => array('description' => 'Use onebox (Pantheon dev only).'),\n );\n\n foreach ($items as $key => $array) {\n if (isset($array['options'])) {\n $items[$key]['options'] = array_merge($items[$key]['options'], $common);\n }\n else {\n $items[$key]['options'] = $common;\n }\n }\n\n return $items;\n}", "protected function _postExec()\n {\n }", "#[CLI\\Hook(type: HookManager::POST_COMMAND_HOOK, target: '*')]\n public function druplicon($result, CommandData $commandData): void\n {\n // If one command does a Drush::drush() to another command,\n // then this hook will be called multiple times. Only print\n // once.\n if ($this->printed) {\n return;\n }\n $this->printed = true;\n $annotationData = $commandData->annotationData();\n $commandName = $annotationData['command'];\n if ($commandData->input()->hasOption('druplicon') && $commandData->input()->getOption('druplicon')) {\n $this->logger()->debug(dt('Displaying Druplicon for \"!command\" command.', ['!command' => $commandName]));\n $misc_dir = $this->config->get('drush.base-dir') . '/misc';\n if ($commandData->input()->getOption('no-ansi')) {\n $content = file_get_contents($misc_dir . '/druplicon-no_color.txt');\n } else {\n $content = file_get_contents($misc_dir . '/druplicon-color.txt');\n }\n $commandData->output()->writeln($content);\n }\n }", "function devshop_projects_post_hosting_devshop_deploy_task($task, $data) {\n\n // Save the deployed git ref to the environment record.\n drush_log('[DEVSHOP] Environment Deployed. Saving record.');\n\n $environment = $task->task_args['environment'];\n $git_ref = $task->task_args['git_ref'];\n\n $return = db_query('UPDATE {hosting_devshop_project_environment} SET git_ref = \"%s\" WHERE project_nid = %d AND name = \"%s\"', $git_ref, $task->ref->nid, $environment);\n\n if ($return) {\n drush_log('[DEVSHOP] New git ref saved to environment..');\n }\n else {\n return drush_set_error('[DEVSHOP] Environment update failed!');\n }\n\n hosting_add_task($task->ref->project->environments[$environment]->platform, 'verify');\n}", "function civicrm_drush_command() {\n $items = array();\n\n // the key in the $items array is the name of the command.\n $items['civicrm-install'] = \n array('callback' => 'civicrm_pkg_install',\n 'description' => \"Install a new instance of CiviCRM.\",\n 'options' =>\n array('--dbuser' => 'MySQL username for your Drupal/CiviCRM database.',\n '--dbpass' => 'MySQL password for your Drupal/CiviCRM database.',\n '--dbhost' => 'MySQL host for your Drupal/CiviCRM database. Defaults to localhost.',\n '--dbname' => 'MySQL database name of your Drupal/CiviCRM database.',\n '--tarfile' => 'Path to your CiviCRM tar.gz file.',\n ),\n );\n $items['civicrm-upgrade-db'] = \n array('callback' => 'civicrm_upgrade_db',\n 'description' => \"Execute the civicrm/upgrade?reset=1 process from the command line.\",\n );\n $items['civicrm-update-cfg'] = \n array('callback' => 'civicrm_config_update',\n 'description' => \"Update config_backend to correct config settings, especially when the CiviCRM site has been cloned / migrated.\",\n 'examples' => \n array('drush -l http://example.com/civicrm civicrm-update-cfg' => \n 'Update config_backend to correct config settings for civicrm installation on example.com site.',\n ),\n );\n $items['civicrm-cache-clear'] = \n array('callback' => 'civicrm_cache_clear',\n 'description' => \"Clear all CiviCRM database and smarty caches.\",\n );\n $items['civicrm-upgrade'] = \n array('callback' => 'civicrm_upgrade',\n 'description' => \"Replace CiviCRM codebase with new specified tarfile and upgrade database by executing the CiviCRM upgrade process - civicrm/upgrade?reset=1.\",\n 'examples' => \n array('drush civicrm-upgrade --tarfile=~/tarballs/civicrm-3.1.4-drupal.tar.gz' => \n 'Replace old CiviCRM codebase with new v3.1.4 and run upgrade process.',\n ),\n 'options' => \n array('--tarfile' => \n 'Path of new CiviCRM tarfile, with which current CiviCRM codebase is to be replaced.',\n '--backup-dir' => \n 'Specify a directory to backup current CiviCRM codebase and database into, defaults to a backup directory above your Drupal root.'\n ),\n );\n $items['civicrm-restore'] = \n array('callback' => 'civicrm_restore',\n 'description' => 'Restore CiviCRM codebase and database back from the specified backup directory.',\n 'examples' => \n array('drush civicrm-restore --restore-dir=../backup/modules/20100309200249' => \n 'Replace current civicrm codebase with the $restore-dir/civicrm codebase, and reload the database with $restore-dir/civicrm.sql file',\n ),\n 'options' => \n array('--restore-dir' => \n 'Path of directory having backed up CiviCRM codebase and database.',\n '--backup-dir' => \n 'Specify a directory to backup current CiviCRM codebase and database into, defaults to a backup directory above your Drupal root.'\n ),\n );\n $items['civicrm-rest'] = \n array('callback' => 'civicrm_rest',\n 'description' => \"Rest interface for accessing CiviCRM APIs. It can return xml or json formatted data.\", \n 'examples' => \n array(\"drush civicrm-rest --query='civicrm/contact/search&json=1&key=7decb879f28ac4a0c6a92f0f7889a0c9&api_key=7decb879f28ac4a0c6a92f0f7889a0c9'\" => \n 'Use contact search api to return data in json format.',\n ),\n 'options' => \n array('--query' => 'Query part of url. Refer CiviCRM wiki doc for more details.'),\n );\n $items['civicrm-sql-conf'] = \n array('callback' => 'civicrm_sql_conf',\n 'description' => 'Print CiviCRM database connection details.',\n );\n $items['civicrm-sql-connect'] = \n array('callback' => 'civicrm_sql_connect',\n 'description' => 'A string for connecting to the CiviCRM DB.',\n );\n $items['civicrm-sql-dump'] = \n array('callback' => 'civicrm_sql_dump',\n 'description' => 'Exports the CiviCRM DB as SQL using mysqldump.',\n 'examples' => \n array('drush civicrm-sql-dump --result-file=../CiviCRM.sql' => \n 'Save SQL dump to the directory above Drupal root.',\n ),\n 'options' => \n array('--result-file' => 'Save to a file.'),\n );\n $items['civicrm-sql-query'] = \n array('callback' => 'civicrm_sql_query',\n 'description' => 'Execute a query against the CiviCRM database.',\n 'examples' => \n array('drush civicrm-sql-query \"SELECT * FROM civicrm_contact WHERE id=1\"' => \n 'Browse user record',\n ),\n 'arguments' => \n array('query' => 'A SQL query. Mandatory.',\n ),\n );\n $items['civicrm-sql-cli'] = \n array('callback' => 'civicrm_sql_cli',\n 'description' => \"Open a SQL command-line interface using CiviCRM's credentials.\",\n );\n\n return $items;\n}", "function drush_shell_complete($command = FALSE) {\n $commands = drush_get_commands();\n if (empty($command)) {\n ksort($commands);\n foreach($commands as $key => $command) {\n if (!$command['hidden'] && !in_array($key, $command['deprecated-aliases'])) {\n $rows[] = $key . ':' . str_replace(':', '\\:', $command['description']);\n }\n }\n }\n else {\n if (array_key_exists($command, $commands)) {\n $command = $commands[$command];\n foreach ($command['arguments'] as $key => $description) {\n $rows[] = $key . ':' . str_replace(':', '\\:', $description;\n }\n }\n }\n print join(\"\\n\", $rows) . \"\\n\";\n return;\n}", "public function drushExit() {\n drush_set_context('DRUSH_EXECUTION_COMPLETED', TRUE);\n exit($this->frontendReturn);\n }", "function si_batch_ingest_drush_command() {\n return array(\n 'si_batch_ingest_fieldbooks' => array(\n 'callback' => 'drush_si_batch_ingest_fieldbooks',\n 'description' => \"Ingests all fieldbook related data, make sure the proper data is in the drush directory.\",\n 'examples' => array(\n 'drush ingest-fieldbooks',\n ),\n 'aliases' => array('ingest-fieldbooks'),\n 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN, // We can pass in users id on the command line using drush -u.\n )\n );\n}", "public function process()\n\t{\n\t\t/* get our deploy file */\n\t\t$this->deploy_json = array_merge($this->get_hard_actions(),$this->get_deploy());\n\n\t\t$task_name = implode(' ',$this->config['args']);\n\n\t\t/* if the task doesn't exist but it's not empty then show a error */\n\t\tif (!$this->task_exists($task_name)) {\n\t\t\tif (!empty($task_name)) {\n\t\t\t\t$this->e('<light_red>Task \"'.$task_name.'\" is not defined.</off>');\n\t\t\t}\n\t\t\t/* show help in a table */\n\t\t\t$this->table($this->get_help());\n\t\t} else {\n\t\t\t/* run this task */\n\t\t\t$this->task($task_name);\n\t\t}\n\t}", "function islandora_gsearch_update_drush_command() {\n $items = array();\n\n $items['islandora_gsearch_update'] = array(\n 'description' => \"updates a gsearch index using a list of pids read from a text file, should work with islandora 6.x or islandora 7.x.\",\n 'arguments' => array(\n 'pidlist_file' => 'The path to a plain text file that contains a list of pids one pid per line',\n 'index_name' => 'the name of the index to update.',\n 'gsearch_url' => 'the url for gsearch, ie. http://localhost/fedoragsearch/rest',\n 'interactive' => 'if TRUE then you will be asked to confirm the export for each object'\n ),\n 'examples' => array(\n 'drush islandora_gsearch_update path/to/pidlist.txt gsearch_solr http://localhost:8080/fedoragsearch/rest TRUE',\n ),\n 'aliases' => array('islandoragu'),\n //'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN, // we can pass in users id on the command line using drush -u.\n );\n\n return $items;\n}", "function ihc_drush_command( ) {\n $items = array();\n\n $items['ihcModReset'] = array(\n 'description' => dt('Reset --modAfter target object date.'),\n 'arguments' => array(\n 'first' => dt(\"First PID to process. The namespace portion of this PID defines the default primary namespace. This parameter may be specified as 'namespace:first-last' in place of the --repeat option.\"),\n ),\n 'options' => array(\n 'modAfter' => dt(\"Sets a new YYYY-mm-ddTHH:ii:ssZ timestamp string. Default is '2000-01-01T00:00:00:Z'.\"),\n ),\n 'examples' => array(\n 'Example' => 'drush -u 1 ihcModReset grinnell:1 --modAfter=2015-09-01T00:00:00Z',\n ),\n 'aliases' => array('ihcM'),\n );\n\n $items['ihcCollect'] = array(\n 'description' => dt('Collect IHC info for a range of PIDs.'),\n 'arguments' => array(\n 'first' => dt(\"First PID to process. The namespace portion of this PID defines the default primary namespace. This parameter may be specified as 'namespace:first-last' in place of the --repeat option.\"),\n ),\n 'options' => array(\n 'repeat' => dt(\"Specifies the number of consecutive PIDs following 'first' to be processed. Default is 'all'.\"),\n 'follow' => dt('If specified, the known constituents of compoundCModel objects are processed following their parent.'),\n 'modAfter' => dt(\"If set with a YYYY-mm-ddTHH:ii:ssZ timestamp string, then only objects modified after said local time are considered. Default is the last operation date/time.\"),\n ),\n 'examples' => array(\n 'Example' => 'drush -u 1 ihcCollect grinnell:1 --repeat=all',\n ),\n 'aliases' => array('ihcC'),\n );\n\n $items['ihcAnalyze'] = array(\n 'description' => dt('Analyze existing Islandora Health Check data for a specified range of existing PID data.'),\n 'arguments' => array(\n 'first' => dt('First PID to process. The namespace portion of this PID defines the default primary namespace.'),\n ),\n 'options' => array(\n 'repeat' => dt(\"Specifies the number of consecutive PIDs following 'first' to be processed. Default is 'all'.\"),\n 'script' => dt('The path of a new or existing bash script to accept fhcF and fhcS commands for follow-up operations.'),\n 'modAfter' => dt(\"If set with a YYYY-mm-ddTHH:ii:ssZ timestamp string, then only objects modified after said local time are considered. Default is the last operation date/time.\"),\n ),\n 'examples' => array(\n 'Example' => 'drush ihcAnalyze grinnell:100 --repeat=27 --script=public://script.sh',\n ),\n 'aliases' => array('ihcA'),\n );\n\n $items['ihcReport'] = array(\n 'description' => dt('Report existing Islandora Health Check data and analysis results to create an XSLS report from a specified range of existing PID data.'),\n 'arguments' => array(\n 'first' => dt('First PID to process. The namespace portion of this PID defines the default primary namespace.'),\n ),\n 'options' => array(\n 'repeat' => dt(\"Specifies the number of consecutive PIDs following 'first' to be processed. Default is 'all'.\"),\n 'xlsx' => dt('The name of the XLSX file to be created.'),\n 'awstats' => dt(\"Specifies the return of only AWSTATS (access) statistics for the target object(s).\"),\n 'reportColumns' => dt(\"A string of up to 10 letters representing the columns to be reported, or 'special' to represent columns 'ABCDGHNPQ'. Default is 'standard' representing 'ABCDEFIJMO'.\"),\n ),\n 'examples' => array(\n 'Example' => 'drush ihcReport grinnell:100 --repeat=5 --xlsx=HEALTH_CHECK_Nov-10.xlsx',\n ),\n 'aliases' => array('ihcR'),\n );\n\n $items['ihcQuick'] = array(\n 'description' => dt('Collect, analyze, and report Islandora Health Check info for one or more PIDs with output directed to an XLSX file.'),\n 'arguments' => array(\n 'first' => dt('First PID to process. The namespace portion of this PID defines the default primary namespace.'),\n ),\n 'options' => array(\n 'repeat' => dt(\"Specifies the number of consecutive PIDs following 'first' to be processed. Default is 'all'.\"),\n 'xlsx' => dt('The name of the XLSX file to be created. Default is DG_Quick.xlsx.'),\n 'reportColumns' => dt(\"A string of five letters representing the columns to be reported along with A-C and I-J. Default is 'DEFGH'.\"),\n 'modAfter' => dt(\"If set with a YYYY-mm-ddTHH:ii:ssZ timestamp string, then only objects modified after said local time are considered. Default is the last operation date/time.\"),\n ),\n 'examples' => array(\n 'Example' => 'drush ihcQuick grinnell:100 --repeat=10',\n ),\n 'aliases' => array('ihcQ'),\n );\n\n return $items;\n}", "public function onPostCmdEvent() {\n if ($this->isToRunInstallation) {\n $this->install();\n }\n }", "function leadership_drush_command() {\n $items = array();\n $items['leadership-unpublish-print-profiles'] = array(\n 'description' => 'Unpublishes all print profiles',\n 'drupal dependencies' => array('leadership'),\n 'examples' => array(\n 'unpublish nodes' => 'drush leadership-unpublish-print-profiles',\n ),\n );\n $items['leadership-add-year'] = array(\n 'description' => 'Add a year (which is a taxonomy term of Leadership Session Vocabulary) to all active Leadership companies',\n 'drupal dependencies' => array('leadership'),\n 'arguments' => array(\n 'tid1' => t('The taxonomy id of the previous year'),\n 'tid2' => t('The taxonomy id of the year that needs to be added '),\n ),\n 'required-arguments' => TRUE,\n 'examples' => array(\n 'Add 2014' => 'drush leadership-add-year 6511 6512',\n 'Add 2015' => 'drush leadership-add-year 6512 6513',\n ),\n );\n $items['leadership-check-approval'] = array(\n 'description' => 'Looks for data-cards & online-profiles that are unapproved, then sends email to the sales rep for that company',\n 'drupal dependencies' => array('leadership'),\n 'examples' => array(\n 'check for unapproved' => 'drush leadership-check-approval',\n ),\n $items['leadership-session-switchover'] = array(\n 'description' => 'Checks if the current date is equal to or greater than the Next Session Year and switches the current section and paths to new images.',\n 'drupal dependencies' => array('leadership'),\n 'examples' => array(\n 'check if session should be switched' => 'drush leadership-session-switchover',\n ),\n )\n );\n\n return $items;\n}", "function post_sql_sync_extras_drush_help_alter(&$command) {\n if ($command['command'] == 'sql-sync') {\n $command['options']['rr'] = \"Rebuild the registry on the target site after the sync operation has completed.\";\n $command['options']['fra'] = \"Revert all features on the target site after the sync operation has completed.\";\n $command['options']['enable'] = \"Enable the specified modules in the target database after the sync operation has completed.\";\n $command['options']['disable'] = \"Disable the specified modules in the target database after the sync operation has completed.\";\n $command['options']['permission'] = \"Add or remove permissions from a role in the target database after the sync operation has completed. The value of this option must be an array, so it may only be specified in a site alias record or drush configuration file. See `drush topic docs-example-sync-extension`.\";\n }\n}", "protected function onPostInstall(){\n $this->aTx['storage']->addCommand(\n 'pkg/onPostInstall',\n new AMI_Tx_Cmd_Args(get_object_vars($this))\n );\n }", "public function onPostCmdEvent(\\Composer\\Script\\Event $event)\n {\n $event->getIO()->write(\"Updating Shepherd scaffold files.\");\n $this->updateShepherdScaffoldFiles();\n $event->getIO()->write(\"Creating necessary directories.\");\n $this->createDirectories();\n $event->getIO()->write(\"Creating settings.php file if not present.\");\n $this->populateSettingsFile();\n $event->getIO()->write(\"Removing write permissions on settings files.\");\n $this->removeWritePermissions();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to define the patient_enquiry & EnquiryPlanGenration relation
public function fn_patient_enquiry_plan_genration_data() { return $this->belongsTo('App\Model\PatientEnquiry', 'patient_enquiry_id'); }
[ "public function inquiry()\n {\n return $this->hasOne('App\\Inquiry','saleslead_id');\n }", "public function getEnquiry()\n {\n return $this->hasOne(Enquiry::className(), ['id' => 'enquiry_id']);\n }", "function familyelderrelationrpt()\n\t{\n\t\t$this->load->model('constantmodel');\n\t\t\n\t\t$this->data['elder_psychologicalstatus'] = $this->constantmodel->get_sub_constant(44);\n\t\t$this->data['elder_elderbehaviour'] = $this->constantmodel->get_sub_constant(43);\n\t\t$this->data['elder_elderpariah'] = $this->constantmodel->get_sub_constant(56);\n\t\t$this->data['elder_choice'] = $this->constantmodel->get_sub_constant(38);\n\t\t\n\t}", "public function enquiry() {\n //Get the request and load it as variables\n $request = \\Request::all();\n $procedureId = (!empty($request['procedure_id']) && $request['procedure_id'] > 0) ? Validate::escapeString($request['procedure_id']) : null;\n $hospitalId = Validate::escapeString($request['hospital_id']);\n $title = Validate::escapeString($request['title']);\n $firstName = Validate::escapeString($request['first_name']);\n $lastName = Validate::escapeString($request['last_name']);\n $email = Validate::escapeString($request['email']);\n $phoneNumber = Validate::escapeString($request['phone_number']);\n $postcode = Validate::escapeString($request['postcode']);\n $reason = !empty($request['reason_for_contact']) ? Validate::escapeString($request['reason_for_contact']) : 'other';\n $additionalInformation = Validate::escapeString($request['additional_information']);\n\n //Check if we have the required variables\n $required = ['hospitalId', 'title', 'firstName', 'lastName', 'email', 'phoneNumber','postcode'];\n foreach($required as $req) {\n if(empty($$req)){\n $this->returnedData['error'] = 'Please supply the value: '.$req;\n Errors::generateError($this->returnedData);\n }\n }\n\n //Check if there is one or more hospital_id sent\n if (strpos($hospitalId, ',') !== false) {\n //Explode the hospital ids\n $hospitalIds = explode(',', $hospitalId);\n } else {\n $hospitalIds = [$hospitalId];\n }\n\n //Check if the Hospital is Private\n// if(!empty($hospitalIds) && is_array($hospitalIds)) {\n// foreach($hospitalIds as $key => $hospitalId) {\n// if(!empty($hospitalId)) {\n// $hospital = Hospital::where('id', $hospitalId)->with('hospitalType')->first();\n// if(empty($hospital) || $hospital->hospitalType->name == 'NHS') {\n// unset($hospitalIds[$key]);\n// }\n// }\n// }\n// }\n\n //Validate date of birth (OLD)\n// if(!Validate::isValidDate($dob)) {\n// $this->returnedData['error'] = 'The date_of_birth is wrong. Please try again.';\n// Errors::generateError($this->returnedData);\n// }\n\n //Validate the email\n if(!Validate::isValidEmail($email)) {\n $this->returnedData['error'] = 'The email is wrong. Please try again.';\n Errors::generateError($this->returnedData);\n }\n\n //Validate the phone_number\n if(!Validate::isValidPhoneNumber($phoneNumber)) {\n $this->returnedData['error'] = 'The phone number is wrong. Please try again.';\n Errors::generateError($this->returnedData);\n }\n\n //Validate the postcode\n if(!Validate::isValidPostcode($postcode)) {\n $this->returnedData['error'] = 'The postcode is wrong. Please try again.';\n Errors::generateError($this->returnedData);\n }\n\n //Set the Specialty if we have a procedure_id\n $specialtyId = null;\n if(!empty($procedureId)) {\n $specialty = Procedure::where('id', $procedureId)->first();\n if(!empty($specialty))\n $specialtyId = $specialty->specialty_id;\n }\n\n //We can create the actual Enquiry(s) if it reaches here\n $enquiry = [];\n foreach($hospitalIds as $i => $hospitalId) {\n $enquiry[$i] = new Enquiry();\n $enquiry[$i]->specialty_id = $specialtyId;\n $enquiry[$i]->hospital_id = $hospitalId;\n $enquiry[$i]->title = $title;\n $enquiry[$i]->first_name = $firstName;\n $enquiry[$i]->last_name = $lastName;\n $enquiry[$i]->email = $email;\n $enquiry[$i]->phone_number = $phoneNumber;\n $enquiry[$i]->postcode = $postcode;\n $enquiry[$i]->reason = $reason;\n $enquiry[$i]->additional_information = $additionalInformation;\n $enquiry[$i]->save();\n\n //Get the hospital and send the email if it has an email address\n $hospital = Hospital::where('id', $hospitalId)->first();\n $specialty = Specialty::where('id', $specialtyId)->first();\n $specialtyName = '';\n //Set the Specialty Name if we have it\n if(!empty($specialty))\n $specialtyName = $specialty->name;\n\n //TODO: This is for the `live` environment ONLY\n if(env('APP_ENV') == 'live') {\n if(!empty($hospital) && !empty($hospital->email)) {\n try {\n $bodyProvider = Email::getProviderBody($specialtyName, $title, $firstName, $lastName, $email, $phoneNumber, $postcode, $additionalInformation);\n Email::send($bodyProvider, $hospital->email, 'Enquiry regarding treatment at your hospital', 'datamanager@hospitalcompare.co.uk');\n } catch(\\Exception $e){\n \\Log::info('Something went wrong sending the Provider email. Please check the enquiries: '.\\GuzzleHttp\\json_encode($enquiry).'. Error:'.$e->getMessage());\n }\n }\n }\n\n //Send the email //TODO: Activate it once the tests are working\n if(!empty($enquiry[$i])) {\n $bodyUser = Email::getUserBody($hospital->name, $specialtyName, $title, $firstName, $lastName, $email, $phoneNumber, $postcode, $reason, $additionalInformation);\n $ATBody = Email::getTrunkieBody($hospital->name, $hospital->location_id, $specialtyName, $title, $firstName, $lastName, $email, $phoneNumber, $postcode, $additionalInformation);\n //Send the Email to User\n try {\n Email::send($bodyUser, $email, 'Thank you for Enquiring with Hospital Compare', 'datamanager@hospitalcompare.co.uk');\n } catch(\\Exception $e){\n \\Log::info('Something went wrong sending the User email. Please check the enquiries: '.\\GuzzleHttp\\json_encode($enquiry[$i]).'. Error:'.$e->getMessage());\n }\n //Send the Data to AT\n try {\n Email::send($ATBody, 'sechcemailbccabshatdsdnlntets@hospitalcompare.onmicrosoft.com', 'Enquire ID: '.$enquiry[$i]->id, 'datamanager@hospitalcompare.co.uk');\n } catch(\\Exception $e){\n \\Log::info('Something went wrong sending the email to AT. Please check the enquiries: '.\\GuzzleHttp\\json_encode($enquiry[$i]).'. Error:'.$e->getMessage());\n }\n\n }\n }\n\n $this->returnedData['success'] = true;\n $this->returnedData['data'] = $enquiry;\n\n return $this->returnedData;\n }", "public function consultation() \n {\n return $this->belongsTo('App\\Client\\Consultation');\n\n }", "public function exam_questions_anwser_choices()\n {\n return $this->hasMany(ExamQuestionsChoices::class, 'exam_question_id');\n }", "public function getByEnquiry($enquiryId) {\n \n $returnArray = array();\n\t\t\n\t\t//Use the Enquiry datasource to retrieve the identifiers to the reference subject's\n\t\t//residences.\n\t\t$enquiryDatasource = new Datasource_ReferencingLegacy_Enquiry();\n\t\t$currentResidenceId = $enquiryDatasource->getResidenceId(\n\t\t\t$enquiryId, Model_Referencing_ResidenceChronology::CURRENT);\n\t\t$firstPreviousResidenceId = $enquiryDatasource->getResidenceId(\n\t\t\t$enquiryId, Model_Referencing_ResidenceChronology::FIRST_PREVIOUS);\n\t\t$secondPreviousResidenceId = $enquiryDatasource->getResidenceId(\n\t\t\t$enquiryId, Model_Referencing_ResidenceChronology::SECOND_PREVIOUS);\n\t\t\n\t\t\n\t\t//Now identify the residences recorded in the tenant_address table.\n\t\tfor($i = 0; $i < 3; $i++) {\n\t\t\t\n\t\t\tswitch($i) {\n\t\t\t\t\n\t\t\t\tcase 0: $residenceId = $currentResidenceId; break;\n\t\t\t\tcase 1: $residenceId = $firstPreviousResidenceId; break;\n\t\t\t\tcase 2: $residenceId = $secondPreviousResidenceId; break;\n\t\t\t}\n\t\t\t\n\t\t\tif(empty($residenceId)) {\n\t\t\t\t\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$select = $this->select();\n\t\t\t$select->where('refno = ?', $residenceId);\n\t\t\t$residenceRow = $this->fetchRow($select);\n\t\t\t\n\t\t\tif(!empty($residenceRow)) {\n\t\t\t\t\t\n\t\t\t\t$residence = new Model_Referencing_Residence();\n\t\t\t\t\n\t\t\t\t//Set the ID.\n\t\t\t\t$residence->id = $residenceRow->refno;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Set the address.\n\t\t\t\t$address = new Model_Core_Address();\n\t\t\t\t$address->flatNumber = $residenceRow->flat;\n\t\t\t\t$address->houseName = $residenceRow->house;\n\t\t\t\t$address->addressLine1 = $residenceRow->address1;\n\t\t\t\t$address->addressLine2 = $residenceRow->address2;\n\t\t\t\t$address->town = $residenceRow->town;\n\t\t\t\t$address->postCode = $residenceRow->postcode;\n\t\t\t\t$address->country = $residenceRow->country;\n\t\t\t\t$residence->address = $address;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Set the chronology.\n\t\t\t\tswitch($i) {\n\t\t\t\t\n\t\t\t\t\tcase 0: $residence->chronology = Model_Referencing_ResidenceChronology::CURRENT; break;\n\t\t\t\t\tcase 1: $residence->chronology = Model_Referencing_ResidenceChronology::FIRST_PREVIOUS; break;\n\t\t\t\t\tcase 2: $residence->chronology = Model_Referencing_ResidenceChronology::SECOND_PREVIOUS; break;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Set the duration of occupancy.\n\t\t\t\t$residence->durationAtAddress = $residenceRow->monthshere;\n\n\t\t\t\t\n\t\t\t\t//Set the residential status (owner, tenant, living with relatives).\n\t\t\t\tif($residence->chronology == Model_Referencing_ResidenceChronology::CURRENT) {\n\t\t\t\t\t\n\t\t\t\t\t$referenceSubjectDatasource = new Datasource_ReferencingLegacy_ReferenceSubject();\n\t\t\t\t\t$residentialStatus = $referenceSubjectDatasource->getLegacyResidentialStatus($enquiryId);\n\t\t\t\t\tswitch($residentialStatus) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'Owner':\n\t\t\t\t\t\t\t$residence->status = Model_Referencing_ResidenceStatus::OWNER;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'Tenant':\n\t\t\t\t\t\t\t$residence->status = Model_Referencing_ResidenceStatus::TENANT;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'Living with Relative':\n\t\t\t\t\t\t\t$residence->status = Model_Referencing_ResidenceStatus::LIVING_WITH_RELATIVES;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$residence->status = null;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t\n\t\t\t\t\t$residence->status = null;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Set the referee and referencing details, if applicable. We only obtain a referee and\n\t\t\t\t//reference against the current residence, and even then only if the applicant is a\n\t\t\t\t//tenant at the current residence.\n\t\t\t\t$residence->refereeDetails = null;\n\t\t\t\t$residence->referencingDetails = null;\n\t\t\t\t\t\n\t\t\t\tif($residence->chronology == Model_Referencing_ResidenceChronology::CURRENT) {\n\t\t\t\t\t\n\t\t\t\t\tif($residence->status == Model_Referencing_ResidenceStatus::TENANT) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$refereeDatasource = new Datasource_ReferencingLegacy_ResidentialReferees();\n\t\t\t\t\t\t$residence->refereeDetails = $refereeDatasource->getByEnquiry($enquiryId);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$residentialReferenceDatasource = new Datasource_ReferencingLegacy_ResidentialReferences();\n\t\t\t\t\t\t$residence->referencingDetails = $residentialReferenceDatasource->getByEnquiry($enquiryId);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$returnArray[] = $residence;\n\t\t\t}\n\t\t}\n \n\t\t\n\t\t//Finalize\n\t\tif(empty($returnArray)) {\n\t\t\t\n\t\t\t$returnVal = null;\n\t\t}\n\t\telse {\n\t\t\t\n\t\t\t$returnVal = $returnArray;\n\t\t}\n return $returnVal;\n }", "public function applicant_answers()\n {\n return $this->hasMany('App\\ApplicantAnswer');\n }", "public function requirements()\n\t{\n\t\treturn $this->belongsToMany('App\\Award', 'award_requirements');\n\t}", "public function getEnquiries()\n {\n return $this->hasMany(Enquiry::className(), ['countries_id' => 'id']);\n }", "public function getEnquiries()\n {\n return $this->hasMany(Enquiry::className(), ['program_id' => 'id']);\n }", "public function getAdmissionDiagnosis(){\n return $this->hasMany(AdmissionDiagnosis::className(), ['admission_id' => 'transaction_number']);\n }", "public function appointments_patient()\n {\n return $this->hasMany('App\\Appointment', 'patient_id');\n }", "public function attendanceApprovals()\n {\n return $this->hasMany('App\\Models\\AttendanceApproval', 'regno', 'personnel_no');\n }", "public function createEnquiryTask() {\n $this->type = \"enquiry\";\n return $this->createTask();\n }", "public function getEnquiryBatches() \n { \n return $this->hasMany(EnquiryBatch::className(), ['enquiry_id' => 'id']); \n }", "public function getIddefActividads()\n {\n return $this->hasMany(RelActividadRestriccion::className(), ['iddef_actividad' => 'iddef_actividad'])->viaTable('def_actividad', ['iddef_actividad' => 'iddef_actividad']);\n }", "public function agency()\n {\n return $this->belongsTo('App\\Models\\Api\\v1\\Person', 'n_AgencyPersoninfoId_FK')->withDefault();\n }", "public function inquiries(){\n return $this->hasMany('ProIMAN\\Inquiry','subject_id');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
two array contains id of painting and artist
public function __construct() { $this->artist = array(); $this->painting = array(); }
[ "public function find_artist() {\n\n $this->artistas = $this->user_artistas;\n if(is_array($this->user_artistas)) {\n foreach($this->user_artistas as $artista) {\n $query_db = \"SELECT DISTINCT a2.id_fb FROM artista a1, artista a2, assemelha_artista aa\n WHERE a2.id_fb IS NOT NULL AND \" . mysql_real_escape_string($artista) . \" = a1.id_fb AND a1.id_spotify = aa.id_spotify_super and aa.id_spotify_sub = a2.id_spotify\";\n $artistas_res = mysql_query($query_db, $this->my_connect);\n if($artistas_res === FALSE) { die(mysql_error()); }\n while($artistas_row = mysql_fetch_array($artistas_res)) {\n array_push($this->artistas, $artistas_row['id_fb']);\n }\n }\n }\n if(is_array($this->artistas)) { \n $this->artistas = array_unique($this->artistas);\n }\n }", "public function mapPackArtist( array $a = array() ){\r\n\t\tif($a){\r\n\t\t\t$packId=(int)$a['packId'];\r\n\t\t\t$artistIds=$a['artistIds'];\r\n\t\t\tif($packId){\r\n\t\t\t\t$this->sSql = \"DELETE FROM pack_artist WHERE pack_id='\".$packId.\"'\";\r\n\t\t\t\t$resDel = $this->oMysqli->query($this->sSql);\r\n\t\t\t}\r\n\t\t\tif(!empty($artistIds)){\r\n\t\t\t\tforeach($artistIds as $kR=>$vR){ \r\n\t\t\t\t\t$this->sSql = \"INSERT IGNORE INTO pack_artist (`pack_id`,`artist_id`) VALUES ('\".$packId.\"','\".$vR.\"')\";\r\n\t\t\t\t\t$res = $this->oMysqli->query($this->sSql);\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t}", "public function mapArtistImage( array $a = array() ){\r\n\t\tif($a){\r\n\t\t\t$imageId=(int)$a['imageId'];\r\n\t\t\t$artistIdsArray=$a['artistIds'];\r\n\t\t\tif($imageId){\r\n\t\t\t\t$this->sSql = \"DELETE FROM `image_map` WHERE image_id='\".$imageId.\"' AND content_type=13\";\r\n\t\t\t\t$resDel = $this->oMysqli->query($this->sSql);\r\n\t\t\t}\r\n\t\t\tif($artistIdsArray){\r\n\t\t\t\tforeach($artistIdsArray as $kT=>$vT){ \r\n\t\t\t\t\t$this->sSql = \"INSERT IGNORE INTO `image_map` (`image_id`,`content_id`,`content_type`) VALUES ('\".$imageId.\"',\".$vT.\", 13)\";\r\n\t\t\t\t\t$res = $this->oMysqli->query($this->sSql);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function getArtistInfo($id){\n if(is_array($id)){\n $idQuery = 'IN (';\n foreach ($id as $i)\n $idQuery .= '\"'.mysql_real_escape_string($id).'\", \"';\n $idQuery = substr($idQuery, 0, -strlen(', \"')); #remove trailing ', \"'\n }\n else\n $idQuery = '= \"'.mysql_real_escape_string($id).'\"';\n $query = 'SELECT CONCAT_WS(\" \", first_name, last_name) AS name, wiki FROM `artist_table` WHERE id IN';\n $query .= ' (SELECT artist FROM `artist_links` WHERE artist_links.object '.$idQuery.')';\n return self::doQuery($query);\n }", "function getRelatedArtists($artist_id){\n $array = $this->executeCURL(\"https://api.spotify.com/v1/artists/$artist_id/related-artists\", array(\"Authorization: Bearer $this->accessToken\"), \"GET\");\n\n if(isset($array['error'])){\n $this->response['successful'] = false;\n $this->response['errors'][] = (isset($array['error']['message'])) ? $array['error']['message'] : $array['error'];\n (isset($array['error_description'])) ? $this->response['errors'][] = $array['error_description'] : $array['error'];\n return null;\n }else{\n $this->response['successful'] = true;\n $this->response['status_message'] = \"Successfully returned album array.\";\n return $array['artists'];\n }\n }", "function mergeArtists($id) {\n\n\t$dupRow = mysql_fetch_array(mysql_query(\"select real_artist,duplicates from duplicates where id = '\".$id.\"'\"));\n\n\t// get real artist id\n\t$real_artist_info = explode(\"-\",$dupRow['real_artist']);\n\t$rID = $real_artist_info[0];\n\t$rName = $real_artist_info[1];\n\n\t// get duplicate artist id\n\t$dup_artist_info = explode(\"-\",$dupRow['duplicates']);\n\t$dupID = $dup_artist_info[0];\n\tfor($i=1;$i<sizeof($dup_artist_info); $i++) {\n\t\t$dupName .= $dup_artist_info[$i];\n\t}\n\t$albumsQuery=mysql_query(\"select id from album where artist='\".$dupID.\"'\");\n\t\n\t// add this duplicate name to the aka list of the actual artist\n\t$realArtistAKA = mysql_fetch_array(mysql_query(\"select aka from artist where id = \".$rID));\n\tif($realArtistAKA['aka'] != '') {\n\t\t$realArtistAKA['aka'] .= ', ';\n\t}\n\t$retVal = mysql_query(\"update artist set aka = '\".$realArtistAKA['aka'].\" \".$dupName.\"' where id = \".$rID);\n\t\n\t\n\t// for each album within duplicate artist\n\twhile($album = mysql_fetch_array($albumsQuery) ) {\n\t\t\n\t\t// create new directory under real artist for album\n\t\tif(!file_exists(\"/var/www/music/\".$rID.\"/\".$album['id']) ) {;\n\t\t\texec(\"mkdir /var/www/music/\".$rID.\"/\".$album['id']);\n\t\t}\n\n\t\tif(!file_exists(\"/var/www/music/\".$rID.\"/\".$album['id']) ) {\n\t\t\terror_log(\"could not make directory /var/www/music/\".$rID.\"/\".$album['id']);\n\t\t}\n\n\t\t$songsQuery = mysql_query(\"select id, filename from song where artist = '\".$dupID.\"' and album = '\".$album['id'].\"'\");\n\n\t\tif(mysql_num_rows($songsQuery) == 0) {\n\t\t\terror_log('no songs for artist '.$dupID.' and album '.$album['id']);\n\t\t}\n\t\t// for each song in the duplicate artist directory\n\t\twhile($song = mysql_fetch_array($songsQuery)) {\n\t\t\t$filename = $song['filename'];\t\n\n\t\t\t// copy to newly created real artist album directory\n\t\t\terror_log(\"cp /var/www/music/\".$dupID.\"/\".$album['id'].\"/\".$filename.\" /var/www/music/\".$rID.\"/\".$album['id'].\"/\".$filename);\n\t\t\texec(\"cp /var/www/music/\".$dupID.\"/\".$album['id'].\"/\".$filename.\" /var/www/music/\".$rID.\"/\".$album['id'].\"/\".$filename);\n\t\t\t\n\t\t\t// verify copy of file\n\t\t\tif(!file_exists(\"/var/www/music/\".$rID.\"/\".$album['id'].\"/\".$filename) ) {\n\t\t\t\terror_log(\"unsuccessful copy: /var/www/music/\".$dupID.\"/\".$album['id'].\"/\".$filename.\" /var/www/music/\".$rID.\"/\".$album['id'].\"/\".$filename);\n\t\t\t} else {\n\t\t\t\t// if verified, remove file from old directory\n\t\t\t\texec(\"rm -f /var/www/music/\".$dupID.\"/\".$album['id'].\"/\".$filename) or (error_log(\"couldn't delete: /var/www/music/\".$dupID.\"/\".$album['id'].\"/\".$filename));\n\t\t\t\t// update song record (both artist and album entry) in database\n\t\t\t\tmysql_query(\"update song set artist = '\".$rID.\"', album = '\".$album['id'].\"' where id = '\".$song['id'].\"'\");\n\t\t\t}\n\n\t\t}\n\t\t\n\t\t// once all songs are copied, update artist column in album database\n\t\tmysql_query(\"update album set artist = '\".$rID.\"' where id = '\".$album['id'].\"'\");\n\t}\n\n\t// once all the albums have been moved, update the artist to status 0\n\tmysql_query(\"update artist set status = 0 where id = '\".$dupID.\"'\");\n\n}", "function get_song_ids() {\n\n\t\t$sql = \"SELECT id FROM song WHERE artist='\" . sql_escape($this->id) . \"' ORDER BY album, track\";\n\t\t$db_results = mysql_query($sql, dbh());\n\n\t\twhile ($r = mysql_fetch_assoc($db_results)) {\n\t\t\t$results[] = $r['id'];\n\t\t}\n\n\t\treturn $results;\n\n\t}", "public function gettingBreweriesNames($ids,$breweries){\n $BreweriesArray=array();\n\n foreach($ids as $id){\n foreach($breweries as $brewerie){\n if($id==$brewerie->id){\n array_push($BreweriesArray,$brewerie);\n }\n }\n }\n return $BreweriesArray;\n }", "function &dok_rel_song_artist($songs = array(), $artists = array() ) {\n\t$where = 'where ';\n\tif ( sizeof($songs) )\t{\n\t\t$where .= 'r.song_id in ('.implode(',',$songs).')';\n\t} elseif ( sizeof($artists) ) {\n\t $where .= 'r.artist_id in ('.implode(',',$artists).')';\n\t}\n\t$query = 'select r.artist_id, r.song_id from '.dok_tn('rel_song_artist').' as r left join '.dok_tn('song').' as s on r.song_id = s.id '.$where.' order by s.hits desc, s.name';\n\treturn dok_oquery($query);\n}", "function getartistdata($id) {\n $getArtistData = $this->find('first', array('conditions' => array('id' => $id))); \n return $getArtistData;\n }", "public function addArtist($id) {\n \n $this->favList[$this->art][\" $id\"] = new ArtistFavourite($id);\n $this->saveFavourites();\n }", "function getAlbumByArtist($artist_id) {\n global $conn;\n $query = \"SELECT * FROM albums AS al JOIN artists AS ar ON al.album_artist_id = ar.artist_id WHERE album_artist_id = :artist_id\";\n $stmt = $conn->prepare($query);\n $stmt->execute([\n ':artist_id' => $artist_id\n ]);\n $albums = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n return $albums;\n}", "public function getJsonIdList(){\n $this->loadCart();\n $idArray=null;\n \n if(isset($this->PaintingID)){\n foreach ($this->PaintingID as $key => $paintingEntity) {\n $idArray[]=str_replace(\" \",\"\",$key);\n }\n }\n\n \n return $idArray;\n }", "public function artistList(): array {\n return $this->collage->artistList();\n }", "function setId($id) {\r\n // Set artist id and wipe data\r\n $this->_id\t\t= $id;\r\n $this->_data\t= null;\r\n }", "public function getSongIds(){\n $query = mysqli_query($this->con, \"SELECT id FROM songs WHERE artist='$this->id' ORDER BY plays ASC\");\n\n $songArray = array();\n\n while($row = mysqli_fetch_array($query)){\n array_push($songArray, $row['id']);\n }\n\n return $songArray;\n }", "public static function get_all_product_ids_by_artist_number(int $artist_id) \n {\n try {\n global $wpdb;\n $product_ids = $wpdb->get_col($wpdb->prepare(\"SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_key = '_artist_id' AND meta_value = %d\", $artist_id));\n return $product_ids;\n }\n catch(\\Exception $e) {\n Logger::write_log($e->getMessage());\n }\n }", "function addArtists($c){\n\t$artists = array();\n\t$db = new DB($c['db_host'], $c['db_user'], $c['db_pass'], $c['db_name']);\n\t$sql = \"SELECT id, name from artist order by name asc\";\n\t\t$query = $db->query($sql);\n\t\twhile($row = $query->fetch_array()){\n\t\t\t$i = $row['id'];\n\t\t\t$n = $row['name'];\n\t\t\t$artists[] = new Artist($i,$n);\n\t\t}\n\t\t$db->close();\n\t\treturn $artists;\n}", "public function getPackArtistMap( array $a = array() ){\r\n\t\tif($a){\r\n\t\t\t$where=\"\";\r\n\t\t\tif($a['where']){\r\n\t\t\t\t$where=$a['where'];\r\n\t\t\t}\r\n\t\t\t\t$this->sSql = \"SELECT * FROM pack_artist WHERE 1 $where\";\r\n\t\t\t\treturn $res = $this->oMysqli->query($this->sSql);\r\n\t\t}\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find a new key based on a given key. Keep appending '_'s to the original key until a new unique key is found or 5 '_'s have been appended.
private static function newKey($a, $k) { $newk = $k; for ($i = 0; $i < 5; $i++) { $newk .= '_'; if (!array_key_exists($newk, $a)) { return $newk; } } return null; }
[ "function meta_key_change( $key ){\r\n\t\t\r\n\t\t$length = strlen( $key );\r\n\t\t$new_key = (string) '';\r\n\t\t$new_key_1 = (string) '';\r\n\t\t\r\n\t\tif( $length <= 27 ){\r\n\t\t\tfor( $i = 1; $i <= 20; $i++ ){\r\n\t\t\t\t$new_key = $key.'_'.$i;\r\n\t\t\t\t$key_exists = $this->meta_key_exists( $new_key );\r\n\t\t\t\tif( empty( $key_exists ) ){\r\n\t\t\t\t\treturn $new_key;\r\n\t\t\t\t\t//break;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}elseif( $length == 28 ){\r\n\t\t\tfor( $i = 1; $i <= 20; $i++ ){\r\n\t\t\t\t$new_key = $key.$i;\r\n\t\t\t\t$key_exists = $this->meta_key_exists( $new_key );\r\n\t\t\t\tif( empty( $key_exists ) ){\r\n\t\t\t\t\treturn $new_key;\r\n\t\t\t\t\t//break;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}elseif( $length == 29 ){\r\n\t\t\tfor( $i = 1; $i <= 20; $i++ ){\r\n\t\t\t\t$new_key = substr_replace( $key, \"\", -1 );\r\n\t\t\t\t$new_key_1 = $new_key.$i;\r\n\t\t\t\t$key_exists = $this->meta_key_exists( $new_key_1 );\r\n\t\t\t\tif( empty( $key_exists ) ){\r\n\t\t\t\t\treturn $new_key_1;\r\n\t\t\t\t\t//break;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "public function buildKey($key);", "private function generateNewKey() {\n $keyExists = true;\n while ($keyExists) {\n $key = $this->generate();\n $keyExists = self::exists($key);\n }\n \n return $key;\n }", "public function findKey($key);", "function\tnewKey() {\n\t\tFDbg::begin( 1, basename( __FILE__), __CLASS__, __METHOD__.\"( $_digits, '$_nsStart', '$_nsEnd')\") ;\n\t\t$keyCol\t=\t$this->keyCol ;\n\t\t$myQuery\t=\t$this->getQueryObj( \"Select\") ;\n\t\t$myQuery->addWhere( $this->keyCol . \" LIKE 'A.%'\") ;\n\t\t$myQuery->addOrder( $this->keyCol . \" DESC\") ;\n\t\t$myQuery->addLimit( new FSqlLimit( 0, 1)) ;\n\t\t$myRow\t=\tFDb::queryRow( $myQuery, self::$db[$this->className]) ;\n\t\t$this->_assignFromRow( $myRow) ;\n\t\tFDbg::trace( 2, FDbg::mdTrcInfo1, basename( __FILE__), __CLASS__, __METHOD__.\"( $_digits, '$_nsStart', '$_nsEnd')\", \"Last Key := '\".$this->$keyCol.\"'\") ;\n\t\t$this->$keyCol\t=\t\"A.\" . sprintf( \"%06d\", intval( substr( $this->$keyCol, 2)) + 1) ;\n\t\tFDbg::end() ;\n\t}", "function upgrade_key($newkey=FALSE) {\n\tstatic $key=false;\n\tif ( !$newkey ) {\n\t\treturn $key;\n\t}\n\t$key = $newkey;\n}", "public function getNewKey();", "protected function prepare_key($key) {\n return $this->cacheprefix . $key;\n }", "protected function getPrefixedKey($key): string\n {\n }", "private function keyPrep($len)\n\t{\n\t\t// we never modify the actual key, so we save it into another variable\n\t\t$this->expanded_key = $this->key();\n\t\t$this->expanded_key = strtoupper($this->expanded_key);\n\t\t$this->expanded_key = preg_replace(\"/[^A-Z]/\", \"\", $this->expanded_key);\n\t\t$keylen = strlen($this->expanded_key);\n\n\t\t// The key must be prepared so that it is the same length as the\n\t\t// message. If it is longer or shorter we need to modify it\n\t\t// to make it the correct length\n\t\tif($keylen > $len)\n\t\t\t$this->expanded_key = substr($this->expanded_key, 0, $len);\n\t\telse if($len > $keylen)\n\t\t{\n\t\t\t// if the key is shorter than the message, then we need pad the key\n\t\t\t// by repeating it until it is the correct length\n\t\t\t$diff = $len - $keylen;\n\t\t\t$pos = 0;\n\n\t\t\tfor($i = 0; $i < $diff; ++$i)\n\t\t\t{\n\t\t\t\tif($pos >= $keylen)\n\t\t\t\t\t$pos = 0;\n\n\t\t\t\t$this->expanded_key .= $this->expanded_key[$pos];\n\t\t\t\t++$pos;\n\t\t\t}\n\t\t}\n\t}", "private function expandKey()\n\t{\n\t\t// start by copying the key to the xkey variable\n\t\t$this->xkey = $this->key();\n\t\t$len = $this->keySize();\n\n\t\t// the max length of the key is 128 bytes\n\t\tif($len > 128)\n\t\t\t$this->xkey = substr($this->xkey, 0, 128);\n\n\t\t// now expanded the rest of the key to 128 bytes, using the sbox\n\t\tfor($i = $len; $i < 128; ++$i)\n\t\t{\n\t\t\t$byte1 = ord($this->xkey[$i - $len]);\n\t\t\t$byte2 = ord($this->xkey[$i - 1]);\n\t\t\t$pos = ($byte1 + $byte2);\n\n\t\t\t// the sbox is only 255 bytes, so if we extend past that\n\t\t\t// we need to modulo 256 so we have a valid position\n\t\t\tif($pos > 255)\n\t\t\t\t$pos -= 256;\n\n\t\t\t$this->xkey .= chr(self::$_sbox[$pos]);\n\t\t}\n\n\t\t// now replace the first byte of the key with it's position in the sbox\n\t\t$pos = ord($this->xkey[0]);\n\t\t$this->xkey[0] = chr(self::$_sbox[$pos]);\n\t}", "public function adjustKey($key)\r\n {\r\n if ($key>= sizeof(FACINGS)) {\r\n return 0;\r\n }\r\n if ($key< 0) {\r\n return sizeof(FACINGS)-1;\r\n }\r\n return $key;\r\n\r\n \r\n }", "abstract protected function findLRUKey();", "private function keyStretching($key) {\n\t\tif($this->sha1 == true && function_exists(\"sha1\")) {\n\t\t\tfor ($i=0;$i<$this->rounds;++$i) {\n\t\t\t\t$key = sha1($key);\n\t\t\t}\n\t\t} else {\n\t\t\tfor ($i=0;$i<$this->rounds;++$i) {\n\t\t\t\t$key = md5($key);\n\t\t\t}\n\t\t}\n\t\treturn $key;\n\t}", "private function newKeystring($keyString, $key)\n {\n $newKeyString = $keyString;\n if ($newKeyString != \"\") {\n $newKeyString .= '.';\n }\n\n return $newKeyString.$key;\n }", "private function _addKeyPrefix($key)\n {\n if (!empty($this->settings['prefix'])\n && strpos($key, $this->settings['prefix']) !== 0\n ) {\n $key = $this->settings['prefix'] . $key;\n }\n return $key;\n }", "function genKeySingleton(string $tableName, string $keyName, int $keyLength = 15)\n{\n\t$ret = '';\n\n\t# --- Generate ---\n\n\tglobal $db;\n\n\tdo\n\t\t# Generate\n\t\t$key = genKey($keyLength);\n\t\n\t# Duplicate?\n\twhile(QB::table($tableName)->where(\n\t\t\t\t$keyName,\n\t\t\t\t'=',\n\t\t\t\t$key\n\t\t\t)->first() !== NULL);\n\n\treturn $key;\n}", "private function generate_key() {\n $key_parts = array();\n for ($i=0; $i<$this->part_count; $i++) {\n\t $key_parts[] = $this->generate_key_part();\n\t}\n\treturn implode($this->seperator, $key_parts);\n }", "function define_course_keys($wantedCode, $prefix4all = \"\", $prefix4baseName = \"\", $prefix4path = \"\", $addUniquePrefix = false, $useCodeInDepedentKeys = true)\r\n{\r\n\tglobal $prefixAntiNumber, $_configuration;\r\n\t$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);\t\r\n\t$wantedCode = generate_course_code($wantedCode);\r\n\t$keysCourseCode = $wantedCode;\r\n\tif(!$useCodeInDepedentKeys)\r\n\t{\r\n\t\t$wantedCode = '';\r\n\t}\r\n\r\n\tif($addUniquePrefix)\r\n\t{\r\n\t\t$uniquePrefix = substr(md5(uniqid(rand())), 0, 10);\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$uniquePrefix = '';\r\n\t}\r\n\r\n\t$keys = array ();\r\n\r\n\t$finalSuffix = array ('CourseId' => '', 'CourseDb' => '', 'CourseDir' => '');\r\n\r\n\t$limitNumbTry = 100;\r\n\r\n\t$keysAreUnique = false;\r\n\r\n\t$tryNewFSCId = $tryNewFSCDb = $tryNewFSCDir = 0;\r\n\r\n\twhile (!$keysAreUnique)\r\n\t{\r\n\t\t$keysCourseId = $prefix4all.$uniquePrefix.$wantedCode.$finalSuffix['CourseId'];\r\n\r\n\t\t$keysCourseDbName = $prefix4baseName.$uniquePrefix.strtoupper($keysCourseId).$finalSuffix['CourseDb'];\r\n\r\n\t\t$keysCourseRepository = $prefix4path.$uniquePrefix.$wantedCode.$finalSuffix['CourseDir'];\r\n\r\n\t\t$keysAreUnique = true;\r\n\r\n\t\t// check if they are unique\r\n\t\t$query = \"SELECT 1 FROM \".$course_table . \" WHERE code='\".$keysCourseId . \"' LIMIT 0,1\";\r\n\t\t$result = api_sql_query($query, __FILE__, __LINE__);\r\n\r\n\t\tif($keysCourseId == DEFAULT_COURSE || Database::num_rows($result))\r\n\t\t{\r\n\t\t\t$keysAreUnique = false;\r\n\r\n\t\t\t$tryNewFSCId ++;\r\n\r\n\t\t\t$finalSuffix['CourseId'] = substr(md5(uniqid(rand())), 0, 4);\r\n\t\t}\r\n\r\n\t\tif($_configuration['single_database'])\r\n\t\t{\r\n\t\t\t$query = \"SHOW TABLES FROM `\".$_configuration['main_database'].\"` LIKE '\".$_configuration['table_prefix'].\"$keysCourseDbName\".$_configuration['db_glue'].\"%'\";\r\n\t\t\t$result = api_sql_query($query, __FILE__, __LINE__);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$query = \"SHOW DATABASES LIKE '$keysCourseDbName'\";\r\n\t\t\t$result = api_sql_query($query, __FILE__, __LINE__);\r\n\t\t}\r\n\r\n\t\tif(Database::num_rows($result))\r\n\t\t{\r\n\t\t\t$keysAreUnique = false;\r\n\r\n\t\t\t$tryNewFSCDb ++;\r\n\r\n\t\t\t$finalSuffix['CourseDb'] = substr('_'.md5(uniqid(rand())), 0, 4);\r\n\t\t}\r\n\r\n\t\t// @todo: use and api_get_path here instead of constructing it by yourself\r\n\t\tif(file_exists($_configuration['root_sys'].$_configuration['course_folder'].$keysCourseRepository))\r\n\t\t{\r\n\t\t\t$keysAreUnique = false;\r\n\r\n\t\t\t$tryNewFSCDir ++;\r\n\r\n\t\t\t$finalSuffix['CourseDir'] = substr(md5(uniqid(rand())), 0, 4);\r\n\t\t}\r\n\r\n\t\tif(($tryNewFSCId + $tryNewFSCDb + $tryNewFSCDir) > $limitNumbTry)\r\n\t\t{\r\n\t\t\treturn $keys;\r\n\t\t}\r\n\t}\r\n\r\n\t// db name can't begin with a number\r\n\tif(!stristr(\"abcdefghijklmnopqrstuvwxyz\", $keysCourseDbName[0]))\r\n\t{\r\n\t\t$keysCourseDbName = $prefixAntiNumber.$keysCourseDbName;\r\n\t}\r\n\r\n\t$keys[\"currentCourseCode\"] = $keysCourseCode;\r\n\t$keys[\"currentCourseId\"] = $keysCourseId;\r\n\t$keys[\"currentCourseDbName\"] = $keysCourseDbName;\r\n\t$keys[\"currentCourseRepository\"] = $keysCourseRepository;\r\n\r\n\treturn $keys;\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the instance ID.
public function set_id($instance_id) { $this->id = $instance_id; }
[ "public function set_instance_id($instance_id) {\n\t\t$this->_instance_id = $instance_id;\n\t}", "public function setInstanceId($val)\n {\n $this->_propDict[\"instanceId\"] = $val;\n return $this;\n }", "private function updateInstanceId() : void\n {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'http://169.254.169.254/latest/meta-data/instance-id');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 5);\n $instanceId = curl_exec($ch);\n curl_close($ch);\n\n if (is_string($instanceId) && preg_match('/^i-/', $instanceId)) {\n $this->instanceId = $instanceId;\n } else {\n $this->instanceId = 'unknown';\n }\n }", "public function setPinstanceID($value)\n {\n return $this->set(self::PINSTANCEID, $value);\n }", "function setID($id) {\r\n $this->id = $id;\r\n }", "public function setId($value) { $this->_id = $value; }", "public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }", "public function setId($value) { $this->id = $value;}", "public function get_instance_id()\n {\n }", "public function setInstanceId($value) \n {\n $this->_fields['InstanceId']['FieldValue'] = $value;\n return $this;\n }", "public function setID($id) {\n $this->ID = $id;\n }", "function set_id($id){\n $this->id->value = $id;\n }", "public function set_id( $id ) {\n\t\t$this->id = $this->is_valid_id( $id ) ? $id : $this->generate_session_id();\n\t}", "protected function configureId(): void\n {\n $this->id = sprintf(\n $this->options['id_format'],\n $this->options['server_name'],\n $this->options['pid'],\n implode(',', $this->queues)\n );\n }", "function setInstance($instance);", "public function setInstanceID($instanceID = null)\n {\n $this->instanceID = $instanceID;\n\n return $this;\n }", "public function setCurrentID($value)\n\t{\n\t\t$this->{static::CURRENT_ID} = $value;\n\t}", "function setId($n){\n $this->id = $n;\n }", "public function setID( $id = null ) {\n\t\tif ( defined( 'WPINC' ) )\n\t\t\t$this->_post_id = $id ? $id : get_the_ID();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the maximum timelimit before editing privileges expire
public static function getEditLimit() { if ( !defined( 'EDIT_LIMIT' ) ) { define( 'EDIT_LIMIT', ( int ) ini_get( 'session.gc_maxlifetime' ) ); } return EDIT_LIMIT; }
[ "public function getTimeLimit(): int;", "public function getTimeLimit()\n\t{\n\t\treturn $this->timeLimit;\n\t}", "public function getMaxTimeAllowed()\n\t{\n\t\treturn $this->max_time_allowed;\n\t}", "public function getTimeLimit(): int\n {\n return $this->time_limit;\n }", "public function get_max_time_allowed()\n {\n if (self::debug > 0) {\n error_log('learnpathItem::get_max_time_allowed()', 0);\n }\n if (!empty($this->max_time_allowed)) {\n return $this->max_time_allowed;\n } else {\n return '';\n }\n }", "public function getTimeLimit() : int {}", "public function getRemainingLimit();", "public function getMaxLimit()\n {\n return $this->max_limit;\n }", "public function getTimeLimit()\n {\n return $this->get(self::TIMELIMIT);\n }", "public function getPerUserUsageLimit();", "protected function get_time_limit() {\n\n\t\t$time_limit = 30;\n\n\t\t// Apply deprecated filter from deprecated get_maximum_execution_time() method\n\t\tif ( has_filter( 'action_scheduler_maximum_execution_time' ) ) {\n\t\t\t_deprecated_function( 'action_scheduler_maximum_execution_time', '2.1.1', 'action_scheduler_queue_runner_time_limit' );\n\t\t\t$time_limit = apply_filters( 'action_scheduler_maximum_execution_time', $time_limit );\n\t\t}\n\n\t\treturn absint( apply_filters( 'action_scheduler_queue_runner_time_limit', $time_limit ) );\n\t}", "function GetForgetLimitSecond()\n\t{\n\t\t$limit_sec = 300;\n\t\treturn $limit_sec;\n\t}", "public function getMiterLimit(){}", "public function getTimeLimitMinutes()\n {\n return $this->timeLimitMinutes;\n }", "function get_vrm_access_limit() {\n\t\t$res = $this->db->query( \"SELECT value FROM access_limit WHERE name='vrm'\" )->row_array();\n\t\treturn ( int ) @$res[ 'value' ];\n\t}", "private function getAdvancedReservationLimit() {\n $config = $this->config(self::CONFIG_NAME);\n $advanced_reservation_limit = $config->get('advanced_reservation_limit');\n return isset($advanced_reservation_limit) ? $advanced_reservation_limit : 0;\n }", "public function getEffectiveLimit()\n {\n if ($this->limit === null) {\n return $this->defaultLimit;\n }\n return $this->limit;\n }", "private function getReservationLimit() {\n $config = $this->config(self::CONFIG_NAME);\n $reservation_limit = $config->get('reservation_limit');\n return isset($reservation_limit) ? $reservation_limit : 0;\n }", "public function getLimit()\r\n {\r\n return $this->fields['Limit']['value'];\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This listens early for upload events, and in the case of uploaded files that should be transcoded it registers the other listeners defined here.
public function onResolveUploadedContent(ResolveUploadedContentEvent $e) { $req = $e->getRequest(); if ($file = $req->files->get('file', false)) { if ('false' !== $req->request->get('transcode', 'true')) { $this->container->get('event_dispatcher')->addSubscriber($this); } } }
[ "protected function preUpload(){}", "public function HookEvents() {\n\t\tadd_action( 'add_attachment', array( $this, 'EventFileUploaded' ) );\n\t\tadd_action( 'delete_attachment', array( $this, 'EventFileUploadedDeleted' ) );\n\t\tadd_action( 'admin_init', array( $this, 'EventAdminInit' ) );\n\t}", "protected function registerEventToServer() {\r\n foreach ($this->eventManager->register() as $event => $callback) {\r\n $this::$original->on($event,function(...$args) use($callback) {\r\n $this->eventManager::invoke($callback,$args);\r\n });\r\n }\r\n }", "private function define_process_hooks() {\n\t\t$process = new RTMedia_Transcoding_Process();\n\n\t\t/**\n\t\t * Hook into wp_generate_attachment_metadata to process the file for transcoding\n\t\t *\n\t\t * Here, we could have used add_attchment hook as well but some plugin like Amazon S3\n\t\t * hook into \"wp_generate_attachment_metadata\" and sends file to S3, it is possible that during this time\n\t\t * file might have deleted from local server. We could change it in some hook which gets fired after attachment\n\t\t * meta data has been generated.\n\t\t */\n\t\t$this->loader->add_filter( 'wp_generate_attachment_metadata', $process, 'do_transcoding', 999, 2 );\n\n\t\t/**\n\t\t * Hook into \"init\" action to handle the call back from transcoding server.\n\t\t */\n\t\t$this->loader->add_action( 'init', $process, 'handle_callback' );\n\t}", "public function onFileUploaded($event) {\n\t\t$this->raiseEvent('onFileUploaded', $event);\n\t}", "protected function registerPersistentEventHandlers()\n {\n parent::registerPersistentEventHandlers();\n\n EventUtil::registerPersistentModuleHandler('MUFiles', 'module.scribite.editorhelpers', array('MUFiles_Listener_ThirdParty', 'getEditorHelpers'));\n EventUtil::registerPersistentModuleHandler('MUFiles', 'moduleplugin.tinymce.externalplugins', array('MUFiles_Listener_ThirdParty', 'getTinyMcePlugins'));\n EventUtil::registerPersistentModuleHandler('MUFiles', 'moduleplugin.ckeditor.externalplugins', array('MUFiles_Listener_ThirdParty', 'getCKEditorPlugins'));\n }", "private function processEventSubscribers()\n {\n if (isset($this->configuration['events']['subscribers'])) {\n foreach ($this->configuration['events']['subscribers'] as $i => $subscriber) {\n if (is_string($subscriber)) {\n $this->configuration['events']['subscribers'][$i] = array('class' => $subscriber);\n }\n }\n }\n }", "public function lifecycleFileUpload() {\n $this->upload();\n }", "public function lifecycleFileUpload(): void\n {\n $this->upload();\n }", "protected function setupListeners()\n {\n //\n }", "public function initEventSubscribers(): void\n {\n $loader = new SlimAppEventSubscriberLoader($this->container);\n $loader->load();\n }", "public function lifecycleFileUpload()\n {\n $this->upload();\n }", "protected function _afterUpload()\n {\n\n }", "private function initEventHandlers()\n {\n /* //init global event handlers\n craft()->on('i18n.onAddLocale', array(craft()->commerce_productTypes, 'addLocaleHandler'));*/\n// craft()->on('commerce_orders.onOrderComplete', array(craft()->commerce_customers, 'saveUserHandler'));\n// craft()->on('users.onActivateUser', array(craft()->commerce_customers, 'loginHandler'));\n// craft()->on('commerce_orderHistories.onStatusChange', array(craft()->commerce_customers, 'logoutHandler'));\n// craft()->on('email.onSendEmailError', array(craft()->commerce_customers, 'logoutHandler'));\n\n }", "private function initListeners()\r\n {\r\n $this->eventDispatcher->registerByConfig($this->config, $this->runId);\r\n }", "protected function registerPersistentEventHandlers()\n {\n // core -> \n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'api.method_not_found', array('Pdfviewer_Listener_Core', 'apiMethodNotFound'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'core.preinit', array('Pdfviewer_Listener_Core', 'preInit'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'core.init', array('Pdfviewer_Listener_Core', 'init'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'core.postinit', array('Pdfviewer_Listener_Core', 'postInit'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'controller.method_not_found', array('Pdfviewer_Listener_Core', 'controllerMethodNotFound'));\n \n // front controller -> Pdfviewer_Listener_FrontController\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'frontcontroller.predispatch', array('Pdfviewer_Listener_FrontController', 'preDispatch'));\n \n // installer -> Pdfviewer_Listener_Installer\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'installer.module.installed', array('Pdfviewer_Listener_Installer', 'moduleInstalled'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'installer.module.upgraded', array('Pdfviewer_Listener_Installer', 'moduleUpgraded'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'installer.module.uninstalled', array('Pdfviewer_Listener_Installer', 'moduleUninstalled'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'installer.subscriberarea.uninstalled', array('Pdfviewer_Listener_Installer', 'subscriberAreaUninstalled'));\n \n // modules -> Pdfviewer_Listener_ModuleDispatch\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module_dispatch.postloadgeneric', array('Pdfviewer_Listener_ModuleDispatch', 'postLoadGeneric'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module_dispatch.preexecute', array('Pdfviewer_Listener_ModuleDispatch', 'preExecute'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module_dispatch.postexecute', array('Pdfviewer_Listener_ModuleDispatch', 'postExecute'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module_dispatch.custom_classname', array('Pdfviewer_Listener_ModuleDispatch', 'customClassname'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module_dispatch.service_links', array('Pdfviewer_Listener_ModuleDispatch', 'serviceLinks'));\n \n // mailer -> Pdfviewer_Listener_Mailer\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module.mailer.api.sendmessage', array('Pdfviewer_Listener_Mailer', 'sendMessage'));\n \n // page -> Pdfviewer_Listener_Page\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'pageutil.addvar_filter', array('Pdfviewer_Listener_Page', 'pageutilAddvarFilter'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'system.outputfilter', array('Pdfviewer_Listener_Page', 'systemOutputfilter'));\n \n // errors -> Pdfviewer_Listener_Errors\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'setup.errorreporting', array('Pdfviewer_Listener_Errors', 'setupErrorReporting'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'systemerror', array('Pdfviewer_Listener_Errors', 'systemError'));\n \n // theme -> Pdfviewer_Listener_Theme\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'theme.preinit', array('Pdfviewer_Listener_Theme', 'preInit'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'theme.init', array('Pdfviewer_Listener_Theme', 'init'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'theme.load_config', array('Pdfviewer_Listener_Theme', 'loadConfig'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'theme.prefetch', array('Pdfviewer_Listener_Theme', 'preFetch'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'theme.postfetch', array('Pdfviewer_Listener_Theme', 'postFetch'));\n \n // view -> Pdfviewer_Listener_View\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'view.init', array('Pdfviewer_Listener_View', 'init'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'view.postfetch', array('Pdfviewer_Listener_View', 'postFetch'));\n \n // user login -> Pdfviewer_Listener_UserLogin\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module.users.ui.login.started', array('Pdfviewer_Listener_UserLogin', 'started'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module.users.ui.login.veto', array('Pdfviewer_Listener_UserLogin', 'veto'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module.users.ui.login.succeeded', array('Pdfviewer_Listener_UserLogin', 'succeeded'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module.users.ui.login.failed', array('Pdfviewer_Listener_UserLogin', 'failed'));\n \n // user logout -> Pdfviewer_Listener_UserLogout\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module.users.ui.logout.succeeded', array('Pdfviewer_Listener_UserLogout', 'succeeded'));\n \n // user -> Pdfviewer_Listener_User\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'user.gettheme', array('Pdfviewer_Listener_User', 'getTheme'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'user.account.create', array('Pdfviewer_Listener_User', 'create'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'user.account.update', array('Pdfviewer_Listener_User', 'update'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'user.account.delete', array('Pdfviewer_Listener_User', 'delete'));\n \n // registration -> Pdfviewer_Listener_UserRegistration\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module.users.ui.registration.started', array('Pdfviewer_Listener_UserRegistration', 'started'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module.users.ui.registration.succeeded', array('Pdfviewer_Listener_UserRegistration', 'succeeded'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module.users.ui.registration.failed', array('Pdfviewer_Listener_UserRegistration', 'failed'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'user.registration.create', array('Pdfviewer_Listener_UserRegistration', 'create'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'user.registration.update', array('Pdfviewer_Listener_UserRegistration', 'update'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'user.registration.delete', array('Pdfviewer_Listener_UserRegistration', 'delete'));\n \n // users module -> Pdfviewer_Listener_Users\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module.users.config.updated', array('Pdfviewer_Listener_Users', 'configUpdated'));\n \n // group -> Pdfviewer_Listener_Group\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'group.create', array('Pdfviewer_Listener_Group', 'create'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'group.update', array('Pdfviewer_Listener_Group', 'update'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'group.delete', array('Pdfviewer_Listener_Group', 'delete'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'group.adduser', array('Pdfviewer_Listener_Group', 'addUser'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'group.removeuser', array('Pdfviewer_Listener_Group', 'removeUser'));\n \n // special purposes and 3rd party api support -> Pdfviewer_Listener_ThirdParty\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'get.pending_content', array('Pdfviewer_Listener_ThirdParty', 'pendingContentListener'));\n EventUtil::registerPersistentModuleHandler('Pdfviewer', 'module.content.gettypes', array('Pdfviewer_Listener_ThirdParty', 'contentGetTypes'));\n }", "public function onShortcodeHandlers()\n {\n $include_default_shortcodes = $this->config->get('plugins.shortcode-core.include_default_shortcodes', true);\n if ($include_default_shortcodes) {\n $this->shortcodes->registerAllShortcodes(__DIR__ . '/classes/shortcodes', ['ignore' => ['Shortcode', 'ShortcodeObject']]);\n }\n\n // Add custom shortcodes directory if provided\n $custom_shortcodes = $this->config->get('plugins.shortcode-core.custom_shortcodes');\n if (isset($custom_shortcodes)) {\n $this->shortcodes->registerAllShortcodes(GRAV_ROOT . $custom_shortcodes);\n }\n }", "protected function emitBeforeHandleUploadSignal() {\n\t\t$this->getSignalSlotDispatcher()->dispatch('Fab\\MediaUpload\\Controller\\MediaUploadController', 'beforeHandleUpload');\n\t}", "protected function registerInternalEvents()\n {\n // Execute the internal fired event.\n $this->listen(static::FIRED, function ($event, $attachments) {\n\n // Receive an event as parameter when and event has been fired.\n // Then we call the event resolver to dispatch a registered event.\n $this->resolveEvent($event, $attachments);\n });\n\n // Execute the internal terminated event.\n $this->listen(static::TERMINATED, function ($event) {\n\n // Receive an event that had been terminated and must be locked.\n $this->terminate($event);\n });\n\n // Define the reserved internal events.\n $this->internalEvents = [\n static::FIRED,\n static::ON_EXCEPTION,\n static::TERMINATED,\n ];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all the Medrill video entities for a given product
public function getVideosByProduct($product_id);
[ "public function videos()\n {\n return $this->product->videos()\n ->orderBy('position');\n }", "function get_all_videos_lists() {\n \n $offset = (int)get_input('offset', 0);\n$limit = (int)get_input('limit', 10); \n \n $options = array(\n\t'type' => 'object',\n\t'subtype' => 'video',\n\t'limit' => $limit,\n\t'offset' => $offset,\n\t'full_view' => false,\n\t'list_type_toggle' => false,\n\t'no_results' => elgg_echo('video:notfound'),\n\t\n\t);\n\n $getter = 'elgg_get_entities';\n $entities = call_user_func($getter, $options); \n \n return $entities;\n}", "public function getVideosByProduct($product_id)\n {\n $qb = $this->_em->createQueryBuilder();\n\n $qb->select('mv')\n ->from('\\Fisdap\\Entity\\MedrillVideo', 'mv')\n ->join(\"mv.products\", \"p\")\n ->where(\"p.id = ?1\")\n ->setParameter(1, $product_id)\n ->orderBy('mv.title', 'ASC');\n\n $results = $qb->getQuery()->getResult();\n\n // re-key the array so it's keyed by category\n $categorized_videos = array();\n foreach ($results as $video) {\n $categorized_videos[$video->category->name][] = $video;\n }\n\n ksort($categorized_videos);\n return $categorized_videos;\n }", "public function medias()\n {\n return $this->belongsToMany('App\\Medias', 'media_product', 'product_id', 'media_id');\n }", "public function medias()\n {\n return $this->morphMany(ProductMedia::class, 'mediable');\n }", "public function multimedia()\n {\n return $this->hasMany('App\\MultiMedia', 'content_id')->where(\"content_type\", \"product\")->get();\n }", "public function getVideosByProductAndCategory($product_id, $category_id);", "public function renderVideoProduct($video_id, $data){\n $debug = [];\n $archived = empty($data['archieve']) ? 0 : 1;\n $description = $data['description'];\n $media_kits = $data['media_kits'];\n $tags_data = $data['tags'];\n \n $query = \\Drupal::database()->select('vmt_videos', 'v');\n $query->fields('v', ['video_id', 'video_name', 'user_id', 'media_preset_id', 'video_media_id']);\n $query->condition('v.video_id', $video_id, '=');\n $video = $query->execute()->fetchObject();\n $uid = $video->user_id;\n $media_title = $video->video_name;\n\n $tags = [];\n\t\tif (is_array($tags_data) ){\n\t\t\tforeach($tags_data as $term_text){\n $tags[] = getTagsByTermId(trim($term_text), $uid);\n\t\t\t}\n\t\t}\n \n if($video->video_media_id == 0){\n //create new media\n $media_new = Media::create([\n 'bundle' => 'video', \n 'name' => $media_title,\n 'field_description_plain_text' => ['value' => $description, ],\n 'field_copyright_number' => ['value' => '', ],\n 'field_favorite' => ['value' => '', ],\n 'field_archived' => ['value' => $archived, ],\n 'field_media_source_type' => ['value' => 'generated', ],\n 'field_format' => ['value' => '.mp4', ],\n ]);\n $media_new->uid = $uid;\n }else{\n $media_new = Media::load($video->video_media_id); \n }\n \n $media_new->set('name', $media_title);\n $media_new->set('field_archived', $archived);\n $media_new->set('field_description_plain_text', $description);\n $media_new->field_made_from_preset->target_id = $video->media_preset_id;\n // check the \"Render pending\" check box when adding a video to the processing / rendering queue\n $media_new->set('field_render_status', 'Pending');\n $media_new->set('field_keywords', $tags);\n \n // save media\n $media_new->save();\n $mid = $media_new->id();\n $debug['mid'] = $mid;\n \n // update video with media\n \\Drupal::database()->update('vmt_videos')\n ->fields(['video_media_id' => $mid])\n ->condition('video_id', $video_id)\n ->execute();\n\n // associate media with media vault\n $media_vault_id = \\Drupal::database()->select('node_field_data', 'n')->fields('n', ['nid'])->condition('n.uid', $uid, '=')->condition('n.type', 'media_vault', '=')->orderBy('n.nid', 'desc')->range(0, 1)->execute()->fetchField();\n // media_voult_id to append new media item\n $debug['media_vault_id'] = $media_vault_id;\n if(!empty($media_vault_id)) {\n $voult = Node::load($media_vault_id);\n $items = $voult->get('field_vault_video')->getValue();\n $vmids = [];\n foreach($items as $key =>$value){\n $vmids[] = $value['target_id'];\n }\n // check if already appended or not\n if(!in_array($mid, $vmids)){\n $voult->get('field_vault_video')->appendItem(['target_id' => $mid]);\n $voult->save();\n }\n } \n \n // associate media with media kits\n $all_media_kits = \\Drupal::database()->select('node_field_data', 'n')->fields('n', ['nid'])->condition('n.uid', $media_new->getOwnerId() , '=')->condition('n.type', 'media_kit', '=')->execute()->fetchAll();\n // remove media file from the media kits\n foreach($all_media_kits as $kit){\n $node_kit = Node::load($kit->nid);\n $items = $node_kit->get('field_vault_video')->getValue();\n foreach($items as $key =>$value){\n if($value['target_id'] == $mid){\n $debug['mkit_rmid'][$kit->nid][] = $key;\n $node_kit->get('field_vault_video')->removeItem($key);\n $node_kit->save();\n }\n } \n }\n\n // add media file to the selected media kits\n if(is_array($media_kits)) {\n foreach($media_kits as $kit){\n $node_kit = Node::load($kit);\n $items = $node_kit->get('field_vault_video')->getValue();\n $kmids = [];\n foreach($items as $key =>$value){\n $kmids[] = $value['target_id'];\n }\n \n if(!in_array($mid, $kmids)){\n $debug['mkit_rmid'][$kit][] = $mid; \n $node_kit->get('field_vault_video')->appendItem(['target_id' => $mid]);\n $node_kit->save();\n }\n }\n }\n \n /*\n echo '<pre>'; print_r($video); echo '</pre>'; \n echo '<pre>'; print_r($debug); echo '</pre>';\n die();\n */\n\n\t\treturn $mid;\n }", "public function videos()\n {\n return $this->morphedByMany(Video::class, 'likeable', $this->table, self::foreignPivotKey);\n }", "public function findAllMediaUsed(): array\n {\n $allMediaUser = [];\n\n function buildMediaArrayEntries($mediaObject){\n\n $objectNamespace = get_class($mediaObject);\n $parsedNamespace=explode('\\\\',$objectNamespace);\n $type = strtolower( $parsedNamespace[ count( $parsedNamespace ) -1 ] );\n $media = $mediaObject->getMedia();\n $filename = $media->getId().'.'.$mediaObject->getExtension();\n $path = '/medias/quick/'.$type.'s/low/'.$filename;\n\n if(file_exists('C:/inetpub/wwwroot/infowaytemplate/public'.$path)){\n return [\n 'id'=> $media->getId(),\n 'type' => $type,\n 'name' => $media->getFilename(),\n 'path' => $path,\n 'elements' => [\n 'id' => $mediaObject->getId(),\n 'type' => $type,\n 'content' => $media->getId().'.'.$mediaObject->getExtension(),\n 'incrustOrder' => 0,\n ]\n ];\n }else return false;\n }\n $images = $this->getEntityManager()->getRepository(Image::class)->findAllTemplateImages();\n\n foreach($images as $image){\n $media = buildMediaArrayEntries($image);\n if( $media ) $allMediaUser[] = $media;\n }\n $videos = $this->getEntityManager()->getRepository(Video::class)->createQueryBuilder('v')->leftjoin('v.media','media')->where('media != :type')->setParameter('type','sync')->getQuery()->getResult();\n\n foreach($videos as $video){\n $media = buildMediaArrayEntries($video);\n if( $media ) $allMediaUser[] = $media;\n }\n\n\n\n // $allMediaUser = [];\n // $qb = $this->createQueryBuilder('m');\n // $qb->where('m.type != :mediatype')\n // ->setParameter('mediatype','sync');\n // $medias = $qb->getQuery()->getResult();\n //\n //\n // foreach ($medias as $media)\n // {\n // $medias = ['images'=>[], 'videos'=>{}]\n //\n // $image = $this->getEntityManager()->getRepository(Image::class)->findOneByMedia($media);\n //\n // if(!$image)\n // {\n // $video = $this->getEntityManager()->getRepository(Video::class)->findOneByMedia($media);\n //\n // //dd($video);\n // if($video)\n // $allMediaUser[] = [\n // 'id' => $media->getId(),\n // 'type' => 'video',\n // 'name' => $media->getFilename(),\n // 'elements' => [\n // [\n // 'id' => $video->getId(),\n // 'type' => 'video',\n // 'content' => $media->getId() . '.' . $video->getExtension(),\n // //'content' => \"67.png\",\n // 'incrustOrder' => 0\n // ]\n // ]\n // ];\n // //throw new NotFoundHttpException(sprintf(\"Error ! Media '%d' not found in Image and Video entities !\", $media->getId()));\n //\n // }\n // else\n // $allMediaUser[] = [\n // 'id' => $media->getId(),\n // 'type' => 'image',\n // 'name' => $media->getFilename(),\n // 'elements' => [\n // [\n // 'id' => $image->getId(),\n // 'type' => 'image',\n // 'content' => $media->getId() . '.' . $image->getExtension(),\n // //'content' => \"67.png\",\n // 'incrustOrder' => 0\n // ]\n // ]\n // ];\n //\n // }\n //\n\n return $allMediaUser;\n\n }", "public function videos()\n {\n return $this->morphedByMany('App\\Video', 'taggable');\n }", "public static function getProductVideos(int $productId) {\n if (filter_var($productId, FILTER_VALIDATE_INT) == false) {\n throw new Exception(\"Fout in product nummer\");\n }\n\n $directory = \"mp/product/$productId/\";\n\n // Als de product directory bestaat\n if (file_exists($directory) && is_dir($directory)) {\n return glob($directory . \"**.{mp4,ogg}\", GLOB_BRACE);\n } else {\n if (IS_DEBUGGING_ENABLED) {\n throw new Exception(\"Bestand niet gevonden\");\n } else {\n return array();\n }\n }\n }", "public function videos()\n {\n return $this->morphedByMany(Video::class, 'userable');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SiteBundle:Video')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function videoAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $items = $em->getRepository('AppBundle:Item')->findBy(array('type' => 'video'));\n\n return $this->render('item/video_list.html.twig', array(\n 'items' => $items,\n ));\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('PolmediaBundle:Video')->getAllVideos();\n return array(\n 'entities' => $entities,\n );\n }", "public function media()\n {\n return $this->morphToMany(Media::class, 'entity', 'entity_media')\n ->withPivot(['id', 'zone'])\n ->withTimestamps();\n }", "public function getEntityMedia()\n\t{\n\t\treturn $this->aEntityMedia;\n\t}", "public function videos()\n {\n $this->videos->videosAttrs = ['title', 'url', ['thumb', 'medium']];\n $this->videos->limit = 2;\n $records = $this->videos->all();\n\n return ['videos' => $records];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds the default_image details element.
protected function defaultImageForm(array &$element, array $settings) { $element['default_image'] = [ '#type' => 'details', '#title' => t('Default image'), '#open' => TRUE, ]; // Convert the stored UUID to a FID. $fids = []; $uuid = $settings['default_image']['uuid']; if ($uuid && ($file = $this->getEntityManager()->loadEntityByUuid('file', $uuid))) { $fids[0] = $file->id(); } $element['default_image']['uuid'] = [ '#type' => 'managed_file', '#title' => t('Image'), '#description' => t('Image to be shown if no image is uploaded.'), '#default_value' => $fids, '#upload_location' => $settings['uri_scheme'] . '://default_images/', '#element_validate' => [ '\Drupal\file\Element\ManagedFile::validateManagedFile', [get_class($this), 'validateDefaultImageForm'], ], '#upload_validators' => $this->getUploadValidators(), ]; $element['default_image']['alt'] = [ '#type' => 'textfield', '#title' => t('Alternative text'), '#description' => t('This text will be used by screen readers, search engines, and when the image cannot be loaded.'), '#default_value' => $settings['default_image']['alt'], '#maxlength' => 512, ]; $element['default_image']['title'] = [ '#type' => 'textfield', '#title' => t('Title'), '#description' => t('The title attribute is used as a tooltip when the mouse hovers over the image.'), '#default_value' => $settings['default_image']['title'], '#maxlength' => 1024, ]; $element['default_image']['width'] = [ '#type' => 'value', '#value' => $settings['default_image']['width'], ]; $element['default_image']['height'] = [ '#type' => 'value', '#value' => $settings['default_image']['height'], ]; }
[ "private function get_default_image() {\n\t\tif ( count( $this->images ) === 0 && WPSEO_Options::get( 'og_default_image', '' ) !== '' ) {\n\t\t\t$this->add_image( WPSEO_Options::get( 'og_default_image' ) );\n\t\t}\n\t}", "public function getDefaultImage();", "function be_schema_default_image($graph_piece)\n{\n $use_default = false;\n if (has_post_thumbnail()) {\n $image_src = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');\n if (empty($image_src[1]) || 1199 > $image_src[1])\n $use_default = true;\n } else {\n $use_default = true;\n }\n\n if ($use_default) {\n $graph_piece['image']['@id'] = home_url('#logo');\n }\n return $graph_piece;\n}", "protected function defaultImageForm(array &$element, array $settings) {\n $element['default_image'] = [\n '#type' => 'details',\n '#title' => t('Default image'),\n '#open' => TRUE,\n ];\n // Convert the stored UUID to a FID.\n $fids = [];\n $uuid = $settings['default_image']['uuid'];\n if ($uuid && ($file = \\Drupal::service('entity.repository')->loadEntityByUuid('file', $uuid))) {\n $fids[0] = $file->id();\n }\n $element['default_image']['uuid'] = [\n '#type' => 'managed_file',\n '#title' => t('Image'),\n '#description' => t('Image to be shown if no image is uploaded.'),\n '#default_value' => $fids,\n '#upload_location' => $settings['uri_scheme'] . '://default_images/',\n '#element_validate' => [\n '\\Drupal\\file\\Element\\ManagedFile::validateManagedFile',\n [static::class, 'validateDefaultImageForm'],\n ],\n '#upload_validators' => $this->getUploadValidators(),\n ];\n $element['default_image']['alt'] = [\n '#type' => 'textfield',\n '#title' => t('Alternative text'),\n '#description' => t('Short description of the image used by screen readers and displayed when the image is not loaded. This is important for accessibility.'),\n '#default_value' => $settings['default_image']['alt'],\n '#maxlength' => 512,\n ];\n $element['default_image']['title'] = [\n '#type' => 'textfield',\n '#title' => t('Title'),\n '#description' => t('The title attribute is used as a tooltip when the mouse hovers over the image.'),\n '#default_value' => $settings['default_image']['title'],\n '#maxlength' => 1024,\n ];\n $element['default_image']['width'] = [\n '#type' => 'value',\n '#value' => $settings['default_image']['width'],\n ];\n $element['default_image']['height'] = [\n '#type' => 'value',\n '#value' => $settings['default_image']['height'],\n ];\n }", "public function DefaultImage() {\n\t\treturn $this->Product()->DefaultImage();\n\t}", "protected function getDefaultPicture()\n {\n $this->file_path = _CURRENT_TEMPLATE_PATH . 'images/default.png';\n $this->format = 'png';\n $this->mime = 'image/png';\n $this->has_picture = false;\n }", "public function getDefaultImage()\n\t{\n\t\treturn $this->default_image;\n\t}", "public function defaultPhoto()\n {\n if ($this->photos()->count()) {\n return $this->photos->first()->image;\n }\n\n return '';\n }", "public function DefaultImageLink()\n {\n if ($this->DefaultProductImageID) {\n $defaultImage = $this->DefaultProductImage();\n if ($defaultImage && $defaultImage->exists()) {\n return $defaultImage->Link();\n }\n }\n\n return 'ecommerce/images/productPlaceHolderThumbnail.gif';\n }", "protected function buildImageElement($options)\n\t{\n\t\tif($this->id and empty($options['alt'])) {\n\t\t\t$options['alt'] = esc_attr(get_post_meta($this->id, '_wp_attachment_image_alt', true));\n\t\t}\n\n\t\t$img = '<img src=\"' . $this->buildCachedFileNameUrl . '\" ';\n\t\tforeach($options as $attr => $value) $img.= $attr . '=\"' . $value . '\" ';\n\t\t$img.= '/>';\n\n\t\treturn $img;\n\t}", "public function getDefaultImage()\n {\n return $this->defaultImage;\n }", "public function getDefaultImage()\n {\n return $this->sDefaultImage;\n }", "public function getDefaultThumbnail();", "public function getDefaultImageUrl()\r\n {\r\n return $this->getViewFileUrl('Mageplaza_Blog::media/images/mageplaza-logo-default.png');\r\n }", "function dguk_default_field_image($field_name) {\n $field_info = field_info_field($field_name);\n $fid = $field_info['settings']['default_image'];\n return file_load($fid);\n}", "public function createImgTag() {\n\t\t$this->imgNeko = '<img src=\"';\n\t\t$this->imgNeko .= $this->imgUri;\n\t\t$this->imgNeko .= '\" width=\"';\n\t\t$this->imgNeko .= $this->imgSize[0];\n\t\t$this->imgNeko .= '\" height=\"';\n\t\t$this->imgNeko .= $this->imgSize[1];\n\t\t$this->imgNeko .= '\" alt=\"';\n\t\t$this->imgNeko .= $this->creditInfo;\n\t\t$this->imgNeko .= '\">';\n\t}", "function getDefaultImageUrl()\n\t{\n\t\treturn $this->getViewFileUrl('Mageplaza_Blog::media/images/Mageplaza-logo.png');\n\t}", "public function defaultMediaSetting()\n {\n update_option('image_default_align', 'center');\n update_option('image_default_link_type', 'none');\n update_option('image_default_size', 'full');\n }", "public function defaultImage($id){\n Picture::create([\n 'name' => null,\n 'description' => null,\n 'remote_location' => env(\"APP_URL\"). \"/storage/\" . $this->getPicPath() . \"/image_placeholder.jpg\",\n 'picturable_id' => $id,\n 'picturable_type' => $this->getPicType()\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add hook to add a term when a user is added to the system (user_register ID is passed as param)
function jl_uat_add( $user_id ) { /** * Data that we have access to * ID * user_login * user_pass * user_nicename * user_email * user_url * user_registered * display_name */ $user = get_userdata( $user_id ); $term = wp_insert_term( $user->display_name, JL_UAT_TAXONOMY ); if ( !is_wp_error( $term ) ) { // add term meta, the user id add_term_meta( $term['term_id'], JL_UAT_META_KEY, $user_id, true ); } else { var_dump('ERROR'); var_dump($term); wp_die(); } }
[ "function add_terms_user(VSStore $store, WP_User $user)\n{\n\t$terms_users = get_post_meta($store->ID, 'vs_store_terms_users', true);\n\t$terms_users = array_unique($terms_users);\n\t$terms_users[] = $user->ID;\n\tupdate_post_meta($store->ID, 'vs_store_terms_users',$terms_users);\n\n\t$terms_user_requests = get_post_meta($store->ID, 'vs_store_terms_user_requests', true);\n\tif(is_array($terms_user_requests))\n\t{\n\t\t$terms_user_requests = array_unique($terms_user_requests);\n\t\tif($array_key = array_search($user->ID, $terms_user_requests))\n\t\t{\n\t\t\tunset($terms_user_requests[$array_key]);\n\t\t\t$terms_user_requests = array_values($terms_user_requests);\n\n\t\t\tupdate_post_meta($store->ID, 'vs_store_terms_user_requests', $terms_user_requests);\n\t\t}\n\t}\n}", "public function register() {\n\n\t\terror_log('try ufRegister');\n $user = $this->ufRegister();\n\t\terror_log('ufRegister done');\n $this->storeOAuth($user->id);\n }", "function wMyWallet_user_register_action($user_id)\n {\n // if use special referral code option was set\n if (wMyWallet_Options::get('use-special-referral-code')) {\n // call add_referral_code_to_user function\n wMyWallet_add_referral_code_to_user($user_id);\n }\n }", "public static function user_registration(){\n add_action( 'user_register', array('SWTSA_Users_Security', 'associate_gamer_tag'), 90, 1 );\n }", "public function registeruser() {\n $this->register();\n\n }", "function hook_save_user_role_register($user_id) {\n global $aiosc_user, $aiosc_settings, $aiosc_capabilities;\n\t\t\n\t\tif(is_wp_error($user_id)) return;\n\t\t\n $user = new aiosC_User($user_id);\n $role = $aiosc_settings->get(\"default_role\");\n if(!$role) return;\n if($aiosc_capabilities->role_exists($role)) {\n if($aiosc_capabilities->role_has_cap('staff', $role)) return;\n $user->wpUser->add_role($role);\n }\n }", "public static function addTerm( Application_Model_User $antaUser, $term, $stem, $language ){\n\t\t\n\t\t$stmt = Anta_Core::mysqli()->query( \"\n\t\t\tINSERT IGNORE INTO anta_\".$antaUser->username.\".`terms` (\n\t\t\t\t`term`, `stem`, `language`\n\t\t\t) VALUES (\n\t\t\t\tLOWER( ? ), ?, ?\n\t\t\t)\",array( $term, $stem, $language )\n\t\t);\n\t\t\n\t\t$idTerm = Anta_Core::mysqli()->lastInsertId( \"anta_\".$antaUser->username.\".`terms`\" );\n\t\t\n\t\tif ( $idTerm != 0 ) return $idTerm;\n\t\t\n\t\treturn self::getIdTerm( $antaUser, $term, $language );\n\t\t\n\t}", "public function register_meta() {\n\t\tregister_meta( 'term', $this->meta_key, array(\n\t\t\t'auth_callback' => array( $this, 'auth_callback' ),\n\t\t\t'sanitize_callback' => array( $this, 'sanitize_callback' )\n\t\t) );\n\t}", "public function register_taxonomy(){ \n \t register_taxonomy(\n \t\t$this->params['taxonomy_name'],\n \t\t'user',\n \t\tarray(\n \t\t\t'public' => true,\n \t\t\t'labels' => array(\n \t\t\t\t'name' => __( $this->params['plural_label'] ),\n \t\t\t\t'singular_name' => __( $this->params['singular_label'] ),\n \t\t\t\t'menu_name' => __( $this->params['plural_label'] ),\n \t\t\t\t'search_items' => __( 'Search ' . $this->params['plural_label'] ),\n \t\t\t\t'popular_items' => __( 'Popular ' . $this->params['plural_label'] ),\n \t\t\t\t'all_items' => __( 'All ' . $this->params['plural_label'] ),\n \t\t\t\t'edit_item' => __( 'Edit ' . $this->params['singular_label'] ),\n \t\t\t\t'update_item' => __( 'Update ' . $this->params['singular_label'] ),\n \t\t\t\t'add_new_item' => __( 'Add New ' . $this->params['singular_label'] ),\n \t\t\t\t'new_item_name' => __( 'New '. $this->params['singular_label'] .' Name' ),\n \t\t\t\t'separate_items_with_commas' => __( 'Separate '. $this->params['plural_label'] .' with commas' ),\n \t\t\t\t'add_or_remove_items' => __( 'Add or remove ' . $this->params['plural_label'] ),\n \t\t\t\t'choose_from_most_used' => __( 'Choose from the most popular ' . $this->params['plural_label'] ),\n \t\t\t),\n \t\t\t'capabilities' => array(\n \t\t\t\t'manage_terms' => 'edit_users', // Using 'edit_users' cap to keep this simple.\n \t\t\t\t'edit_terms' => 'edit_users',\n \t\t\t\t'delete_terms' => 'edit_users',\n \t\t\t\t'assign_terms' => 'read',\n \t\t\t),\n \t\t\t'update_count_callback' => array(&$this, 'update_privilege_count') // Use a custom function to update the count.\n \t\t)\n \t);\n }", "function icterms_register_user_terms_acceptance( $userId )\n{\n // update database\n $tbl = get_module_main_tbl(array('icterms_acceptances'));\n \n Claroline::getDatabase()->exec(\"\n INSERT `{$tbl['icterms_acceptances']}`\n SET\n user_id = \".(int)Claroline::getDatabase()->escape($userId).\",\n terms_acceptance_timestamp = \".claro_time().\"\n \");\n \n // update session\n $_SESSION['icterms_terms_acceptance_in_progress'] = false;\n $_SESSION['icterms_user_must_accept_terms'] = false;\n}", "public function save_func_meta() {\n\n $c_user = get_current_user_id();\n if ( isset( $_POST['allowed-term'] ) ) {\n update_post_meta( get_the_ID(), '_sub_allowed_term_ids', $_POST['allowed-term'] );\n } else {\n update_post_meta( get_the_ID(), '_sub_allowed_term_ids', '' );\n }\n }", "public function addUserField($field) {}", "public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}", "function my_add_szpital_admin_page() {\n\n $tax = get_taxonomy( 'szpital' );\n\n add_users_page(\n esc_attr( $tax->labels->menu_name ),\n esc_attr( $tax->labels->menu_name ),\n $tax->cap->manage_terms,\n 'edit-tags.php?taxonomy=' . $tax->name\n );\n}", "public function register()\n\t{\n\t\t// Adding AD user attributes to profile page\n\t\tadd_action('show_user_profile', array($this, 'extendOwnProfile'));\n\t\tadd_action('edit_user_profile', array($this, 'extendForeignProfile'));\n\t}", "function created_term( $term_id, $tt_id, $taxonomy ) {\n\t\t$this->process_term( $term_id, $taxonomy );\n\t}", "function addnewuser() {\n \t\t\t$this->set('GetUserQ', $this->Users->GetUsers(0));\n \t\t\t$this->set('GetLevelsQ', $this->AccessLevels->index());\n \t\t}", "function pmprobt_user_register( $user_id ) {\r\n\r\n global $signup_flag;\r\n\r\n $api = new PMPro_Boomtrain();\r\n $user = get_userdata($user_id);\r\n $api->updatePerson($user->user_email);\r\n\r\n //make sure we don't track signup again if changing level\r\n// $signup_flag = true;\r\n// $api->trackEvent('bt_signup');\r\n}", "function hook_taxonomy_term_insert($term) {\n db_insert('mytable')\n ->fields(array(\n 'tid' => $term->tid,\n 'foo' => $term->foo,\n ))\n ->execute();\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
close bet (update final choice)
function closeBet($bet, $id) { $db = $this->connect(); $result = $db->prepare("UPDATE bets SET betFinalResult = :choice WHERE nameID = :id"); $result->execute([ 'choice' => $bet, 'id' => $id ]); return $result; }
[ "public function closeGame() {\n \t$status = \\pool\\Status::find_status_by_category_and_name( \"game\", \"Closed\" );\n \t$this->status_id = $status->id;\n \t$this->save(); \n \t//lock all the picks for this game\n \t$this->lockAllPicks();\n }", "protected function update_game_state_choose_turbo_swing() {\n $this->gameState = BMGameState::END_TURN;\n }", "public function SetClosed() {\n $this->activityId = Vacancy::CLOSE;\n $this->Save();\n }", "public function setClosed()\n\t{\n\t\tglobal $conf,$langs,$user;\n\n\t\t$error=0;\n\n\t\t$this->db->begin();\n\n\t\t$sql = 'UPDATE '.MAIN_DB_PREFIX.'expedition SET fk_statut='.self::STATUS_CLOSED;\n\t\t$sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > 0';\n\n\t\t$resql=$this->db->query($sql);\n\t\tif ($resql)\n\t\t{\n\t\t\t// Set order billed if 100% of order is shipped (qty in shipment lines match qty in order lines)\n\t\t\tif ($this->origin == 'commande' && $this->origin_id > 0)\n\t\t\t{\n\t\t\t\t$order = new Commande($this->db);\n\t\t\t\t$order->fetch($this->origin_id);\n\n\t\t\t\t$order->loadExpeditions(self::STATUS_CLOSED);\t\t// Fill $order->expeditions = array(orderlineid => qty)\n\n\t\t\t\t$shipments_match_order = 1;\n\t\t\t\tforeach($order->lines as $line)\n\t\t\t\t{\n\t\t\t\t\t$lineid = $line->id;\n\t\t\t\t\t$qty = $line->qty;\n\t\t\t\t\tif (($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) && $order->expeditions[$lineid] != $qty)\n\t\t\t\t\t{\n\t\t\t\t\t\t$shipments_match_order = 0;\n\t\t\t\t\t\t$text='Qty for order line id '.$lineid.' is '.$qty.'. However in the shipments with status Expedition::STATUS_CLOSED='.self::STATUS_CLOSED.' we have qty = '.$order->expeditions[$lineid].', so we can t close order';\n\t\t\t\t\t\tdol_syslog($text);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($shipments_match_order)\n\t\t\t\t{\n\t\t\t\t\tdol_syslog(\"Qty for the \".count($order->lines).\" lines of order have same value for shipments with status Expedition::STATUS_CLOSED=\".self::STATUS_CLOSED.', so we close order');\n\t\t\t\t\t$order->cloture($user);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->statut=self::STATUS_CLOSED;\n\n\n\t\t\t// If stock increment is done on closing\n\t\t\tif (! $error && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE))\n\t\t\t{\n\t\t\t\trequire_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';\n\n\t\t\t\t$langs->load(\"agenda\");\n\n\t\t\t\t// Loop on each product line to add a stock movement\n\t\t\t\t// TODO possibilite d'expedier a partir d'une propale ou autre origine ?\n\t\t\t\t$sql = \"SELECT cd.fk_product, cd.subprice,\";\n\t\t\t\t$sql.= \" ed.rowid, ed.qty, ed.fk_entrepot,\";\n\t\t\t\t$sql.= \" edb.rowid as edbrowid, edb.eatby, edb.sellby, edb.batch, edb.qty as edbqty, edb.fk_origin_stock\";\n\t\t\t\t$sql.= \" FROM \".MAIN_DB_PREFIX.\"commandedet as cd,\";\n\t\t\t\t$sql.= \" \".MAIN_DB_PREFIX.\"expeditiondet as ed\";\n\t\t\t\t$sql.= \" LEFT JOIN \".MAIN_DB_PREFIX.\"expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid\";\n\t\t\t\t$sql.= \" WHERE ed.fk_expedition = \".$this->id;\n\t\t\t\t$sql.= \" AND cd.rowid = ed.fk_origin_line\";\n\n\t\t\t\tdol_syslog(get_class($this).\"::valid select details\", LOG_DEBUG);\n\t\t\t\t$resql=$this->db->query($sql);\n\t\t\t\tif ($resql)\n\t\t\t\t{\n\t\t\t\t\t$cpt = $this->db->num_rows($resql);\n\t\t\t\t\tfor ($i = 0; $i < $cpt; $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$obj = $this->db->fetch_object($resql);\n\t\t\t\t\t\tif (empty($obj->edbrowid))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$qty = $obj->qty;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$qty = $obj->edbqty;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($qty <= 0) continue;\n\t\t\t\t\t\tdol_syslog(get_class($this).\"::valid movement index \".$i.\" ed.rowid=\".$obj->rowid.\" edb.rowid=\".$obj->edbrowid);\n\n\t\t\t\t\t\t$mouvS = new MouvementStock($this->db);\n\t\t\t\t\t\t$mouvS->origin = &$this;\n\n\t\t\t\t\t\tif (empty($obj->edbrowid))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// line without batch detail\n\n\t\t\t\t\t\t\t// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record\n\t\t\t\t\t\t\t$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans(\"ShipmentClassifyClosedInMounir\", $numref));\n\t\t\t\t\t\t\tif ($result < 0) {\n\t\t\t\t\t\t\t\t$this->error = $mouvS->error;\n\t\t\t\t\t\t\t\t$this->errors = $mouvS->errors;\n\t\t\t\t\t\t\t\t$error++; break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// line with batch detail\n\n\t\t\t\t\t\t\t// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record\n\t\t\t\t\t\t\t$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans(\"ShipmentClassifyClosedInMounir\", $numref), '', $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, $obj->fk_origin_stock);\n\t\t\t\t\t\t\tif ($result < 0) {\n\t\t\t\t\t\t\t\t$this->error = $mouvS->error;\n\t\t\t\t\t\t\t\t$this->errors = $mouvS->errors;\n\t\t\t\t\t\t\t\t$error++; break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->error=$this->db->lasterror();\n\t\t\t\t\t$error++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Call trigger\n\t\t\tif (! $error)\n\t\t\t{\n\t\t\t\t$result=$this->call_trigger('SHIPPING_CLOSED', $user);\n\t\t\t\tif ($result < 0) {\n\t\t\t\t\t$error++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdol_print_error($this->db);\n\t\t\t$error++;\n\t\t}\n\n\t\tif (! $error)\n\t\t{\n\t\t\t$this->db->commit();\n\t\t\treturn 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->statut = self::STATUS_VALIDATED;\n\t\t\t$this->db->rollback();\n\t\t\treturn -1;\n\t\t}\n\t}", "public function constantScoreClose()\n {\n return $this->fieldClose();\n }", "public function isOpenChoice();", "function sellbot()\n {\n // check if its a valid choice\n $valid = 0;\n \n if(isset($_POST['cb'])) {\n // get IDs\n $ids = explode(',',implode(',',$_REQUEST['cb']));\n\n // only one picked\n if (count($ids) == 1) {\n $valid = 1;\n $server = $this->data['umbrella'] . '/work/buymybot';\n\n // get pieces in bots table given $id\n $pieces = explode(',',$this->factory->getPieces($ids[0]));\n\n // we need our API key\n $apikey = $this->properties->get('apikey');\n $this->data['workparms'] = [\n ['key' => 'key', 'value' => $apikey],\n ['key' => 'part1', 'value' => $pieces[0]],\n ['key' => 'part2', 'value' => $pieces[1]],\n ['key' => 'part3', 'value' => $pieces[2]],\n ];\n\n $result = file_get_contents($server . '/' . $pieces[0] . '/' . $pieces[1]\n . '/' . $pieces[2] . '?key=' . $apikey);\n $this->data['workresult'] = $result;\n\n // Handle the purchase at our end\n if (substr($result, 0, 2) == 'Ok')\n {\n // we're in, update bots table\n $this->factory->remove('bots', $ids[0]);\n\n // current balance\n $old_balance = $this->data['balance'] = $this->properties->get('balance');\n\n $balance = file_get_contents($this->data['umbrella'] . '/info/balance/' . $this->trader);\n $this->properties->put('balance', $balance);\n\n // update history table\n $amount = $balance - $old_balance;\n $message = \"Shipped 1 bot, id: \".$ids[0];\n $this->data['message'] = $message;\n $this->factory->addHistory(1, $amount, $message);\n }\n } \n }\n\n if ($valid == 0)\n $this->data['message'] = \"Please pick a bot for sale!\";\n \n $this->polish();\n }", "public function _getClose(){ return floatval($this->_getDataKey('close')); }", "function testSetOppClosed()\r\n {\r\n $params['name'] = \"UnitTest OpportunityName\";\r\n\r\n // create opportunity data\r\n $obj = new CAntObject($this->dbh, \"opportunity\", null, $this->user);\r\n $obj->setValue(\"name\", $params['name']); \r\n $oppid = $obj->save();\r\n $this->assertTrue($oppid > 0);\r\n\r\n // test set opportunity Converted\r\n $params['id'] = $oppid;\r\n $params['f_closed'] = \"t\";\r\n $customerController = new CustomerController($this->ant, $this->user);\r\n $customerController->debug = true;\r\n \r\n $ret = $customerController->setOppClosed($params);\r\n $this->assertTrue($ret > 0);\r\n\r\n // clear data\r\n $obj->removeHard();\r\n }", "public function placeAndSettleBet();", "function confirm_updated_vote( $number , $vote ){ \n require('choices.php');\n $team = $choices[ $vote ];\n $message = \"Your vote has been updated to \" . $team . \" Text 'Vote' for all the choices.\";\n send_text( $number , $message );\n\n}", "public static function closeBid($id){\r\n\t\t$status = array('on_bid' => SharQuery::$STATUSCODE['product_onbid']['ORIGINALSELL'],'due_date'=>null);\r\n\t\t$query = SharIt::db()->createCommand()->update(SharDB::tableName('product'),\r\n\t\t\t$status, $id)->limit(1)->execute();\r\n return true;\r\n\t}", "public function checkAndCancelMatch() {\n\t\t$this->calculate_bet = false;\n\t\tif($this->match_info != false && $this->no_data_found == false && is_object($this->match_info) && (in_array($this->match_info->period,$this->cancelled_match_status) || $this->match_info->status != \"active\")) {\n\t\t\tif($this->bet_type == \"single\"){\n\t\t\t\t// match cancelled should return stack\n\t\t\t\t$this->returnStackDueToCancelMatch('cancel');\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// match cancelled we should change odd value for combo\n\t\t\t\t$this->cancel_match_count++;\n\t\t\t\t$this->result_status['' . $this->single_bet_info->match_id . '@' . $this->single_bet_info->odds_type . ''] = 11;\n\t\t\t\t$this->changeOddValue(1,'cancel');\n\t\t\t}\n\t\t}\n\t}", "function confirm_new_vote( $number , $vote ){\n require('choices.php');\n $team = $choices[ $vote ];\n $message = \"Your vote for \" . $team . \" has been recorded. Text 'Vote' for all the choices.\";\n return send_text( $number, $message );\n\n}", "public function close()\n {\n $this->allowTo('student');\n\n // Do we have a session to close ?\n if(!empty($_SESSION['play']['sessionId'])){\n\n // Check if session is active\n $active = $this->manager->findActive($_SESSION['play']['sessionId']);\n\n if($active){\n\n // Get user\n $loggedUser = $this->getUser();\n\n // Get session id\n $sessionId = $_SESSION['play']['sessionId'];\n\n // START older version, actually this version work with Aurelien's ResultController\n // Get questions\n $questions = $this->manager->questionsByQuizId($_SESSION['play']['quizId']);\n\n foreach($questions as $question){\n\n $choices = [];\n\n // Get choices\n $choicesList = $this->manager->choicesByQuestionId($question['questionId']);\n\n foreach($choicesList as $choice){\n $answers = $_POST[$question['questionId']];\n if(!is_array($answers)){\n $answers = [$answers];\n }\n $answer = 0;\n if(!empty($_POST[$question['questionId']]) && in_array($choice['choiceId'], $answers)){\n $answer = 1;\n }\n $choices[] = [$choice['choiceId'] => $answer];\n }\n\n $choicesFinal = [];\n foreach($choices as $key => $value){\n $choicesFinal = $choicesFinal + $choices[$key];\n }\n\n // Save answer (even if no choice checked, according to method used to calculate the results)\n $this->manager->setTable(\"answers\");\n $this->manager->insert([\n 'session_id' => $sessionId,\n 'user_id' => $loggedUser['id'],\n 'question_id' => $question['questionId'],\n 'choices' => serialize($choicesFinal)\n ]);\n\n }\n // END older version\n\n // START optimized version, but not effective with Aurelien's ResultController\n // Save answers\n // if(!empty($_POST)){\n // foreach($_POST as $questionId => $choicesId){\n // $this->manager->setTable(\"answers\");\n // $this->manager->insert([\n // 'session_id' => $sessionId,\n // 'user_id' => $loggedUser['id'],\n // 'question_id' => $questionId,\n // 'choices' => serialize($choicesId)\n // ]);\n // }\n // }\n // END optimized version\n\n // Close session\n \n // Get date\n $dateStop = new \\DateTime();\n\n $this->manager->setTable(\"sessions\");\n $this->manager->update([\n 'date_stop' => $dateStop->format('Y-m-d H:i:s'),\n ], $sessionId, true);\n }\n\n // Destroy session\n unset($_SESSION['play']);\n }\n\n // Redirect to result page\n $this->redirectToRoute('result_view_session', ['userId' => $loggedUser['id'], 'sessionId' => $sessionId]);\n }", "public function setInitiativeBidding($game)\n {\n $this->header['description'].= _('You can bid for initiative or pass') ;\n $highestBid = $this->getHighestBid($game) ;\n $this->sliders[] = array (\n 'ID' => 'forumInitiativeBidModal' ,\n 'title' => _('Bid for the initiative'),\n 'verb' => 'forumInitiativeBid',\n 'text' => 'BID'\n ) ;\n // You can always decide to pass\n $this->header['actions'] = array (\n array (\n 'type' => 'button' ,\n 'verb' => 'forumInitiativeBidPass' ,\n 'text' => 'PASS'\n )\n );\n // Default : If we are here, it means you have at least one Senator who can bid more than the current highest bid\n foreach ($this->yourParty->senators as $senatorID=>$senator) {\n /**\n * Get the corresponding Senator Model (entity)\n * @var \\Entities\\Senator $senatorModel\n */\n $senatorModel = $game->getFilteredCards(array('SenatorID' => $senatorID))->first();\n if ($senatorModel->getTreasury()>$highestBid)\n {\n $senator->addMenuItem(\n array (\n 'style' => 'primary' ,\n 'disabled' => FALSE ,\n 'verb' => 'forumInitiativeBid' ,\n 'text' => _('Bid') ,\n 'attributes' => array (\n 'data-json'=> '{\"action\":[\"slider\" , \"forumInitiativeBidModal\" , \"'.$senatorModel->getName().' bids for the initiative\" , \"'.($highestBid+1).'\" , \"'.$senatorModel->getTreasury().'\" , \"\" ]}'\n )\n )\n );\n }\n }\n }", "private function endCombat_normal()\r\n\t{\r\n\t\t$this->calculGainRyos();\r\n\t\t$this->calculGainExp();\r\n\t\t\r\n\t\tif ($this->gagnant == 0)\r\n\t\t{\r\n\t\t\t$ninja_gagnant = $this->_combattant;\r\n\t\t\t$ninja_perdant = $this->_adversaire;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$ninja_gagnant = $this->_adversaire;\r\n\t\t\t$ninja_perdant = $this->_combattant;\r\n\t\t}\r\n\t\t\r\n\r\n\t\tif ($ninja_perdant->ninja['stats_amulette_guerrier'] == 1) :\r\n\t\t\t$perte_vie_perdant = ceil(($ninja_perdant->ninja['stats_vie_max'] * 1) / 100);\r\n\t\telse :\r\n\t\t\t$perte_vie_perdant = ceil(($ninja_perdant->ninja['stats_vie_max'] * 5) / 100);\r\n\t\tendif;\r\n\r\n\t\tif ($ninja_gagnant->ninja['stats_amulette_guerrier'] == 1) :\r\n\t\t\t$perte_vie_gagnant = ceil(($ninja_gagnant->ninja['stats_vie_max'] * 1) / 500);\r\n\t\telse :\r\n\t\t\t$perte_vie_gagnant = ceil(($ninja_gagnant->ninja['stats_vie_max'] * 5) / 500);\r\n\t\tendif;\r\n\r\n\t\t$ninja_perdant->ninja['stats_vie'] - $perte_vie_perdant >= 0 ? \r\n\t\t\t$param_vie_perdant = 'stats_vie = stats_vie - '.$perte_vie_perdant : \r\n\t\t\t$param_vie_perdant = 'stats_vie = 0';\r\n\r\n\t\t$ninja_gagnant->ninja['stats_vie'] - $perte_vie_gagnant >= 0 ? \r\n\t\t\t$param_vie_gagnant = 'stats_vie = stats_vie - '.$perte_vie_gagnant : \r\n\t\t\t$param_vie_gagnant = 'stats_vie = 0';\r\n\r\n\t\t$requete_maj_gagnant = \"UPDATE \r\n\t\t\t\t\t\t\t\t\twan_stats \r\n\t\t\t\t\t\t\t\tSET \r\n\t\t\t\t\t\t\t\t\tstats_victoire = stats_victoire + 1, \r\n\t\t\t\t\t\t\t\t\tstats_ryos = stats_ryos + \".$this->gain_ryos.\", \r\n\t\t\t\t\t\t\t\t\tstats_xp = stats_xp +\".$this->gain_exp.\", \r\n\t\t\t\t\t\t\t\t\tstats_combat_max = stats_combat_max - 1,\r\n\t\t\t\t\t\t\t\t\t\".$param_vie_gagnant.\" \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tstats_id = \".ktPDO::get()->quote($ninja_gagnant->ninja['stats_id']).\" \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\r\n\t\t$requete_maj_perdant = \"UPDATE \r\n\t\t\t\t\t\t\t\t\twan_stats \r\n\t\t\t\t\t\t\t\tSET \r\n\t\t\t\t\t\t\t\t\tstats_defaite = stats_defaite + 1, \r\n\t\t\t\t\t\t\t\t\tstats_xp = stats_xp + 5, \r\n\t\t\t\t\t\t\t\t\tstats_combat_max = stats_combat_max - 1, \r\n\t\t\t\t\t\t\t\t\t\".$param_vie_perdant.\"\r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tstats_id = \".ktPDO::get()->quote($ninja_perdant->ninja['stats_id']).\" \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\r\n\t\t$requete_maj_combat = \"UPDATE \r\n\t\t\t\t\t\t\t\t\twan_arene \r\n\t\t\t\t\t\t\t\tSET \r\n\t\t\t\t\t\t\t\t\tarene_gagnant = \".ktPDO::get()->quote($ninja_gagnant->ninja['stats_id']).\", \r\n\t\t\t\t\t\t\t\t\tarene_gagnant_ryos = \".$this->gain_ryos.\", \r\n\t\t\t\t\t\t\t\t\tarene_gagnant_xp = \".$this->gain_exp.\" \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tarene_id = \".ktPDO::get()->quote($this->combat['arene_id']).\" \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\r\n\t\t$resultat_maj = 0;\r\n\t\t$resultat_maj += ktPDO::get()->exec($requete_maj_gagnant);\r\n\t\t$resultat_maj += ktPDO::get()->exec($requete_maj_perdant);\r\n\t\t$resultat_maj += ktPDO::get()->exec($requete_maj_combat);\r\n\t\t\r\n\t\tif ($resultat_maj == 3)\r\n\t\t{\r\n\t\t\t$log_data = array('winner_id' => $ninja_gagnant->ninja['ninja_id'],\r\n\t\t\t\t\t\t\t 'winner_login' => $ninja_gagnant->ninja['ninja_login'],\r\n\t\t\t\t\t\t\t 'looser_id' => $ninja_perdant->ninja['ninja_id'],\r\n\t\t\t\t\t\t\t 'looser_login' => $ninja_perdant->ninja['ninja_login'],\r\n\t\t\t\t\t\t\t 'fight_id' => $this->combat['arene_id'],\r\n\t\t\t\t\t\t\t 'exp_awarded' => $this->gain_exp,\r\n\t\t\t\t\t\t\t 'ryos_awarded' => $this->gain_ryos, \r\n\t\t\t\t\t\t\t 'mode' => 'normal',\r\n\t\t\t\t\t\t\t 'log_to' => 'winner');\r\n\r\n\t\t\t$log = array('ninja' => $ninja_gagnant->ninja['ninja_id'], 'class' => __CLASS__, 'method' => 'endCombat', 'data' => $log_data);\r\n\r\n\t\t\twanLog::log($log);\r\n\r\n\t\t\t$log_data['log_to'] = 'looser';\r\n\r\n\t\t\t$log = array('ninja' => $ninja_perdant->ninja['ninja_id'], 'class' => __CLASS__, 'method' => 'endCombat', 'data' => $log_data);\r\n\r\n\t\t\twanLog::log($log);\r\n\r\n\t\t\t$this->html_out .= $ninja_gagnant->ninja['ninja_login']. ' remporte '.$this->gain_ryos.' ryôs et '.$this->gain_exp.' exp.';\r\n\t\t\t$this->html_out .= '<br /><a href=\"index.php?page=arene\" alt=\"Retour à l\\'arène\">Retour</a>';\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->html_out .= '<br />Un problème est survenu, tes stats ne seront pas mis à jour et tu peux recommencer le combat.';\r\n\t\t\treturn;\r\n\t\t}\r\n\t\treturn;\r\n\t}", "public function actionClose(){\n\t\tYii::app()->regkey->cekReg();\n\n\t\t$id = Yii::app()->session['session_id'];\n\t\t$model = $this->loadModel($id);\n\n\t\t//save session\n\t\tif(isset($_POST['Session']))\n\t\t{\n\n\t\t\t$model->attributes=$_POST['Session'];\n\t\t\t$model->state = SESSION_CLOSED;\n\t\t\t$model->total_sales = $model->total;\n\t\t\t$model->total_drawer = str_replace(\",\",\"\",$model->total_drawer);\n\t\t\t$model->difference = $model->total_drawer - $model->total_sales;\n\n\t\t\tif(! $model->save())\n\t\t\t{\n\t\t\t\tprint \"error \" . $model->getErrors(); die;\n\t\t\t}\n\n\t\t\tunset(Yii::app()->session['session_id']);\n\n\t\t\t//close OpenERP session\n\t\t\t$wf = Session::closeOeSession($model);\n\t\t\tif($wf > 0 ){\n\t\t\t\tYii::app()->user->setFlash('success','Session succesfully closed and posted to OE');\n\t\t\t}\n\t\t\telse{\n\t\t\t\tYii::app()->user->setFlash('error','Session failed be posted to OE');\n\t\t\t}\n\n\t\t\t$this->redirect(array('/session/view', 'id'=>$id)) ;\t\n\t\t}\n\n\n\t\t$total_sales = $this->getTotalSales($model);\n\t\t$model->total_sales = $total_sales;\n\t\t$model->close_date = date(\"Y-m-d H:i:s\");\n\n\t\t$this->render('close',array(\n\t\t\t'model'=>$model,\n\t\t));\n\n\t}", "function exitSurvey()\n\t{\n\t\tif(!$this->preview)\n\t\t{\n\t\t\t$this->backToRepository();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ctrl->setParameterByClass(\"ilobjsurveygui\", \"pgov\", $_REQUEST[\"pgov\"]);\n\t\t\t$this->ctrl->redirectByClass(\"ilobjsurveygui\", \"questions\");\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
PHP 4 equivalent for date_create().
function date_create($date_in = NULL, $timezone = NULL) { if (empty($date_in) || strtolower($date_in) == 'now') { // Create a current date for an empty value or 'now'. $date_out = date_date('Y-m-d H:i:s', (time()), $timezone); } elseif (substr($date_in, 0, 1) == '@' && is_numeric(substr($date_in, 1))) { // An number prefixed with '@' is interpreted as a timestamp. $date_out = date_date('Y-m-d H:i', substr($date_in, 1), $timezone); } elseif (preg_match(DATE_REGEX_LOOSE, $date_in, $regs)) { $year = date_pad(isset($regs[1]) ? $regs[1] : 0, 4); $month = date_pad(isset($regs[2]) ? $regs[2] : 0); $day = date_pad(isset($regs[3]) ? $regs[3] : 0); $hour = date_pad(isset($regs[5]) ? $regs[5] : 0); $minute = date_pad(isset($regs[6]) ? $regs[6] : 0); $second = date_pad(isset($regs[7]) ? $regs[7] : 0); $date_out = "$year-$month-$day $hour:$minute:$second"; } else { // Try to use strtotime, will only work on post-1970 dates. // Only use it if the value is big enough that timezone conversions // won't make it into a negative value. $test = @strtotime($date_in .' '. $timezone); if ($test > 86400) { $date_out = date_date('Y-m-d H:i', $test, $timezone); } } if (empty($date_out)) { return NULL; } $date = new StdClass(); $date->value = $date_out; $date->timestamp = date_datetime2timestamp($date->value, $timezone); $date->timezone = $timezone; return $date; }
[ "function date_create_dmy($date) {\n $d = substr($date, 0, 2);\n $m = substr($date, 3, 2);\n $y = substr($date, 6, 4);\n return date_create(\"$y-$m-$d\");\n}", "function date_create_mdy($date) {\n $d = substr($date, 3, 2);\n $m = substr($date, 0, 2);\n $y = substr($date, 6, 4);\n return date_create(\"$y-$m-$d\");\n}", "public function getCreationDate()\n {\n $date = $this->get('ts_created');\n return Date::factory($date);\n }", "public function create($value = null)\n {\n return new Date($value);\n }", "public function createDate () {\n return date('Y-m-d H:i:s', $this->created);\n }", "function make_date(){\n return strftime(\"%y-%m-%d %H:%M:%S\", time());\n}", "public static function BuildCurrentDate()\n {\n return date('YYYYmmdd');\n }", "static public function now()\n {\n return date(DT_DATETIME1);\n }", "public function getCreateDatetime() {\n return date(\"Y-m-d H:i:s\");\n }", "function createTimestamp( $year, $month, $day, $hour=0, $minute=0, $second=0 )\n{\n\treturn( mktime ( $hour, $minute, $second, $month, $day, $year ) );\n}", "public function get_date_create()\n\t{\n\t\treturn $this->date_create;\n\t}", "function makeDate()\n{\n return strftime(\"%Y-%m-%d %H:%M:%S\", time());\n}", "function createCreated( ) {\n if( !isset( $this->created['value']['year'] ) &&\n !isset( $this->created['value']['month'] ) &&\n !isset( $this->created['value']['day'] ) &&\n !isset( $this->created['value']['hour'] ) &&\n !isset( $this->created['value']['min'] ) &&\n !isset( $this->created['value']['sec'] ))\n return;\n $formatted = $this->_format_date_time( $this->created['value'], 7 );\n $attributes = ( isset( $this->created['xparams'] )) ? $this->_createParams( $this->created['xparams'] ) : null;\n return $this->_createElement( 'CREATED', $attributes, $formatted[0] );\n }", "public function getDateCreated()\n\t{\n\t\treturn new Precurio_Date($this->date_created);\n\t}", "public static function create() {\r\n\t\treturn self::_createFromTimestamp(number_format(microtime(true), 3, '.', ''));\r\n\t}", "public function getCreateDate()\n\t{\n\t\t$created_at = $this->getValue('created_at');\n\n\t\treturn $created_at && isset($created_at) ? strtotime($created_at) : null;\n\t}", "function rfc_date() {\n $tz = date(\"Z\");\n $tzs = ($tz < 0) ? \"-\" : \"+\";\n $tz = abs($tz);\n $tz = $tz/36 + $tz % 3600;\n $date = sprintf(\"%s %s%04d\", date(\"D, j M Y H:i:s\"), $tzs, $tz);\n return $date;\n }", "function YmdHis($Y, $m = 1, $d = 1, $H = 0, $i = 0, $s = 0)\n{\n// $YmdHis = $Y . add0($m) . add0($d) . add0( $H ) . add0($i) . add0($s);\n return date(\"YmdHis\", mktime($H, $i, $s, $m, $d, $Y));\n}", "function fnMakeDate($intDay, $intMonth, $intYear, $strFormate = 'd-M-Y') {\r\n return date($strFormate, mktime(0, 0, 0, $intMonth, $intDay, $intYear));\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extract the version number part up to the minor version from a version string. E.g. "7.0.5" => "7.0"
protected function getMinorVersionNumber(string $version): string { preg_match('/(\d+\.\d+)/', $version, $matches); return $matches[1]; }
[ "public static function extractMajorAndMinorVersion($versionString)\n {\n\t\tif (preg_match('/^(\\d+\\.\\d+)/', $versionString, $matches)) {\n\t\t\treturn $matches[1];\n\t\t}\n\n\t\treturn '';\n\t}", "public static function extract_version_number($version_string)\n\t{\n\t\t$parts = explode('|', $version_string);\n\t\tif (count($parts) == 2)\n\t\t\treturn trim($parts[1]);\n\n\t\tif (strpos($parts[0], '.') === false)\n\t\t\treturn '1.0.'.trim($parts[0]);\n\n\t\treturn trim($parts[0]);\n\t}", "private function makeMajorMinor($version) {\n return substr($version, 0, strrpos($version, '.'));\n }", "public static function majorMinorConstraint(string $version): string {\n preg_match('/^(\\d+)\\.(\\d+)\\.\\d+/', $version, $matches);\n return '^' . $matches[1] . '.' . $matches[2];\n }", "function version_parse($version)\n{\n return str_replace(\n array('-stable', '-git'),\n array('.0', '.99'),\n $version\n );\n}", "function next_version_stable($matches)\n{\n $version_parts = explode('.', $matches['version']);\n $last_version = array_pop($version_parts);\n $last_version++;\n $version_parts[] = $last_version;\n\n return implode('.', $version_parts) . (empty($matches['prerelease']) ? '-dev' : $matches['prerelease']);\n}", "public function getMinorVersion();", "public static function nextSignificantRelease($version)\n {\n $parsed = explode('.', $version, 3);\n if (count($parsed) > 1) {\n array_pop($parsed);\n }\n $parsed[count($parsed) - 1]++;\n if (count($parsed) === 1) {\n $parsed[] = '0';\n }\n\n return implode('.', $parsed);\n }", "public function getMinorVersion() {}", "private function normalize_version_number( $version ) {\n\t\tif ( preg_match( '`^\\d+\\.\\d+$`', $version ) ) {\n\t\t\t$version .= '.0';\n\t\t}\n\n\t\treturn $version;\n\t}", "function expand_version($version) {\n\t$major = substr($version, 0, 2);\n\t$minor = substr($version, 2, 2);\n\t$bugfix = substr($version, 4, 2);\n\tif (intval($bugfix) != 0) {\n\t\t\t$new_ver = $major . \".\" . $minor . \".\" . $bugfix;\n\t} else if (intval($minor) != 0) {\n\t\t\t$new_ver = $major . \".\" . $minor;\n\t} else {\n\t\t$new_ver = $major;\n\t}\n\treturn $new_ver;\n}", "function GetOSMinorVersion(){}", "function get_version_parts($version) {\n $version_parts = [];\n $string_parts = explode('.', $version);\n\n foreach ($string_parts as $string_part) {\n $version_parts[] = str_replace('x-', '', $string_part);\n }\n\n return $version_parts;\n}", "public static function max_version()\n {\n $v = static::pluck('version')\n ->transform( function($v) {\n return collect( explode('.', $v) )\n ->transform( function($part) {\n return substr('0000' . $part, -3);\n })\n ->implode('.');\n })\n ->max();\n\n if ( ! $v ) return null;\n\n return\n collect( explode('.',$v) )\n ->transform( function($part) {\n return 1 * $part;\n })\n ->implode('.');\n }", "function system_assemble_version_number( string $major ,\n string $minor ,\n string $patch ,\n string $extension = '' ) : string\n{\n // Assemble the semver string\n $version = $major.'.'.$minor.'.'.$patch;\n\n // Add the extension if provided\n $version = ($extension) ? $version.'-'.$extension : $version;\n\n // Return the assembled string\n return $version;\n}", "public static function getMajor() {\n return (int) explode('.', Version::id())[0];\n }", "public function getMinor()\n {\n return (int) Arr::get($this->getExplodedVersion(), 1, 0);\n }", "function versionAsNumber($version) {\n $tokens = preg_split('/\\\\./', $version);\n return $tokens[0] * 10000 + $tokens[1] * 100 + $tokens[2];\n}", "protected function fetchVersion()\n {\n $describe = exec('git describe --tags');\n $describe = explode('-', $describe);\n\n // v0.1.0-3-g2f6c6a6 -> v0.1.0 (g2f6c6a6)\n if (count($describe) > 2) {\n return $describe[0].' ('.$describe[2].')';\n }\n\n return current($describe);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check if transaction id exist in api log table
public function payoneApiLogTransactionIdExist() { $DBConfig = Shopware()->Db()->getConfig(); $sql = "SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='s_plugin_mopt_payone_api_log' AND TABLE_SCHEMA='" . $DBConfig['dbname'] . "' AND COLUMN_NAME ='transaction_id';"; $result = Shopware()->Db()->query($sql); if ($result->rowCount() === 0) { return false; } return true; }
[ "function transaction_exists( $transaction_id ) {\n global $wpdb;\n\n $query = $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}{$this->table} WHERE trxId = %d\", $transaction_id );\n $result = $wpdb->get_row( $query );\n\n if ( $result ) {\n return true;\n }\n\n return false;\n }", "private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }", "public function check_txn_id(Detail\\IPNTransaction $transaction): bool\n\t{\n\t\treturn true;\n\t}", "function check_transaction($userID, $id){\n $query = \"SELECT transaction_id, ticket.event_id FROM transaction INNER JOIN ticket ON transaction.ticket_id = ticket.ticket_id WHERE transaction.user_id = '$userID' AND ticket.event_id = '$id'\";\n return $this->db->query($query);\n }", "function transaction_exists ($tran_key){\n \t$ret = true;\n \t$sql_conn = $this->dbConnection();\n \t$q_result = mysqli_query($sql_conn, \"SELECT COUNT(TransactionID) AS MYCNT FROM cc_transactions WHERE TransactionKey = '\".addslashes($tran_key).\"'\");\n \t$row = mysqli_fetch_array($q_result,MYSQLI_ASSOC);\n \tif($row['MYCNT'] == 0){\n \t\t$ret = false;\n \t}\n \t$sql_conn->close();\n \treturn $ret;\n }", "protected function hasID($transaction)\n {\n return (int)$transaction->id > 0;\n }", "function is_duplicate_txn_id($txn_id = '')\n{\n global $ilance;\n \n $sql = $ilance->db->query(\"\n SELECT invoiceid\n FROM \" . DB_PREFIX . \"invoices\n WHERE custommessage = '\" . $ilance->db->escape_string($txn_id) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n return true;\n }\n \n return false;\n}", "private function checkIsExists(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.listId' => $this->listId,\n $this->table. '.campaignId' => $this->campaignId,\n ]\n ]);\n\n return !is_null($id);\n }", "public function isTransactionFailed(): bool;", "public function checkCreatorLogExists($creatorId);", "function isTransactionIDValid($txn_idFromPaypal) {\n\t$conn = Doctrine_Manager::connection(); \n\t$query = \"SELECT txn_id from payment WHERE txn_id = '\".$txn_idFromPaypal.\"'\";\n\t$result = $conn->fetchOne($query); \n\t\n\tif(!isEmptyString($result)){ \n\t\t// an error occured while processing the query\n\t\tsendTestMessage(\"Paypal Transaction ID \".$txn_idFromPaypal.\" already exists!!\", \"Query: \".$query.\", <br>Error: \");\n\t\treturn false;\n\t} else {\n\t\t// if there are no rows returned then txn_id has not been used before and is therefore valid.\t\n\t\treturn true;\n\t}\n}", "private function isTransactionExist($transactionId)\n {\n if (strlen($transactionId) <= 3) {\n return false;\n }\n\n $insertOrder = $this->db->fetchRow(\n 'SELECT id FROM s_order WHERE transactionID = ? AND status != -1',\n [$transactionId]\n );\n\n return !empty($insertOrder['id']);\n }", "protected function _validateTransactionID()\n {\n return ($this->request->getModuleCode() !== NULL AND $this->request->getTransactionID() !== NULL );\n }", "public function recordExists($id);", "public function isUnderTransaction(){ }", "protected function txn_is_duplicate() {\n\n\t\tif($this->log_to_db) {\n\t\t\tif($this->connect_db()) {\n\t\t\t\tif(mysql_num_rows(mysql_query(\"SELECT txn_id FROM ipn WHERE txn_id='\".mysql_real_escape_string($this->ipn['txn_id'],$this->dbc).\"'\",$this->dbc)) != 0) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\n\t}", "function transactionstored($txn_id) {\r\n\t\tglobal $db_connection;\r\n\t\t// IS THERE A TRANSACTION??\r\n\t\t$u_name_q = \"select count(*) from classified_sales where ( transid = '\";\r\n\t\t$u_name_q .= trim($txn_id);\r\n\t\t$u_name_q .= \"')\";\r\n\t\t////\r\n\t\t//\t\t\r\n\t\t$q_result = @mysqli_query($u_name_q) or die (mysqli_error($db_connection)); // \r\n\t\t//\r\n\t\t$row = @mysqli_fetch_row($q_result);\r\n\t\t//\r\n\t\t$counter = $row[0];\r\n\r\n\t\tif ( $counter <= 0 ) return(true);\r\n\t\treturn(false);\r\n\t}", "function isSalesExist()\n\t{\n\t\tglobal $db;\n\n\t\t$query = 'SELECT sales_id FROM '.sales_table.' WHERE sales_id = '.$this->sales_id;\n\t\t$db->query($query);\n\t\t$result = $db->query($query);\n\n\t\tif(!$result)\n\t\t{\n\t\t\t$err_info = $db->errorInfo();\n\t\t\techo $err_info[2];\n\t\t\terror_log('Function : isSalesExist, Class : receipt, '.$err_info[2]);\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arr = $result->fetch(PDO::FETCH_ASSOC);\n\t\t\t$sales_id = $arr['sales_id'];\n\t\t}\n\t\treturn $sales_id;\n\t}", "public function isUnderTransaction();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to edit a bottle (named product to match other business services)
public function editProduct(Bottle $bottle) { // Call updateBottle method in bottleDataService and set to variable $editStatus = $this->updateBottle($bottle); // Return the edit status boolean return $editStatus; }
[ "public function testUpdateProduct()\n {\n }", "public function testUpdateProductUsingPOST()\n {\n }", "public function updateProduct()\n\t{\n\t}", "public function testAdminEditProduct(): void\n {\n $newProductPostTitle = 'Product Title '.mt_rand();\n\n $client = static::createClient([], [\n 'PHP_AUTH_USER' => 'vandana_admin',\n 'PHP_AUTH_PW' => 'vandana@admin',\n ]);\n $client->request('GET', '/en/admin/product/8/edit');\n $client->submitForm('Save changes', [\n 'product[name]' => $newProductPostTitle,\n ]);\n\n $this->assertResponseRedirects('/en/admin/product/8/edit', Response::HTTP_FOUND);\n\n /** @var \\App\\Entity\\Product $product */\n $product = self::$container->get(ProductRepository::class)->find(8);\n $this->assertSame($newProductPostTitle, $product->getName());\n }", "public function testUpdateBrandUsingPUT()\n {\n }", "public function testUpdateProductionLot()\n {\n }", "function edit_product_in_admin(){\n\n}", "public function showEditProduct(){\n $productDB = new ProductModel();\n $productId = filter_input(INPUT_POST, 'id');\n $view = new View();\n $view->products = $productDB->getTaskById($productId);\n $view->renderAdmin('admin_edit_product.php', 'admin_view.php');\n }", "public function update(): void\n {\n Utility::reqMethodCheck('PUT');\n $validation = [];\n parse_str(file_get_contents('php://input'), $_PUT);\n\n // if parameter missing\n (!isset($_PUT['product_id']))? Utility::response(400,\"parameter 'product_id' is missing\") : '';\n (!isset($_PUT['name']) ) ? Utility::response(400,\"parameter 'name' is missing\") : '';\n (!isset($_PUT['quantity'])) ? Utility::response(400,\"parameter 'quantity' is missing\") : '';\n (!isset($_PUT['desk']) ) ? Utility::response(400,\"parameter 'desk' is missing\") : '';\n\n // if product not exist\n $this->model(\"barang_model\")->checkBarang($_PUT['product_id']);\n\n // not empty\n (strlen($_PUT['name']) == 0) ? $validation['name'] = \"cannot be empty\" : '';\n (strlen($_PUT['quantity'])== 0) ? $validation['quantity'] = \"cannot be empty\" : '';\n (strlen($_PUT['desk']) == 0) ? $validation['desk'] = \"cannot be empty\" : '';\n // max length \n (strlen($_PUT['name']) > 100)? $validation['name'] = \"max 100 character\" : '';\n (strlen($_PUT['quantity'])> 11) ? $validation['quantity'] = \"max 11 character\" : '';\n (strlen($_PUT['desk']) > 255)? $validation['desk'] = \"max 255 character\" : '';\n // quantity must number \n ((bool)preg_match_all('/[A-Za-z,.\\\\/?><:;\\'\\\"|!@#$%^&*()\\-_\\+={}\\\\[\\\\]`~]/', $_PUT['quantity'])) ? $validation['quantity'] = \"must integer!\" : '';\n \n (!empty($validation)) ? Utility::response(400,$validation) : '';\n\n $this->model(\"barang_model\")->updateBarang($_PUT);\n }", "public function update_put(){\r\n $response = $this->ProductM->update_product(\r\n $this->put('id'),\r\n $this->put('name'),\r\n $this->put('price')\r\n \r\n );\r\n $this->response($response);\r\n }", "function editarProducto() {\n $id = Request::read('id');\n if($this->isLogged()) {\n $header = file_get_contents(\"plantilla/_header.html\");\n $this->getModel()->setDato('header', $header);\n $footer = file_get_contents(\"plantilla/_footer.html\");\n $this->getModel()->setDato('footer', $footer);\n $this->getModel()->setDato('archivo' , 'producto/_editar_producto.html');\n $productoEditar = $this->getModel()->getProduct($id);\n $this->getModel()->setDatos($productoEditar->getAttributesValues());\n $todos = $this->getModel()->getAllFamilies();\n $this->getModel()->setDato('option', $todos);\n } else {\n $this->index();\n }\n }", "public function editSKU() {\n\t\t\t\t//Build edit SKU json.\n $jsonString = '{\n\t\t\t\t \"SKUMapping\": {\n\t\t\t\t\t\"ClientSKU\": \"Sample Client SKU\",\n\t\t\t\t\t\"CCHProductCode\": \"90002199000000000019\",\n\t\t\t\t\t\"Description\": \"Sample Mapping 45 New\",\n\t\t\t\t\t\"StartDate\": \"2014-08-29T00:00:00\",\n\t\t\t\t\t\"EndDate\": \"2015-08-30T00:00:00\"\n\t\t\t\t }\n\t\t\t\t}';\n\n\t\t\t\t//Replace ENTITY_ID placeholder with your actual entity id below. \n $curl = curl_init($this->URL.'entity/STX-02199-00/productMapping/edit');\n \n\t\t\t\t//Set other options for the call.\n curl_setopt($curl, CURLOPT_HTTPHEADER, $this->multiHeaders);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonString);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n \n\t\t\t\t//Make the call and then close the connection\n $response = curl_exec($curl);\n\t\t\t\tprint \"\\n\\nEdit SKU Response::\\n\".$response;\n curl_close($curl);\n }", "public function edit_product(){\n if ( ! $this->ion_auth->logged_in() OR ! $this->ion_auth->is_admin())\n {\n redirect('auth', 'refresh');\n }\n else\n {\n /* Breadcrumbs */\n $this->data['breadcrumb'] = $this->breadcrumbs->show();\n\n /*List Units*/\n $this->data['prod_types'] = $this->products_model->get_prod_types();\n \n /*List Prod Types*/\n $this->data['prod_units'] = $this->products_model->get_prod_unit();\n\n /*Product Details*/\n $this->data['prod_details'] = $this->products_model->get_product_details($this->input->get(\"prod_id\"));\n\n /*Product Invetory*/\n $this->data['prod_inventory'] = $this->products_inventory_model->get_products_inventory($this->input->get('prod_id'));\n\n /*Load Template*/\n $this->template->admin_render('admin/products/edit_product', $this->data);\n\n }\n }", "function ciniki_artcatalog_productUpdate(&$ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'product_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Product'), \n 'name'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Name'), \n 'permalink'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Permalink'), \n 'flags'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Flags'), \n 'sequence'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Sequence'), \n 'image_id'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Image'), \n 'synopsis'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Synopsis'), \n 'description'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Description'), \n 'price'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'currency', 'name'=>'Price'), \n 'taxtype_id'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Taxtype'), \n 'inventory'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Inventory'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'checkAccess');\n $rc = ciniki_artcatalog_checkAccess($ciniki, $args['tnid'], 'ciniki.artcatalog.productUpdate'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n\n //\n // Get the existing details\n //\n $strsql = \"SELECT id, artcatalog_id \"\n . \"FROM ciniki_artcatalog_products \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $args['product_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.artcatalog', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['item']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.artcatalog.36', 'msg'=>'Product does not exist'));\n }\n $product = $rc['item'];\n\n //\n // Check if permalink needs updating\n //\n if( isset($args['name']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'makePermalink');\n $args['permalink'] = ciniki_core_makePermalink($ciniki, $args['name']);\n //\n // Check to make sure the permalink is unique within the artcatalog item\n //\n $strsql = \"SELECT id, name, permalink \"\n . \"FROM ciniki_artcatalog_products \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND artcatalog_id = '\" . ciniki_core_dbQuote($ciniki, $product['artcatalog_id']) . \"' \"\n . \"AND permalink = '\" . ciniki_core_dbQuote($ciniki, $args['permalink']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.artcatalog', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num_rows'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.artcatalog.37', 'msg'=>'You already have a product with this name, please choose another name'));\n }\n }\n\n //\n // Update product\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n return ciniki_core_objectUpdate($ciniki, $args['tnid'], 'ciniki.artcatalog.product', $args['product_id'], $args, 0x07);\n}", "public function updateBookingProduct(\\WarehouseBundle\\Entity\\BookingProduct $bookingProduct);", "public function testEditBillProductPrice() {\n\n $data = $this->generateData();\n\n $post = [\n 'product_id' => $data['product']->id,\n 'bill_product_id' => $data['billProduct']->id,\n 'product_code' => $data['product']->code,\n 'product_price' => rand(1, 99)\n ];\n\n $this->actingAs($data['user'])\n ->post(TestUrlBuilder::editBillProductPrice($data['bill']->id), $post)\n ->seeJson([\n 'success' => true,\n 'message' => trans('bill.price_updated')\n ]);\n }", "public function testUpdateSupplierProduct()\n {\n }", "public function test_can_update_the_product()\n {\n\n $product = Product::factory()->create();\n\n $formData = [\n 'code' => 'Changed',\n 'name' => 'Changed',\n 'description' => 'Changed',\n ];\n $response = $this->json('PUT', '/api/products/'.$product->id, $formData);\n\n $response->seeJson([\n 'status' => 'success',\n ])\n ->seeJsonEquals([\n 'message' => 'Product updated successfully',\n 'status' => 'success',\n ]);\n\n }", "public function testCreateUpdateProduct()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function Inscriptions_Noof_Presents, Parameter list: $inscription=array() Returns number of participants registered for $inscription.
function Inscriptions_Noof_Presents($inscription=array()) { if (empty($inscription)) { return $this->Language_Message("Inscriptions_NoPresents_Message"); } return $this->ParticipantsObj()->Sql_Select_NHashes ( $this->UnitEventWhere ( array ( "Friend" => $inscription[ "Friend" ], "Presence" => 2, ) ) ); }
[ "public function countParticipants()\n {\n return DB::table('cups_participants')->whereCupId($this->id)->count();\n }", "public function getCountParticipants()\n\t{\n\t \treturn count($this->participants);\n\t}", "public function getParticipantsCount(): int;", "public function countFetchedNotices()\n {\n $map = new Yammer_notice_stub();\n return $map->count();\n }", "function Inscriptions($args=array())\n {\n $this->Hash2Object($args);\n $this->AlwaysReadData=array(\"Friend\",\"School\",\"Name\",\"SortName\",\"Unit\",\"Event\",\"CH\");\n $this->Sort=array(\"SortName\");\n $this->InscriptionEventTableSGroups= array\n (\n array\n (\n \"Basic\" => 0,\n \"Inscriptions\" => 0,\n ),\n );\n \n $this->InscriptionFriendLatexTableData=\n array\n (\n \"Name\",\"School\",\n \"INEP\",\"Address\",\n \"City\",\"Area\",\n \"ZIP\",\"Phone\",\n \"Cell\"\n );\n $this->IncludeAllDefault=TRUE;\n $this->CellMethods[ \"Inscriptions_Noof_Participants\" ]=TRUE;\n $this->CellMethods[ \"Inscriptions_Noof_Presents\" ]=TRUE;\n }", "public function countInstitutes() {\n\n $systemDatabaseManager = SystemDatabaseManager::getInstance();\n $query = \"SELECT\n COUNT(*) AS instituteCount\n FROM\n institute\";\n\n return $systemDatabaseManager->executeQuery($query,\"Query: $query\");\n }", "public function getParticipationCount(): int\n {\n return count($this->getParticipationIds());\n }", "function nombre_participants($participants){\n\t\t$table_participants = explode(\"|\", $participants);\n\t\treturn count($table_participants)-1;\n\t}", "function wpcampus_get_interested_count() {\n\treturn GFAPI::count_entries( 1, array(\n\t\t'status' => 'active',\n\t));\n}", "function wpcampus_get_attend_in_person_count() {\n\t$search_criteria = array(\n\t\t'status' => 'active',\n\t);\n\t$search_criteria['field_filters'][] = array(\n\t\t'key' => '6',\n\t\t'operator' => 'like',\n\t\t'value' => 'Attend in person',\n\t);\n\treturn $counts = GFAPI::count_entries( 1, $search_criteria );\n}", "public function getSubscriberCount();", "public function inscriptions()\n\t{\n\t\t$query = $this->db->select('date_inscription, count(id) as nb_inscriptions')\n\t\t\t\t\t\t ->from('joueurs')\n\t\t\t\t\t\t ->where('date_inscription BETWEEN (NOW() - INTERVAL 30 DAY) AND (NOW() - INTERVAL 1 DAY)')\n\t\t\t\t\t\t ->group_by('DATE(date_inscription)')\n\t\t\t\t\t\t ->get();\n\t\t$inscriptions = $query->result();\n\t\t$donnees_graphique = array();\n\t\t\n\t\tforeach ($inscriptions as $inscription)\n\t\t\t$donnees_graphique[strtotime($inscription->date_inscription)] = $inscription->nb_inscriptions;\n\n\t\t// On affiche\n\t\t$vars = array(\n\t\t\t'donnees_graphique' => json_encode($donnees_graphique)\n\t\t);\n\t\treturn $this->layout->view('staff/statistiques/inscriptions', $vars);\n\t}", "public function countMemberCollection() {\n return count($this->elements($this->using('xpath')->value('//div[@class=\"listen-list listen-subscribe\"]/ul/li')));\n }", "public function getInnListCount()\n {\n return $this->count(self::INNLIST);\n }", "function getNumbersSections(){\r\n\r\n\t\t$criteriaTribes \t\t= new Criteria('rel_user_uid',$this->uidOwner);\r\n\t\t$nbSections['nbTribes']\t= $this->reltribeusers_factory->getCount($criteriaTribes);\r\n\t\t$criteriaUid \t\t= new Criteria('uid_owner',$this->uidOwner);\r\n\t\t$criteriaAlbum \t\t= new CriteriaCompo($criteriaUid);\r\n\t\tif ($this->isOwner==0){\r\n\t\t\t$criteriaPrivate = new criteria('private',0);\r\n\t\t\t$criteriaAlbum->add($criteriaPrivate);\r\n\t\t}\r\n\t\t$nbSections['nbPhotos']\t= $this->album_factory->getCount($criteriaAlbum);\r\n\t\t$criteriaFriends \t\t= new criteria('friend1_uid',$this->uidOwner);\r\n\t\t$nbSections['nbFriends']= $this->friendships_factory->getCount($criteriaFriends);\r\n $criteriaUidAudio = new criteria('uid_owner',$this->uidOwner);\r\n $nbSections['nbAudio'] = $this->audio_factory->getCount($criteriaUidAudio);\r\n\t\t$criteriaUidVideo \t\t= new criteria('uid_owner',$this->uidOwner);\r\n\t\t$nbSections['nbVideos'] = $this->videos_factory->getCount($criteriaUidVideo);\r\n\t\t$criteriaUidScraps \t\t= new criteria('scrap_to',$this->uidOwner);\r\n\t\t$nbSections['nbScraps'] = $this->scraps_factory->getCount($criteriaUidScraps);\r\n\r\n\t\treturn $nbSections;\r\n\t}", "public function getCountPhonebookList(){\n\t\t$r = $this->getDb()->selectQuery(sprintf(\"SELECT COUNT(*) FROM sip INNER JOIN user ON sip.uid=user.uid LEFT JOIN extensions ON sip.name = SUBSTR(extensions.appdata, 5)\"));\n\t\treturn intval($r[0]);\n\t}", "public function nbPatientSUP900(){\n\t\t$adapter = $this->tableGateway->getAdapter ();\n\t\t$sql = new Sql ( $adapter );\n\t\t$select = $sql->select ('patient');\n\t\t$select->columns(array ('ID_PERSONNE'));\n\t\t$select->where( array (\n\t\t\t\t'ID_PERSONNE > 900'\n\t\t) );\n\t\t$stmt = $sql->prepareStatementForSqlObject($select);\n\t\t$result = $stmt->execute();\n\t\treturn $result->count();\n\t}", "function site_notification_count($username) {\n if(!$username) {\n $user = elgg_get_logged_in_user_entity();\n } else {\n $user = get_user_by_username($username);\n if (!$user) {\n throw new InvalidParameterException('registration:usernamenotvalid');\n }\n }\n\n\tif (elgg_is_active_plugin('site_notifications')) {\n $return['count'] = elgg_get_entities_from_metadata(array(\n\t\t\t\t'type' => 'object',\n\t\t\t\t'subtype' => 'site_notification',\n\t\t\t\t'owner_guid' => $user->guid,\n\t\t\t\t'metadata_name' => 'read',\n\t\t\t\t'metadata_value' => false,\n\t\t\t\t'count' => true,\n\t\t\t));\n\t}else{\n\t\t$return['count'] = 0;\n\t}\n \n return $return;\n}", "function nb_avis($idq,$ide){\n\treturn count_records(\"questionsvalidation\",\"id=\".$idq.\" and id_etab=\".$ide,false,false);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the content width in pixels, based on the theme's design and stylesheet. Priority 0 to make it available to lower priority callbacks.
function t2018_content_width() { $GLOBALS['content_width'] = apply_filters( 't2018_content_width', 640 ); }
[ "public function content_width() {\n\t\t\t$GLOBALS['content_width'] = apply_filters( 'cera_content_width', 1140 );\n\t\t}", "function neblue_content_width() {\r\n $GLOBALS['content_width'] = apply_filters('neblue_content_width', 750);\r\n}", "function recesswp_content_width()\n{\n $GLOBALS['content_width'] = apply_filters('recesswp_content_width', 840);\n}", "function staffplex_content_width() {\r\n\t$GLOBALS['content_width'] = apply_filters( 'staffplex_content_width', 640 );\r\n}", "function hola_elementor_content_width() {\n\t\t$defaultS['content_width'] = apply_filters( 'hola_elementor_content_width', 800 );\n\t}", "function streetsheettheme_content_width() {\n\t$GLOBALS['content_width'] = apply_filters( 'streetsheettheme_content_width', 640 );\n}", "function prana_set_content_width( $width = '' ) {\n\tglobal $content_width;\n\t$content_width = absint( $width );\n}", "function lsx_process_content_width() {\n\t\tglobal $content_width;\n\n\t\tif (\n\t\t\tis_page_template( 'page-templates/template-front-page.php' ) ||\n\t\t\tis_page_template( 'page-templates/template-full-width.php' )\n\t\t) {\n\t\t\t$content_width = 1140;\n\t\t}\n\t}", "function ckav_action_theme_content_width() {\n\tif ( is_attachment() && wp_attachment_is_image() ) {\n\t\t$GLOBALS['content_width'] = 810;\n\t}\n}", "function majale_content_width() {\n\t\tif ( is_attachment() && wp_attachment_is_image() ) {\n\t\t\t$GLOBALS['content_width'] = 810;\n\t\t}\n\t}", "public function setContentWidth(): void\n {\n printf('<style>:root{ --content-width: %spx;}</style>', $this->contentWidth);\n }", "function academica_set_content_width() {\n\tglobal $content_width;\n\n\t$classes = academica_sidebar_classes();\n\n\tif ( in_array( 'column-double', $classes ) || is_page_template( 'template-sidebar-left.php' ) || is_page_template( 'template-sidebar-right.php' ) )\n\t\t$content_width = 880;\n\n\telseif ( in_array( 'column-full', $classes ) || is_page_template( 'template-full-width.php' ) )\n\t$content_width = 1170;\n}", "function twentyfourteen_content_width() {\n\tif ( is_attachment() && wp_attachment_is_image() ) {\n\t\t$GLOBALS['content_width'] = 810;\n\t}\n}", "function motif_content_width() {\n\tglobal $content_width;\n\n\tif ( is_page_template( 'page-templates/full-width-page.php' )\n\t || is_page_template( 'page-templates/grid-page.php' )\n\t || is_attachment() )\n\t\t$content_width = 1032;\n}", "function twentythirteen_content_width() {\n\tglobal $content_width;\n\n\tif ( is_attachment() )\n\t\t$content_width = 724;\n\telseif ( has_post_format( 'audio' ) )\n\t\t$content_width = 484;\n}", "function eugine_content_width() {\n\tif ( is_attachment() && wp_attachment_is_image() ) {\n\t\t$GLOBALS['content_width'] = 810;\n\t}\n}", "function javo_drt_content_width() {\n\tif ( is_page_template( 'templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) {\n\t\tglobal $content_width;\n\t\t$content_width = 960;\n\t}\n}", "function buddyboss_content_width() {\n\tif ( is_page_template( 'full-width.php' ) || is_attachment() || !is_active_sidebar( 'sidebar-1' ) ) {\n\t\tglobal $content_width;\n\t\t$content_width = 960;\n\t}\n}", "function utthehill_content_width() {\n\tglobal $content_width;\n\n\tif ( is_attachment() )\n\t\t$content_width = 724;\n\telseif ( has_post_format( 'audio' ) )\n\t\t$content_width = 484;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get all related JointPermissions.
public function jointPermissions() { return $this->hasMany(JointPermission::class); }
[ "public function jointPermissions(): HasMany\n {\n return $this->hasMany(JointPermission::class);\n }", "public function getAllPermissions();", "protected function getPermissions()\n {\n return Permission::with('roles')->get();\n }", "public function getAllPermissions()\n\t{\n\t\treturn $this->user->userPermissions()->get();\n\t}", "public function allPermissions();", "public function permissions()\n\t{\n\t\treturn $this->has_many_and_belongs_to('Permission', 'user_permissions');\n\t}", "static function getAllPermissions()\n {\n return Permission::select('id', 'name', 'display_name', 'description')\n ->get();\n }", "public static function getAll()\n {\n return Permission::all();\n }", "public function permissions()\n\t{\n\t\treturn $this->manyShiftsToMany('Permission');\n\t}", "public function getAllPermissions()\n {\n if (!$this->_allPermissions)\n {\n $this->_allPermissions = array();\n $permissions = $this->getPermissions();\n foreach ($permissions as $permission)\n {\n $this->_allPermissions[$permission->getName()] = $permission;\n }\n\n foreach ($this->getGroups() as $group)\n {\n foreach ($group->getPermissions() as $permission)\n {\n $this->_allPermissions[$permission->getName()] = $permission;\n }\n }\n }\n\n return $this->_allPermissions;\n }", "public abstract function getPermissions();", "public function allPermissions(): Collection\n {\n if ($this->modelIsRole()) {\n return $this->permissions()->get();\n\n } else {\n return $this->mergePermissions();\n }\n }", "public function permissions()\n {\n $pivotTable = config('permission.database.action_permissions_table');\n\n $relatedModel = config('permission.database.permissions_model');\n\n return $this->belongsToMany($relatedModel, $pivotTable, 'action_id', 'permission_id')->withTimestamps();\n }", "public function permissions() : BelongsToMany\n {\n return $this->morphToMany(Permission::class, 'model', 'model_has_permissions', 'model_id', 'permission_id');\n }", "public function getPermissions() {\n return Permission::getPluginPermissions($this->getName());\n }", "public function listAllPermissions(){\r\n $pdo = Logger::connect();\r\n $SQL = \"select * FROM permissions\";\r\n $q = $pdo->prepare($SQL);\r\n if ($q->execute()){\r\n return $q->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n Logger::disconnect();\r\n }", "public function subPermissions()\n\t{\n\t\treturn $this->hasMany('Regulus\\Identify\\Models\\Permission', 'parent_id');\n\t}", "public function getAllPermissionsAsArray()\n {\n return Permission::all()->toArray();\n }", "public function getPermissionsViaRoles() {\n return $this->getAllPermissions();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use this method to get information about a member of a chat. Returns a ChatMember object on success.
public function getChatMember(GetChatMemberRequest $request): ChatMember { return ChatMember::fromPayload($this->call($request)->getPayload()); }
[ "public function getChatMember()\n {\n return $this->hasOne(ChatMember::className(), ['id' => 'member_id']);\n }", "public function getChatMember(array $params)\n {\n $response = $this->post('getChatMember', $params);\n\n return new ChatMember($response->getDecodedBody());\n }", "public function getChatMember($chat_id, $user_id)\n {\n $params = compact('chat_id', 'user_id');\n return $this->sendRequest('getChatMember', $params);\n }", "function GetChatMember($chatid,$userid){\n\t$truechannel = json_decode(file_get_contents('https://api.telegram.org/bot'.API_KEY.\"/getChatMember?chat_id=\".$chatid.\"&user_id=\".$userid));\n\t$tch = $truechannel->result->status;\n\treturn $tch;\n\t}", "public function getChatMember($chatId, int $userId): \\Sumrak\\TelegramBot\\Entity\\ChatMember\n {\n $response = $this->apiAdapter->call('getChatMember', [\n 'chat_id' => $chatId,\n 'user_id' => $userId,\n ]);\n\n return $this->serializer->deserialize(\n \\Sumrak\\TelegramBot\\Entity\\ChatMember::class,\n $response\n );\n }", "public function get_member()\r\n {\r\n return $this->member;\r\n }", "public function getMember()\n {\n return Member::get_by_id(Member::class, $this->slug);\n }", "public function getMember()\n {\n return $this->member;\n }", "public function getMember() {\n global ${'sess_user_name'};\n if(empty($this->oMember)){\n $sessionName = ${'sess_user_name'} ? ${'sess_user_name'} : 'user';\n $this->oMember = new CMS_Member($this->oSession, $sessionName);\n }\n return $this->oMember;\n }", "public function getMember();", "public function getChatMember(array $content)\n {\n return $this->endpoint('getChatMember', $content);\n }", "public function getChat()\n {\n return $this->hasOne(Chat::class, ['id' => 'chat_id'])\n ->private()\n ->viaTable(ChatMember::tableName(), ['user_id' => 'id']);\n }", "public function getMember()\n {\n if (array_key_exists('member', $this->_params)) {\n return $this->_params['member'];\n } else {\n return null;\n }\n }", "public function getMemberById($id) {\n return \\App\\Member::find($id);\n }", "public function getMemberInfo()\n {\n return $this->member_info;\n }", "public function getMemberDetails() {\r\n $id = $this->session->gets('ameriaa_user_id');\r\n $sql = \"SELECT * FROM \".DB_PREFIX.\"members WHERE member_id = '$id' \" ;\r\n return $this->db->find($sql);\r\n \r\n }", "protected function member() {\n\t\t\tif($this->verb == 'save') { //call to api/member/save\n\n\t\t\t\t$this->auth->authenticate(true); //check if caller is authorized to use this method\n\n\t\t\t\tif($this->method == 'POST') {\n\n\t\t\t\t\treturn $this->saveMember();\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn parent::_response(Array('error' => \"Only accepts POST requests\"), 403);\n\n\t\t\t\t}\n\n\t\t\t} elseif(isset($this->args[0]) && is_numeric($this->args[0])) { // call to api/member/{id}\n\n\t\t\t\tif($this->method == 'GET') { //return member with given id\n\n\t\t\t\t\ttry{\n\t\t\t\t\t\t$this->auth->authenticate(true);\n\t\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\treturn $this->getMember();\n\t\t\t\t\t}\n\n\t\t\t\t\treturn $this->getMember(true);\n\n\t\t\t\t} elseif($this->method == 'DELETE') { //delete member with given id\n\n\t\t\t\t\t$this->auth->authenticate(true); //check if caller is authorized to use this method\n\n\t\t\t\t\treturn $this->deleteMember();\n\n\t\t\t\t} else { // wrong method\n\n\t\t\t\t\treturn parent::_response(Array('error' => 'Only accepts GET or DELETE requests.'), 403);\n\n\t\t\t\t}\n\n\t\t\t} else { //call to any other domain: api/member/*\n\t\t\t\tif ($this->method == 'GET') { // return all members\n\t\t \t\n\t\t \ttry{\n\t\t\t\t\t\t$this->auth->authenticate(true);\n\t\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\treturn $this->getMembers();\n\t\t\t\t\t}\n\n\t\t \treturn $this->getMembers(true);\n\n\t\t } \n\t\t else {\n\n\t\t return parent::_response(Array('error' => \"Only accepts GET requests\"), 403);\n\n\t\t }\n\n\t\t\t}\n\t\t}", "public function getMembers()\n {\n $members = [];\n $results = $this->chatworkApi->getRoomMembersById($this->room_id);\n foreach ($results as $result) {\n $members[] = new ChatworkUser($result);\n }\n\n $this->listMembers = $members;\n\n return $members;\n }", "public function getGuildQueryMember()\n {\n return $this->get(self::_GUILD_QUERY_MEMBER);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tags from languages category with names, only used in responses. Generated from protobuf field repeated .clarifai.api.FullTag languages_full = 31 [(.clarifai.api.utils.cl_show_if_empty) = true];
public function getLanguagesFull() { return $this->languages_full; }
[ "public function setLanguagesFull($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Clarifai\\Api\\FullTag::class);\n $this->languages_full = $arr;\n\n return $this;\n }", "private function render_languages() {\n $languages = ProblemStatementsStorage::languages();\n foreach ($languages as $language => $language_name_to_display) {\n echo '<div class=\"category\">\n <a href=\"' . $language . '?category=warm_up\">\n <img src=\"../codeup_res/views/img/' . $language . '.png\" alt=\"' . $language_name_to_display . ' icon\">\n </a>\n <h5>' . $language_name_to_display . '</h5>\n </div>';\n }\n }", "public static function getAllActiveLanguageFullNamePost()\n {\n $q = self::getInstance()\n ->createQuery('l')\n ->select('l.name,l.culture')\n ->where('l.status= ?', 1);\n\n return $q;\n }", "protected function addShortLabels(array $languages)\n {\n foreach ($languages as $key => $val) {\n if (!array_key_exists('short_label', $val) || !$val['short_label']) {\n $languages[$key]['short_label'] = substr(strtoupper($val['label']), 0, 2);\n }\n }\n\n return $languages;\n }", "function language( $languages, $options = array() ) {\n\n\t// Parse formatting options\n\t$options = wp_parse_args( (array) $options, array(\n\t\t'show_icon' => true,\n\t\t'show_text' => true,\n\t\t'is_link' => true,\n\t\t'variant' => 'spoken_languages',\n\t) );\n\n\tif ( empty( $languages ) ) {\n\n\t\t/**\n\t\t * Filter empty meta value.\n\t\t *\n\t\t * @param string $value Replaced empty value.\n\t\t */\n\t\treturn apply_filters( \"wpmoly/filter/meta/empty/{$options['variant']}/value\", empty_value( $languages ) );\n\t}\n\n\t$show_text = utils\\is_bool( $options['show_text'] );\n\t$show_icon = utils\\is_bool( $options['show_icon'] );\n\n\tif ( is_string( $languages ) ) {\n\t\t$languages = explode( ',', $languages );\n\t}\n\n\t$languages_data = array();\n\n\tforeach ( $languages as $key => $language ) {\n\n\t\t$language = utils\\get_language( $language );\n\t\t$languages_data[ $key ] = $language;\n\n\t\tif ( ! $show_text ) {\n\t\t\t$name = '';\n\t\t} elseif ( '1' == utils\\o( 'translate-languages' ) ) {\n\t\t\t$name = $language->localized_name;\n\t\t} else {\n\t\t\t$name = $language->standard_name;\n\t\t}\n\n\t\tif ( $show_icon ) {\n\t\t\t$icon = '<span class=\"wpmoly language iso icon\" title=\"' . esc_attr( $language->localized_name ) . ' (' . esc_attr( $language->standard_name ) . ')\">' . esc_attr( $language->code ) . '</span>&nbsp;';\n\t\t} else {\n\t\t\t$icon = '';\n\t\t}\n\n\t\tif ( $options['is_link'] ) {\n\n\t\t\t$options['language'] = $language;\n\n\t\t\tif ( 'language' == $options['variant'] ) {\n\t\t\t\t$options['variant'] = 'language';\n\t\t\t\t$options['title'] = sprintf( __( '%s-dubbed movies', 'wpmovielibrary' ), $language->localized_name );\n\n\t\t\t\t/**\n\t\t\t\t * Filter language URL.\n\t\t\t\t *\n\t\t\t\t * @since 3.0.0\n\t\t\t\t *\n\t\t\t\t * @param string $language Language value.\n\t\t\t\t * @param array $options Formatting options.\n\t\t\t\t */\n\t\t\t\t$name = apply_filters( 'wpmoly/filter/detail/language/url', $name, $options );\n\n\t\t\t} elseif ( 'subtitles' == $options['variant'] ) {\n\t\t\t\t$options['variant'] = 'subtitles';\n\t\t\t\t$options['title'] = sprintf( __( '%s-subtitled movies', 'wpmovielibrary' ), $language->localized_name );\n\n\t\t\t\t/**\n\t\t\t\t * Filter subtitles URL.\n\t\t\t\t *\n\t\t\t\t * @since 3.0.0\n\t\t\t\t *\n\t\t\t\t * @param string $subtitles Language value.\n\t\t\t\t * @param array $options Formatting options.\n\t\t\t\t */\n\t\t\t\t$name = apply_filters( 'wpmoly/filter/detail/subtitles/url', $name, $options );\n\n\t\t\t} else {\n\t\t\t\t$options['variant'] = 'spoken_languages';\n\t\t\t\t$options['title'] = sprintf( __( '%s-speaking movies', 'wpmovielibrary' ), $language->localized_name );\n\n\t\t\t\t/**\n\t\t\t\t * Filter spoken language URL.\n\t\t\t\t *\n\t\t\t\t * @since 3.0.0\n\t\t\t\t *\n\t\t\t\t * @param string $language Language value.\n\t\t\t\t * @param array $options Formatting options.\n\t\t\t\t */\n\t\t\t\t$name = apply_filters( 'wpmoly/filter/meta/spoken_languages/url', $name, $options );\n\t\t\t} // End if().\n\t\t} else {\n\t\t\t/**\n\t\t\t * Filter single language meta value.\n\t\t\t *\n\t\t\t * @since 3.0.0\n\t\t\t *\n\t\t\t * @param string $language Filtered language.\n\t\t\t * @param array $language_data Language instance.\n\t\t\t * @param string $icon Language icon string.\n\t\t\t * @param array $options Formatting options.\n\t\t\t */\n\t\t\t$name = apply_filters( \"wpmoly/filter/meta/{$options['variant']}/single\", $name, $language, $icon, $options );\n\t\t} // End if().\n\n\t\t$languages[ $key ] = $icon . $name;\n\t} // End foreach().\n\n\t/**\n\t * Filter final languages lists.\n\t *\n\t * This is used to generate permalinks for languages and can be extended to\n\t * post-formatting modifications.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $languages Filtered languages list.\n\t * @param array $languages_data Languages data array.\n\t * @param array $options Formatting options.\n\t */\n\treturn apply_filters( \"wpmoly/filter/meta/{$options['variant']}\", implode( ', ', $languages ), $languages_data, $options );\n}", "function theme_lat_language_list($format = 'table') {\n \n $language_vocabulary_id = variable_get('latlangnav_vid', null);\n $language_terms = taxonomy_get_tree($language_vocabulary_id); // Get terms for Language vocabulary\n $is_content_found = false;\n\n foreach ($language_terms as $language_term) {\n \n // Skip the \"Any\" term\n if ($language_term->name == 'Any') { \n continue; \n }\n\n // Get content count per language\n $view = views_get_view('public_content_by_language'); // Should be named \"lat_language_content_by_language\"; the \"public\" part is omitted by definition.\n $view->preview('default', array($language_term->tid));\n $count = count($view->result);\n\n // Prepare language list variables \n if ($count > 0) {\n $is_content_found = true;\n $lang_names []= $language_term->name;\n $lang_urls []= url();\n $lang_counts []= $count;\n }\n \n }\n\n // Break early if content is nonexistant\n if (!$is_content_found) {\n return '';\n }\n\n // Sort by count decreasing\n array_multisort($lang_counts, SORT_DESC, $lang_names, $lang_urls);\n \n switch($format) {\n \n case 'table':\n foreach ($lang_names as $index => $language_name) {\n $lang_count = $lang_counts[$index]; \n $language_link = l($language_name, 'language/'.drupal_strtolower($language_name)); \n $lang_table []= array($language_link, $lang_count); \n }\n $lat_language_list = theme('table', array('Languages', 'Posts'), $lang_table);\n break;\n \n case 'item_list':\n foreach ($lang_names as $index=> $language_name) {\n $lang_count = $lang_counts[$index];\n $lang_item_list []= l(\"$language_name ($lang_count posts)\", 'language/'.drupal_strtolower($language_name));\n }\n $lat_language_list = theme('item_list', $lang_item_list, 'Languages');\n break;\n \n }\n \n $lat_language_list = \"<div class='lat-language-listing'>$lat_language_list</div>\";\n return $lat_language_list;\n \n}", "public function listLanguages();", "public function languageList();", "public function languageConditionMatchesCompleteLanguagesExpression() {}", "function wporg_themes_get_tag_translations() {\n\t$translations = array();\n\tforeach ( wporg_themes_get_feature_list( 'all' ) as $group => $tags ) {\n\t\t$translations = array_merge( $translations, $tags );\n\t}\n\treturn $translations;\n}", "public function getLanguages() {}", "public function shortLanguage()\n\t{\n\t\t$locale = $this->locale();\n\t\t$explode = explode('_', $locale);\n\t\t$short = array_shift($explode);\n\n\t\treturn $short;\n\t}", "public function getCategoryNameEN() {\n return $this->category_name_en;\n }", "public function getLanguages();", "public function languageName();", "public static function get_labels() {\n\t\t $language = Authentication::get_language();\n\t\t $path = Configuration::get_languages_path();\n\t\t $language_path = \"$path/$language.json\";\n\n\t\t if (file_exists($language_path)) {\n\t\t \treturn json_decode(file_get_contents($language_path), true);\n\t\t }\n\t\t else {\n\t\t \treturn array();\n\t\t }\n\t\t}", "public function getAdditionalLanguages();", "public static function getLanguages();", "public static function get_list_languages();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The number of assertions in the bag.
public function count() { return count($this->assertions); }
[ "public function getAssertionCount()\n {\n return count($this->_successes) + count($this->_failures) + count($this->_errors);\n }", "public function incrementAssertionCount()\n {\n return $this->assertions++;\n }", "public function getNumAssertions()\n {\n return $this->replacement_numAssertions;\n }", "public function count() : int\n {\n $count = 0;\n\n foreach ($this->failures as $key => $failures) {\n foreach ($failures as $ruleName => $parameters) {\n ++$count;\n }\n }\n\n return $count;\n }", "public function getExpectationCount()\n {\n $count = 0;\n /** @var Expectation $expectations */\n $expectations = $this->getExpectations() ?: $this->getDefaultExpectations();\n foreach ($expectations as $expectation) {\n if ($expectation->isCallCountConstrained()) {\n $count++;\n }\n }\n return $count;\n }", "public function count()\n {\n return \\count($this->constraint);\n }", "public function testCountElementsInBag()\n {\n $this->assertEquals(0, $this->bag->count());\n $this->bag->add('foo', 'bar');\n $this->assertEquals(1, $this->bag->count());\n }", "public function count(): int\n {\n return $this->getBag('default')->count();\n }", "public function testCount() {\n return sizeof($this->tests);\n }", "public function count(): int\n {\n return \\count($this->observed);\n }", "public function mockery_getExpectationCount()\n {\n $count = 0;\n foreach ($this->_mocks as $mock) {\n $count += $mock->mockery_getExpectationCount();\n }\n return $count;\n }", "public function countTests()\n {\n return array_sum($this->countTests);\n }", "public function count()\n {\n return count($this->chain);\n }", "public static function getCount()\n {\n return self::getTestCase()->getCount();\n }", "public function count()\n {\n $subject = $this->itSubject;\n return count($this->$subject);\n }", "public function count()\n\t{\n\t\treturn \\count($this->alerts);\n\t}", "public function count() {\n\t\treturn count($this->elements);\n\t}", "function count() {\n\t\treturn count($this->keys);\n\t}", "public function estimateCount(): int;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is registered at cb_head ANCHOR. This loads the photo tagging plugin in clipbucket. You can use tagger_configurations filter to change tagger configurations. Following is the list of configurations : |= Show Tag labels =| BOOL showLabels => true |= Provide an element ID and labels will loaded in them =| STRING labelWrapper => null |= Open labels links in new window =| BOOL labelLinksNew => false |= Make string like facebook: Tag1, Tag2 and Tag3 =| BOOL makeString => true |= We JS to create string. Set true, to create using CSS. Be warn CSS might not work in >IE9 =| BOOL makeStringCSS => false |= This wraps Remove Tag link in round brackets ( ) =| BOOL wrapDeleteLinks => true |= Show a little indicator arrow. Note: Arrow is created purely from CSS. Might not work in >IE9 =| BOOL use_arrows => true |= To display Tag Photo elsewhere, provide an element ID =| STRING buttonWrapper => null |= This will add a tag icon previous to Tag Photo text =| BOOL addIcon => true
function load_tagging() { global $db, $cbphoto, $photo, $userquery; if ( USE_PHOTO_TAGGING != true ) { return false; } if ( empty($photo) || !$photo || !isset( $photo['ci_id'] ) ) { return false; } $options = $cbphoto->get_default_tagger_configs(); $phrases = $options['phrases']; /* User does not need phrases in apply_filters() function */ unset( $options['phrases'] ); $options = apply_filters( $options, 'tagger_configurations'); /* Put back phrases in $options, over-wrtting JS Plugin Phrases */ $options['phrases'] = $phrases; $options['allowTagging'] = $photo['allow_tagging']; $tags = $cbphoto->get_photo_tags( $photo['photo_id'] ); $autoComplete = $options['autoComplete']; $uid = userid(); if ( $uid ) { $friends = $userquery->get_contacts( $uid, 0, 'yes'); } if ( $friends ) { foreach ( $friends as $contact ) { $fa[$contact['contact_userid']] = $contact['username']; $typeahead[] = $contact['username']; } } if ( $tags ) { /* Tags exists */ foreach ( $tags as $tag ) { $needs_update = false; /* Check if tag is active or not and if current user is not tagger or owner of photo or is guest, do not show tag */ if ( ( !$uid && $tag['ptag_active'] == 'no' ) || ( $tag['ptag_active'] == 'no' && $uid && $tag['ptag_by_userid'] != $uid && $tag['photo_owner_userid'] != $uid ) ) { continue; } $ta = array(); $ta['id'] = $tag['ptag_id']; $ta['key'] = $tag['ptag_key']; $ta['width'] = $tag['ptag_width']; $ta['height'] = $tag['ptag_height']; $ta['left'] = $tag['ptag_left']; $ta['top'] = $tag['ptag_top']; $ta['label'] = $tag['username'] = $tag['ptag_username']; $ta['added_by'] = $tag['ptag_by_username']; $ta['date_added'] = nicetime( $tag['date_added'], true); if ( $tag['ptag_active'] == 'no' ) { $ta['pending'] = true; } /* Photo owner and User which has tagged */ if ( $uid == $tag['photo_owner_userid'] || $uid == $tag['ptag_by_userid'] ) { $ta['canDelete'] = true; } /* If make sure tag is a user See which person is online, tagger or tagged If Tagger is online, give him option to delete if Tagged is online, check if it's tagger's friend if true, give option to delete */ if ( $tag['ptag_isuser'] == 1 ) { if ( $uid == $tag['ptag_by_userid'] ){ // Tagger is online $ta['canDelete'] = true; // Grant him access to delete if ( is_array($friends) && $fa[ $tag['ptag_userid'] ] ) { $ta['link'] = $userquery->profile_link( $tag['ptag_userid'] ); // Person tagged is in his contacts lists and already been tagged, remove it from typahead array unset( $typeahead[ end(array_keys($typeahead,$tag['ptag_username'])) ] ); } } else if ( $uid == $tag['ptag_userid'] ) { if ( is_array($friends) && $fa[ $tag['ptag_by_userid'] ] ) { $ta['canDelete'] = true; $ta['link'] = $userquery->profile_link( $tag['ptag_userid'] ); } } /* This basically checks, if tagger and tagged and logged-in user are same * create the profile link for logged-in user. This will be achieved if user tags * itself on a photo */ if ( $tag['ptag_by_userid'] == $tag['ptag_userid'] && $tag['ptag_userid'] == $uid ) { $ta['link'] = $userquery->profile_link( $tag['ptag_userid'] ); } } $defaultTags[] = $ta; } $options['defaultTags'] = $defaultTags; } if ( $friends && $typeahead && $options['autoComplete'] == 1 ) { $options['autoCompleteOptions']['source'] = $typeahead; } assign('tagger_configs', json_encode($options)); assign('selector_id',$cbphoto->get_selector_id()); assign('photo',$photo); Template(STYLES_DIR.'/global/photo_tagger.html',false); }
[ "public function body_banner_tags() {\r\n\t\t$this->output('<div class = \"blue-header tags-page hidden-xs\">\r\n\t\t\t\t<div class=\"icon col-xs-3\">\r\n\t\t\t\t\t<img src=\"'.$this->rooturl.'images/add_tags.svg\">\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class = \"text col-xs-8\">\r\n\t\t\t\t\t<h3>add tags to easily find answers</h3>\r\n\t\t\t\t\t<div class=\"desc\">\r\n\t\t\t\t\t\tDescription text comes here: How to add tags, how tags help, number of tags that can be added etc.\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class = \"arrow col-xs-1\">\r\n\t\t\t\t\t<a href=\"#\" ><span class=\"glyphicon glyphicon-menu-down\"></span> </a>\r\n\t\t\t\t</div>\r\n\t\t\t</div>');\r\n\t}", "public function getTagsOfThisPhoto($tag='')\n\t\t{\n\t\t\t$tags_arr = explode(' ',$this->fields_arr['photo_tags']);\n\t\t\tforeach($tags_arr as $tags)\n\t\t\t\t{\n\t\t\t\t\t?>\n\t\t\t\t\t<span>\n\t\t\t\t\t<a id=\"photo_tag_<?php echo $tags; ?>\"\n\t\t\t\t\t<?php\n\t\t\t\t\t\tif (isMember() and chkIsSubscriptionEnabled() and chkIsSubscriptionEnabledForModule())\n\t\t\t\t\t\t\techo 'onmouseover=\"getSubscriptionOption(\\''.addslashes($tags).'\\', \\''.$this->CFG['site']['is_module_page'].'\\', \\'Tag\\', \\'pos_'.$this->changeTitle($tags).'\\')\"';\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t\thref=\"<?php echo getUrl('photolist','?pg=photonew&amp;tags='.$tags, 'photonew/?tags='.$tags,'','photo');?>\"><?php echo $tags;?></a>\n\t\t\t\t\t<span id=\"pos_<?php echo $this->changeTitle($tags); ?>\">&nbsp;</span>\n\t\t\t\t\t</span>\n\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t}", "function configurar_socialtags(){\n\t$tags = array();\n\t$tags[] = 'facebook';\n\t$tags[] = 'twitter';\n\t$config = array();\n\t$config['tags'] = $tags;\n\t$config['jsselector'] = '#content';\n\t$config['wopen'] = 'non';\n\t$config['badge'] = '';\n\t$config['badgejs'] = '';\n\tecrire_meta('socialtags',serialize($config));\n}", "function jetpack_bitly_og_tag() {\n\tif ( has_filter( 'wp_head', 'jetpack_og_tags' ) === false ) {\n\t\t// Add the bitly part again back if we don't have any jetpack_og_tags added.\n\t\tif ( method_exists( $GLOBALS['bitly'], 'og_tags' ) ) {\n\t\t\t$GLOBALS['bitly']->og_tags();\n\t\t}\n\t} elseif ( isset( $GLOBALS['posts'] ) && $GLOBALS['posts'][0]->ID > 0 ) {\n\t\tprintf( \"<meta property=\\\"bitly:url\\\" content=\\\"%s\\\" /> \\n\", esc_attr( $GLOBALS['bitly']->get_bitly_link_for_post_id( $GLOBALS['posts'][0]->ID ) ) );\n\t}\n\n}", "public function addTag();", "function tag()\n\t{\n\t\t$data['tagcloud'] = $this->admin_model->tag();\n \t$this->template->load('adminweb/media','adminweb/mod_tag/view_tag',$data);\n\t}", "public function tag()\n\t{\n\t\t$crud = $this->generate_crud('blog_tags');\n\t\t$this->mPageTitle = 'Blog Tags';\n\t\t$this->render_crud();\n\t}", "public function doTags() {\n\t\t$cs = Yii::app()->clientScript;\n\t\tforeach($this->metaTags as $tag) {\n\t\t\tif ($tag !== null) {\n\t\t\t\t$cs->registerMetaTag($tag['content'], $tag['name'], $tag['httpEquiv'], isset($tag['options']) ? $tag['options'] : array());\n\t\t\t}\n\t\t}\n\t\tforeach($this->linkTags as $tag) {\n\t\t\tif ($tag !== null) {\n\t\t\t\t$cs->registerLinkTag($tag['relation'], $tag['type'], $tag['href'], null, isset($tag['options']) ? $tag['options'] : array());\n\t\t\t}\n\t\t}\n\t\tforeach($this->cssFiles as $tag) {\n\t\t\tif ($tag !== null) {\n\t\t\t\t$cs->registerCssFile($tag['file'], $tag['media']);\n\t\t\t}\n\t\t}\n\t}", "protected function setOpenGraphTags()\n {\n // Should be overridden by the plugin\n }", "function widget_jiglu_autotag_init() {\nfunction widget_jiglu_autotag($args) {\nextract($args);\necho $before_widget.$before_title . '' . $after_title; ?>\n**** REPLACE THIS LINE WITH JIGLU SCRIPT CODE - SHOULD LOOK LIKE THIS <script type=\"text/javascript\" src=\"http://nigel-tagging.jiglu.com/widgets/autotag/d8504df01528cbda0115374c09f43b5d\"></script>*****\n<? echo $after_widget;\n}\nregister_sidebar_widget('Jiglu Autotag widget', 'widget_jiglu_autotag');}", "function add_tagging_attribute( $photo ) {\n if ( $photo ) {\n // Make sure current photo is being viewed\n // and photo tagging is enabled globally\n if ( $photo['photo_key'] == mysql_clean(get('item')) && USE_PHOTO_TAGGING === true ) {\n // Make sure photo has enabled tagging\n if ( $photo['allow_tagging'] == 'yes' ) {\n return true;\n }\n }\n }\n \n return false;\n}", "public function suggestPhotoTagging()\n\t{\n\t\t$this->suggest( 'photos.tagme' );\n\t}", "public function tag() {return 'trello';}", "public function tag()\n\t{\n\t\t$_slug = preg_replace( '#' . app_setting( 'url', 'shop' ) . 'tag/?#', '', uri_string() );\n\n\t\tif ( $_slug ) :\n\n\t\t\t$this->_tag_single( $_slug );\n\n\t\telse :\n\n\t\t\t$this->_tag_index();\n\n\t\tendif;\n\t}", "public function setConfigurationForTags()\n {\n $this->findElement($this->tagMetagenList)->click();\n $this->findElement($this->tagMetagen)->click();\n\n $this->waitForElementClickable($this->tagConstructorList)->click();\n $this->waitForElementClickable($this->tagConstructor)->click();\n\n $this->findElement($this->tagPostingTypeList)->click();\n $this->findElement($this->tagPosting)->click();\n\n $this->findElement($this->tagPlaceholdersBtn)->click();\n $this->waitForElementClickable($this->tagPlaceholder)->click();\n\n $this->findElement($this->tagContentTypeList)->click();\n $this->findElement($this->tagContentType)->click();\n }", "public function getTag()\n {\n $image = '<img src=\"' . $this->get() . '\" border=0 width=\"' . $this->size . '\" alt=\"'.sprintf(L_CLICK,L_LINKS_19).'\" />';\n return $image;\n }", "function gtags_display_tags() {\n\n\t$gtags_dir_cloud = get_option('gtags_dir_cloud'); \n\t\n\tif ( $gtags_dir_cloud=='show' || $gtags_dir_cloud=='link' || !$gtags_dir_cloud ){\n\t\t$hide_tag_style = 'link' == $gtags_dir_cloud ? ' style=\"display:none;\" ' : '';\n\t\t\t\t\n\t\techo '<div id=\"gtags-top\">';\n\t\techo '\t<div id=\"gtags-top-cloud\" class=\"gtags\"'.$hide_tag_style.'>'. wp_generate_tag_cloud( gtags_make_tags(), gtags_cloud_args() ).'</div>';\n\t\t\n\t\tif ( $gtags_dir_cloud=='link' ) {\n\t\t\techo '\t<div id=\"gtags-toggle-top\"><a href=\"javascript:void(0);\">Afficher les catégories de projet</a></div>';\n\t\t}\n\t\t\n\t\techo '</div>';\n\t}\n}", "function generate_toolbar_item_browse_tagcloud()\n{\n\tglobal $CONF;\n\treturn '<a href=\"'.$CONF['script_filename'].'?page=tagcloud\"><img src=\"http://icons.iconarchive.com/icons/fatcow/farm-fresh/16/tag-yellow-icon.png\"/> TagCloud</a>';\n}", "function cyberchimps_post_tags() {\n\t\tglobal $post;\n\n\t\tif ( is_single() ) {\n\t\t\t$show = ( cyberchimps_get_option( 'single_post_byline_tags', 1 ) ) ? cyberchimps_get_option( 'single_post_byline_tags', 1 ) : false;\n\t\t} elseif ( is_archive() ) {\n\t\t\t$show = ( cyberchimps_get_option( 'archive_post_byline_tags', 1 ) ) ? cyberchimps_get_option( 'archive_post_byline_tags', 1 ) : false;\n\t\t} else {\n\t\t\t$show = ( cyberchimps_get_option( 'post_byline_tags', 1 ) ) ? cyberchimps_get_option( 'post_byline_tags', 1 ) : false;\n\t\t}\n\t\tif ( $show ) :\n\t\t\t$tags_list = get_the_tag_list( '', ', ' );\n\t\t\tif ( $tags_list ) :\n\t\t\t\t$tags = sprintf( __( 'Tags: %s', 'cyberchimps_core' ), $tags_list );\n\t\t\t\t?>\n\t\t\t\t<span class=\"taglinks\">\n\t\t\t\t<?php echo apply_filters( 'cyberchimps_post_tags', $tags ); ?>\n\t\t\t</span>\n\t\t\t\t<span class=\"sep\"> <?php echo apply_filters( 'cyberchimps_entry_meta_sep', '|' ); ?> </span>\n\t\t\t\t<?php\n\t\t\tendif; // End if $tags_list\n\t\tendif;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of Mobility
public function setMobility($mobility) { $this->mobility = $mobility; return $this; }
[ "protected function setMobile($value=true) { $this->_is_mobile = $value; }", "protected function setMobile($value = true)\n {\n $this->_is_mobile = $value;\n }", "protected function setProductivity()\n {\n $this->productivity = random_int(8, 12);\n }", "public static function set_mobile()\n\t{\n\t\tself::$_mobile = true ;\n\t}", "public function testSetValideMob() {\n\n $obj = new PointBonTrav();\n\n $obj->setValideMob(true);\n $this->assertEquals(true, $obj->getValideMob());\n }", "public function setPower()\n {\n $this->_role->power = 200;\n }", "public function setPower()\n {\n $this->_role->power = 100;\n }", "public function setStalemate() {\n $this->status |= Game::STATUS_STALEMATE;\n }", "public function setNerveMotor($value)\n {\n $this->nerveMotor = $value;\n }", "private function setIsMedic()\n {\n $this->isMedic = 10 === rand(1, 10) ? 1 : 0;\n }", "public function getMobilityNeed()\n {\n return $this->mobilityNeed;\n }", "public function setMute($value){\t\n if($this->GetValue(\"upnp_ClientName\")==\"SonosK\"){\n $this->MuteSNS($value);\n } else {\t\n $ClientIP = getvalue($this->GetIDForIdent(\"upnp_ClienIP\"));\n $ClientPort = getvalue($this->GetIDForIdent(\"upnp_ClientPort\")); \n $RenderingControlURL = getvalue($this->GetIDForIdent(\"upnp_ClientRenderingControlURL\"));\n switch ($value){\n case 'on':\n $this->SetMute_AV($ClientIP, $ClientPort, $RenderingControlURL, '1');\n SetValue($this->GetIDForIdent(\"upnp_Mute\"), true);\n break;\n case 'off':\n $this->SetMute_AV($ClientIP, $ClientPort, $RenderingControlURL, '0');\n SetValue($this->GetIDForIdent(\"upnp_Mute\"), false);\n break;\n case 'toggle':\n $state = GetValue($this->GetIDForIdent(\"upnp_Mute\"));\n if($state){\n $this->SetMute_AV($ClientIP, $ClientPort, $RenderingControlURL, '0');\n SetValue($this->GetIDForIdent(\"upnp_Mute\"), false);\n }\n else {\n $this->SetMute_AV($ClientIP, $ClientPort, $RenderingControlURL, '1');\n SetValue($this->GetIDForIdent(\"upnp_Mute\"), true);\n }\n break;\n default :\n $this->SendDebug(\"Error_setMute: \", 'wrong parameter.', 0);\n }\n } \n }", "public function setMileage($value) {\n\t\t$this->_mileage = $value;\n\t}", "public function setAttackSpeed()\n {\n $this->_role->attack_speed = 0.75;\n }", "public function useMobileAgent() {\n $this->user_agent = $this->mobile_agent;\n }", "public function setNegotiable($value)\r\n {\r\n $this->negotiable = $value;\r\n }", "public function setMobileMedia()\n {\n }", "public function SetAntennaMode_MTVA() {\n \n }", "public function setMpn($value)\n {\n $this->mpn = $value;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the default feed for this subdomain
public function getDefaultFeed() { if (!$this->team) { return ''; } // Get List Of Available IDX Feeds For The Team Site $default_feed = $this->getDefaultFeedFromArray(explode(",", $this->team['subdomain_idxs'])); return $default_feed; }
[ "public function defaultFeedConfiguration();", "static public function getDefaultCdnSite()\n\t{\n\t\t$oSite = Core_Entity::factory('Site', CURRENT_SITE);\n\t\t$oCdn_Site = $oSite->Cdn_Sites->getByDefault(1);\n\n\t\treturn $oCdn_Site;\n\t}", "public function getFeed()\n {\n return $this->feed;\n }", "protected function getDefaultDatasource() {\n foreach ($this->datasources as $k => $o) if ($o->isDefault()) return $o;\n }", "function fetch_feed() {\n include_once(ABSPATH . WPINC . '/rss.php');\n $rssdata = fetch_rss($this->feed_uri);\n \n // filter out already posted items, if necessary\n if ($lastpost = get_option('digest_post_last_post')) {\n $datefilter = create_function('$item', 'return ('.$lastpost.' < strtotime($item[\\'pubdate\\']));');\n $rssdata->items = array_filter($rssdata->items, $datefilter);\n }\n \n return $rssdata;\n }", "public function get_feeds() {\n\t\treturn get_option( 'wire_curator_feed_url', array() );\n\t}", "public function getUrlFeed(){\n\t\t\treturn $this->url_feed;\n\t\t}", "public function getDefaultRss() {\n $db = PearDatabase::getInstance();\n \n $result = $db->pquery('SELECT rssid FROM vtiger_rss where starred = 1', array());\n $recordId = $db->query_result($result,'0','rssid');\n if($recordId) {\n $this->setId($recordId);\n } else {\n $result = $db->pquery('SELECT rssid FROM vtiger_rss', array());\n $recordId = $db->query_result($result,'0','rssid');\n $this->setId($recordId);\n }\n }", "public function get()\n {\n $this->checkIfFeedIsLoaded();\n\n return $this->feed;\n }", "public function feed()\n {\n return $this->adapter->getFeed();\n }", "public static function get_default() {\n\t\tglobal $wpdb;\n\n\t\t$result = $wpdb->get_row(\n\t\t\t\"SELECT * FROM $wpdb->edd_mailchimp_lists WHERE is_default = 1 LIMIT 1\"\n\t\t);\n\n\t\tif ( $result ) {\n\t\t\treturn new static( $result->remote_id );\n\t\t}\n\n\t\treturn $result;\n\t}", "public static function feedburnerFeedUrl()\n {\n return MainMeta::firstOrFail()->feedburner_feed_url;\n }", "public function get_widget_defaults() {\n $feed_urls = $this->get_feed_urls();\n $default_title = array_keys($feed_urls);\n $default_url = array_values($feed_urls);\n\n return array(\n 'feed_title' => $default_title[0],\n 'feed_url' => $default_url[0],\n 'num_posts' => 20,\n 'exclude_categories' => ''\n );\n }", "private function getDefaultFeedOrg() {\n $feed = DB::table('edu_orgs_types')->where('code', '=', 'FEED')->first();\n \n if (!$feed) {\n return null;\n } \n \n $feed_org = DB::table('edu_orgs')\n ->where('org_type_id', '=', $feed->id)\n ->where(function($query) {\n $query->whereRaw('active_till is null or active_till > date(now())');\n })\n ->first();\n \n if (!$feed_org) {\n return null;\n }\n \n return $feed_org->id;\n }", "public function getFeed() {\n\t\t$feed = $this->getFeedCache();\n\t\tif (!$feed) {\n\t\t\t$feed = $this->getFeedUncached();\n\t\t\t$this->extend('updateFeedUncachedData', $feed);\n\t\t\t$this->setFeedCache($feed);\n\t\t\tif (class_exists(AbstractQueuedJob::class)) {\n\t\t\t\tsingleton(SocialFeedCacheQueuedJob::class)->createJob($this);\n\t\t\t}\n\t\t}\n\n\t\t$data = array();\n\t\tif ($feed) {\n\t\t\tforeach ($feed as $post) {\n\t\t\t\t$created = DBDatetime::create();\n\n\t\t\t\t$timestamp = $this->getPostCreated($post);\n\n\t\t\t\tif (!is_numeric($timestamp)) {\n\t\t\t\t\t$timestamp = strtotime($this->getPostCreated($post));\n\t\t\t\t}\n\n\t\t\t\t$created->setValue($timestamp);\n\n\t\t\t\t$data[] = array(\n\t\t\t\t\t'Type' => $this->getType(),\n\t\t\t\t\t'Content' => $this->getPostContent($post),\n\t\t\t\t\t'Created' => $created,\n\t\t\t\t\t'URL' => $this->getPostUrl($post),\n\t\t\t\t\t'Data' => $post,\n\t\t\t\t\t'UserName' => $this->getUserName($post),\n\t\t\t\t\t'Image' => $this->getImage($post)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$result = ArrayList::create($data);\n\t\t$result = $result->sort('Created', 'DESC');\n\t\treturn $result;\n\t}", "public function getRssfeed()\n\t{\n\t\treturn $this->rssfeed;\n\t}", "function socialit_get_current_rss_link(){\r\n\tswitch (bb_get_location()) {\r\n\t\tcase 'profile-page':\r\n\t\t\tif ( $tab = isset($_GET['tab']) ? $_GET['tab'] : bb_get_path(2) )\r\n\t\t\t\tif ($tab != 'favorites')\r\n\t\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\t$feed = get_favorites_rss_link(0, BB_URI_CONTEXT_LINK_ALTERNATE_HREF + BB_URI_CONTEXT_BB_FEED);\r\n\t\t\tbreak;\r\n\t\t\r\n\t\tcase 'topic-page':\r\n\t\t\t$feed = get_topic_rss_link(0, BB_URI_CONTEXT_LINK_ALTERNATE_HREF + BB_URI_CONTEXT_BB_FEED);\r\n\t\t\tbreak;\r\n\t\t\r\n\t\tcase 'tag-page':\r\n\t\t\tif (bb_is_tag()) {\r\n\t\t\t\t$feed = bb_get_tag_posts_rss_link(0, BB_URI_CONTEXT_LINK_ALTERNATE_HREF + BB_URI_CONTEXT_BB_FEED);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\r\n\t\tcase 'forum-page':\r\n\t\t\t$feed = bb_get_forum_posts_rss_link(0, BB_URI_CONTEXT_LINK_ALTERNATE_HREF + BB_URI_CONTEXT_BB_FEED);\r\n\t\t\tbreak;\r\n\t\t\r\n\t\tcase 'front-page':\r\n\t\t\t$feed = bb_get_posts_rss_link(BB_URI_CONTEXT_LINK_ALTERNATE_HREF + BB_URI_CONTEXT_BB_FEED);\r\n\t\t\tbreak;\r\n\t\t\r\n\t\tcase 'view-page':\r\n\t\t\tglobal $bb_views, $view;\r\n\t\t\tif ($bb_views[$view]['feed']) {\r\n\t\t\t\t$feed = bb_get_view_rss_link(null, BB_URI_CONTEXT_LINK_ALTERNATE_HREF + BB_URI_CONTEXT_BB_FEED);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t$feed = bb_get_posts_rss_link(BB_URI_CONTEXT_LINK_ALTERNATE_HREF + BB_URI_CONTEXT_BB_FEED);\r\n\t\t\tbreak;\r\n\t}\r\n\treturn $feed;\r\n}", "function get_feed_url()\r\n\t{\r\n\t\t$out = $this->feed_url;\t\t\r\n\t\treturn $out;\t\r\n\t}", "function mixtape_qodef_get_default_blog_list() {\n\n\t\t$blog_list = mixtape_qodef_options()->getOptionValue('blog_list_type');\n\t\treturn $blog_list;\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize the object and load data. $rankId = 1; $rank = new GamificationRank($rankId);
public function __construct($id = 0) { $this->table = new GamificationTableRank(JFactory::getDbo()); if (!empty($id)) { $this->table->load($id); } }
[ "private static function create_rank($rank)\n {\n }", "function SetRank($id, $rank){\n\t}", "public function __construct(array $academic_Rank = array())\n {\n $this\n ->setAcademic_Rank($academic_Rank);\n }", "public function setRank() {\n\n // Assign the face value for the card based on its rank\n switch($this->rank) {\n\n case 0:\n\n $this->finalRank = \"A\";\n break;\n\n case 11:\n\n $this->finalRank = \"J\";\n break;\n\n case 12:\n\n $this->finalRank = \"Q\";\n break;\n\n case 13:\n\n $this->finalRank = \"K\";\n break;\n\n default:\n\n $this->finalRank = $this->rank;\n break;\n }\n }", "public function setRank($rank)\n {\n $this->rank = $rank;\n }", "public function insertRanking()\n {\n $objRanking = new RankingDAO();\n $objRanking->insertReg\n (\n Sanitize::filter($_GET['name']),\n Sanitize::filter($_GET['score']),\n Sanitize::filter($_GET['time']),\n Sanitize::filter($_GET['mov']));\n }", "public function setRank($rank) {\n if ($this->rankIsValid($rank)) {\n $this->rank = $rank;\n }\n }", "public function setRank()\n {\n $this->set('rank',(HPBanner_Grid::getConn()->fetchSingle(\"select max(rank) from \".$this->getGrid(true)->getTableRaw())+1));\n return $this;\n }", "public function __construct()\n {\n parent::__construct();\n $this->scoreArea = new ScoreArea();\n $this->scoreCalculation = new ScoreCalculation();\n }", "public function loadRanks(array $data) : void {\n\n $ranks = (array)$data['ranks'];\n\n $defaultRank = (string)$data['default-rank'];\n\n $keys = array_keys($ranks);\n\n /** @var Rank[]|array $outputRanks */\n $outputRanks = [];\n\n foreach($keys as $localName) {\n $value = (array)$ranks[$localName];\n $rank = Rank::parseRank($localName, $value);\n if($rank !== null) {\n $outputRanks[$localName] = $rank;\n }\n }\n\n $this->ranks = $outputRanks;\n\n /** @var Rank|null $outputDefaultRank */\n $this->defaultRank = isset($outputRanks[$defaultRank]) ? $outputRanks[$defaultRank] : null;\n }", "public function setRankId($rankId)\n {\n $this->rank_id = (int)$rankId;\n }", "public function __construct()\n {\n $this->accountingBigStatisticsRepo = new AccountingBigStatisticsRepository();\n }", "public function actionAddRank()\n\t{\n\t\t$catg_name = $_GET['catg_name'];\n\t\t$rank_name = $_GET['rank_name'];\n\t\t$rank_pr = $_GET['rank_pr'];\n\t\t$rank = new Ranks;\n\t\t$rank->rank_name = $rank_name;\n\t\t$rank->cat_name = $catg_name;\n\t\t$rank->rank_priority = $rank_pr;\n\t\t$rank->save();\n\t}", "public function __construct()\n\t{\n\t\t$this->entityName = Rate::ENTITY_NAME;\n\t\t$this->modelClass = \"\\PhoenixRates\\Model\\Rate\";\n $this->dataItem = Rate::RATE_DATA_ENTITY;\t\t\n\t}", "public function __construct(\\WorkdayWsdl\\\\StructType\\Academic_RankObjectType $academic_Rank_Reference = null, $version = null)\n {\n $this\n ->setAcademic_Rank_Reference($academic_Rank_Reference)\n ->setVersion($version);\n }", "public function getRanking()\n {\n }", "public function setRank()\n { \n $this->set('rank',$this->getGrid()->getMaxRank()+1);\n return $this;\n }", "public function __construct($data)\r\n {\r\n\r\n foreach ($data as $tank) {\r\n $this->tanks[] = [\r\n \"tank_id\" => $tank->tank_id,\r\n\r\n \"frags\" => floatval(number_format($tank->all->frags / $tank->all->battles, 10)),\r\n\r\n \"damage\" => floatval(number_format($tank->all->damage_dealt / $tank->all->battles, 10, '.', '')),\r\n\r\n \"spot\" => floatval(number_format($tank->all->spotted / $tank->all->battles, 10)),\r\n\r\n \"defence\" => floatval(number_format($tank->all->dropped_capture_points / $tank->all->battles, 10)),\r\n\r\n \"winrate\" => floatval(number_format($tank->all->wins / $tank->all->battles * 100, 10)),\r\n\r\n \"battles\" => floatval(number_format($tank->all->battles, 10, '.', ''))\r\n ];\r\n }\r\n\r\n // calculate ratings\r\n $this->WN8 = $this->calculateWN8();\r\n }", "public function addRank(Rank $l)\n\t{\n\t\tif ($this->collRanks === null) {\n\t\t\t$this->initRanks();\n\t\t}\n\t\tif (!in_array($l, $this->collRanks, true)) { // only add it if the **same** object is not already associated\n\t\t\tarray_push($this->collRanks, $l);\n\t\t\t$l->setUsr($this);\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method for fittercompany column
function column_fittercompany( $item ) { $action_nonce = wp_create_nonce( 'action_nonce' ); $title = sprintf( '<a href="?page=%s&action=%s&id=%s&_wpnonce=%s"><strong>%s</strong></a>', 'faf-new-fitter', 'edit', absint( $item->id ), $action_nonce, $item->fitterCompany); $actions = [ 'edit' => sprintf( '<a href="?page=%s&action=%s&id=%s&_wpnonce=%s">%s</a>', 'faf-new-fitter', 'edit', absint( $item->id ), $action_nonce, 'Edit' ), 'delete' => sprintf( '<a href="?page=%s&action=%s&id=%s&_wpnonce=%s">%s</a>', esc_attr( $_GET['page'] ), 'delete', absint( $item->id ), $action_nonce, 'Delete' ) ]; return $title . $this->row_actions( $actions ); }
[ "public function getDecoratedCompany(){\n\t\t\t\t$value=$this->nullValueMarker;\n if(Flag::isFlagSet(\"company_name\",$this->SCREENING))\n\t\t\t\t\t$value=$this->COMPANY_NAME;\n\t\t\t\tif($this->COMPANY_NAME==\"\")\n {\n\t\t\t\t\tif(!in_array(\"COMPANY_NAME\",$this->fieldsArray))\n\t\t\t\t\tProfileFieldsLogging::callFieldStack(1);\n\t\t\t\t}\n\t\t\t\treturn $value;\n }", "public function addCompanyColumn(Varien_Eveny_Observer $observer)\n\t{ \n\t\t$companyBlock = $observer->getBlock();\n\n\t\tif(!isset($companyBlock)){ \n\t\t\treturn $this; \n\t\t}\n\t if($companyBlock instanceof Mage_Adminhtml_Block_Customer_Grid){\n\t \t$companyBlock->addColumnAfter('billing_company',\n\t \t\tarray(\n\t \t\t\t'header' => Mage::helper('customer')->__('Company'),\n\t \t\t\t'type' => 'text',\n\t \t\t\t'index' => 'billing_company',\n\t \t\t\t'filter_condition_callback'=>array($this,'filterCompany')\n\t \t\t\t),\n\t \t\t\t'email' \n\t \t\t);\n\t }\n\t}", "function pw_cfm_company_field( $payment, $edd_receipt_args ) {\n?>\n\t<tr>\n\t\t<td><strong><?php _e( 'Company', 'edd' ); ?>:</strong></td>\n\t\t<td><?php echo get_post_meta( $payment->ID, 'company', true ); ?></td>\n\t</tr>\n<?php\n}", "public function getCompanyName();", "public static function companyField()\n {\n return static::randomElement(static::$companyField);\n }", "protected function _getCompanyField()\n {\n if ($this->_isCompanyNeeded()) {\n return array(\n 'title' => '<span id=\"' . $this->code . '_block\">Firma:</span>',\n 'field' => tep_draw_input_field($this->code . '_company', '')\n );\n }\n\n return null;\n }", "public function register_company_foundation_field() {\n\t\t// add field in \"front-end\"\n\t\tfunction frontend_company_foundation_field( $fields ) {\n\t\t\t$fields['company']['company_foundation'] = array(\n\t\t\t\t'label' => esc_html__( 'Foundation Year', 'wp-job-manager-company-profiles' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'required' => false,\n\t\t\t\t'priority' => 4,\n\t\t\t\t'placeholder' => 'e.g. 1992',\n\t\t\t);\n\t\t\treturn $fields;\n\t\t}\n\t\tadd_filter( 'submit_job_form_fields', 'frontend_company_foundation_field' );\n\n\t\t// add field in \"back-end\"\n\t\tfunction admin_company_foundation_field( $fields ) {\n\t\t\t$fields['_company_foundation'] = array(\n 'label' => esc_html__( 'Foundation Year', 'wp-job-manager-company-profiles' ),\n 'type' => 'text',\n 'required' => false,\n 'placeholder' => 'e.g. 1992',\n\t\t\t);\n\t\t\treturn $fields;\n\t\t}\n\t\tadd_filter( 'job_manager_job_listing_data_fields', 'admin_company_foundation_field' );\n }", "function oilContribsByCompany() {\n\t#DEPRECATED\n\t$query = \"select b.Name, sum(Amount) as cash from contribs_clean a join oilcompanies b on a.CompanyID = b.id join candidates_main c on a.CandidateID = c.CandidateID where a.CandidateID like 'P%' group by a.COmpanyID order by cash\";\n\treturn dbLookupArray($query);\n}", "function companyField(string $field){\n $company = Company::first()->toArray();\n return $company[$field];\n }", "public function get_company_code(){\n\t\treturn $this->v_company_code;\n\t}", "public function getCompany()\n {\n return $this->company;\n }", "public function getProductionCompany();", "public function docCompany($company = ''){$this->docCompany = $company;}", "abstract protected function define_column_submitter_name_title();", "public function getCompanyType();", "public function company() {\n $comapny = $this->Settings->get_all_company();\n $data = [\n 'company' => $comapny\n ];\n $this->load->view('setting/suggest_company', $data);\n }", "public function getUsrcfaxcompany()\n {\n return $this->usrcfaxcompany;\n }", "function oilContribsByCompany() {\n\t$query = \"select b.Name, sum(Amount) as cash from contribs_clean a join oilcompanies b on a.CompanyID = b.id join candidates_main c on a.CandidateID = c.CandidateID where a.CandidateID like 'P%' group by a.COmpanyID order by cash\";\n\treturn dbLookupArray($query);\n}", "public function getLogisticCompanyId()\n {\n return $this->logistic_company_id;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the value isn't a keyword.
private function isNotQuotable($val) { $keywords = [ 'true', 'false', 'null', 'NOW\(\)', 'COUNT\(.*\)', 'MAX\(.*\)', '\d+' ]; $keywords = array_merge($keywords, $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords']); // Check if the val is a keyword foreach ($keywords as $keyword) { if (preg_match(sprintf('/^%s$/is', $keyword), $val)) { return true; } } return false; }
[ "protected function isReservedKeyword($value)\n {\n static $keywords = array(\n '__class__',\n '__dir__',\n '__file__',\n '__function__',\n '__line__',\n '__method__',\n '__namespace__',\n '__trait__',\n 'abstract',\n 'and',\n 'array',\n 'as',\n 'break',\n 'case',\n 'catch',\n 'callable',\n 'cfunction',\n 'class',\n 'clone',\n 'const',\n 'continue',\n 'declare',\n 'default',\n 'die',\n 'do',\n 'echo',\n 'else',\n 'elseif',\n 'empty',\n 'enddeclare',\n 'endfor',\n 'endforeach',\n 'endif',\n 'endswitch',\n 'endwhile',\n 'eval',\n 'exception',\n 'exit',\n 'extends',\n 'final',\n 'finally',\n 'for',\n 'foreach',\n 'function',\n 'global',\n 'goto',\n 'if',\n 'implements',\n 'include',\n 'include_once',\n 'instanceof',\n 'insteadof',\n 'interface',\n 'isset',\n 'list',\n 'namespace',\n 'new',\n 'old_function',\n 'or',\n 'parent',\n 'php_user_filter',\n 'print',\n 'private',\n 'protected',\n 'public',\n 'require',\n 'require_once',\n 'return',\n 'static',\n 'switch',\n 'this',\n 'throw',\n 'trait',\n 'try',\n 'unset',\n 'use',\n 'var',\n 'while',\n 'xor',\n );\n return in_array(strtolower($value), $keywords, true);\n }", "abstract protected function isKeyword($tokenType);", "abstract protected function isKeyword(string $string, string|null &$content): bool;", "public function is_empty_focus_keyword() {\n\t\treturn ! $this->get_meta( 'focus_keyword' );\n\t}", "final public function isKeywordsValue($value) {\n return in_array($value, $this->dictionary['keywords']);\n }", "public function isKeyword()\n {\n return $this->special === self::PATH_ITEM_KEYWORD_PREFIX;\n }", "public function isSetKeyword(): bool;", "abstract protected function isKeyword($string, &$content);", "private function isKeyword($type)\n {\n return in_array(strtolower($type), array_keys($this->keywords), true);\n }", "public static function validKeywords()\n {\n return static::getPrefixedConstants('KEYWORD_');\n }", "function isWord() {\n if (!strlen(trim($this->value))) {\n return false;\n }\n if (preg_match('/^\\&[a-z0-9]+;$/i',trim($this->value))) {\n return false;\n }\n return preg_match('/[a-z]/i',$this->value);\n }", "protected function _validate_words($value) {\n return (bool)preg_match('/^\\w+$/', $value);\n }", "protected function isTypeAKeyword($type)\n {\n return in_array(strtolower($type), static::$keywords, true);\n }", "private static function isKeyword() {\n\n foreach (Lexical::$keywords as $keyword) {\n if(strcasecmp(Lexical::$temp_lex, $keyword) == 0) { #case insensitive comp\n\n $token = new Token($keyword, $keyword);\n _Global::$instruction_counter++;\n return $token;\n }\n }\n\n return false;\n }", "function eligibleKeywords($feed, $feedPos)\r\n{\r\n global $er;\r\n if(isEmpty($feed[12]))\r\n {\r\n log_(\"**Notice: No keyword found at FeedLine $feedPos\");\r\n $er = true;\r\n }\r\n else return true;\r\n}", "final public static function isNotString($value):bool\n {\n return is_scalar($value) && !is_string($value);\n }", "function isReservedKeyword( /*String*/ $identifier )\r\n {\r\n global $config, $strings;\r\n \r\n if( !$config->strictMode )\r\n {\r\n $identifier = strtolower( $identifier );\r\n }\r\n \r\n switch( $identifier )\r\n {\r\n case \"break\":\r\n case \"case\": case \"catch\": case \"continue\":\r\n case \"default\": case \"delete\": case \"do\":\r\n case \"else\":\r\n case \"finally\": case \"for\": case \"function\":\r\n case \"if\": case \"in\": case \"instanceof\":\r\n case \"new\":\r\n case \"return\":\r\n case \"switch\":\r\n case \"this\": case \"throw\": case \"try\": case \"typeof\":\r\n case \"var\": case \"void\":\r\n case \"while\": case \"with\":\r\n $this->log( sprintf( $strings->reservedKeyword, $identifier ) );\r\n return true;\r\n \r\n default:\r\n return false;\r\n }\r\n }", "function has_term_value($value) {\n return $this->get_term_by_value($value) !== FALSE;\n }", "public function hasKeyword($keyword)\n {\n // case 1: specific keyword\n if ($keyword != 'any') {\n return (strpos($this->getFieldValue('keywords'), $keyword) !== false);\n }\n // case 2: any keyword\n else {\n return ($this->getFieldValue('keywords') != '');\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handle the action to delete a control from pnlLeft
protected function btnDeleteLeft_Click($strFormId, $strControlId, $strParameter) { // Get the left panel's Child Controls $objChildControls = $this->pnlLeft->getChildControls(); // Only remove if pnlLeft has at least one control to remove if (count($objChildControls) > 0) { // Set the parent of the last control in this array to be NULL, // essentially removing it from the panel (and the form altogether) $objChildControls[count($objChildControls) - 1]->setParentControl(null); } }
[ "public function delLeft()\n {\n }", "function ncurses_del_panel($panel) {}", "public function manualDeleteViewAction() {\n $this->loadLayout()->_setActiveMenu(\"deleteorder/deleteorder\");\n $this->_addContent($this->getLayout()->createBlock('deleteorder/adminhtml_manualdelete'))\n ->_addLeft($this->getLayout()->createBlock('deleteorder/adminhtml_deleteorder_edit_tabs'));\n $this->renderLayout();\n }", "function ncurses_del_panel($panel)\n{\n}", "public function on_wxbutton_deletetemplate()\n\t{\n\t\t// Which template does the user wish to delete ?\n\t\t$user_selection = $this->wxlistbox_templates->GetSelection();\n\t\tif( $user_selection == wxNOT_FOUND ) return;\n\t\t\n\t\t$user_choice = $this->wxlistbox_templates->GetString(\n\t\t\t$user_selection\n\t\t);\n\t\t\n\t\t\n\t\t$result = $this->website_project->db_delete(\n\t\t\tDILL2_CORE_CONSTANT_DB_TABLE_TEMPLATE_NAME,\n\t\t\tarray(\n\t\t\t\tDILL2_CORE_CONSTANT_DB_TABLE_TEMPLATE_COLUMN_TEMPLATENAME,\n\t\t\t\t\"=\",\n\t\t\t\t$user_choice,\n\t\t\t\tSQLITE3_TEXT\n\t\t\t)\n\t\t);\n\t\t\n\t\tif( $result )\n\t\t{\n\t\t\t$this->refresh_related_controls();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// The template could not be deleted due to an error.\n\t\t\t$wxdialog_error = new wxMessageDialog(\n\t\t\t\t$wxdialog,\n\t\t\t\t\"The selected template could not be deleted.\",\n\t\t\t\tDILL2_TEXT_DIALOG_ERROR_CAPTION,\n\t\t\t\twxOK | wxCENTRE | wxICON_ERROR\n\t\t\t);\n\t\t\t$wxdialog_error->ShowModal();\t\t\t\n\t\t}\n\t}", "public function prepare_control() {\n\t\tif ( ! $this->tabs )\n\t\t\t$this->manager->remove_control( $this->id );\n\t}", "public function deleteButtonClicked($sender, $param)\n /*\n * Purpose: Delete the selected record from Recipe Category table and rebind\n * Parameters\n * @param TControl $sender Page\n * @param TEventParameter $param Validator control\n * Returns: nothing\n * Side-effects: Selected Item removed\n */\n {\n $item = $param->Item;\n // obtains the primary key corresponding to the datagrid item\n $RI_ID = $this->RecipeCategoryGrid->DataKeys[$item->ItemIndex];\n if ($RI_ID != null) {\n $data = $this->GetCategoryData();\n //Remove the selected record\n unset($data[$RI_ID]);\n $this->SetCategoryData($data);\n }\n self::rebindRecipeCategory();\n }", "public function deleteAction() {\r\n $this->_helper->layout->setLayout('admin-simple');\r\n $this->view->id = $id = $this->_getParam('id');\r\n\r\n if ($this->getRequest()->isPost()) {\r\n if (!empty($id))\r\n Engine_Api::_()->getItem('siteiosapp_menus', $id)->delete();\r\n\r\n $this->_forward('success', 'utility', 'core', array(\r\n 'smoothboxClose' => 10,\r\n 'parentRefresh' => 10,\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Deleted Successfully!'))\r\n ));\r\n }\r\n }", "public function showRemovePartPanel($sender,$param)\r\n {\r\n \t$partInstanceId = $this->kitDataList->DataKeys[$sender->Parent->ItemIndex];\r\n \t$partInstance = Factory::service(\"PartInstance\")->getPartInstance($partInstanceId);\r\n \tif(!$partInstance instanceof PartInstance)\r\n \t\treturn $this->onError(\"Invalid part. Please Contact \". Config::get(\"SupportHandling\",\"Contact\") .\" on \". Config::get(\"SupportHandling\",\"Phone\") .\" or \". Config::get(\"SupportHandling\",\"Email\") .\"! \");\r\n\r\n \tif($param != null)\r\n\t\t\t$itemIndex = $sender->Parent->ItemIndex;\r\n\t\telse\r\n\t\t\t$itemIndex = 0;\r\n\r\n\t\t$this->kitDataList->SelectedItemIndex = -1;\r\n\t\t$this->kitDataList->EditItemIndex = $itemIndex;\r\n \t$this->loadPartsList();\r\n\r\n \t$this->kitDataList->getEditItem()->removingPartInstance_SerialNo->Text=$partInstance;\r\n \t$this->kitDataList->getEditItem()->removingPartInstance_Id->Value=$partInstanceId;\r\n \t$this->kitDataList->getEditItem()->targetWarehouseId->Value=\"\";\r\n }", "function trash() { \n\t\t$adsdetail = JRequest::get('POST');\n\t\t$model = $this->getModel('showads');\n\t\t$model->statusChange($adsdetail);\n\t}", "function ProcessLeftDown(wxMouseEvent &$event){}", "function hook_panels_pane_delete($pids) {\n foreach ($pids as $pid) {\n // Create dummy pane with pid as property.\n $pane = (object) array('pid' => $pid);\n i18n_string_object_remove('panels_pane_configuration', $pane);\n }\n}", "public function delete(){\n if (empty($this->pad)){\n msg('Your pad is empty.');\n closeNode();\n }else{\n msg('Please send the number of the note you want to delete from your pad :');\n bindNode('deleteNote');\n }\n\n\n }", "public function __viewDelete()\n\t\t{\n\t\t\t$sectionId = $this->_context[1];\n\n\t\t\t// Delete the section.\n\t\t\t//\n\t\t\t$sectionManager = new SectionManager($this->_Parent);\n\t\t\t$sectionManager->delete($sectionId);\n\n\t\t\t// Reditect to the manage page fields page. (We can't just call __viewIndex()\n\t\t\t// to render the page as we need to redraw the menu).\n\t\t\t//\n\t\t\tredirect(URL . PF_MANAGE_URL);\n\t\t}", "public function deleteAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$model->deleteBox($this->_request->getParam('boxid'));\n\t\t$this->_redirect('/admin/box/list');\n\t }", "public function deleteAction()\n\t{\n\n // check if we know what should be deleted\n if ($id = $this->getRequest()->getParam('id')) {\n try {\n // init model and delete\n $model = Mage::getModel('responsiveslider/responsiveslider_item');\n $model->load($id);\n $model->delete();\n\n //delete link to slider\n $this->_resetItemToSlidersLink();\n\n // display success message\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('responsiveslider')->__('The slide has been deleted.')\n );\n // go to grid\n $this->_redirect('*/*/');\n\n return;\n\n } catch (Exception $e) {\n // display error message\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n // go back to edit form\n $this->_redirect('*/*/edit', array('id' => $id));\n\n return;\n }\n }\n // display error message\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('responsiveslider')->__('Unable to find a slide to delete.')\n );\n // go to grid\n $this->_redirect('*/*/');\n\t}", "public function deleteButtonClicked($sender, $param)\n /*\n * Purpose: Deletes the selected row by the data key\n * Parameters\n * @param TControl $sender Page\n * @param TEventParameter $param Validator control\n * Returns: nothing\n * Side-effects: Recipe_Category rebound\n */{\n $item = $param->Item;\n // obtains the primary key corresponding to the datagrid item\n $RC_ID = $this->RecipeCategoryGrid->DataKeys[$item->ItemIndex];\n //find by ID\n $RecipeCat = Recipe_CategoryRecord::finder()->findByPk($RC_ID);\n //if exists\n if($RecipeCat instanceof Recipe_CategoryRecord)\n {\n //delete by primary key\n Recipe_CategoryRecord::finder()->deleteByPk($RC_ID);\n }\n //rebind\n\n $this->dataBindRecipeIngredient();\n $this->rebindRecipeCategory();\n }", "public function showRemovePartPanel($sender,$param)\r\n {\r\n \t$partInstanceId = $this->theDataList->DataKeys[$sender->Parent->ItemIndex];\r\n\r\n \tif ($this->isAgent)\r\n \t{\r\n\t\t\tif(!Factory::service(\"UserAccountFilter\")->hasFilter(Core::getUser(),Core::getRole(),\"ViewWarehouse\"))\r\n\t\t\t\treturn $this->onError(\"No UserAccountFilter 'ViewWarehouse' set for you, Please Contact \". Config::get(\"SupportHandling\",\"Contact\") .\" on \". Config::get(\"SupportHandling\",\"Phone\") .\" or \". Config::get(\"SupportHandling\",\"Email\") .\"!\");\r\n \t}\r\n\r\n \t$partInstance = Factory::service(\"PartInstance\")->getPartInstance($partInstanceId);\r\n \tif(!$partInstance instanceof PartInstance)\r\n \t\treturn $this->onError(\"Invalid part to remove! Please Contact \". Config::get(\"SupportHandling\",\"Contact\") .\" on \". Config::get(\"SupportHandling\",\"Phone\") .\" or \". Config::get(\"SupportHandling\",\"Email\") .\"! \");\r\n\r\n \tif($param != null)\r\n\t\t\t$itemIndex = $sender->Parent->ItemIndex;\r\n\t\telse\r\n\t\t\t$itemIndex = 0;\r\n\r\n \t$this->theDataList->SelectedItemIndex = -1;\r\n\t\t$this->theDataList->EditItemIndex = $itemIndex;\r\n \t$this->loadTransitNoteDetails($this->transitNote);\r\n\r\n \t$this->theDataList->getEditItem()->removingPartInstance_SerialNo->Text=$partInstance;\r\n \t$this->theDataList->getEditItem()->removingPartInstance_Id->Value=$partInstanceId;\r\n \t$this->theDataList->getEditItem()->targetWarehouseId->Value=\"\";\r\n }", "public function beforeDelete()\n {\n CmsMenuItem::deleteAll([\"MENU\"=>$this->ID]);\n return parent::beforeDelete();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Smarty plugin File: function.writhem_admin_comments.php Type: function Name: writhem_admin_comments Purpose: returns the guid based on a comment's id when only a gid is present.
function smarty_function_writhem_admin_comments($params, Smarty_Internal_Template $template) { if (!isset($params['id'])) return false; require_once("/var/www/newznab/www/lib/framework/db.php"); $db = new DB; $query = "SELECT r.guid FROM `releasecomment` as c " . "LEFT JOIN `releases` as r ON c.gid = r.gid " . "WHERE c.id = %d;"; $result = $db->queryOneRow(sprintf($query, $params['id'])); if (isset($result['guid'])) $output = "<a class=\"btn btn-mini\" href=\"". WWW_TOP . "/../details/{$result['guid']}#comments\">view</a>"; else $output = "<a class=\"btn btn-mini disabled\">none</a>"; return $output; }
[ "function dahz_framework_get_meta_comment_link() {\n\t\tif ( is_single() ) {\n\t\t\t$output = sprintf( '#comments' );\n\t\t} else {\n\t\t\t$output = sprintf( '%s#comments', esc_url( get_permalink() ) );\n\t\t}\n\n\t\treturn $output;\n\t}", "public function getCommentId(){\n\t\treturn($this->commentId);\n\t}", "public static function debug_commentid() {\n\t\t$query = mysql_query(\"SELECT `cid`,`datetime`,`text` FROM comments WHERE `cid` = ''\");\n\t\twhile($r = mysql_fetch_assoc($query))\n\t\t\tif(!$r['cid'])\n\t\t\t\tmysql_query(\"UPDATE comments SET `cid` = '\".uniqid().\"' WHERE `datetime` = '{$r['datetime']}' AND `text` = '\".addslashes($r['text']).\"' LIMIT 1\");\n\t\tmysql_free_result($query);\n\t\tunset($query);\n\t}", "function get_edit_comment_link($comment_id = 0)\n{\n}", "function wf_rtc_get_commenthash($comment_id)\n{\n\t$commentdata = get_comment($comment_id);\n\t$commenthash = get_option(\"wf_commenthash_string\");\n\t\n\t$hash = md5($commenthash . $commentdata->comment_date . $commentdata->comment_ID);\n\t\n\treturn $hash;\n}", "function getCommentId(){\n $sql = \"select COMMENT_ID from COMMENT where RATING_RATING_ID = '\" . getRatingId() . \"'\";\n $results = queryDB($sql);\n if ($result = nextRow($results)){\n return $result['COMMENT_ID'];\n }\n else{\n return null;\n }\n }", "public function getCommentId() {\n\t\treturn Temboo_Results::getSubItemByKey($this->base, \"commentId\");\n\t}", "function get_edit_comment_link($comment_id = 0)\n {\n }", "function create_comment_section() {\n\t\tglobal $pdo;\n\t\t$sql = \"INSERT INTO comment_section () VALUES ()\";\n\t\t$sth = $pdo->prepare($sql);\n\t\t$sth->execute();\n\t\t$sql = \"SELECT LAST_INSERT_ID() AS id\";\n\t\t$sth = $pdo->prepare($sql);\n\t\t$sth->execute();\n\t\treturn $sth->fetch()[\"id\"];\n\t}", "public function getCommentID() {\n return($this->commentID);\n }", "function get_comment_author_url($comment_id = 0)\n {\n }", "function ___comment( $seperate = false ){\n\t\n\tcomments_template( '/gidd/core_extension/gidd_comment/comments.php', $seperate );\n\t\n}", "function get_id_commentaire(){\n\tglobal $db ;\n\t$table = 'commentaires';\n\t\n\t$req = \"SELECT id FROM $table WHERE commid is null\";\n\t$id_commt = readData($db, $q);\n\treturn $id_commt;\n}", "public function getCommentUserId() : Uuid {\n\t\treturn($this->commentUserId);\n\t}", "public function getCommentsGrpNameFromCommentsGrpId()\n {\n try {\n $result = Comment::join('comments_groups', function ($join) {\n $join->on('comments.comment_group_id', '=', 'comments_groups.comment_group_id');\n })\n ->select()\n ->get();\n return $result;\n } catch (QueryException $e) {\n echo $e;\n }\n }", "function get_comment_author_link($comment_id = 0)\n {\n }", "function comment_author_url($comment_ID = 0)\n{\n}", "public function getG_id();", "function addComment($mysqli, $replyString, $replyStringCID, $username){\n //search for the content made with timestamp timestampCID\n $result = $mysqli->query(\"SELECT CID,PermissionType,GroupID FROM Content WHERE replyString='\".$replyStringCID.\"';\");\n $first_row = mysqli_fetch_row($result);\n if(is_bool($first_row[0])){\n return 'addComment: There is no such content which has this string as content: '.$replyStringCID;\n }\n\n //get user and see if exists\n $result2 = $mysqli->query(\"SELECT UID FROM User_ WHERE Username='\".$username.\"';\");\n $first_row_2 = mysqli_fetch_row($result2);\n if(is_bool($first_row_2[0])){\n return 'addComment: There is no such user that has this username: '.$username;\n }\n\n if($first_row[2]!=''){\n return 'addComment: Content comes from a group. Cannot comment on some content from a group.';\n }\n\n if($first_row[1]==0){\n return 'addComment: Content cannot be commented due to privilege level';\n }\n\n if($first_row[1]==1){\n //only comment is accepted. No links!\n if(strpos($replyString, \"www.\") !== false){\n return 'addComment: There is a link inside the comment; according to the privilege level, cannot be sent.';\n }\n }\n $timestamp = time();\n $mysqli->query(\"INSERT INTO Comment (CID, replyString, TimeStamp) VALUES (\".$first_row[0].\",'\".$replyString.\"',\".$timestamp.\");\");\n //find CoID of just added entity\n $result3 = $mysqli->query(\"SELECT CoID FROM Comment WHERE TimeStamp=\".$timestamp.\";\");\n $first_row_3 = mysqli_fetch_row($result3);\n $mysqli->query(\"INSERT INTO Post_Comment (CoID, UID) VALUES (\".$first_row_3[0].\",\".$first_row_2[0].\");\");\n return 'addComment: '.$mysqli->error;\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
//////////////////////////////////////////////// Synchronize WooCommerce product
public static function sync_product( Pronamic_Softwear_WooCommerce_Product $product ) { $result = true; if ( empty( $product->id ) ) { $result = self::insert_product( $product ); } return $result; }
[ "function syncProductsToStore(){\n\t\t//#1 - Get all not synched products\n\t\t$driveProductsList = DRIVE_getProductNotSynced();\n\n\t\tif(empty($driveProductsList)){\n\t\t\t$msg = \"There are no Products From Drive to Sync.<br>\";\n\t\t\techo $msg;\n\t\t\tlogData($msg);\n\t\t\texit(1);\n\t\t}\n\n\n\n\t\t//#2 - Iterate to create/or update in case of exist\n\t\tforeach ($driveProductsList as $driveProduct) {\n\t\t\t//flag to update STOCK\n\t\t\t$toUpdateStock = false;\n\n\t\t\t$msg = \"Synching ref: \".$driveProduct['ref'].\"...<br>\";\n\t\t\techo $msg;\n\t\t\tlogData($msg);\n\n\t\t\t//#2.1 - Now, check if this product exists in store!\n\t\t\t$productAlreadyInStore = WSDL_GetProductFromSku($driveProduct['ref']);\n\n\t\t\tif($productAlreadyInStore !== null){\n\t\t\t\t//first we update prices\n\t\t\t\tWSDL_UpdProductPricesByProd($productAlreadyInStore, $driveProduct);\n\t\t\t\t//in this case, update drive product with ST.obs = StoreProd.product_id\n\t\t\t\t//Update Product and save it in Drive\n\t\t\t\t$driveProduct['obs'] = strval($productAlreadyInStore->product_id);\n\n\t\t\t\t//#update obs in drive\n\t\t\t\t$driveProduct = DRIVE_saveInstance(\"St\", $driveProduct);\n\t\t\t\tif($driveProduct == null){\n\t\t\t\t\t$msg = \"Error on save entity for St. <br><br>\";\n\t\t\t\t\techo $msg;\n\t\t\t\t\tlogData($msg);\n\t\t\t\t\tcontinue;\n\t\t\t\t}else{\n\t\t\t\t\t$msg = \"Product obs updated in Drive!product_id:\".$productAlreadyInStore->product_id.\" <br><br>\";\n\t\t\t\t\techo $msg;\n\t\t\t\t\tlogData($msg);\n\n\t\t\t\t\t$toUpdateStock = true;//mark flag to update stock later\n\t\t\t\t}\n\n\n\t\t\t}else{\n\t\t\t\t//Create it in store\n\t\t\t\t//#3 - Call WSDL (directly url of our php in reparacaomobile server) - return = {product_id, product_sku}\n\t\t\t\t$productInStore = WSDL_AddProduct($driveProduct);\nprint_r($productInStore);\n\t\t\t\tif(isset($productInStore->error)){\n\t\t\t\t\t$msg = \"Error on synchronizing ref: \".$driveProduct['ref'].\"...<br>\";\n\t\t\t\t\techo $msg;\n\t\t\t\t\tlogData($msg);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t//#4 - Update Product and save it in Drive\n\t\t\t\t$driveProduct['obs'] = strval($productInStore->product_id);\n\n\t\t\t\t//#4.1 - Save It\n\t\t\t\t$driveProduct = DRIVE_saveInstance(\"St\", $driveProduct);\n\t\t\t\tif($driveProduct == null){\n\t\t\t\t\t$msg = \"Error on save entity for St. <br><br>\";\n\t\t\t\t\techo $msg;\n\t\t\t\t\tlogData($msg);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$msg = \"Products with ref: \".$driveProduct['ref'].\" synched to Store!<br>\";\n\t\t\t\techo $msg;\n\t\t\t\tlogData($msg);\n\n\n\t\t\t\t$toUpdateStock = true;//mark flag to update stock later\n\t\t\t}\n\n\n\t\t\tif($toUpdateStock == true){\n\t\t\t\t$returnStockUpdated=WSDL_UpdProductStockById($driveProduct['obs'], $driveProduct['stock']);\n\n\t\t\t \tif($returnStockUpdated->returnCode == 0){\n\t\t\t \t\t$msg = \"Product stock updated in STORE!product ref: \".$driveProduct['ref'].\" <br><br>\";\n\t\t\t\t\techo $msg;\n\t\t\t\t\tlogData($msg);\n\t\t\t \t}\n\t\t\t}\n\n\n\t\t}\n\n\t\t$msg = \"Products synched from Drive to Store!<br>\";\n\t\techo $msg;\n\t\tlogData($msg);\n\n\t}", "public function sync_products_ew(){\r\n\t\tupdate_option('woo_save_object_to_economic', false);\r\n\t\tglobal $wpdb;\r\n\t\t$client = $this->woo_economic_client();\r\n\t\t$sync_log = array();\r\n\t\t$sync_log[0] = true;\r\n\t\tif(!$client){\r\n\t\t\t$sync_log[0] = false;\r\n\t\t\tarray_push($sync_log, array('status' => __('fail', 'woocommerce-e-conomic-integration'), 'msg' => __('Could not create e-conomic client, please try again later!', 'woocommerce-e-conomic-integration') ));\r\n\t\t\treturn $sync_log;\r\n\t\t}\r\n\t\t\r\n\t\t$products = $client->Product_GetAll()->Product_GetAllResult;\r\n\t\t//logthis($products);\r\n\t\t\r\n\t\t$product_handles = array();\r\n\t\t\r\n\t\tforeach($products->ProductHandle as $product){\r\n\t\t\t$product_handles[$product->Number] = $client->Product_GetProductGroup(array('productHandle' => $product))->Product_GetProductGroupResult;\r\n\t\t}\r\n\r\n\t\tforeach($product_handles as $product_number => $group){\r\n\t\t\t$sku = str_replace($this->product_offset, '', $product_number);\r\n\t\t\t//logthis($group->Number);\r\n\t\t\tif($group->Number == $this->product_group){\r\n\t\t\t\t/*$productNumber = $client->Product_GetNumber(array(\r\n\t\t\t\t\t'productHandle' => array('Number' => $product_number ),\r\n\t\t\t\t))->Product_GetNumberResult;*/\r\n\t\t\t\t\r\n\t\t\t\t$product_name = $client->Product_GetName(array(\r\n\t\t\t\t\t'productHandle' => array('Number' => $product_number ),\r\n\t\t\t\t))->Product_GetNameResult;\r\n\t\t\t\t\r\n\t\t\t\t//logthis($product_number);\r\n\t\t\t\t//logthis($product_name);\r\n\t\t\t\t//logthis($sku);\r\n\t\t\t\t\r\n\t\t\t\t$product_post_ids = $wpdb->get_results(\"SELECT post_id FROM \".$wpdb->prefix.\"postmeta WHERE meta_key = '_sku' AND meta_value = '\".$sku.\"'\", OBJECT_K );\r\n\t\t\t\t//logthis($product_post_ids);\r\n\t\t\t\r\n\t\t\t\tif(!empty($product_post_ids)){\r\n\t\t\t\t\tforeach($product_post_ids as $product_post_id){\r\n\t\t\t\t\t\t$product_id = $product_post_id->post_id;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(get_post_status( $product_id ) == 'trash'){\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//logthis('product_id: '.$product_id);\r\n\t\t\t\t\t//logthis('product_number: '.$product_number);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$product_id = NULL;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$product_data = $client->Product_GetData(array(\r\n\t\t\t\t\t'entityHandle' => array('Number' => $product_number ),\r\n\t\t\t\t))->Product_GetDataResult;\t\r\n\t\t\t\t\r\n\t\t\t\t//logthis($product_data);\r\n\t\t\t\t\r\n\t\t\t\tif($product_id != NULL){\r\n\t\t\t\t\tlogthis('update product : '.$product_number);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($this->product_sync == \"on\"){\r\n\t\t\t\t\t\t$product = new WC_Product($product_id);\r\n\t\t\t\t\t\t$post = array(\r\n\t\t\t\t\t\t\t'ID'\t\t => $product_id,\r\n\t\t\t\t\t\t\t'post_content' => $product_data->Description != ''? $product_data->Description : $product_data->Name,\r\n\t\t\t\t\t\t\t'post_title' => $product_data->Name,\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$post_id = wp_update_post( $post, true );\r\n\t\t\t\t\t\tif (is_wp_error($post_id)) {\r\n\t\t\t\t\t\t\t$errors = $post_id->get_error_messages();\r\n\t\t\t\t\t\t\tforeach ($errors as $error) {\r\n\t\t\t\t\t\t\t\tlogthis($error);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tupdate_post_meta( $post_id, '_price', (int) $product_data->SalesPrice );\r\n\t\t\t\t\t\t//update_post_meta( $post_id, '_sale_price', (int) $product_data->SalesPrice );\r\n\t\t\t\t\t\tif($product->managing_stock()){\r\n\t\t\t\t\t\t\tif((int)$product_data->InStock > 0){\r\n\t\t\t\t\t\t\t\t$product->set_stock($product_data->InStock);\r\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, '_stock_status', 'instock' );\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$product->set_stock(0);\r\n\t\t\t\t\t\t\t\tupdate_post_meta( $post_id, '_stock_status', 'outofstock' );\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tlogthis('Product: '.$product->get_title().' Stock updated to '.$product_data->InStock);\r\n\t\t\t\t\t\t\tarray_push($sync_log, array('status' => __('success', 'woocommerce-e-conomic-integration'), 'sku' => $product_number, 'name' => $product_data->Name, 'msg' => __('Product sync: Successful! <br> Product stock sync: Successfull!', 'woocommerce-e-conomic-integration') ));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tarray_push($sync_log, array('status' => __('success', 'woocommerce-e-conomic-integration'), 'sku' => $product_number, 'name' => $product_data->Name, 'msg' => __('Product sync: Successful! <br> Product stock sync: Stock management disabled, Stock management can be enabled at Product->Inventory.', 'woocommerce-e-conomic-integration') ));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif($product->managing_stock()){\r\n\t\t\t\t\t\t\t($product_data->InStock !=0 || $product_data->InStock =='') ? $product->set_stock($product_data->InStock) : logthis('Product stock not updated.');\r\n\t\t\t\t\t\t\tlogthis('Product: '.$product->get_title().' Stock updated to '.$product_data->InStock);\r\n\t\t\t\t\t\t\tarray_push($sync_log, array('status' => __('success', 'woocommerce-e-conomic-integration'), 'sku' => $product_number, 'name' => $product_data->Name, 'msg' => __('Product sync: Disabled! Use \"Activate product sync\" settings to enable it. <br> Product stock sync: Successfull!', 'woocommerce-e-conomic-integration') ));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tarray_push($sync_log, array('status' => __('success', 'woocommerce-e-conomic-integration'), 'sku' => $product_number, 'name' => $product_data->Name, 'msg' => __('Product sync: Disabled! Use \"Activate product sync\" settings to enable it. <br> Product stock sync: Stock management disabled, Stock management can be enabled at Product->Inventory.', 'woocommerce-e-conomic-integration') ));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tlogthis('add product : '.$product_number);\r\n\t\t\t\t\t$post = array(\r\n\t\t\t\t\t\t'post_status' => 'publish',\r\n\t\t\t\t\t\t'post_type' => 'product',\r\n\t\t\t\t\t\t'post_title' => $product_data->Name,\r\n\t\t\t\t\t\t'post_content' => $product_data->Description != ''? $product_data->Description : $product_data->Name,\r\n\t\t\t\t\t\t'post_excerpt' => $product_data->Description != ''? $product_data->Description : $product_data->Name,\r\n\t\t\t\t\t);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$post_id = wp_insert_post( $post, true );\r\n\t\t\t\t\tif (is_wp_error($post_id)) {\r\n\t\t\t\t\t\t$errors = $post_id->get_error_messages();\r\n\t\t\t\t\t\tforeach ($errors as $error) {\r\n\t\t\t\t\t\t\tlogthis('Product creation error');\r\n\t\t\t\t\t\t\tlogthis($error);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$product = new WC_Product($post_id);\r\n\t\t\t\t\tupdate_post_meta( $post_id, '_sku', $sku );\r\n\t\t\t\t\tupdate_post_meta( $post_id, '_price', (string) $product_data->SalesPrice );\r\n\t\t\t\t\t//update_post_meta( $post_id, '_sale_price', (int) $product_data->SalesPrice );\r\n\t\t\t\t\tif((int)$product_data->InStock > 0){\r\n\t\t\t\t\t\t$product->set_stock($product_data->InStock);\r\n\t\t\t\t\t\tupdate_post_meta( $post_id, '_stock_status', 'instock' );\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$product->set_stock(0);\r\n\t\t\t\t\t\tupdate_post_meta( $post_id, '_stock_status', 'outofstock' );\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tarray_push($sync_log, array('status' => __('success', 'woocommerce-e-conomic-integration'), 'sku' => $product_number, 'name' => $product_data->Name, 'msg' => __('Product sync: Successful! <br> Product stock sync: Successfull!', 'woocommerce-e-conomic-integration') ));\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//$sync_log[0] = false;\r\n\t\t\t\t//array_push($sync_log, array('status' => __('fail', 'woocommerce-e-conomic-integration'), 'sku' => $product_number, 'msg' => __('Product group doesn\\'t match the Product group in settings!', 'woocommerce-e-conomic-integration') ));\r\n\t\t\t\tlogthis(\"Product group doesn't match the Product group in settings: \".$product_number);\r\n\t\t\t}\r\n\t\t}\r\n\t\tupdate_option('woo_save_object_to_economic', true);\r\n\t\treturn $sync_log;\r\n\t}", "public function sync_products() {\n\t\tif ( wp_verify_nonce( $_POST['_wpnonce'], 'wc_mc_product_stock_manager_sync_products' ) ) {\n\t\t\t$args = array(\n\t\t\t\t'post_type' => 'product',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t\t'meta_query' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'key' => '_stock_status',\n\t\t\t\t\t'value' => 'outofstock',\n\t\t\t\t\t'compare' => '='\n\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'fields' => 'ids',\n\t\t\t);\n\t\t\t$service \t\t= new WCMCPROD_Core_Products();\n\t\t\t$product_ids \t= get_posts( $args ); \n\n\t\t\tforeach ( $product_ids as $product_id ) {\n\t\t\t\t$product = wc_get_product( $product_id );\n\t\t\t\t$save_id = $service->get_product( $product_id );\n\t\t\t\tif ( !$save_id ) {\n\t\t\t\t\t$service->save_product( $product_id, $product->get_name(), $product->get_permalink(), 'out_of_stock' );\n\t\t\t\t} else {\n\t\t\t\t\t$service->update_product( $save_id, $product->get_name(), $product->get_permalink(), 'out_of_stock' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twp_send_json_success( sprintf( __( ' %d products synced', 'wc-mc-product-stock-manager' ), count( $product_ids ) ) );\n\t\t} else {\n\t\t\twp_send_json_error( __( 'Not allowed', 'wc-mc-product-stock-manager' ) );\n\t\t}\n\t}", "public function sync_price(&$product);", "public function handle_set_product_sync_prompt() {\n\n\t\tcheck_ajax_referer( 'set-product-sync-prompt', 'security' );\n\n\t\t// phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t$product_id = isset( $_POST['product'] ) ? (int) $_POST['product'] : 0;\n\t\t// phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t$sync_enabled = isset( $_POST['sync_enabled'] ) ? (string) $_POST['sync_enabled'] : '';\n\t\t// phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t$var_sync_enabled = isset( $_POST['var_sync_enabled'] ) ? (string) $_POST['var_sync_enabled'] : '';\n\t // phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t$product_cats = isset( $_POST['categories'] ) ? (array) $_POST['categories'] : array();\n\t\t// phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t$product_tags = isset( $_POST['tags'] ) ? (array) $_POST['tags'] : array();\n\n\t\tif ( $product_id > 0 && in_array( $var_sync_enabled, array( 'enabled', 'disabled' ), true ) && in_array( $sync_enabled, array( 'enabled', 'disabled' ), true ) ) {\n\n\t\t\t$product = wc_get_product( $product_id );\n\n\t\t\tif ( $product instanceof \\WC_Product ) {\n\n\t\t\t\tif ( ( 'enabled' === $sync_enabled && ! $product->is_type( 'variable' ) ) || ( 'enabled' === $var_sync_enabled && $product->is_type( 'variable' ) ) ) {\n\n\t\t\t\t\t$has_excluded_terms = false;\n\n\t\t\t\t\tif ( $integration = facebook_for_woocommerce()->get_integration() ) {\n\n\t\t\t\t\t\t// try with categories first, since we have already IDs\n\t\t\t\t\t\t$has_excluded_terms = ! empty( $product_cats ) && array_intersect( $product_cats, $integration->get_excluded_product_category_ids() );\n\n\t\t\t\t\t\t// the form post can send an array with empty items, so filter them out\n\t\t\t\t\t\t$product_tags = array_filter( $product_tags );\n\n\t\t\t\t\t\t// try next with tags, but WordPress only gives us tag names\n\t\t\t\t\t\tif ( ! $has_excluded_terms && ! empty( $product_tags ) ) {\n\n\t\t\t\t\t\t\t$product_tag_ids = array();\n\n\t\t\t\t\t\t\tforeach ( $product_tags as $product_tag_name_or_id ) {\n\n\t\t\t\t\t\t\t\t$term = get_term_by( 'name', $product_tag_name_or_id, 'product_tag' );\n\n\t\t\t\t\t\t\t\tif ( $term instanceof \\WP_Term ) {\n\n\t\t\t\t\t\t\t\t\t$product_tag_ids[] = $term->term_id;\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t$term = get_term( (int) $product_tag_name_or_id, 'product_tag' );\n\n\t\t\t\t\t\t\t\t\tif ( $term instanceof \\WP_Term ) {\n\t\t\t\t\t\t\t\t\t\t$product_tag_ids[] = $term->term_id;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$has_excluded_terms = ! empty( $product_tag_ids ) && array_intersect( $product_tag_ids, $integration->get_excluded_product_tag_ids() );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $has_excluded_terms ) {\n\n\t\t\t\t\t\tob_start();\n\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tid=\"facebook-for-woocommerce-go-to-settings\"\n\t\t\t\t\t\t\tclass=\"button button-large\"\n\t\t\t\t\t\t\thref=\"<?php echo esc_url( add_query_arg( 'tab', Product_Sync::ID, facebook_for_woocommerce()->get_settings_url() ) ); ?>\"\n\t\t\t\t\t\t><?php esc_html_e( 'Go to Settings', 'facebook-for-woocommerce' ); ?></a>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tid=\"facebook-for-woocommerce-cancel-sync\"\n\t\t\t\t\t\t\tclass=\"button button-large button-primary\"\n\t\t\t\t\t\t\tonclick=\"jQuery( '.modal-close' ).trigger( 'click' )\"\n\t\t\t\t\t\t><?php esc_html_e( 'Cancel', 'facebook-for-woocommerce' ); ?></button>\n\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t$buttons = ob_get_clean();\n\n\t\t\t\t\t\twp_send_json_error(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'message' => sprintf(\n\t\t\t\t\t\t\t\t /* translators: Placeholder %s - <br/> tag */\n\t\t\t\t\t\t\t\t\t__( 'This product belongs to a category or tag that is excluded from the Facebook catalog sync. It will not sync to Facebook. %sTo sync this product to Facebook, click Go to Settings and remove the category or tag exclusion or click Cancel and update the product\\'s category / tag assignments.', 'facebook-for-woocommerce' ),\n\t\t\t\t\t\t\t\t\t'<br/><br/>'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'buttons' => $buttons,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twp_send_json_success();\n\t}", "public function syncProductList()\n {\n // Evaluation only needed for custom product list and product tag\n if (!$this->isCustomList() && !$this->model_type !== ProductTag::class) return;\n\n $product_ids = $this->isCustomList() ? $this->product_ids : $this->getProductQuery()->get('id')->pluck('id')->all();\n\n $this->products()->sync($product_ids);\n }", "public static function do_deferred_product_sync()\n {\n }", "public static function ah_woocommerce_before_single_product() {\n // Load product update script. Redirect to My Subscription page\n // after product update click\n WCCS_Asset_Loader::enqueue_wccs_update_product_script(\n WCCS_Page_Configuration::get_page_link( 'mysubscription' ) );\n wccs_get_template( 'custom-subscription-update-box.php' );\n }", "private function getWCMLSynchronizeProductData() {\n\t\tglobal $woocommerce_wpml;\n\n\t\tif ( is_object( $woocommerce_wpml )\n\t\t && class_exists( 'WCML_Synchronize_Product_Data' )\n\t\t && is_a( $woocommerce_wpml->sync_product_data, 'WCML_Synchronize_Product_Data' )\n\t\t) {\n\t\t\treturn $woocommerce_wpml->sync_product_data;\n\t\t}\n\n\t\treturn false;\n\t}", "public function variable_product_sync() {\n\t\tglobal $woocommerce;\n\n\t\tparent::variable_product_sync();\n\n\t\t$children = get_posts( array(\n\t\t\t'post_parent' \t=> $this->id,\n\t\t\t'posts_per_page'=> -1,\n\t\t\t'post_type' \t=> 'product_variation',\n\t\t\t'fields' \t\t=> 'ids',\n\t\t\t'post_status'\t=> 'publish'\n\t\t));\n\n\t\tif ( $children ) {\n\t\t\tforeach ( $children as $child ) {\n\n\t\t\t\t$child_price = get_post_meta( $child, '_price', true );\n\t\t\t\t$child_billing_period = get_post_meta( $child, '_subscription_period', true );\n\n\t\t\t\t// We only care about the lowest price\n\t\t\t\tif ( $child_price !== $this->min_variation_price )\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// Set to the shortest possible billing period\n\t\t\t\t$this->subscription_period = WC_Subscriptions::get_longest_period( $this->subscription_period, $child_billing_period );\n\t\t\t}\n\n\t\t\t$woocommerce->clear_product_transients( $this->id );\n\t\t}\n\n\t}", "function setSyncItemsCodeProduct()\n {\n }", "public function productsFetchAndQueueForResync() {\n $products = $this->productProvider->getProductsAll();\n\n $all_product_ids = [];\n\n $i = 0;\n $data['product_keys'] = [];\n\n // We'll process PRODUCTS_PER_QUEUE_ITEM products per queue worker run.\n foreach ($products as $product) {\n $all_product_ids[] = $product->getId();\n $data['product_ids'][] = $product->getId();\n\n if (++$i == self::PRODUCTS_PER_QUEUE_ITEM) {\n $queue = $this->queue->get('gd_product_product_synchronise_queue', FALSE);\n $queue->createItem($data);\n $i = 0;\n $data['product_ids'] = [];\n }\n }\n\n // Adding tail (if any).\n if ($i > 0) {\n $queue = $this->queue->get('gd_product_product_synchronise_queue', FALSE);\n $queue->createItem($data);\n }\n\n\n // Deleting products that don't exist in commercetools anymore.\n $this->syncDeletedProducts($all_product_ids);\n }", "public function sync_all_custom_fields_attributes() {\n\t\tglobal $sync_taxonomies;\n\t\t$sync_taxonomies = [];\n\t\tedgenet()->debug->notice( \"\\n\" );\n\t\tedgenet()->debug->notice( \"\\n\" );\n\t\tedgenet()->debug->notice( str_repeat( '*', 32 ) );\n\t\tedgenet()->debug->notice( __( 'Start SYNC_ALL_CUSTOM_FIELDS_ATTRIBUTES', 'edgenet' ) );\n\t\tedgenet()->debug->notice( str_repeat( '*', 32 ) );\n\n\t\t// Get array of all product IDs\n\t\t$args = [\n\t\t\t'post_type' => 'product',\n\t\t\t'post_status' => 'all',\n\t\t\t'posts_per_page' => - 1,\n\t\t\t'fields' => 'ids',\n\t\t];\n\n\t\t$product_ids = new \\WP_Query( $args );\n\n\t\tedgenet()->debug->notice( __( sprintf( 'Syncing %s products', $product_ids->post_count ), 'edgenet' ) );\n\n\t\tforeach ( $product_ids->posts as $product_id ) {\n\t\t\tedgenet()->debug->notice( __( sprintf( 'Starting sync for Product ID: %s', $product_id ), 'edgenet' ) );\n\t\t\t$this->sync_product_custom_fields_attributes( $product_id );\n\t\t\tedgenet()->debug->notice( __( sprintf( 'Stopping sync for Product ID: %s', $product_id ), 'edgenet' ) );\n\t\t}\n\n\t\tedgenet()->debug->notice( str_repeat( '*', 32 ) );\n\t\tedgenet()->debug->notice( __( 'End SYNC_ALL_CUSTOM_FIELDS_ATTRIBUTES', 'edgenet' ) );\n\t\tedgenet()->debug->notice( str_repeat( '*', 32 ) );\n\t\tedgenet()->debug->notice( \"\\n\" );\n\t\tedgenet()->debug->notice( \"\\n\" );\n\t}", "function sp_woo_add_product_compare_ajax() {\n\t$nonce = $_POST['ajaxCustomNonce'];\n\n\t// bail if nonce don't check out\n\tif ( ! wp_verify_nonce( $nonce, '_sp_nonce' ) )\n\t\t die ( 'error' );\n\n\t$product_id = absint( $_POST['product_id'] );\n\t\n\t$plus_one = 0;\n\t\n\t// check if there is existing cookie\n\tif ( isset( $_COOKIE['sp_product_compare'] ) ) {\n\t\t$cookie = maybe_unserialize( $_COOKIE['sp_product_compare'] );\n\n\t\t// sanitize the cookie\n\t\tis_array( $cookie ) ? array_walk_recursive( $cookie, 'sp_clean_multi_array' ) : null;\n\n\t\tif ( is_array( $cookie ) && ! in_array( $product_id, $cookie ) ) {\n\t\t\tarray_push( $cookie, $product_id );\n\n\t\t} else {\n\t\t\t$message = __( 'Item is already in your compare list.', 'sp-theme' );\n\n\t\t\techo json_encode( array( 'message' => $message, 'count' => sp_woo_get_compare_item_count() ) );\n\t\t\texit;\n\t\t}\n\n\t} else {\n\t\t$cookie = array( $product_id );\n\t}\n\n\tif ( setcookie( 'sp_product_compare', maybe_serialize( $cookie ), apply_filters( 'sp_product_compare_cookie_expire_time', time() + 60*60*24*1 ), '/' ) ) {\n\t\t$message = __( 'Item added to compare list.', 'sp-theme' );\n\n\t\t// add one to count as we can't get correct count right after setting cookie\n\t\t$plus_one = 1;\n\n\t} else {\n\t\t$message = __( 'Sorry, unable to add this item for compare.', 'sp-theme' );\n\t}\n\n\techo json_encode( array( 'message' => $message, 'count' => ( sp_woo_get_compare_item_count() + $plus_one ) ) );\n\texit;\n}", "public function syncItemsWeb()\n {\n\n $single_sku = $this->option('sync_items_web');\n $url_addition = '';\n if(!empty($single_sku)){\n $url_addition = '?$filter=PARTNAME eq \\''.$single_sku.'\\'';\n }\n // get all items from priority\n $response = $this->makeRequest('GET', 'LOGPART'.$url_addition);\n if (!$response['status']) {\n $this->sendEmailError(\n $this->option('email_error_sync_items_web'),\n 'Error Sync Items Web',\n $response['body']\n );\n }\n $data = json_decode($response['body_raw'], true);\n $SKU = []; // Priority items SKU numbers\n // collect all SKU numbers\n foreach($data['value'] as $item) {\n $SKU[] = $item['PARTNAME'];\n }\n // get all products from woocommerce\n $products = get_posts(['post_type' => array('product', 'product_variation'),\n 'post_status' => array('publish'),\n 'posts_per_page' => -1]);\n // get single product according to option\n $args = array(\n 'post_type'\t\t=>\tarray('product', 'product_variation'),\n 'post_status' => array('publish'),\n 'meta_query'\t=>\tarray(\n array(\n 'key' => '_sku',\n 'value'\t=>\t$single_sku\n )\n )\n );\n if(!empty($single_sku)){\n $products = get_posts($args);\n }\n $requests = [];\n $json_requests = [];\n\n\n // loop trough products\n foreach($products as $product) {\n\n $meta = get_post_meta($product->ID);\n $method = in_array($meta['_sku'][0], $SKU) ? 'PATCH' : 'POST';\n\n $terms = get_the_terms(($product->post_type == 'product_variation' ? $product->post_parent : $product->ID), 'product_cat' );\n\n foreach ( $terms as $term ) {\n $cat_id = $term->id;\n }\n $attr = get_the_terms ( ($product->post_type == 'product_variation' ? $product->post_parent : $product->ID), 'pa_size' );\n $size = $attr[0]->name;\n\n $attributes = wc_get_product($product->ID)->get_attributes();\n $product_attr = get_post_meta($product->ID, '_product_attributes' );\n foreach ($product_attr as $attr) {\n foreach ($attr as $attribute) {\n $attrnames = str_replace(\"pa_\", \"\", $attribute['name']);\n }\n }\n //\n $body =[\n 'PARTNAME' => $meta['_sku'][0],\n 'PARTDES' => $product->post_title,\n 'BASEPLPRICE' => (float) $meta['_regular_price'][0],\n 'INVFLAG' => ($meta['_manage_stock'][0] == 'yes') ? 'Y' : 'N',\n 'SPEC1' => $terms[0]->name\n ];\n // here I need to apply filter to manipulate the json\n $body['product'] = $product;\n $body = apply_filters('simply_sync_items_to_priority',$body);\n unset($body['product']);\n $res = $this->makeRequest($method, 'LOGPART', ['body' => json_encode($body)], $this->option('log_items_web', true));\n if (!$res['status']) {\n $this->sendEmailError(\n $this->option('email_error_sync_items_web'),\n 'Error Sync Items Web',\n $res['body']\n );\n }\n }\n\n // add timestamp\n $this->updateOption('items_web_update', time());\n\n\n }", "public function updateProduct()\n\t{\n\t}", "private function resync_products( array $products ) {\n\n\t\t$integration = facebook_for_woocommerce()->get_integration();\n\n\t\t// re-sync each product\n\t\tforeach ( $products as $product ) {\n\n\t\t\tif ( $product->is_type( 'variable' ) ) {\n\n\t\t\t\t// create product group and schedule product variations to be synced in the background\n\t\t\t\t$integration->on_product_publish( $product->get_id() );\n\n\t\t\t} elseif ( $integration->product_should_be_synced( $product ) ) {\n\n\t\t\t\t// schedule simple products to be updated or deleted from the catalog in the background\n\t\t\t\tif ( Products::product_should_be_deleted( $product ) ) {\n\t\t\t\t\tfacebook_for_woocommerce()->get_products_sync_handler()->delete_products( array( $product->get_id() ) );\n\t\t\t\t} else {\n\t\t\t\t\tfacebook_for_woocommerce()->get_products_sync_handler()->create_or_update_products( array( $product->get_id() ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function sync_products_from() {\n\n\t\t// do the request to get all products\n\t\t$all_products = $this->request('GET', '/products');\n\t\t// loop all returned products\n\t\tforeach ($all_products->products as $product) {\n\n\t\t\t// get all prices for the product\n\t\t\t$prices = $this->request('GET', '/productPrices?productId=' . $product->id);\n\n\t\t\t// if there is aleady such product\n\t\t\t// in our db, update it\n\t\t\tif ($find = Product::where('external_id', '=', $product->id)->first()) {\n\t\t\t\t$fields = $this->billy_to_system_fields($product, 'update');\n\t\t\t\t$find->fill($fields);\n\t\t\t\t$find->save();\n\n\t\t\t\t// update the price\n\t\t\t\tDB::table('prices')\n\t\t\t\t ->where('product_id', $find->id)\n\t\t\t\t ->delete();\n\n\t\t\t\tforeach ($prices->productPrices as $p_price) {\n\t\t\t\t\t$fields = $this->billy_to_system_fields($p_price, 'insert');\n\t\t\t\t\t$fields['product_id'] = $find->id;\n\t\t\t\t\t$new_price = new Price($fields);\n\t\t\t\t\t$new_price->save();\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t// if not - create it\n\t\t\t\t$fields = $this->billy_to_system_fields($product, 'insert');\n\t\t\t\t$new_product = new Product($fields);\n\t\t\t\t$new_product->save();\n\n\t\t\t\tforeach ($prices->productPrices as $p_price) {\n\t\t\t\t\t$fields = $this->billy_to_system_fields($p_price, 'insert');\n\t\t\t\t\t$fields['product_id'] = $new_product->id;\n\t\t\t\t\t$new_price = new Price($fields);\n\t\t\t\t\t$new_price->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn redirect('/products');\n\n\t}", "function assign_wc_products(){\r\n\t\t$wc_prods = new WP_Query(array(\r\n\t\t\t\t'post_type'=>'product', \r\n\t\t\t\t'posts_per_page'=>-1,\r\n\t\t\t\t'tax_query' => array(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'taxonomy' => 'product_cat',\r\n\t\t\t\t\t\t'field' => 'slug',\r\n\t\t\t\t\t\t'terms' => 'ticket',\r\n\t\t\t\t\t),\r\n\t\t\t\t),\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\tob_start();\r\n\r\n\t\t?><div style='text-align:center;padding:15px'><?php\r\n\r\n\t\tif($wc_prods->have_posts()):\r\n\t\t\t?>\r\n\t\t\t<p><?php _e('Select a WC Product to assign this event ticket, instead of the already assigned WC Product','evotx');?><br/><br/>\r\n\t\t\t<i><?php _e('This event ticket is currently assigned to the below WC Product!','eventon');?></i><br/><code> (ID: <?php echo $_POST['wcid'];?>) <?php echo get_the_title($_POST['wcid']);?></code></p>\r\n\r\n\t\t\t<select class='field' name='evotx_wcid'><?php\r\n\r\n\t\t\twhile($wc_prods->have_posts()): $wc_prods->the_post();\r\n\r\n\t\t\t\t$selected = (!empty($_POST['wcid']) && $wc_prods->post->ID == $_POST['wcid'])? 'selected=\"selected\"':'';\r\n\r\n\t\t\t\t?><option <?php echo $selected;?> value=\"<?php echo $wc_prods->post->ID;?>\">(ID: <?php echo $wc_prods->post->ID;?>) <?php the_title();?></option><?php\r\n\t\t\tendwhile;\r\n\r\n\t\t\t?></select>\r\n\r\n\t\t\t\t<br/><br/><p><i><?php _e('NOTE: When selecting a new WC Product be sure the product is published and can be assessible on frontend of your website','evotx');?></i></p>\r\n\t\t\t\t<p style='text-align:center; padding-top:10px;'>\r\n\t\t\t\t\t<span class='evo_btn evotx_submit_manual_wc_prod' data-eid=\"<?php echo $_POST['eid'];?>\"><?php _e('Save Changes','eventon');?></span>\r\n\t\t\t\t</p>\r\n\t\t\t\t<?php\r\n\r\n\t\t\twp_reset_postdata();\r\n\t\telse:\r\n\t\t\t?><p><?php _e('You do not have any items saved! Please add new!','eventon');?></p><?php\r\n\t\tendif;\r\n\r\n\t\techo \"</div>\";\r\n\r\n\t\techo json_encode(array('content'=>ob_get_clean(), 'status'=>'good')); exit;\r\n\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ensure the new password is at least the minimum length as specified in System Settings
public function validatePasswordLength() { $validated = true; $fieldNewPassword = $this->getProperty('fieldNewPassword','password_new'); $newPassword = $this->dictionary->get($fieldNewPassword); $minLength = $this->modx->getOption('password_min_length',null,8); if (empty($newPassword) || strlen($newPassword) < $minLength) { $this->errors[$fieldNewPassword] = $this->modx->lexicon('login.password_too_short',array('length' => $minLength)); $validated = false; } return $validated; }
[ "public function getPasswordMinLength();", "function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}", "private function checkpassword() {\r\n\t\t$variable = \"password\";\r\n\t\tif(!$this->checkStrelenshorterthan($this->$variable, 20) or !$this->checkStrelenlongerthan($this->$variable, 6)) {\r\n\t\t\t$this->setAddResultRecord(\"Error: Password should not be more than 20 and less than 6 number.<br>\");\r\n\t\t\t$this->validated = 0;\r\n\t\t}\r\n\t}", "public function testGeneratePasswordMinimumLength(): void\n {\n $str = \\AWonderPHP\\PluggableUnplugged\\UnpluggedStatic::generatePassword(12);\n $actual = strlen($str);\n $expected = 12;\n $this->assertEquals($expected, $actual);\n }", "public function validatePassword()\n {\n\t\tif ((strlen($this->newPasswordInput1) < 8) || (strlen($this->newPasswordInput1) > 20))\n\t\t{\n\t\t\t$this->error_password[] = \"Password has to consist of 8 to 20 characters\";\n\t\t}\n\t\t\n\t\tif ($this->newPasswordInput1 != $this->newPasswordInput2)\n\t\t{\n\t\t\t$this->error_password[] = \"Passwords are not the same\";\n\t\t}\n\t}", "public function checkPasswordReturnsTrueWithValidAlphaCharClassPasswordAndFixedHash() {}", "public function getMinimumPasswordLength()\n {\n return (int)SG_Variables::getInstance()->get(\n 'user_minimum_password_length', \n 6\n );\n }", "public function setTooShortPasswordMessage() {\n\t\t$this->message .= 'Password has too few characters, at least 6 characters.<br />';\n\t}", "function wpwebapp_get_minimum_pw_length() {\n\t$options = wpwebapp_get_plugin_options_security();\n\tif ( $options['minimum_password_length'] === '' ) {\n\t\treturn '8';\n\t} else {\n\t\treturn $options['minimum_password_length'];\n\t}\n}", "function checkPasswordLength($password) {\r\n return strlen($password) >= 6;\r\n}", "public function testGeneratePasswordTooLong(): void\n {\n $str = \\AWonderPHP\\PluggableUnplugged\\UnpluggedStatic::generatePassword(512);\n $actual = strlen($str);\n $expected = 255;\n $this->assertEquals($expected, $actual);\n }", "public function min_password_length()\r\n\t{\r\n\t\treturn $this->CI->login->auth_security['min_password_length'];\r\n\t}", "function validatePassword($input){\n\t\tif(strlen($input) >= 8){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function isValidPassword($password)\r\n{\r\n if (strlen($password) >= 6) {\r\n return $password;\r\n }\r\n}", "public function testGeneratePasswordMaxLength(): void\n {\n $str = \\AWonderPHP\\PluggableUnplugged\\UnpluggedStatic::generatePassword(255);\n $actual = strlen($str);\n $expected = 255;\n $this->assertEquals($expected, $actual);\n }", "public static function setPasswordMinLength($length){\n Configuration::where('id', 1)\n ->update(['password_min_length' => $length]);\n }", "public function min_password_length()\n\t{\n\t\treturn $this->CI->auth->auth_security['min_password_length'];\n\t}", "public function testIncorrectPasswordLength()\n {\n $this->visit('/register')\n ->type('blaa', 'name')\n ->type('tester@gmail.com', 'email')\n ->type('secret', 'password')\n ->type('secret', 'password_confirmation')\n ->press('Register')\n ->see('The password must be at least 8 characters');\n }", "function username_more_than_sixteen($input){\r\n if (strlen($input) > 16){\r\n $result = true;\r\n $_SESSION['passwordVerified'] = true;\r\n header('location: accountchange.php?error=usernamelong');\r\n exit;\r\n }\r\n else {\r\n $result = false;\r\n }\r\n return $result;\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compile a where not in subselect clause.
protected function compileWhereNotInSub(WhereBuilder $query, $where) { return $this->wrap($where['column']).' not in ('.$this->compileSelect($where['query']).')'; }
[ "protected function whereNotInSub(Builder $query, array $where)\n {\n return $this->wrap($where['column']) . ' not in (' . $this->compileSelect($where['query']) . ')';\n }", "protected function where_not_in($where)\n\t{\n\t\t$parameters = $this->parameterize($where['values']);\n\n\t\treturn $this->wrap($where['column']).' NOT IN ('.$parameters.')';\n\t}", "protected function whereNotInSub(Builder $query, $where)\n {\n $select = $this->compileSelect($where['query']);\n\n return $where['column'] . ' not in (' . $select . ')';\n }", "public function notIn($x, $y)\n {\n /*if($y instanceof QueryBuilder){\n \t$y = array($y->getSQL());\n }*/\n \n return new Func($x . ' NOT IN', $y);\n }", "public function notIn($expression);", "private function stringBuilderNotIn() {\n $column = $this->getQuotedCurrentColumn();\n return $column.' NOT IN ('.$this->getValueStringForConditionIn().')';\n }", "public function where_not_in($field, $val=array());", "public function where_not_in($column_name, $values_count) {\n $column_name = $this->_quote_identifier($column_name);\n $placeholders = $this->_create_placeholders($values_count);\n return $this->_add_where(\"{$column_name} NOT IN ({$placeholders})\");\n }", "public function where_not_in($field = \"\", $in = array()) {\n if (empty($field)) {\n show_error(\"Mongo field is require to perform where not in query.\", 500);\n }\n\n if (is_array($in) && count($in) > 0) {\n $this->_w($field);\n $this->wheres[$field]['$nin'] = $in;\n return ($this);\n } else {\n show_error(\"in value should be an array.\", 500);\n }\n }", "public function where_not_in($column_name, $values)\n {\n }", "public function get_records_notin($table, $fields='*', $where, $ncol, $narray)\r\n\t{\r\n\t\t\tif($fields)\r\n\t\t\t\t$this->db->select($fields);\r\n\t\t\tif(!empty($where))\r\n\t\t\t\t$this->db->where($where);\r\n\t\t\tif(!empty($narray))\r\n\t\t\t\t$this->db->where_not_in($ncol, $narray);\r\n\t\t\treturn $this->db->get($table)->result();\t\t\r\n\t\t\t\r\n\t}", "public function notInWhere($expr, $values, $useOrWhere=null);", "public function testGettingSqlForNotInConditionWithParameters()\n {\n $condition = new NotInCondition('foo', [[1, PDO::PARAM_INT], [2, PDO::PARAM_INT], [3, PDO::PARAM_INT]]);\n $this->assertEquals('foo NOT IN (?,?,?)', $condition->getSql());\n }", "public function notIn() {\n\t\t$this->string[] = ' NOT IN ';\n\t\treturn $this;\n\t}", "public function addNotIn($column, $params, $operand = 'AND');", "public function notIn(TokenConditionNotIn $token, TokenBase $previous = null) {\n\t\treturn \"\\t{$token->property} NOT IN [\" . implode(',', is_array($token->value) ? $token->value : array()) . ']';\n\t}", "public function testNotIn()\n {\n $exp = $this->_commonField->notIn(range(0, 10));\n $this->_testExpression($exp, 'NOT IN');\n }", "public static function notIn(...$values): self\n {\n return new self('!in', $values);\n }", "function notIn($x, $y, $and=null, ...$args)\n {\n $expression = array();\n array_push($expression, $x, _notIN, $y, $and, ...$args);\n return $expression;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get latest 'n' comments that are posted to blogs
public function _get_last_blog_comments($number = -1) { $_comments = array(); $qb = net_nehmer_comments_comment::new_query_builder(); $qb->add_constraint('status', '>=', 4); $_res = $qb->execute(); foreach($_res as $comment) { $qb2 = midcom_db_article::new_query_builder(); $qb2->add_constraint('guid', '=', $comment->objectguid); $qb2->add_constraint('topic', '=', $this->_config->get('blog_topic_id')); $_res2 = $qb2->execute(); if (count($_res2)) { $_comments[$comment->metadata->created]['type'] = 'blog'; $_comments[$comment->metadata->created]['object'] = $comment; krsort($_comments); } } if ( isset($number) && $number != -1 && count($_comments) > $number) { $_comments = array_splice($_comments, 0, $number); } return $_comments; }
[ "public function retrieveComments() \n {\n // ref: https://stackoverflow.com/questions/24860973/laravel-how-to-get-last-n-entries-from-db\n // That took some googling to figure out lol\n $comments = Comments::orderBy('id', 'desc')->take(5)->get();\n return $comments;\n }", "public static function getRecentComments()\n {\n return self::find()\n ->orderBy(['created_at' => SORT_DESC])\n ->limit(3)\n ->all();\n }", "public function recentComments()\n {\n return $this->replies()->with(['recentComments' => function($query) {\n $query->take(3);\n }])->latest();\n }", "function _show_most_commented($params = array()) {\n\t\tif (!empty($_GET[\"id\"])) {\n\t\t\t$_GET[\"page\"] = intval($_GET[\"id\"]);\n\t\t\tunset($_GET[\"id\"]);\n\t\t}\n\t\t// Get most commented posts\n\t\t$sql = \"SELECT \n\t\t\t\tc.object_id AS post_id,\n\t\t\t\tb.user_id,\n\t\t\t\tb.add_date AS post_date,\n\t\t\t\tb.privacy,\n\t\t\t\tb.allow_comments,\n\t\t\t\tb.title AS post_title, \n\t\t\t\tb.num_reads, \n\t\t\t\tCOUNT(c.id) AS num_comments,\n\t\t\t\tSUBSTRING(b.text FROM 1 FOR \".intval(module('blog')->POST_TEXT_PREVIEW_LENGTH).\") AS post_text \n\t\t\tFROM \".db('comments').\" AS c,\n\t\t\t\t\".db('blog_posts').\" AS b \n\t\t\tWHERE c.object_name='\"._es('blog').\"' \n\t\t\t\tAND b.active=1 \n\t\t\t\tAND b.id=c.object_id \n\t\t\t\tAND b.privacy NOT IN(9)\n\t\t\t\tAND b.allow_comments NOT IN(9)\n\t\t\tGROUP BY c.object_id \n\t\t\t\";\n\t\t// Geo filter\n\t\tif (module('blog')->ALLOW_GEO_FILTERING && GEO_LIMIT_COUNTRY != \"GEO_LIMIT_COUNTRY\" && GEO_LIMIT_COUNTRY != \"\") {\n\t\t\t$sql .= \" HAVING b.user_id IN (SELECT id FROM \".db('user').\" WHERE country = '\"._es(GEO_LIMIT_COUNTRY).\"') \";\n\t\t}\n\t\t$order_by_sql = \" ORDER BY num_comments DESC\";\n\t\t// Prepare pager\n\t\t$path = \"./?object=\".'blog'.\"&action=\".$_GET[\"action\"];\n\t\t$GLOBALS['PROJECT_CONF'][\"divide_pages\"][\"SQL_COUNT_REWRITE\"] = false;\n\t\tlist($add_sql, $pages, $total, $counter) = common()->divide_pages($sql, $path, null, module('blog')->STATS_NUM_MOST_COMMENTED * module('blog')->FROM_DB_MULTIPLY);\n\t\t// Get from db\n\t\t$Q = db()->query($sql. $order_by_sql. $add_sql);\n\t\twhile ($A = db()->fetch_assoc($Q)) {\n\t\t\t$blog_comments_ids[$A[\"post_id\"]] = $A;\n\t\t\t$users_ids[$A[\"user_id\"]] = $A[\"user_id\"];\n\t\t}\n\t\tunset($users_ids[\"\"]);\n\t\t// Get users infos and settings\n\t\tif (!empty($users_ids))\t{\n\t\t\t$this->_users_infos = user($users_ids, array(\"id\",\"name\",\"nick\",\"profile_url\",\"photo_verified\"), array(\"WHERE\" => array(\"active\" => 1)));\n\t\t\t$this->_users_blog_settings = module('blog')->_get_blog_settings_for_user_ids($users_ids);\n\t\t}\n\t\t$posts_ids = array_keys($blog_comments_ids);\n\t\tif (!empty($posts_ids)) {\n\t\t\t$this->_num_comments = module('blog')->_get_num_comments(implode(\",\",$posts_ids));\n\t\t}\n\t\t// Process most commented posts\n\t\t$most_commented_posts\t= $this->_process_stats_item($blog_comments_ids, $counter, module('blog')->STATS_NUM_MOST_COMMENTED, $params);\n\n\t\t// For widgets\n\t\tif ($params[\"for_widgets\"]) {\n\t\t\t// Process main template\n\t\t\t$replace = array(\n\t\t\t\t\"most_commented_posts\"\t=> $most_commented_posts,\n\t\t\t);\n\t\t\treturn tpl()->parse('blog'.\"/widget_most_commented\", $replace);\n\t\t}\n\n\t\t// Process main template\n\t\t$replace = array(\n\t\t\t\"is_logged_in\"\t\t\t=> intval((bool) main()->USER_ID),\n\t\t\t\"show_own_posts_link\"\t=> main()->USER_ID ? \"./?object=\".'blog'.\"&action=show_posts\"._add_get(array(\"page\")) : \"\",\n\t\t\t\"change_settings_link\"\t=> main()->USER_ID ? \"./?object=\".'blog'.\"&action=settings\"._add_get(array(\"page\")) : \"\",\n\t\t\t\"all_blogs_link\"\t\t=> \"./?object=\".'blog'.\"&action=show_all_blogs\"._add_get(array(\"page\")),\n\t\t\t\"most_commented_posts\"\t=> $most_commented_posts,\n\t\t\t\"pages\"\t\t\t\t\t=> $pages,\n\t\t\t\"total\"\t\t\t\t\t=> intval($total),\n\t\t);\n\t\treturn tpl()->parse('blog'.\"/most_commented_main\", $replace);\n\t}", "function ca_comment_latest_posts ($count=10, $show_count='yes', $before='<li>', $after='</li>', $before_count='(', $after_count=')') {\nglobal $wpdb, $comment;\n\n $comments=$wpdb->get_results(\"SELECT id\n ,post_title\n ,COUNT(*) cnt \n FROM $wpdb->comments, $wpdb->posts \n WHERE comment_approved = '1' \n AND comment_post_id = id \n GROUP BY id, post_title \n ORDER BY comment_date DESC\");\n\n foreach($comments as $comment) {\n echo $before.'<a href=\"'.get_permalink($comment->id).'\">'.stripslashes($comment->post_title).'</a>';\n if ($show_count != 'no')\n echo $before_count.$comment->cnt.$after_count;\n echo $after;\n if (++$ccount == $count) break;\n }\n}", "function get_most_commented_posts($instance){\n global $wpdb;\n $time_start = $instance['lapse'] > 0 ? date('Y-m-d', strtotime(\"-\".$instance['lapse'].\" day\", time())) : 0;\n \n $most_commented = '\n SELECT\n DATE(post_date) AS post_date,\n id,\n post_title,\n post_status,\n guid,\n comment_count AS post_comment_count,\n terms.term_id as cat_id\n FROM ' . $wpdb->prefix . 'posts post INNER JOIN ' . $wpdb->prefix . 'term_relationships rel ON post.ID = rel.object_id\n INNER JOIN ' . $wpdb->prefix . 'term_taxonomy ttax ON rel.term_taxonomy_id = ttax.term_taxonomy_id\n INNER JOIN ' . $wpdb->prefix . 'terms terms ON ttax.term_id = terms.term_id\n INNER JOIN ' . $wpdb->prefix . 'comments ON ' . $wpdb->prefix . 'comments.comment_post_ID = post.ID\n WHERE\n post.post_type = \"post\"\n AND post.post_status = \"publish\"\n AND post.post_date > \"'.$time_start.'\"\n AND ' . $wpdb->prefix . 'comments.comment_approved = 1\n AND ttax.taxonomy = \"category\"\n AND post.post_date > \"'.$time_start.'\"\n '.(($instance['category'] > 0) ? 'AND terms.term_id = \"'.$instance['category'].'\"' : NULL).'\n GROUP BY\n id\n ORDER BY\n post_comment_count DESC,\n post_date DESC\n LIMIT ' . $instance['post_number'];\n\n $most_commented_posts = $wpdb->get_results($most_commented);\n\n $indx = 0;\n if ( get_option('permalink_structure') ) {\n foreach ($most_commented_posts as $post) {\n $most_commented_posts[$indx]->permalink = get_permalink($post->id);\n $indx++;\n }\n }\n return $most_commented_posts;\n }", "function get_mostcommented($limit = 5) {\n global $wpdb, $post, $tableposts, $tablecomments, $time_difference, $post;\n $mostcommenteds = $wpdb->get_results(\"SELECT $tableposts.ID as ID, post_title, post_name, COUNT($tablecomments.comment_post_ID) AS 'comment_total' FROM $tableposts LEFT JOIN $tablecomments ON $tableposts.ID = $tablecomments.comment_post_ID WHERE comment_approved = '1' AND post_date < '\".date(\"Y-m-d H:i:s\", (time() + ($time_difference * 3600))).\"' AND post_status = 'publish' AND post_password = '' GROUP BY $tablecomments.comment_post_ID ORDER BY comment_total DESC LIMIT $limit\");\n foreach ($mostcommenteds as $post) {\n\t\t\t$post_id = (int) $post->post_id;\n\t\t\t$post_title = htmlspecialchars(stripslashes($post->post_title));\n\t\t\t$comment_total = (int) $post->comment_total;\n $permalink = get_permalink($post->ID);\n\t\t\techo \"+ <a href=\\\"$permalink\\\">$post_title</a> ($comment_total)<br />\";\n }\n}", "public function getAllPostsWithNewComment($limit){\n $entityManager = $this->getEntityManager();\n $queryBuilder = $entityManager->createQueryBuilder();\n $queryBuilder\n ->select('bp')\n ->from('App:BlogPost', 'bp')\n ->join('bp.comments','c','WITH', 'bp.id=c.blogPost')\n ->orderBy('c.updatedAt','DESC')\n ->setMaxResults($limit);\n\n return $queryBuilder->getQuery()->getResult();\n }", "public function get3LatestBlogposts()\n {\n // Connects to db\n $this->db->connect();\n\n // SQL statement\n $sql = \"SELECT * FROM content WHERE `type` = 'post' LIMIT 3;\";\n\n // Executes SQL statement and fetches data from db\n // Fetches data from db and stores in $resultset\n $result = $this->db->executeFetchAll($sql);\n\n // Returns result\n return $result;\n }", "function getMostCommented(){\n $boards = $this->getBoardsMapper()->select('*',NULL , array(\n 'group'=>NULL,\n 'order'=>'commentNumber DESC',\n 'limit'=>4,\n 'offset'=>0\n ));\n return $boards;\n }", "public function allLastComments()\n {\n $db = $this->dbConnect();\n $req = $db->query('SELECT id, author, comment, post_id, DATE_FORMAT(comment_date, \\'%d/%m/%Y à %Hh%imin%ss\\') AS comment_date_fr, reported FROM comments ORDER BY comment_date DESC LIMIT 0, 3');\n \n return $req;\n }", "public static function getLatestReceivedComments($user_id, $count = 5)\n {\n $c = new Criteria();\n $c->add(sfCommentPeer::COMMENTABLE_MODEL, 'ReaktorArtwork');\n $c->add(sfCommentPeer::NAMESPACE, 'frontend'); \n $c->add(sfCommentPeer::AUTHOR_ID, $user_id, Criteria::NOT_EQUAL);\n $c->add(ReaktorArtworkPeer::USER_ID, $user_id);\n $c->setLimit($count);\n $c->addDescendingOrderByColumn(sfCommentPeer::CREATED_AT);\n return sfCommentPeer::doSelectJoinUserAndArtwork($c);\n }", "public function getComments_five($i) \n { \n $comments = [];\n $req = $this->db->query('SELECT *, DATE_FORMAT(date_comment, \"%d/%m/%Y à %H:%i:%s\") as date_comment FROM Comments ORDER BY reports DESC, date_comment DESC LIMIT '. (($i - 1) * 5) .', 5');\n while ($data = $req->fetch(\\PDO::FETCH_ASSOC)) \n {\n $comments[] = $data;\n }\n return $comments;\n }", "private function _downloadcomments()\r\n\t{\t\t\r\n\t\t$commentCount\t= 0;\r\n\t\t$currentUri\t\t= str_replace('%user%', strtolower($this->_userName), REDDIT_USER_COMMENTS_URI);\r\n\t\t$commentData\t= array();\r\n\r\n\t\twhile ($commentCount < $this->_commentsToRetrieve) {\r\n\t\t\t\r\n\t\t\t$commentPage = json_decode($this->_getPageData($currentUri));\r\n\t\t\t$commentData = array_merge($commentData, $commentPage->data->children);\r\n\t\t\t$commentCount += count($commentData->data->children);\r\n\r\n\t\t\tif (count($commentData->data->children) == 25) {\r\n\t\t\t\t$currentUri = str_replace('%user%', strtolower($this->_username), REDDIT_USER_COMMENTS_URI);\r\n\t\t\t\t$currentUri .= '?count=' . $commentCount . '&after=' . $commentData->data->children[24]->data->name;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t\r\n\t\treturn $commentData;\r\n\t}", "function getBlogComments(){\n $blogid = ($_GET['id']);\n $comments = Comments::getComments($blogid);\n return $comments;\n }", "public function getRecentPosts() {\n $sql = \"SELECT * FROM blogpost ORDER BY post_date DESC LIMIT 5\";\n $result = $this->db->query($sql);\n return mysqli_fetch_all($result, MYSQLI_ASSOC);\n }", "public function getComments($limit = 7)\n {\n $limit = (int) $limit;\n\n return $this->db->select(\"SELECT * FROM `comments` ORDER BY `post_time` DESC LIMIT $limit\");\n }", "function dp_recent_comments($no_comments = 10, $comment_len = 75) { \n global $wpdb; \n\t\n\t$request = \"SELECT * FROM $wpdb->comments\";\n\t$request .= \" JOIN $wpdb->posts ON ID = comment_post_ID\";\n\t$request .= \" WHERE comment_approved = '1' AND post_status = 'publish' AND post_password ='' AND comment_type = ''\"; \n\t$request .= \" ORDER BY comment_date DESC LIMIT $no_comments\"; \n\t\t\n\t$comments = $wpdb->get_results($request);\n\t\t\n\tif ($comments) { \n\t\tforeach ($comments as $comment) { \n\t\t\tob_start();\n\t\t\t?>\n\t\t\t\t<li>\n\t\t\t\t\t <?php echo get_avatar($comment,$size='40' ); ?> \n\t\t\t\t\t<a href=\"<?php echo get_permalink( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID; ?>\"><?php echo dp_get_author($comment); ?>:</a>\n\t\t\t\t\t<?php echo strip_tags(substr(apply_filters('get_comment_text', $comment->comment_content), 0, $comment_len)); ?>\n \t\t\t\t</li>\n\t\t\t<?php\n\t\t\tob_end_flush();\n\t\t} \n\t} else { \n\t\techo \"<li>No comments</li>\";\n\t}\n}", "function getRecentComments() {\n global $con;\n try {\n $sql = \"SELECT `comment`, username, `id`, `title`, `title_id` FROM `comments` ORDER BY `id` DESC LIMIT 3\";\n $sql = $con->prepare($sql);\n $sql->execute();\n buildRecentComments($sql->fetchAll());\n } catch (PDOException $e) {\n echo $e;\n }\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this is where all the work gets done in the afterhook when this function all the libraries are loaded, and the job is in two formats, a hash and an object both have the same information just added both for convenience settings is the stdobj that has all the site settings minus env variables notice here how we have to have the POST_AFTER_JOBS set in users/private_init.php for us to post stuff this allows the after hook to run in development machines without adding test data
function do_main_work($settings,$job,$job_hash) { if (getenv('POST_AFTER_JOBS')) { $url_to_use = 'https://hooks.zapier.com/hooks/catch/772315/t2d54t/'; $results = rest_helper($url_to_use, $params = $job_hash, $verb = 'POST', $format = 'json'); publish_to_sns('afterhook posting results to zapier', $results); } }
[ "private function assign_global_variables()\n {\n $this->api_key = $this->arr_payload['api_key'];\n $this->action_datetime = $this->arr_payload['datetime'];\n $this->stage_payload = $this->arr_payload['stage_payload'];\n $this->sender_id = $this->arr_payload['sender_id'];\n $this->password = $this->arr_payload['password'];\n $this->override = $this->arr_payload['override'];\n\n if(isset($this->arr_payload['client_id'])) { $this->client_id = $this->arr_payload['client_id']; }\n if(isset($this->arr_payload['partner_id'])) { $this->partner_id = $this->arr_payload['partner_id']; }\n\n if(isset($this->arr_payload['users'])) {$this->arr_users = $this->arr_payload['users']; } // This will be a multi-dimensional array\n if(isset($this->arr_payload['clients'])) {$this->arr_clients = $this->arr_payload['clients']; }\n if(isset($this->arr_payload['partners'])) {$this->arr_partners = $this->arr_payload['partners']; }\n\n }", "function __preRun_Static_Data()\n {\n\n /*CONFIG FILE - SET TO DATA ARRAY*/\n $this->data['config'] = $this->config->config;\n /*BASE URL's*/\n $this->data['vars']['site_url'] = site_url(); //main\n $this->data['vars']['site_url_client'] = site_url('/client'); //clients\n $this->data['vars']['site_url_admin'] = site_url('/admin'); //admin\n $this->data['vars']['site_url_api'] = site_url('/api'); //api\n $this->data['vars']['site_url_current_page'] = current_url();\n /*PAYPAL IPN URL*/\n $this->data['vars']['paypal_ipn_url'] = site_url('/api/paypalipn'); //admin\n\n /*CR0N JOB LINK\n *--------------------------------------------------------------------\n * url has special key to prevent anyone running this cron urls'\n * key must be changed to make it unique in the settings.php file\n *--------------------------------------------------------------------\n */\n $this->data['vars']['cronjobs_url_general'] = site_url('/admin/cronjobs/general/' . $this->data['config']['security_key']);\n /*ALLOWED FILE TYPES LIST - HUMAN READABLE\n * used mainly to display files types that are allowed in 'info/help' tips for users\n */\n if ($this->config->item('files_allowed_types') === 0) {\n $this->data['vars']['allowed_file_types_human_readable'] = $this->data['lang']['lang_all'];\n } else {\n $this->data['vars']['allowed_file_types_human_readable'] = str_replace('|', ', ', $this->config->item('files_allowed_types'));\n }\n\n }", "protected function initHookObjects() {}", "abstract protected function initJobs();", "public function testPostJobConfig()\n {\n }", "function MyApp_Setup_Globals_Load()\n {\n $hash=$this->MyApp_Setup_Globals_Read();\n $this->MyHash_Args2Object($hash);\n }", "public function tieInCommonConfiguration () {\r\n // Get a Cookie/Session storage object; By default,\r\n // every object should have it's own cookie;\r\n $this->objCookie = new CookieStorage ($this);\r\n\r\n // Get the SKIN information;\r\n if (self::checkSessionVar (new S ('skin'), new O (SKIN))->toBoolean () == FALSE)\r\n $objSkin = self::getSessionVar (new S ('skin')); else $objSkin = new S (SKIN);\r\n\r\n // Get the LANG information;\r\n if (self::checkSessionVar (new S ('language'), new O (LANGUAGE))->toBoolean () == FALSE)\r\n $objLang = self::getSessionVar (new S ('language')); else $objLang = new S (LANGUAGE);\r\n\r\n // Set some predefined defaults ...\r\n\t\t$this->objDataArray\t = new A;\r\n $this->objPathToModule = new FilePath (MOD_DIR . _S . $this->getObjectCLASS ()->toLower ());\r\n $this->objPathToAdmin = new FilePath ($this->objPathToModule->toRelativePath () . _S . ADMIN_DIR . _S);\r\n $this->objPathToSkin = new FilePath ($this->objPathToModule->toRelativePath () . _S . SKIN_DIR_DIR . _S . $objSkin . _S);\r\n $this->objPathToLang = new FilePath ($this->objPathToModule->toRelativePath () . _S . LANGUAGE_DIR . _S . $objLang . _S);\r\n }", "private function _setCoreParams()\n {\n $data = Registry::getAll();\n\n $this->assign(array(\n 'demo_username' => isset($data['config']['demo_username']) ? $data['config']['demo_username'] : null,\n 'demo_password' => isset($data['config']['demo_password']) ? $data['config']['demo_password'] : null,\n 'user_info' => isset($data['user_info']) ? $data['user_info'] : null,\n 'navigation' => isset($data['navigation']) ? $data['navigation'] : null, // Pass navigation to templates\n 'settings' => $data['settings'],\n 'addons' => $data['addons'],\n 'config' => $data['config'],\n 'runtime' => $data['runtime'],\n '_REQUEST' => $_REQUEST, // we need escape the request array too (access via $smarty.request in template)\n 'auth' => \\Tygh::$app['session']['auth'],\n 'server_env' => \\Tygh::$app['server.env'] // Pass server environment to templates\n ));\n }", "public function hookInitialize()\n {\n require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'jobs' . DIRECTORY_SEPARATOR . 'import.php';\n require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'jobs' . DIRECTORY_SEPARATOR . 'sync.php';\n require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'APIfunctions.php';\n }", "function edujobs_init() {\n\t// set default values\n\tdefine('DEFAULT_COUNTRY', 'Colombia');\t// set default country\n\tdefine('DEFAULT_PUBLISH_PERIOD', 'pp15');\t// set published period\n\tdefine('DATE_FORMAT', 'M j, Y');\t// set default date format\n\tdefine('JOB_STATUS_NORMAL', 'normal');\t// set applicant job status to normal\n\tdefine('JOB_STATUS_FAVORITE', 'favorite');\t// set applicant job status to favorite\n\tdefine('JOB_STATUS_REJECTED', 'rejected');\t// set applicant job status to rejected\n\tdefine('DEFAULT_LANG', 'Spanish');\t// set default language\n\tdefine('DEFAULT_CURRENCY', 'COP');\t// set default currency\n\t\n\t$current_site = elgg_get_site_entity();\n\t$temp = array();\n\t$temp = explode(\".\", get_site_domain($current_site->guid));\n\tif (in_array(\"sandbox\", $temp)) {\n\t\tdefine('COLEGIO_PROFILE_TYPE_GUID', 77);\t// set colegio guid from profile manager\n\t\tdefine('DOCENTE_PROFILE_TYPE_GUID', 75);\t// set colegio guid from profile manager\n\t}\t\n\telse if (in_array(\"edufolium\", $temp)) {\n\t\tdefine('COLEGIO_PROFILE_TYPE_GUID', 77);\t// set colegio guid from profile manager\n\t\tdefine('DOCENTE_PROFILE_TYPE_GUID', 75);\t// set colegio guid from profile manager\n\t}\n\telse {\n\t\tdefine('COLEGIO_PROFILE_TYPE_GUID', 287);\t// set colegio guid from profile manager\n\t\tdefine('DOCENTE_PROFILE_TYPE_GUID', 288);\t// set colegio guid from profile manager\t\n\t}\t\n\n\t\n // register a library of helper functions\n elgg_register_library('elgg:edujobs', elgg_get_plugins_path() . 'edujobs/lib/edujobs.php');\n \n // register plugin js\n elgg_register_js('edujobsjs', elgg_get_site_url() . 'mod/edujobs/assets/edujobs.js');\n \n // Register subtype\n run_function_once('edujobs_run_once_subtypes');\n \n // Register entity_type for search\n elgg_register_entity_type('object', Edujobs::SUBTYPE);\n \n // Site navigation\n $item = new ElggMenuItem('edujobs', elgg_echo('edujobs:menu'), 'edujobs/jobs');\n elgg_register_menu_item('site', $item); \n \n\n // Extend CSS\n elgg_extend_view('css/elgg', 'edujobs/css');\n elgg_extend_view('css/elgg', 'edujobs/jquery-ui');\n\n // Register a page handler, so we can have nice URLs\n elgg_register_page_handler('edujobs', 'edujobs_page_handler');\n \n // Register a URL handler for jobs\n elgg_register_entity_url_handler('object', 'edujobs', 'edujobs_url'); \n \n // Add cv widget\n\telgg_register_widget_type('edujobs',\telgg_echo('edujobs:widget:cv'),\telgg_echo('edujobs:widget:cv:description'));\n\n // Register actions\n $action_path = elgg_get_plugins_path() . 'edujobs/actions/edujobs';\n elgg_register_action(\"edujobs/jobs/add\", \"$action_path/addjob.php\"); \n elgg_register_action(\"edujobs/job/delete\", \"$action_path/deljob.php\"); \n elgg_register_action(\"edujobs/job/unpublish\", \"$action_path/jobunpublish.php\"); \n elgg_register_action(\"edujobs/job/apply\", \"$action_path/jobapply.php\");\n elgg_register_action(\"edujobs/job/setfavorite\", \"$action_path/setfavorite.php\");\n\telgg_register_action(\"edujobs/job/setrejected\", \"$action_path/setrejected.php\");\n\telgg_register_action(\"edujobs/cvs/addcv1\", \"$action_path/goaddcv1.php\"); \n\telgg_register_action(\"edujobs/cvs/addcv2\", \"$action_path/goaddcv2.php\"); \n\telgg_register_action(\"edujobs/cvs/addworkexperience\", \"$action_path/goaddworkexperience.php\"); \n\telgg_register_action(\"edujobs/cvs/addeducation\", \"$action_path/goaddeducation.php\"); \n\telgg_register_action(\"edujobs/cvs/addlanguage\", \"$action_path/goaddlanguage.php\"); \n\telgg_register_action(\"edujobs/cvs/addcv6\", \"$action_path/goaddcv6.php\");\n\telgg_register_action(\"edujobs/cvs/addportfolio\", \"$action_path/goaddportfolio.php\");\n}", "function external_script_initialize()\n{\n\t$config['ext_script_path'] = '/bin/sh';\n\t$config['ext_script'][0]['name'] = '/usr/local/reboot_server.sh';\n\t$config['ext_script'][0]['key'] = 'content';\n\t$config['ext_script'][0]['type'] = 'match';\n\t$config['ext_script'][0]['value'] = 'reboot';\n\t$config['ext_script'][0]['parameter'] = 'phone|id|content';\n\t\n\t$config['ext_script'][1]['name'] = '/usr/local/check_user.sh';\n\t$config['ext_script'][1]['key'] = 'sender';\n\t$config['ext_script'][1]['type'] = 'contain';\n\t$config['ext_script'][1]['value'] = '+62';\n\t$config['ext_script'][1]['parameter'] = 'phone|content';\n\t\n\treturn $config;\n}", "public function setup() {\r\n $config = SiteConfig::current_site_config();\r\n\t\t$username = $config->SurveyMonkeyUserName;\t\t\r\n\t\t$password = $config->SurveyMonkeyPassword; // TODO Decryption logic will go here\r\n\r\n\t\t\r\n\t\t$this->totalSteps = 1;\r\n\t}", "function assignDefaults(){\n\t\t\tglobal $db;\n\t\t\t\n\t\t\t$this->assign(\"CACHING\",$this->caching);\n\t\t\t$this->assign(\"TEMPLATE_ROOT\",SERVER_ROOT . TEMPLATE_ROOT);\n\t\t\t$this->assign(\"SERVER_ROOT\",SERVER_ROOT);\n\t\t\t$this->assign(\"TIME\",$this->stopTiming());\n\t\t\t$this->assign(\"TOTALDBQUERIES\",(int)$db->totq);\t\t\t# total DB queries needed to build page\n\t\t\t$this->assign(\"SELF\",SERVER_ROOT . $_GET['data']);\n\t\t\t$this->assign(\"VERSION\",\"1.90\");\n\t\t\t\n\t\t\tif(function_exists('memory_get_usage')){\n\t\t\t $this->assign(\"MEMORY\",round(memory_get_usage()/(1024*1024),2));\n\t\t }\n\t\t}", "private function _assignFrameworkVars() {\n\t\t// Time session was inited\n\t\t$_SESSION[Config::SESSION_PREFIX.'inited'] = time();\n\t\t\n\t\t// Assign the user agent\n\t\t$_SESSION[Config::SESSION_PREFIX.'user_agent'] = md5(Config::SALT.$_SERVER['HTTP_USER_AGENT']);\n\t\t\n\t\t// Assign the user's IP\n\t\t$_SESSION[Config::SESSION_PREFIX.'ip'] = md5(Config::SALT.$_SERVER['REMOTE_ADDR']);\n\t\t\n\t\t// Last hijack check\n\t\t$_SESSION[Config::SESSION_PREFIX.'hijackcheck'] = time();\n\t}", "protected function init_args() \r\n {\r\n\r\n $this->args = new stdClass();\r\n\r\n $this->args->basehref = $_SESSION['basehref'];\r\n \r\n // get user's data\r\n $this->user = $_SESSION['currentUser'];\r\n $this->args->user_id = $this->user->dbID;\r\n $this->args->user_name = $this->user->getDisplayName();\r\n \r\n $this->args->testproject_id = intval(isset($_SESSION['testprojectID']) ?\r\n $_SESSION['testprojectID'] : 0);\r\n $this->args->testproject_name = isset($_SESSION['testprojectName']) ?\r\n $_SESSION['testprojectName'] : 0;\r\n \r\n $params = array();\r\n $params['setting_refresh_tree_on_action'] = array(\"POST\", tlInputParameter::CB_BOOL);\r\n $params['hidden_setting_refresh_tree_on_action'] =\r\n array(\"POST\", tlInputParameter::INT_N);\r\n\r\n I_PARAMS($params, $this->args);\r\n\r\n // was a filter reset requested?\r\n $this->args->reset_filters = false;\r\n if (isset($_REQUEST['btn_reset_filters'])) {\r\n $this->args->reset_filters = true; // mark filter reset in args\r\n $this->do_filtering = false; // mark that no filtering has to be done after reset\r\n }\r\n \r\n // what filter mode has been chosen?\r\n $this->args->simple_filter_mode = \r\n isset($_REQUEST[self::SIMPLE_FILTER_BUTTON_LABEL]) ? true : false;\r\n $this->args->advanced_filter_mode = \r\n isset($_REQUEST[self::ADVANCED_FILTER_BUTTON_LABEL]) ? true : false; \r\n\r\n $this->args->loadExecDashboard = true;\r\n if( isset($_REQUEST['loadExecDashboard']) )\r\n {\r\n $this->args->loadExecDashboard = intval($_REQUEST['loadExecDashboard']);\r\n } \r\n\r\n }", "protected function setupConfig()\n\t{\n\t\t$this->config = OLPBlackbox_Config::getInstance();\n\t\t$site_config = SiteConfig::getInstance()->asObject();\n\n\t\t//Add site config data to the OLPBlackbox_Config\n\t\tforeach ($site_config as $key => $value)\n\t\t{\n\t\t\t$this->config->$key = $value;\n\t\t}\n\n\t\t$this->config->blackbox_mode = $this->mode;\n\t\t$this->config->debug = new OLPBlackbox_DebugConf();\n\t\t$this->config->title_loan = $this->config_data->title_loan;\n\t\t$this->config->olp_db = $this->config_data->sql;\n\t\t$this->config->event_log = $this->config_data->log;\n\t\t$this->config->session = $this->config_data->session;\n\t\t$this->config->allowSnapshot = TRUE;\n\t\t$this->config->allow_datax_rework = $this->config_data->config->enable_rework;\n\t\t$this->config->do_datax_rework = !empty($_SESSION['do_datax_rework']);\n\t\t$this->config->return_visitor = !empty($_SESSION['return_visitor']);\n\t\t$this->config->track_key = $_SESSION['statpro']['track_key'];\n\t\t$this->config->space_key = $_SESSION['statpro']['space_key'];\n\t\t$this->config->hit_stats_bb = defined('STAT_SYSTEM_2') ? STAT_SYSTEM_2 : FALSE;\n\t\t$this->config->hit_stats_site = TRUE;\n\n\t\t// whether we're on the enterprise site; the actual\n\t\t// enterprise company is available via bb_force_winner?\n\t\t$this->config->is_enterprise = $this->config_data->is_enterprise;\n\t\t$this->config->react_company = $this->getReactCompany();\n\n\t\t$this->config->applog = OLP_Applog_Singleton::Get_Instance(\n\t\t\t'blackbox',\n\t\t\t1000000000,\n\t\t\t20,\n\t\t\tNULL,\n\t\t\tFALSE,\n\t\t\t002\n\t\t);\n\t}", "protected function setup_system_data()\n\t{\n\t\t// Query maximum runtime from php.ini\n\t\t$execution_time = $this->php_ini->getNumeric('max_execution_time');\n\t\t$execution_time = min(15, $execution_time / 2);\n\t\t$this->system_data['max_execution_time'] = $execution_time;\n\n\t\t// Set start time\n\t\t$this->system_data['start_time'] = microtime(true);\n\n\t\t// Get memory limit\n\t\t$this->system_data['memory_limit'] = $this->php_ini->getBytes('memory_limit');\n\t}", "function thaw() {\r\n \r\n $vals = $this->that->ac_get_value($this->id, $this->name);\r\n \r\n $GLOBALS[$this->vars_array] = unserialize($vals);\r\n \r\n if ($this->register_globals && is_array ($GLOBALS[$this->vars_array]) ) {\r\n \r\n reset ($GLOBALS[$this->vars_array]);\r\n while (list ($k, $v) = each ($GLOBALS[$this->vars_array])) {\r\n $GLOBALS[$k] = $v;\r\n $GLOBALS[$this->vars_array][$k] =& $GLOBALS[$k]; // change the entry in user vars array, so it is now a reference pointing to a global variable. \r\n }\r\n \r\n }\r\n \r\n }", "function _configDataObjectsCache()\n {\n // cli works under different users... it may cause problems..\n $this->debug(__METHOD__);\n if (function_exists('posix_getpwuid')) {\n $uinfo = posix_getpwuid( posix_getuid () ); \n $user = $uinfo['name'];\n } else {\n $user = getenv('USERNAME'); // windows.\n }\n \n \n\n $iniCache = ini_get('session.save_path') .'/' . \n 'pdocfg-' . $user . '/'. str_replace('/', '_', $this->project) ;\n \n \n if ($this->appNameShort) {\n $iniCache .= '_' . $this->appNameShort;\n }\n if ($this->version) {\n $iniCache .= '.' . $this->version;\n }\n if ($this->database === false) {\n return;\n }\n \n $dburl = parse_url($this->database);\n if (!empty($dburl['path'])) {\n $iniCache .= '-'.ltrim($dburl['path'],'/');\n }\n \n $iniCache .= '.ini';\n $this->debug(__METHOD__ . \" : ini cache : $iniCache\");\n \n $dburl = parse_url($this->database);\n //override ini setting... - store original..\n \n if (isset($this->PDO_DataObject['schema_location'])) {\n $this->dataObjectsOriginalIni = $this->PDO_DataObject['schema_location'];\n ///print_r($this->DB_DataObject);exit;\n }\n // \n $this->PDO_DataObject['schema_location'] = $iniCache;\n PDO_DataObject::config($this->PDO_DataObject);\n \n // we now have the configuration file name..\n \n if (!file_exists($iniCache) || empty( $this->dataObjectsCacheExpires)) {\n $this->generateDataobjectsCache(true);\n return;\n }\n \n \n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test Root Note Book
public function testNoteBookSub(){ //setup $folderID = rand(0, 999999999); $name = rand(0, 999999999)."Folder123"; $return = array(array("id"=>rand(0, 999999999),"name"=>$name)); $this->expectOutputRegex("{}"); //make sure the js call is made//TODO $model = $this->getMock("Model", array("getFolder")); $model->expects($this->once())//This is call called when a new NoteBook is created ->method("getFolder") ->with($this->equalTo($folderID)); new NoteBook($model,$folderID); }
[ "public function testNoteBookRoot(){\n\t\t\t//setup\n\t\t\t\t$folderID = null;\n\t\t\t\t$name = rand(0, 999999999).\"Folder123\";\n\t\t\t\t$return = array(array(\"id\"=>rand(0, 999999999),\"name\"=>$name));\n\t\t\t\t\t\t\n\t\t\t\t$this->expectOutputRegex(\"{}\"); //make sure the js call is made//TODO\n\t\t $model = $this->getMock(\"Model\", array(\"getRootFolder\"));\n\t\t\t\t\t\t\t\t\n\t\t\t \t$model->expects($this->once())//This is call called when a new NoteBook is created\n\t\t ->method(\"getRootFolder\")\n\t\t ->will($this->returnValue($return));\n\t\t\t\t\t \n\t\t\tnew NoteBook($model,$folderID);\n\t\t}", "public function testGetLibraryDocumentNoteForApiUser()\n {\n }", "public function testAddressBookNoteGetByAddressBookId()\n {\n }", "public function testGetNotes()\n\t{\n\t\t$response = $this->actingAs($this->user)->json('GET', 'api/notes/');\n\n\t\t$response\n\t\t\t->assertSuccessful()\n\t\t\t->assertJson($this->notes->toArray());\n\t}", "public function testGetNotes()\n\t{\n\t\t$returnData = new stdClass;\n\t\t$returnData->code = 200;\n\t\t$returnData->body = $this->sampleString;\n\n\t\t$token = $this->oauth->getToken();\n\n\t\t$this->client->expects($this->once())\n\t\t->method('get')\n\t\t->with('me/notes?access_token=' . $token['access_token'])\n\t\t->will($this->returnValue($returnData));\n\n\t\t$this->assertThat(\n\t\t\t$this->object->getNotes('me'),\n\t\t\t$this->equalTo(json_decode($this->sampleString))\n\t\t);\n\t}", "public function testAddressBookNoteInsertAddressBookNote()\n {\n }", "public function testGetLibraryDocumentInfo()\n {\n }", "public function testGetNotesBySearch()\n {\n }", "public function testProjectProjectsIdNotesNoteIdGet()\n {\n\n }", "public function testNotesOne()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testGetDocumentOfLibraryDocument()\n {\n }", "public function testStorePurchaseOrderNote()\n {\n }", "public function testIndexPurchaseOrderNote()\n {\n }", "public function testCreateLibraryDocument()\n {\n }", "public function testEmptyNote()\n {\n $sample = realpath(__DIR__ . '/files/issue00018.ged');\n\n $parser = new Parser();\n $gedcom = $parser->parse($sample);\n\n $sour = current($gedcom->getSour());\n\n $this->assertCount(0, $sour->getNote());\n $this->assertCount(1, $parser->getErrors());\n }", "public function testReadPublicDocument()\n {\n }", "public function testBillingNotesEmailDocumentPost()\n {\n }", "public function testGetPublicDocument()\n {\n }", "public function testAddNoteLink()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation userVanityNameAsync Check a user&39;s PM room
public function userVanityNameAsync($vanity_name) { return $this->userVanityNameAsyncWithHttpInfo($vanity_name) ->then( function ($response) { return $response[0]; } ); }
[ "public function testUserVanityName()\n {\n }", "public function userVanityNameRequest($vanity_name)\n {\n // verify the required parameter 'vanity_name' is set\n if ($vanity_name === null || (is_array($vanity_name) && count($vanity_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vanity_name when calling userVanityName'\n );\n }\n\n $resourcePath = '/users/vanity_name';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $vanity_name,\n 'vanity_name', // param base name\n 'string', // openApiType\n 'form', // style\n true, // explode\n true // 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 OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function check_user_name()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($_POST['user_name'])){\n\t\t\t$check = $this->_account->valid_user_name($_POST['user_name']);\n\t\t\techo !empty($check['is_valid']) && $check['is_valid'] == 'Y'? 'VALID': 'INVALID';\n\t\t}\n\t}", "function getName(){\n\t\tif ($this->validUser){\n\t\t\t// get twitter name from twitter url\n\t\t\t$position = strpos($this->urlCont, USER_POSITION);\n\t\t\t$subStr = substr($this->urlCont, $position, MAX_STRING_LENGTH);\n\t\t\t$subStr = preg_replace( \"/\\r|\\n/\", \"\", $subStr); // remove new line chars (for preg_match)\n\t\t\tpreg_match(NON_VERIFIED_USER_REGEX, $subStr , $match);\n\t\t\tif (empty($match)){\n\t\t\t\t// if the $match is empty, try another regex\n\t\t\t\t// this is a regular expression in case the user is verified\n\t\t\t\tpreg_match(VERIFIED_USER_REGEX, $subStr , $match);\n\t\t\t}\n\t\t\t$this->name = trim($match[1]); // remove spaces\n\t\t\treturn $this->name;\n\t\t}\n\t\telse\n\t\t\treturn ERROR_INVALID_USER; // the user is not valud\n\t}", "public function checkUsernameId(){\n\t\t$uname = 'abcd.xyz..1234';\n\t\techo \"+++\". $this->getIdfromUname($uname);\n\t}", "function AJvalidateUserid() {\n\t$user = processInputVar('user', ARG_STRING);\n\tif(validateUserid($user))\n\t\tsendJSON(array('status' => 'valid'));\n\telse\n\t\tsendJSON(array('status' => 'invalid'));\n}", "public function is_user_name($value){\r\n if(!preg_match('/^[a-zA-Z\\d_.]{2,20}$/', $value) && $value != ''){\r\n $this->add_message('User names can only contain letters, numbers, underscores, and periods as well as being between 2-20 characters in length.');\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }", "function checkUsername($name) {\n\t\t$bad_usernames = array('admin','Administrator','administrator','ADMIN'); if((empty($_SESSION['ShoutCloud_Admin_Name'])) && (empty($_SESSION['ShoutCloud_Admin_Loggedin']))) { $bad_usernames[] = $this->adminUser; }\n\t\t$name = utf8_encode(strip_tags($name)); foreach($bad_usernames as $k=>$n) { if($name==$n) { return false; } } return str_ireplace($this->badwords,'',$name);\n\t\t\n\t}", "function VerifyUsername($username_to_verify, $minimal_username_length){\n if(preg_match('/^[a-zA-Z0-9_-]+/', $username_to_verify) && strlen($username_to_verify) > $minimal_username_length){\n return TRUE;\n }\n else{\n return FALSE;\n }\n }", "public function greetUser($name) {\n return \"Hello, \" . $name;\n }", "public function actionSetVanityUrl(){\n $users = User::model()->findAll(array('order'=>'status DESC'));\n \n foreach ($users as $user){\n if ($user->vanityURL == ''){\n $i = 0;\n while ($i < 1000){\n $user->vanityURL = str_replace(\" \", \"\", strtolower($user->name.\"-\".$user->surname));\n if ($i > 0) $user->vanityURL .= \"-\".$i;\n $i++;\n if (Idea::model()->findByAttributes(array('vanityURL'=>$user->vanityURL))) continue;\n if ($user->save()) break;\n }\n }\n }\n $this->render('message',array('title'=>\"Fill vanity urls\",'content'=>\"Success!\"));\n }", "public function handle($name): bool\n {\n if (!\\is_string($name)) {\n $this->setFailureMessage(Messages::MEMBER_NAME_MUST_BE_STRING);\n\n return false;\n }\n\n if (\\strlen($name) < 1) {\n $this->setFailureMessage(Messages::MEMBER_NAME_IS_TOO_SHORT);\n\n return false;\n }\n\n // Globally allowed characters\n $globally = '\\x{0030}-\\x{0039}\\x{0041}-\\x{005A}\\x{0061}-\\x{007A}';\n $globallyNotSafe = '\\x{0080}-\\x{FFFF}';\n\n // Allowed characters\n $allowed = '\\x{002D}\\x{005F}';\n $allowedNotSafe = '\\x{0020}';\n\n $regex = \"/[^{$globally}{$globallyNotSafe}{$allowed}{$allowedNotSafe}]+/u\";\n $safeRegex = \"/[^{$globally}{$allowed}]+/u\";\n\n if (\\preg_match($this->strict ? $safeRegex : $regex, $name) > 0) {\n $this->setFailureMessage(Messages::MEMBER_NAME_MUST_NOT_HAVE_RESERVED_CHARACTERS);\n\n return false;\n }\n\n $regex = \"/^[{$globally}{$globallyNotSafe}]{1}(?:.*[{$globally}{$globallyNotSafe}]{1})?$/u\";\n $safeRegex = \"/^[{$globally}]{1}(?:.*[{$globally}]{1})?$/u\";\n if (\\preg_match($this->strict ? $safeRegex : $regex, $name) == 0) {\n $this->setFailureMessage(Messages::MEMBER_NAME_MUST_START_AND_END_WITH_ALLOWED_CHARACTERS);\n\n return false;\n }\n\n return true;\n }", "function check_account_name($name)\r\n{\r\n\t$temp = strspn(\"$name\", \"QWERTYUIOPASDFGHJKLZXCVBNM0123456789\");\r\n\tif ($temp != strlen($name))\r\n\t\treturn false;\r\n\tif(strlen($name) > 32)\r\n\t\treturn false;\r\n\telse\r\n\t{\r\n\t\t$ok = \"/[A-Z0-9]/\";\r\n\t\treturn (preg_match($ok, $name))? true: false;\r\n\t}\r\n}", "function valid_uniquename($user)\n{\n\tif ( valid_umich($user) ) return true;\n\tif ( valid_eecs($user) ) return true;\n\t// must not be valid!\n\treturn false;\n}", "function invalidUID($username){\n\n $result;\n\n if(!preg_match(\"/^[a-zA-Z0-9]*$/\", $result)) {\n $result = true;\n } else {\n $result = false;\n }\n\n return $result;\n}", "public function is_survey_name_valid()\n {\n //get_survey_by_user_name($name)\n $name=$_GET['name'];\n $data=$this->survey->get_survey_by_user_name($name);\n if(empty($data))\n {\n echo json_encode('true');\n }\n else\n {\n echo json_encode('false');\n }\n }", "public function usernameValid($username);", "function validateUserName($name) {\r\n //if it's NOT valid\r\n if (strlen($name) < 4)\r\n return false;\r\n //if it's valid\r\n else\r\n return true;\r\n }", "function characterName($str){\n\t\t$this->FURY->load->library('Profanity');\n\t\t\tif(preg_match(\"/^[a-zA-Z0-9_|-\\s]{3,16}$/\", $str)){\n\t\t\t\tif($this->FURY->profanity->getScoring($str)<=0){\n\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\t$this->_fury_error_string = gettext(\"Your username contains words which we do not allow as a username, try changing it to something else!\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->_fury_error_string = gettext(\"The username is invalid it may only contain letters, numbers, spaces, -_| and must be between 3 and 15 characters in length.\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
polygonZ4($x1,$y1,$x2,$y2,$x3,$y3,$x4,$y4,$z,$style) 4 points polygon at height z
public static function polygonZ4($x1=100,$y1=100,$x2=150,$y2=50,$x3=120,$y3=175,$x4=80,$y4=150,$z=10, $style='stroke:black;stroke-width:1;fill:lightgrey;') { $y1z=$y1-$z; $y2z=$y2-$z; $y3z=$y3-$z; $y4z=$y4-$z; echo "<polygon points='$x1,$y1z $x2,$y2z $x3,$y3z $x4,$y4z' style='$style' />"; }
[ "public static function surface3P($x1=200,$y1=200,$z1=0,$x2=250,$y2=200,$z2=0,$x3=225,$y3=200,$z3=50,\r\n$style='stroke:black;stroke-width:1;fill:lightgrey') {\r\n$x1z=$x1; $y1z=$y1-$z1;\r\n$x2z=$x2; $y2z=$y2-$z2;\r\n$x3z=$x3; $y3z=$y3-$z3;\r\necho \"<polygon points='$x1z,$y1z $x2z,$y2z $x3z,$y3z' style='$style' />\";\r\n}", "function polygon($params = array())\n {\n $connectEnds = (isset($params['connect']) ? $params['connect'] : false);\n $fillColor = (isset($params['fill']) ? $params['fill'] : false);\n $lineColor = (isset($params['line']) ? $params['line'] : false);\n\n if (!$connectEnds) {\n $fillColor = 'transparent';\n }\n $style = $this->_getLineStyle($lineColor) . $this->_getFillStyle($fillColor);\n\n $attrs = (isset($params['attrs']) && is_array($params['attrs'])) ? $this->_getAttributes($params['attrs']) : null;\n\n $first = true;\n $spline = false;\n $lastpoint = false;\n foreach($this->_polygon as $point) {\n if ($first) {\n $points = 'M';\n } elseif (!$spline) {\n $points .= ' L';\n }\n \n if (($spline) && ($lastpoint !== false)) {\n $points .= ' ' .round($lastpoint['P1X']) . ',' . round($lastpoint['P1Y']) . ' ' .\n round($lastpoint['P2X']) . ',' . round($lastpoint['P2Y']);\n } \n\n $points .= ' ' . round($point['X']) . ',' . round($point['Y']);\n\n if ((isset($point['P1X'])) && (isset($point['P1Y'])) &&\n (isset($point['P2X'])) && (isset($point['P2Y'])))\n {\n if (($first) || (!$spline)) {\n $points .= ' C';\n }\n $lastpoint = $point;\n $spline = true;\n } else {\n $spline = false;\n }\n $first = false;\n }\n if ($connectEnds) {\n $points .= ' Z';\n }\n $this->_addElement(\n '<path ' .\n 'd=\"' . $points . '\" ' .\n 'style=\"' . $style . '\"' .\n ($attrs ? ' ' . $attrs : '') .\n '/>',\n $params\n );\n\n parent::polygon($params);\n }", "public static function triangle($x1=200, $y1=50, $x2=140, $y2=140, $x3=200, \r\n$y3=120, $style='stroke:black;stroke-width:1;fill:none;') {\r\necho \"<polygon points='$x1,$y1 $x2,$y2 $x3,$y3' style='$style' />\";\r\nreturn array($x1,$y1,$x2,$y2,$x3,$y3);\r\n}", "function polygon($params = array())\n {\n $connectEnds = (isset($params['connect']) ? $params['connect'] : false);\n $fillColor = (isset($params['fill']) ? $params['fill'] : false);\n $lineColor = (isset($params['line']) ? $params['line'] : false);\n\n $line = $this->_setLineStyle($lineColor);\n $fill = false;\n if ($connectEnds) {\n $fill = $this->_setFillStyle($fillColor);\n }\n\n $first = true;\n foreach ($this->_polygon as $point) {\n if ($first === true) {\n pdf_moveto($this->_pdf, $point['X'], $point['Y']);\n $first = $point;\n } else {\n if (isset($last['P1X'])) {\n pdf_curveto($this->_pdf,\n $last['P1X'],\n $last['P1Y'],\n $last['P2X'],\n $last['P2Y'],\n $point['X'],\n $point['Y']\n );\n } else {\n pdf_lineto($this->_pdf,\n $point['X'],\n $point['Y']\n );\n }\n }\n $last = $point;\n }\n\n if ($connectEnds) {\n if (isset($last['P1X'])) {\n pdf_curveto($this->_pdf,\n $last['P1X'],\n $last['P1Y'],\n $last['P2X'],\n $last['P2Y'],\n $first['X'],\n $first['Y']\n );\n } else {\n pdf_lineto($this->_pdf,\n $first['X'],\n $first['Y']\n );\n }\n }\n\n if (($line) && ($fill)) {\n pdf_fill_stroke($this->_pdf);\n } elseif ($line) {\n pdf_stroke($this->_pdf);\n } elseif ($fill) {\n pdf_fill($this->_pdf);\n }\n parent::polygon($params);\n }", "function polygon($points)\r\n {\r\n $this->forceBrush();\r\n $xPoints = \" var Xpoints = new Array(\";\r\n $yPoints = \" var Ypoints = new Array(\";\r\n $count = count($points);\r\n for ($i = 0; $i < $count; $i += 2) {\r\n if ($i > 1) {\r\n $xPoints .= \",\";\r\n $yPoints .= \",\";\r\n }\r\n $xPoints .= $points[$i];\r\n $yPoints .= $points[$i+1];\r\n }\r\n $xPoints .= \");\\n\";\r\n $yPoints .= \");\\n\";\r\n echo $xPoints;\r\n echo $yPoints;\r\n echo \"$this->_canvas.fillPolygon(Xpoints, Ypoints);\\n\";\r\n $this->forcePen();\r\n echo \"$this->_canvas.drawPolygon(Xpoints, Ypoints);\\n\";\r\n }", "public function createPolygon(array $linestrings = []): Polygon;", "function polygon($params = array())\n {\n $connectEnds = (isset($params['connect']) ? $params['connect'] : false);\n $fillColor = (isset($params['fill']) ? $params['fill'] : false);\n $lineColor = (isset($params['line']) ? $params['line'] : false);\n\n $line = $this->_setLineStyle($lineColor);\n $fill = false;\n if ($connectEnds) {\n $fill = $this->_setFillStyle($fillColor);\n }\n\n $first = true;\n foreach ($this->_polygon as $point) {\n if ($first === true) {\n ps_moveto($this->_ps, $point['X'], $point['Y']);\n $first = $point;\n } else {\n if (isset($last['P1X'])) {\n ps_curveto($this->_ps,\n $last['P1X'],\n $last['P1Y'],\n $last['P2X'],\n $last['P2Y'],\n $point['X'],\n $point['Y']\n );\n } else {\n ps_lineto($this->_ps,\n $point['X'],\n $point['Y']\n );\n }\n }\n $last = $point;\n }\n\n if ($connectEnds) {\n if (isset($last['P1X'])) {\n ps_curveto($this->_ps,\n $last['P1X'],\n $last['P1Y'],\n $last['P2X'],\n $last['P2Y'],\n $first['X'],\n $first['Y']\n );\n } else {\n ps_lineto($this->_ps,\n $first['X'],\n $first['Y']\n );\n }\n }\n\n if (($line) && ($fill)) {\n ps_fill_stroke($this->_ps);\n } elseif ($line) {\n ps_stroke($this->_ps);\n } elseif ($fill) {\n ps_fill($this->_ps);\n }\n parent::polygon($params);\n }", "public function addPolygon($points)\n {\n $pointCount = count($points);\n\n $this->dataString .= 'M'. \n number_format($points[0]->x, 2, '.', '') .' '. \n number_format($points[0]->y, 2, '.', '');\n\n for ($i = 1; $i < $pointCount; $i++) {\n $this->dataString .= 'L'. \n number_format($points[$i]->x, 2, '.', '') .' '. \n number_format($points[$i]->y, 2, '.', '');\n }\n\n $this->dataString .= 'Z';\n }", "public function rectangleZ($left, $top, $bottom, $z0, $z1) {\r\n $this->iPoints[0] = $this->calc3DPos($left, $top, $z0);\r\n $this->iPoints[1] = $this->calc3DPos($left, $top, $z1);\r\n $this->iPoints[2] = $this->calc3DPos($left, $bottom, $z1);\r\n $this->iPoints[3] = $this->calc3DPos($left, $bottom, $z0);\r\n $this->polygonFour();\r\n }", "private function readPolygon()\n {\n return $this->createPolygon($this->readPolyLine(false));\n }", "public static function rectZ($x=100, $y=100, $z=0, $w=100, $h=50, \r\n$style='stroke:black;stroke-width:1;fill:lightgrey') {\r\n$x1=$x; $y1=$y-$z;\r\necho \"<rect x='$x1' y='$y1' width='$w' height='$h' style='$style' />\";\r\n}", "public function getPolygon($index)\n {\n return $this->getGeometry($index);\n }", "function drawPolygon($linestrings, $stroke='black', $fill='transparent', $stroke_width=2) {\r\n// echo \"Drawing::drawPolygon(linestrings=(\",implode(',',$linestrings),\")<br>\\n\";\r\n if (count($linestrings)==1) {\r\n $pts = [];\r\n foreach($linestrings[0]->points() as $pt)\r\n $pts[] = $this->proj($pt);\r\n return $this->svg->polygon($pts, $stroke, $fill, $stroke_width);\r\n }\r\n $svg = '';\r\n// Remplissage de l'intérieur\r\n if ($fill<>'transparent') {\r\n if (!isset($linestrings[0]->points()[0])) {\r\n echo \"<pre>\";\r\n throw new Exception(\"Point non défini dans \".__FILE__.\", ligne \".__LINE__);\r\n }\r\n $pt0 = $linestrings[0]->points(0); // le premier point du contour extérieur\r\n $pts = [];\r\n foreach($linestrings as $no => $linestring) {\r\n foreach ($linestring->points() as $pt)\r\n $pts[] = $this->proj($pt);\r\n if ($no > 0)\r\n $pts[] = $this->proj($pt0);\r\n }\r\n $svg .= $this->svg->polygon($pts, 'transparent', $fill, 0);\r\n }\r\n// puis dessin du contour\r\n if ($stroke<>'transparent')\r\n foreach ($linestrings as $no => $linestring) {\r\n $ptPrec = null;\r\n foreach ($linestring->points() as $pt) {\r\n $pt = $this->proj($pt);\r\n if ($ptPrec and ($pt<>$ptPrec))\r\n $svg .= $this->svg->line($ptPrec, $pt, $stroke, 'transparent', $stroke_width);\r\n $ptPrec = $pt;\r\n }\r\n }\r\n return $svg;\r\n }", "function get_polygon($polygon) {\n\t\treturn \"ST_geometryN(ST_GeometryFromText('\" . $polygon . \"', \" . $this->clientepsg . \"), 1)\";\n\t}", "public function triangle($p0, $p1, $p2, $z=0) {\r\n $p0 = $this->calc3DPoint($p0->getX(), $p0->getY(), $z);\r\n $p1 = $this->calc3DPoint($p1->getX(), $p1->getY(), $z);\r\n $p2 = $this->calc3DPoint($p2->getX(), $p2->getY(), $z);\r\n $this->polygonPoints($p0, $p1, $p2);\r\n }", "public static function triangleDeg($cx=100, $cy=100, $r=50, $startDeg=0,\r\n$style='stroke:black;stroke-width:1;fill:none;') { \r\n$alpha=2*M_PI/3; $start=deg2rad($startDeg);\r\n$arr1=fm::returnCartesianRad($r,$start);\r\n$arr2=fm::returnCartesianRad($r,$start+$alpha);\r\n$arr3=fm::returnCartesianRad($r,$start+2*$alpha);\r\n$x1=$cx+$arr1[0]; $y1=$cy+$arr1[1];\r\n$x2=$cx+$arr2[0]; $y2=$cy+$arr2[1];\r\n$x3=$cx+$arr3[0]; $y3=$cy+$arr3[1];\r\necho \"<polygon points='$x1,$y1 $x2,$y2 $x3,$y3' \r\nstyle='$style' />\";\r\nreturn array($x1,$y1,$x2,$y2,$x3,$y3);\r\n}", "function draw_triangle($x, $y, $z, $zoom, $height) {\r\n\t\t$coords = array($zoom*$x, $zoom*$y, $zoom*$z);\r\n\t\t$base = array(\r\n\t\t\tarray(-0.5, 0.866),\r\n\t\t\tarray( 1.0, 0.0),\r\n\t\t\tarray(-0.5, -0.866)\r\n\t\t);\r\n\t\t$origin = array(5.0, $height+5.0);\r\n\t\t$centroid = array(0.0, 0.0);\r\n\t\t\r\n\t\tfor ($i = 0; $i < 3; $i++)\r\n\t\t\tfor ($s = 0; $s < 2; $s++) {\r\n\t\t\t\t$triangle[$i][$s] =\t$origin[$s] - $coords[$i]*$base[($i+1)%3][$s] + $coords[($i+1)%3]*$base[$i][$s];\r\n\t\t\t\t$centroid[$s] += $triangle[$i][$s]/3.0;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\tif (isset($_GET['fancy'])) {\r\n\t\t\tglobal $palette;\r\n\t\t\t$fill = $palette[abs($x+$y+$z) % count($palette)];\r\n\t\t\t$textfill = \"#FFFFFF\";\r\n\t\t} else {\r\n if ($x+$y+$z < 0) {\r\n $fill = \"#FFFFFF\";\r\n }\r\n else {\r\n $fill = \"#CCCCCC\";\r\n }\r\n\t\t\t$textfill = \"#000000\";\r\n\t\t}\r\n\t\t\r\n\t\techo '<polygon points=\"'.$triangle[0][0].','.$triangle[0][1].' '.$triangle[1][0].','.$triangle[1][1].' '.$triangle[2][0].','.$triangle[2][1].'\"'.\r\n\t\t\t'style=\"fill:'.$fill.';stroke:black;stroke-width:1;\"/>';\r\n\t\t\r\n\t\techo '<text style=\"font-size:'.((float)abs($x+$y+$z)*$zoom/3.0).'; fill:'.$textfill.'; text-anchor:middle; dominant-baseline:central;\" \r\n\t\t\tx=\"'.$centroid[0].'\" y=\"'.$centroid[1].'\">'.abs($x+$y+$z).'</text>';\r\n\t}", "function kml_regular_polygon( $long, $lat, $meters, $segments = 30, $offset = 0 ) {\n\t$s = \"<Polygon>\\n\";\n\t$s .= \" <outerBoundaryIs><LinearRing><coordinates>\\n\";\n\tforeach( spoints($long, $lat, $meters, $segments, $offset) as $p ) {\n\t\t$s .= \" \".( float )$p[0].\",\".( float )$p[1].\"\\n\";\n\t}\n\t$s .= \" </coordinates></LinearRing></outerBoundaryIs>\\n\";\n\t$s .= \"</Polygon>\\n\";\n\treturn $s;\n}", "public static function pentagonDeg($cx=100, $cy=100, $r=50, $startDeg=0,\r\n$style='stroke:black;stroke-width:1;fill:none;') { \r\n$alpha=2*M_PI/5; $start=deg2rad($startDeg);\r\n$arr1=fm::returnCartesianDeg($r,$start);\r\n$arr2=fm::returnCartesianDeg($r,$start+$alpha);\r\n$arr3=fm::returnCartesianDeg($r,$start+2*$alpha);\r\n$arr4=fm::returnCartesianDeg($r,$start+3*$alpha);\r\n$arr5=fm::returnCartesianDeg($r,$start+4*$alpha);\r\n$x1=$cx+$arr1[0]; $y1=$cy+$arr1[1];\r\n$x2=$cx+$arr2[0]; $y2=$cy+$arr2[1];\r\n$x3=$cx+$arr3[0]; $y3=$cy+$arr3[1];\r\n$x4=$cx+$arr4[0]; $y4=$cy+$arr4[1];\r\n$x5=$cx+$arr5[0]; $y5=$cy+$arr5[1];\r\necho \"<polygon points='$x1,$y1 $x2,$y2 $x3,$y3 $x4,$y4 $x5,$y5' \r\nstyle='$style' />\";\r\nreturn array($x1,$y1,$x2,$y2,$x3,$y3,$x4,$y4,$x5,$y5);\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cleanup the doctrinegenerated folder for next generation
public static function doctrineCleanup() { PathHelper::cleanUp(); }
[ "protected function resetFeedGenerating()\r\n {\r\n XMLClass::deleteTemporaryFilesByDirAndFeedType($this->tmpOutputDir, $this->feedPrefix);\r\n }", "public function init()\n {\n foreach(glob($this->outputDir . '/Structure/Vendor/*') as $target){\n exec(\"rm -rf {$target}\");\n }\n\n foreach(glob($this->outputDir . '/Config/*') as $target){\n exec(\"rm -rf {$target}\");\n }\n }", "public function removeModelFiles()\n {\n @unlink($this->classesDir . $this->className . '.php');\n @unlink($this->classesDir . $this->className . 'Peer.php');\n @unlink($this->classesDir . 'map' . PATH_SEP . $this->className . 'MapBuilder.php');\n @unlink($this->classesDir . 'om' . PATH_SEP . 'Base' . $this->className . '.php');\n @unlink($this->classesDir . 'om' . PATH_SEP . 'Base' . $this->className . 'Peer.php');\n }", "public static function cleanup(Event $event): void {\n // Remove composer create-project files.\n $filenames = [\n 'scripts/composer/CheckGeneratorWizard.php',\n 'scripts/composer/GeneratorWizard.php'\n ];\n\n foreach ($filenames as $filename) {\n if (file_exists($filename)) {\n unlink($filename);\n }\n }\n\n rmdir('scripts/composer');\n rmdir('scripts');\n\n // Message for the user.\n $event->getIO()->write(\"Generator wizard file cleaned.\");\n }", "protected function destroyPackageMigrations()\n {\n File::cleanDirectory('vendor/orchestra/testbench/fixture/database/migrations');\n }", "protected function cleanUp()\n {\n $prefixTempFile = strtolower($this->mainClassName . '-' . $this->environment);\n // this is the part of the path that is fixed for all the feeds downloaded for this project.\n // After this fixed part, we append a random string\n // THIS IS NOT only the directory where to download the feeds\n $temporaryFeedFileFixedPath = '/tmp/feedaggregator-' . $prefixTempFile . '-';\n // cleaning up: let's make sure the previous feed gets deleted\n if ($temporaryFeedFileFixedPath && (realpath($temporaryFeedFileFixedPath) != '/'))\n {\n exec(\"rm $temporaryFeedFileFixedPath*\");\n }\n }", "private function cleanDirectories()\r\n {\r\n $info = $this->getModuleInfo();\r\n $basePath = base_path() . '/workbench/' . $info['packageName'] . '/';\r\n\r\n $this->files->deleteDirectory($basePath . 'src/controllers');\r\n }", "private function cleanupIfNecessary()\n {\n if ( $this->firstRun ) {\n /** @var SiteMapLinkSet $linkSet */\n foreach( $this->em->getRepository('DeepMikotoApiBundle:SiteMapLinkSet')->findAll() as $linkSet ) {\n $fileName = $this->baseDir . '/' . $linkSet->getName();\n if ( file_exists( $fileName ) && is_file( $fileName ) ) {\n unlink( $fileName );\n }\n $this->em->remove( $linkSet );\n }\n $this->em->flush();\n }\n }", "public static function purge()\n {\n self::purgeFactories();\n self::purgeStrategies();\n self::resetDefinitionsBaseDirectory();\n }", "protected function regenerateSchema()\n {\n $metadata = $this->entityManager->getMetadataFactory()->getAllMetadata();\n if (!empty($metadata)) {\n $tool = new SchemaTool($this->entityManager);\n $tool->dropSchema($metadata);\n $tool->createSchema($metadata);\n }\n }", "private function cleanContext()\n {\n $filesystem = new Filesystem();\n $finder = new Finder();\n\n $filesystem->remove(\n $finder\n ->in($this->getFixturesDirectories())\n ->notName('.gitkeep')\n ->getIterator()\n );\n }", "public function removeGeneratedClasses($classPath)\n\t{\n\t\tforeach (glob($classPath . 'generated/*.php') as $filename) {\n\t\t\tunlink($filename);\n\t\t}\n\t\t\n\t\t// remove Cough user classes\n\t\tforeach (glob($classPath . 'concrete/*.php') as $filename) {\n\t\t\tunlink($filename);\n\t\t}\n\t\t\n\t\trmdir($classPath . 'generated');\n\t\trmdir($classPath . 'concrete');\n\t\trmdir($classPath);\n\t}", "protected function cleanVendorMigrationsFolders()\n {\n if( env( 'ENSPHERE_IMPORT', false ) ) {\n $this->info( 'vendor migration clean skipped...' );\n return;\n }\n\n if( ! file_exists( base_path( 'database/migrations/vendor/' ) ) ) {\n $this->info( base_path( 'database/migrations/vendor/' ) . ' doesn\\'t exist...' );\n return;\n }\n\n $di = new \\RecursiveDirectoryIterator( base_path( 'database/migrations/vendor/' ), \\FilesystemIterator::SKIP_DOTS );\n $ri = new \\RecursiveIteratorIterator( $di, \\RecursiveIteratorIterator::CHILD_FIRST );\n foreach ( $ri as $file ) {\n $file->isDir() ? rmdir( $file ) : unlink( $file );\n }\n $this->info( 'vendor migration files cleaned...' );\n }", "public function purge(): void\n {\n $di = new RecursiveDirectoryIterator($this->parameterBag->get('translator.default_path'), FilesystemIterator::SKIP_DOTS);\n\n foreach (new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST) as $fileInfo) {\n if ($fileInfo->isDir()) {\n rmdir($fileInfo->getPathname());\n continue;\n }\n\n if (!$this->isDotFile($fileInfo->getBasename())) {\n unlink($fileInfo->getPathname());\n }\n }\n }", "public function cleanupRegistryFiles() {\n $storage = \\Drupal::entityTypeManager()->getStorage('registry_file');\n $ids = $storage->getQuery()->condition('id', 'bdd_', 'STARTS_WITH')->execute();\n if (!empty($ids)) {\n $entities = $storage->loadMultiple($ids);\n $storage->delete($entities);\n }\n }", "public function cleanup()\n {\n $fsTools = new Filesystem();\n $fsTools->remove($this->createdDirectories);\n }", "public function tearDown()\n {\n $path = '/var/tmp/' . $this->migration_dir;\n $this->removeProjectFolder($path);\n }", "public function clean()\n {\n $this->cache->flush(); // Flushes the entire cache.\n \n // Remove all folders from the asset folder.\n foreach(scandir($this->assetManager->basePath) as $directory)\n {\n if($directory == '..' || $directory == '.')\n {\n continue;\n }\n \n \\yii\\helpers\\FileHelper::removeDirectory($directory);\n }\n \n if($this->has('imagine'))\n {\n $this->imagine->flush(); // Flush all modified images.\n }\n }", "public function cleanDatabase()\n {\n foreach ($this->getTemplates() as $template) {\n $template->cleanDatabase();\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
> create a report. A report may have a title and contains a number of subreports or messages.
public static function createReport($title = "") { assert(is_string($title), 'Wrong type for argument 1. String expected'); $content = ""; if (!empty($title)) { $content = "<title>$title</title>"; } return new self("<report>$content</report>"); }
[ "public function addReport($title = \"\")\n {\n assert(is_string($title), 'Wrong type for argument 1. String expected');\n $report = null;\n if ($this->getName() === 'report') {\n $report = $this->addChild(\"report\");\n if (!empty($title)) {\n $report->addChild(\"title\", (string) $title);\n }\n }\n return $report;\n }", "public function create(Report &$report)\n {\n $data = $report->exportData();\n $endpoint = 'reports.json';\n $response = $this->request(\n $endpoint, 'POST', array(\n 'report' => $data\n )\n );\n $report->setData($response['report']);\n }", "public function testCreateReport()\n {\n }", "public function createReportTask() {\n $this->type = \"report\";\n return $this->createTask();\n }", "public function makeReport()\n {\n }", "protected abstract function generateReport();", "public function createSimpleProjectReport($projectId);", "public function createAction()\n {\n $post_id = filter_var($this->route_params['isbn'], FILTER_SANITIZE_NUMBER_INT);\n if($post_id)\n {\n if($post = Post::getPostByID($post_id))\n {\n $text = filter_input(INPUT_POST, 'text', FILTER_SANITIZE_STRING);\n if($text)\n {\n if(Report::addReport($text, $post->id))\n {\n Flash::addMessage('Report was submitted', Flash::SUCCESS);\n $this->redirect('/');\n }\n else\n {\n Flash::addMessage('Error in report submission!', Flash::DANGER);\n $this->redirect('/');\n }\n }\n else\n {\n Flash::addMessage('Post text was not found', Flash::DANGER);\n $this->redirect('/');\n }\n }\n else\n {\n Flash::addMessage('Post was not found', Flash::DANGER);\n $this->redirect('/');\n }\n }\n else\n {\n Flash::addMessage('Post ID was not found', Flash::DANGER);\n $this->redirect('/');\n }\n }", "public function actionCreate()\n {\n $model = new report();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->report_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\r\n\t\t{\r\n\t\t\treturn new PollsReporting_ReportDefinition();\r\n\t\t}", "public function createReport()\n {\n $model = Report::create([\n 'name' => 'Hotline ' . date('d.m.y H:i')\n ]);\n return $model->id;\n }", "public function actionCreate()\n {\n $model = new Reports();\n\t\t\n\t\t$users = User::getUsersEmails();\n\t\t\n\t\t$teams = Team::getTeams();\n\n\t\t$usedTeams = MapTeamUserReport::getUsedTeams($model->id);\n\t\t\n\t\t$usedUsers = MapTeamUserReport::getUsedUsers($model->id);\n\t\t\n\t\t$types = CabinetHdbkReportType::getTypes();\n\n if ($model->load(Yii::$app->request->post()) && $model->updateSettings()) {\n\t\t\t\n\t\t\t$userId = '';\n\t\t\t$teamId = '';\n\t\t\tif(!empty(Yii::$app->request->post()['user_id'])){\n\t\t\t\t$userId = Yii::$app->request->post()['user_id'];\n\t\t\t}\n\t\t\tif(!empty(Yii::$app->request->post()['team_id'])){\n\t\t\t\t$teamId = Yii::$app->request->post()['team_id'];\n\t\t\t}\n\t\t\tMapTeamUserReport::setReportsMap($model->id, $userId, $teamId);\n\t\t\t\n\t\t\tif(!empty($userId) || !empty($teamId)){\n\t\t\t\tReports::sendReportEmail($userId,$teamId,$model);\n\t\t\t}\n\t\t\t\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n\t\t\t\t'users' => $users,\n\t\t\t\t'teams' => $teams,\n\t\t\t\t'types' => $types,\n\t\t\t\t'usedTeams' => $usedTeams,\n\t\t\t\t'usedUsers' => $usedUsers,\n ]);\n }\n }", "public function testItCanCreateReports()\n {\n $this->analyzer = new Analyzer(10);\n $this->analyzer->analyzeAlgorithms();\n $this->analyzer->createReport(self::REPORT_FILE);\n\n $this->assertFileExists(self::REPORT_FILE);\n\n $content = file_get_contents(self::REPORT_FILE);\n $this->assertContains(\"arrayToDataTable([[\", $content);\n \n if (file_exists(self::REPORT_FILE)) {\n unlink(self::REPORT_FILE);\n }\n }", "public function actionCreate()\n {\n $model = new Report();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "function testCreate() \n {\n global $webUrl;\n global $lang, $SERVER, $DATABASE;\n\n // Turn to the create report page.\n\t\t$this->assertTrue($this->get(\"$webUrl/reports.php\", array('server' => $SERVER)));\n $this->assertTrue($this->clickLink($lang['strcreatereport']));\n\n // Enter information for creating a report.\n $this->assertTrue($this->setField('report_name', $this->_reportName));\n $this->assertTrue($this->setField('db_name', $DATABASE));\n $this->assertTrue($this->setField('descr', 'comment'));\n $this->assertTrue($this->setField('report_sql', 'select * from student where 1=0'));\n\n //Then submit and verify it.\n $this->assertTrue($this->clickSubmit($lang['strsave']));\n $this->assertWantedText($lang['strreportcreated']);\n $this->assertWantedText($this->_reportName);\n\n return TRUE;\n }", "function StartReport($strTitle, $strEmailAddressee)\n\t{\n\t\t// Initialise _rptReport\n\t\t$this->_rptReport = new Report($strTitle, $strEmailAddressee);\n\t}", "public function create()\n\t{\n\t\treturn view('tutorialreports.create');\n\t}", "function create_report_graph($reportgraph) {\n return $this->insert_record(\"block_ilp_report_graph\",$reportgraph);\n }", "public function __response_create_report($vars)\n\t{\n\t\t$categories = array();\n\t\tif( isset($vars['add_category']))\n\t\t{\n\t\t\t$categories = $vars['add_category'];\n\t\t}\n\n\t\t$verify = 0;\n\t\tif( isset($vars['verify']))\n\t\t{\n\t\t\t$verify = (int)$vars['verify'];\n\t\t}\n\n\t\t$approve = 0;\n\t\tif( isset($vars['approve']))\n\t\t{\n\t\t\t$approve = (int)$vars['approve'];\n\t\t}\n\n\t\t// Grab the location_id or create one if we can\n\t\t$location_id = 0;\n\t\tif ( isset($this->data->location_id))\n\t\t{\n\t\t\t$location_id = $this->data->location_id;\n\t\t}\n\t\telseif ( isset($this->data->latitude) AND isset($this->data->longitude))\n\t\t{\n\t\t\t$location_name = map::reverse_geocode($this->data->latitude,$this->data->longitude);\n\n\t\t\t// In case our location name is too long, chop off the end\n\t\t\t$location_name = substr_replace($location_name, '', 250);\n\n\t\t\t$location_data = (object) array('location_name' => $location_name,\n\t\t\t\t\t\t\t\t\t'latitude' => $this->data->latitude,\n\t\t\t\t\t\t\t\t\t'longitude' => $this->data->longitude);\n\t\t\t$location = new Location_Model();\n\t\t\treports::save_location($location_data, $location);\n\t\t\t$location_id = $location->id;\n\t\t}\n\n\t\t// We can only create reports if we have location.\n\t\tif ($location_id == FALSE OR $location_id == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Build title\n\t\t\n\t\t\n\t\t// Build title & description\n\t\t// If this is a message\n\t\tif (isset($this->data->message))\n\t\t{\n\t\t\t$incident_title = $this->data->message;\n\t\t\t$incident_description = $this->data->message;\n\t\t\t$incident_date = $this->data->message_date;\n\t\t\t// If we're got more message detail, make that the description\n\t\t\tif ( ! empty($message->message_detail))\n\t\t\t{\n\t\t\t\t$incident_description = $this->data->message_detail;\n\t\t\t}\n\t\t}\n\t\t// If this is a feed item\n\t\telseif (isset($this->data->item_title))\n\t\t{\n\t\t\t$incident_title = html::strip_tags(html_entity_decode(html_entity_decode($this->data->item_title, ENT_QUOTES)));\n\t\t\t$incident_description = html::clean(html_entity_decode($this->data->item_description, ENT_QUOTES));\n\t\t\t$incident_date = $this->data->item_date;\n\t\t}\n\t\t\n\t\t\n\t\t// Override title from action options\n\t\tif (! empty($vars['report_title']))\n\t\t{\n\t\t\t$incident_title = $vars['report_title'];\n\t\t}\n\n\t\t// Save Incident\n\t\t$incident = new Incident_Model();\n\t\t$incident->location_id = $location_id;\n\t\t$incident->incident_title = $incident_title;\n\t\t$incident->incident_description = $incident_description;\n\t\t$incident->incident_date = $incident_date;\n\t\t$incident->incident_active = $approve;\n\t\t$incident->incident_verified = $verify;\n\t\t$incident->incident_dateadd = date(\"Y-m-d H:i:s\",time());\n\t\t$incident->save();\n\n\t\t// Conflicted.. do I run report add here? Potential to create a mess with action triggers?\n\t\t//Event::run('ushahidi_action.report_add', $incident);\n\t\t\n\t\t// Save media\n\t\tif (isset($this->data->item_title))\n\t\t{\n\t\t\t$news = new Media_Model();\n\t\t\t$news->location_id = $incident->location_id;\n\t\t\t$news->incident_id = $incident->id;\n\t\t\t$news->media_type = 4; // News\n\t\t\t$news->media_link = $this->data->item_link;\n\t\t\t$news->media_date = $this->data->item_date;\n\t\t\t$news->save();\n\t\t}\n\n\t\t$incident_id = $incident->id;\n\n\t\tforeach($categories as $category_id)\n\t\t{\n\t\t\t// Assign Category\n\t\t\tIncident_Category_Model::assign_category_to_incident($incident_id,$category_id);\n\t\t}\n\n\t\t// Link message with incident?\n\t\tif ( isset($this->data->message) AND isset($this->data->id))\n\t\t{\n\t\t\t$message = new Message_Model($this->data->id);\n\t\t\t$message->incident_id = $incident_id;\n\t\t\t$message->save();\n\t\t}\n\t\t// Link feed item with incident\n\t\telseif ( isset($this->data->item_title) AND isset($this->data->id))\n\t\t{\n\t\t\t$item = new Feed_Item_Model($this->data->id);\n\t\t\t$item->incident_id = $incident_id;\n\t\t\t$item->save();\n\t\t}\n\t\t\n\n\t\treturn TRUE;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call this after the authorization flow is successful It will call a different success method depending on the type of authorization in progress.
public function successRouter() { if (!$this->authorizationInProgress()) { // no explicit authorization in progress header('Location: /'); return; } $sessionAuthorizeDetails = $this->getAuthorizationDetails(); $authType = $sessionAuthorizeDetails['type']; switch ($authType) { case 'transaction': return $this->transactionAuthorizeSuccess(); break; case 'adduser': return $this->addUserAuthorizeSuccess(); break; default: throw new Exception('Unknown authorization type'); } }
[ "protected function authSucceeded() {\n\t}", "public abstract function authorisationSuccessful();", "public function authSuccess() {\n\t\ttry {\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Common\\Auth\\Exception('Authentication was successful, but the response could not be processed.');\n\t\t}\n\t}", "public function completeAuthorize() {\n\t\t//TODO\n\t}", "function authenticationSucceeded() {\r\n\t\t}", "public function onAuthorizationComplete()\n\t{\n\t\t$this->raiseEvent('OnAuthorizationComplete',$this,null);\n\t}", "public function onAuthSuccess()\n {\n return true;\n }", "public function resourceOK () {\n $this->setStatus(AuthorizationStatusEnum::OK);\n }", "protected function handleAuthorization()\n {\n if (isset($this->request->target)) {\n $this->authorizeClient($_SERVER['REMOTE_ADDR']);\n $this->onSuccess();\n $this->redirect();\n } elseif ($this->isClientAuthorized($_SERVER['REMOTE_ADDR'])) {\n $this->redirect();\n } else {\n $this->showError();\n }\n }", "public function authenticateAction()\n {\n $opauthResponse = $this->opauth->getResponse();\n\n if (!$this->authenticateActionAlreadyCalled && $opauthResponse !== NULL) {\n $this->authenticateActionAlreadyCalled = TRUE;\n if ($opauthResponse->isAuthenticationSucceeded()) {\n $opauthAccount = $this->opauthAccountService->getAccount($opauthResponse);\n $doesAccountExists = $this->opauthAccountService->doesAccountExist($opauthAccount);\n\n if ($doesAccountExists === FALSE) {\n return $this->onOpauthAccountDoesNotExist($opauthResponse->getRawData(), $opauthAccount);\n }\n } else {\n return $this->onOpauthAuthenticationFailure($opauthResponse->getRawData());\n }\n }\n\n return parent::authenticateAction();\n }", "protected function authorize() {\r\n\r\n $url = $this->base_url . self::LOGIN_ENDPOINT;\r\n\r\n $auth_array = array(\r\n 'login' => $this->username,\r\n 'password' => $this->password,\r\n );\r\n\r\n $json_data = json_encode($auth_array);\r\n\r\n $headers_array = array(\r\n 'Content-Type' => 'application/json'\r\n );\r\n\r\n $args = array(\r\n 'timeout' => 45,\r\n 'redirection' => 0,\r\n 'httpversion' => '1.0',\r\n 'sslverify' => FALSE,\r\n 'method' => 'POST',\r\n 'headers' => $headers_array,\r\n 'body' => $json_data,\r\n );\r\n\r\n\r\n $auth_response = wp_remote_post(\r\n $url, $args\r\n );\r\n\r\n $body = $auth_response['body'];\r\n\r\n $result = json_decode($body);\r\n\r\n $this->auth_status = $result->status;\r\n $this->timestamp = $result->timestamp;\r\n \r\n if (isset($result->error_message)) {\r\n $this->auth_error_message = $result->error_message;\r\n }\r\n\r\n $this->uid = $result->data->user_id;\r\n $this->key = base64_decode($result->data->auth_key);\r\n }", "public function handleAuthorizationCodeRedirect(): void{\n $this->session->set('state', $state = sha1(uniqid(\"\", true)));\n\n $query = http_build_query([\n 'client_id' => $this->clientId,\n 'redirect_uri' => $this->request->getSchemeAndHttpHost() . $this->request->getBasePath() . self::$PROXY_CALLBACK_ENDPOINT,\n 'response_type' => 'code',\n 'scope' => $this->scope,\n 'state' => $state,\n ]);\n\n header('location: ' . $this->apiHost . self::$REMOTE_AUTHORIZE_ENDPOINT . '?' . $query);\n exit();\n }", "public function success() {\n if ($this->hasResponded()) return;\n $this->status('success');\n $this->respond();\n }", "protected function success()\n {\n $this->response = $this->response->withStatus(200);\n $this->jsonBody($this->payload->getOutput());\n }", "protected function failedAuthorization()\n {\n if ($this->responder == 'default') {\n parent::failedAuthorization();\n }\n\n $this->customFailedAuthorization();\n }", "public function execute()\n\t{\n\t\t// The implicit grant flow is never executed because the access token is\n\t\t// returned to the client when handling the authorization request. This\n\t\t// is because the implicit grant essentially \"skips\" the generation of\n\t\t// an authorization code. Refer to section 4.2 of RFC 6749.\n\t}", "public function testDestiny2AwaProvideAuthorizationResult()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "abstract protected function respondLoginSuccess();", "public function post_request_auth() {\n\t\tsession_start();\n\t\t$this->init_gitlab_oauth_provider();\n\n\t\t$authUrl = $this->oauth_provider->getAuthorizationUrl();\n\t\t$_SESSION['oauth2state'] = $this->oauth_provider->getState();\n\t\theader('Location: '.$authUrl);\n\t\texit;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CKO admin order management settings fields
public static function order_settings() { $settings = array( 'order_setting' => array( 'title' => __( 'Order Management settings', 'checkoutcom-cards-settings' ), 'type' => 'title', 'description' => '', ), 'ckocom_order_authorised' => array( 'id' => 'ckocom_order_authorised', 'title' => __('Authorised Order Status', 'checkoutcom-cards-settings'), 'type' => 'select', 'desc_tip' => true, 'options' => wc_get_order_statuses(), 'default' => 'wc-on-hold', 'desc' => __('Select the status that should be used for orders with successful payment authorisation', 'checkoutcom-cards-settings'), ), 'ckocom_order_captured' => array( 'id' => 'ckocom_order_captured', 'title' => __('Captured Order Status', 'checkoutcom-cards-settings'), 'type' => 'select', 'desc_tip' => true, 'options' => wc_get_order_statuses(), 'default' => 'wc-processing', 'desc' => __('Select the status that should be used for orders with successful payment capture', 'checkoutcom-cards-settings'), ), 'ckocom_order_void' => array( 'id' => 'ckocom_order_void', 'title' => __('Void Order Status', 'checkoutcom-cards-settings'), 'type' => 'select', 'desc_tip' => true, 'options' => wc_get_order_statuses(), 'default' => 'wc-cancelled', 'desc' => __('Select the status that should be used for orders that have been voided', 'checkoutcom-cards-settings'), ), 'ckocom_order_flagged' => array( 'id' => 'ckocom_order_flagged', 'title' => __('Flagged Order Status', 'checkoutcom-cards-settings'), 'type' => 'select', 'desc_tip' => true, 'options' => wc_get_order_statuses(), 'default' => 'wc-flagged', 'desc' => __('Select the status that should be used for flagged orders', 'checkoutcom-cards-settings'), ), 'ckocom_order_refunded' => array( 'id' => 'ckocom_order_refunded', 'title' => __('Refunded Order Status', 'checkoutcom-cards-settings'), 'type' => 'select', 'desc_tip' => true, 'options' => wc_get_order_statuses(), 'default' => 'wc-refunded', 'desc' => __('Select the status that should be used for new orders with successful payment refund', 'checkoutcom-cards-settings'), ), ); return apply_filters( 'wc_checkout_com_cards', $settings ); }
[ "function admin_edit_order() {\n\t\t//\n\t}", "function wc_display_custom_billing_fields_admin_order( $order ) {\r\n\twc_get_custom_fields_for_admin_order( $order, array( 'billing' ) );\r\n}", "public function settings_tab() {\n\t\twoocommerce_admin_fields( self::get_settings() );\n\t}", "function settings_tab() {\n\twoocommerce_admin_fields( get_settings() );\n}", "function show_settings_tab(){\n woocommerce_admin_fields($this->get_settings());\t\t\n }", "public function add_settings(){\n woocommerce_admin_fields( self::get_settings() );\n }", "function uc_econt_admin_settings() {\n $form = array();\n $pickup_addr_uc = (array) variable_get('uc_quote_store_default_address', new stdClass());\n// $pickup_addr_econt = _uc_econt_get_address($pickup_addr_uc);\n $url_options = array(t('Demo mode'), t('Live mode'));\n $instruction_returns = array(0 => t('Disabled'), 'shipping_returns' => t('Shipping and returns'), 'returns' => t('Returns'));\n $receipt = array('none' => t('Disabled'), 'dc' => t('Acknowledgment - DC'), 'dc_cp' => t('Acknowledgment + stock receipt - DC-CP'));\n $extra_declared_value = array(0 => t('Disabled'), 1 => t('Always On'), 2 => t('Users choose'));\n \n $country_name = db_result(db_query(\"SELECT country_name FROM {uc_countries} WHERE country_id = '%s'\", $pickup_addr_uc['country']));\n \n $form['econt'] = array(\n '#type' => 'fieldset',\n '#title' => t('Econt shipping options'),\n// '#description' => 'fieldset description',\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n '#weight' => '-1',\n );\n $form['econt']['pickup'] = array(\n '#type' => 'item',\n '#title' => t('Pickup address status'),\n '#value' => _econt_check_default_store_address(),\n '#description' => t('Econt shipping will be active only if default pickup address\n was filled on <a href=\"@url\">Shipping quote settings</a> page and it is located in Bulgaria, !!! Current country is @country',\n array('@url' => url('admin/store/settings/quotes/edit'), '@country' => $country_name)),\n '#weight' => '1',\n );\n \n $form['econt']['uc_econt_eecont_url'] = array(\n '#type' => 'select',\n '#title' => t('Calculate delivery mode'),\n '#options' => $url_options,\n '#default_value' => variable_get('uc_econt_eecont_url', 'Demo mode'),\n '#description' => t(\"To test calculating delivery use Demo mode.\"),\n );\n /*\n $form['econt']['uc_econt_insurance'] = array(\n '#type' => 'checkbox',\n '#title' => t('Insurance'),\n '#default_value' => variable_get('uc_econt_insurance', '1'),\n '#description' => t('Insurance consignment'),\n '#weight' => '2',\n );*/\n $form['econt']['uc_econt_send_delivery_from'] = array(\n '#type' => 'radios',\n '#title' => t('Send delivery from'),\n '#default_value' => variable_get('uc_econt_send_delivery_from', '0'),\n '#options' => array(t('door'), t('Econt office')),\n '#description' => t('Send a consignment of Еcont office, or from your store door.'),\n '#weight' => '3',\n );\n $form['econt']['uc_econt_shop_pay_delivery'] = array(\n '#type' => 'textfield',\n '#title' => t('The Delivery is on behalf of the shop'),\n '#default_value' => variable_get('uc_econt_shop_pay_delivery', ''),\n '#description' => t('Delivery is charged to the store when the contract value is greater than this value, where less is paid by the customer. Value zero /0/ = always at the expense of Store. Blank field = always on behalf of Client.'),\n '#size' => 5,\n '#field_suffix' => variable_get('uc_currency_sign', ''),\n '#weight' => '4',\n );\n $form['econt']['uc_econt_fixed_price'] = array(\n '#type' => 'textfield',\n '#title' => t('Fixed delivery price'),\n '#default_value' => variable_get('uc_econt_fixed_price', '0'),\n '#description' => t('If ECONT website is unreachable to generate the price of delivery, this price is used as a ECONT delivery price.'),\n '#size' => 5,\n '#field_suffix' => variable_get('uc_currency_sign', ''),\n '#weight' => '5',\n );\n $form['econt']['uc_econt_sms_notification'] = array(\n '#type' => 'checkbox',\n '#title' => t('Sms notification of shipment'),\n '#default_value' => variable_get('uc_econt_sms_notification', '1'),\n '#description' => t('Sms notification of the store for a shipment.'),\n '#weight' => '6',\n );\n \n $form['econt']['uc_econt_invoice_before_pay'] = array(\n '#type' => 'checkbox',\n '#title' => t('Invoice before pay CD'),\n '#default_value' => variable_get('uc_econt_invoice_before_pay', '1'),\n '#description' => t('Enable uc_econt_invoice_before_pay.'),\n '#weight' => '7',\n );\n $form['econt']['uc_econt_pay_after_accept'] = array(\n '#type' => 'checkbox',\n '#title' => t('Pay after accept'),\n '#default_value' => variable_get('uc_econt_pay_after_accept', '1'),\n '#description' => t('Orders consignment to be inspected by the recipient and pay cash on delivery only if you ACCEPT my product.'),\n '#weight' => '8',\n );\n $form['econt']['uc_econt_pay_after_test'] = array(\n '#type' => 'checkbox',\n '#title' => t('Pay after test'),\n '#default_value' => variable_get('uc_econt_pay_after_test', '1'),\n '#description' => t('Orders consignment to be Inspected and Tested by recipient and to pay cash on delivery only if\nI accept the goods.'),\n '#weight' => '9',\n );\n \n $form['econt']['uc_econt_instruction_returns'] = array(\n '#type' => 'select',\n '#title' => t('Pay for a canceled item'),\n '#options' => $instruction_returns,\n '#default_value' => variable_get('uc_econt_instruction_returns', 'returns'),\n '#description' => t('When refused shipment on account of the sender is the cost of selected activities. When Disabled, all expenses are charged to the customer.'),\n '#weight' => '10',\n );\n $form['econt']['uc_econt_receipt'] = array(\n '#type' => 'select',\n '#title' => t('Receipts'),\n '#options' => $receipt,\n '#default_value' => variable_get('uc_econt_receipt', '0'),\n '#description' => t('Acknowledgment DC / Acknowledgment + stock receipt DC-CP for shipping product.'),\n '#weight' => '10',\n );\n $form['econt']['uc_econt_dp'] = array(\n '#type' => 'checkbox',\n '#title' => t('Two-way shipment - DP'),\n '#default_value' => variable_get('uc_econt_dp', '1'),\n '#description' => t('Two-way shipment.'),\n '#weight' => '13',\n );\n \n $form['econt']['uc_econt_credit_customer_number'] = array(\n '#type' => 'textfield',\n '#title' => t('Econt customer number of credit payment'),\n '#default_value' => variable_get('uc_econt_credit_customer_number', ''),\n '#description' => t('Customer number for payment of the supply of credit by the sender. <a href=\"@url\">Agreement.</a>', array('@url' => url('http://www.econt.com/dogovoreni_usloviq/'))),\n '#size' => 10,\n //'#field_suffix' => variable_get('uc_currency_sign', ''),\n '#weight' => '14',\n );\n $form['econt']['uc_econt_cod_agreement_number'] = array(\n '#type' => 'textfield',\n '#title' => t('Agreement number for COD'),\n '#default_value' => variable_get('uc_econt_cod_agreement_number', ''),\n '#description' => t('Number of payment for COD.'),\n '#size' => 10,\n //'#field_suffix' => variable_get('uc_currency_sign', ''),\n '#weight' => '15',\n );\n //Econt shipping Extra customer fields\n $form['customer_extra'] = array(\n '#type' => 'fieldset',\n '#title' => t('Econt Extra customer options'),\n '#description' => t('On the next fields, if enabled here customer will choose or set these options on checkout pane.'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n );\n $form['customer_extra']['uc_econt_extra_date_priority'] = array(\n '#type' => 'checkbox',\n '#title' => t('Date priority'),\n '#default_value' => variable_get('uc_econt_extra_date_priority', '1'),\n '#description' => t('Enable the date priority.'),\n '#weight' => '1',\n );\n $form['customer_extra']['uc_econt_extra_time_priority'] = array(\n '#type' => 'checkbox',\n '#title' => t('Time priority'),\n '#default_value' => variable_get('uc_econt_extra_time_priority', '1'),\n '#description' => t('Enable the time priority.'),\n '#weight' => '2',\n );\n $form['customer_extra']['uc_econt_extra_declared_value'] = array(\n '#type' => 'select',\n '#title' => t('Declared value'),\n '#options' => $extra_declared_value,\n '#default_value' => variable_get('uc_econt_extra_declared_value', '0'),\n '#description' => t('Enable the field for declared value.'),\n '#weight' => '3',\n );\n $form['customer_extra']['uc_econt_auto_declared_value'] = array(\n '#type' => 'textfield',\n '#title' => t('Auto declared value'),\n '#default_value' => variable_get('uc_econt_auto_declared_value', '0'),\n '#description' => t('Automatically enable option \"declared value\" for orders over that amount.'),\n '#size' => 5,\n '#field_suffix' => variable_get('uc_currency_sign', ''),\n '#weight' => '4',\n );\n $form['customer_extra']['uc_econt_extra_city_express'] = array(\n '#type' => 'checkbox',\n '#title' => t('Express services'),\n '#default_value' => variable_get('uc_econt_extra_city_express', '1'),\n '#description' => t('Enable city express / intercity express courier.'),\n '#weight' => '5',\n );\n //eEcont profile user\n $form['e_econt_client'] = array(\n '#type' => 'fieldset',\n '#title' => t('e-Econt client login data'),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n );\n $form['e_econt_client']['uc_econt_e_econt_client_username'] = array(\n '#type' => 'textfield',\n '#title' => t('e-Econt username'),\n '#default_value' => variable_get('uc_econt_e_econt_client_username', 'demo'),\n '#description' => t('Client username on e-Econt profile'),\n '#size' => 15,\n );\n $form['e_econt_client']['uc_econt_e_econt_client_passwd'] = array(\n '#type' => 'password',\n '#title' => t('e-Econt password'),\n '#default_value' => variable_get('uc_econt_e_econt_client_passwd', 'demo'),\n '#description' => t('Client password on e-Econt profile, leave blank to not change current if it has been introduced.'),\n '#size' => 15,\n );\n \n $form['#submit'][] = 'uc_econt_admin_settings_form_submit';\n \n return system_settings_form($form);\n}", "function show_settings_tab(){\n woocommerce_admin_fields($this->get_settings());\n }", "function display_settings_tab() {\n\twoocommerce_admin_fields( get_settings() );\n}", "public function admin_options()\n {\n echo '<h3>' . __('Oplata.com', 'kdc') . '</h3>';\n echo '<p>' . __('Payment gateway') . '</p>';\n echo '<table class=\"form-table\">';\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n echo '</table>';\n }", "public function admin_options() {\n\t\t?>\n\t\t<h3>Custom Payment 1 <?php _e( 'Settings', 'woocommerce' ); ?></h3>\n <div id=\"poststuff\">\n\t\t\t\t<div id=\"post-body\" class=\"metabox-holder columns-2\">\n\t\t\t\t\t<div id=\"post-body-content\">\n\t\t\t\t\t\t<table class=\"form-table\">\n\t\t\t\t\t\t\t<?php $this->generate_settings_html();?>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n </div>\n <div class=\"clear\"></div>\n </div>\n<?php\n\t}", "public function feed_settings_fields() {\n $default_settings = parent::feed_settings_fields();\n $form = $this->get_current_form();\n // Prepare customer information fields.\n $billing_info = parent::get_field( 'billingInformation', $default_settings );\n\n $billing_fields = $billing_info['field_map'];\n $add_first_name = true;\n $add_last_name = true;\n foreach ( $billing_fields as $mapping ) {\n //add first/last name if it does not already exist in billing fields\n if ( $mapping['name'] == 'firstName' ) {\n $add_first_name = false;\n } else if ( $mapping['name'] == 'lastName' ) {\n $add_last_name = false;\n }\n }\n\n if ( $add_last_name ) {\n //add last name\n array_unshift( $billing_info['field_map'], array( 'name' => 'lastName', 'label' => __( 'Last Name', 'gravityformspayxpert' ), 'required' => false ) );\n }\n if ( $add_first_name ) {\n array_unshift( $billing_info['field_map'], array( 'name' => 'firstName', 'label' => __( 'First Name', 'gravityformspayxpert' ), 'required' => false ) );\n }\n\n $billing_info['field_map'][] = array( 'name' => 'phone', 'label' => __( 'Phone', 'gravityformspayxpert' ), 'required' => false );\n\n $default_settings = parent::replace_field( 'billingInformation', $billing_info, $default_settings );\n\n return $default_settings;\n }", "public function getStandardCheckoutFormFields ()\n {\n $order = $this->getOrder();\n if (!($order instanceof Mage_Sales_Model_Order)) {\n Mage::throwException($this->_getHelper()->__('Cannot retrieve order object'));\n }\n\n $billingAddress = $order->getBillingAddress();\n\n $streets = $billingAddress->getStreet();\n $street = isset($streets[0]) && $streets[0] != ''\n ? $streets[0]\n : (isset($streets[1]) && $streets[1] != '' ? $streets[1] : '');\n\n if ($this->getConfig()->getDescription()) {\n $transDescription = $this->getConfig()->getDescription();\n } else {\n $transDescription = Mage::helper('cashu')->__('Order #%s', $order->getRealOrderId());\n }\n\n if ($order->getCustomerEmail()) {\n $email = $order->getCustomerEmail();\n } elseif ($billingAddress->getEmail()) {\n $email = $billingAddress->getEmail();\n } else {\n $email = '';\n }\n\n $currency = Mage::app()->getStore()-> getCurrentCurrencyCode();\n if($currency != 'EGP'){\n $currencyrate = Mage::app()->getStore()->getCurrentCurrencyRate();\n $amount = round($order->getBaseGrandTotal()*(1/$currencyrate),2);\n }else{\n $amount = round($order->getBaseGrandTotal(),2);\n }\n \n\t\t// fields to send to cashu\n $fields = array(\n\t\t\t\t\t\t'merchant_id'\t => Mage::getSingleton('cashu/config')->getMerchantId(),\n\t\t\t\t\t\t//'currency'\t\t => Mage::app()->getStore()-> getCurrentCurrencyCode(), \n 'currency' => 'EGP', \n\t\t\t\t\t//\t'account_id' => Mage::getSingleton('cashu/config')->getAccountId(),\n 'product_name' => $transDescription,\n 'amount' \t => $amount,\n 'language' => $this->getConfig()->getLanguage(),\n 'f_name' => $billingAddress->getFirstname(),\n 's_name' => $billingAddress->getLastname(),\n 'street' => $street,\n 'city' => $billingAddress->getCity(),\n 'state' => $billingAddress->getRegionModel()->getCode(),\n 'decline_url' => $this->getFailureURL(),\n \t);\n\n if ($this->getConfig()->getDebug()) {\n $debug = Mage::getModel('cashu/api_debug')\n ->setRequestBody($this->getCashuUrl().\"\\n\".print_r($fields,1))\n ->save();\n $fields['cs2'] = $debug->getId();\n }\n\n return $fields;\n }", "public function testUpdateOmsOrderCustomFields()\n {\n }", "function init_form_fields() { \n // We will add our settings here\n $this->form_fields = array(\n \n 'enabled' => array(\n 'title' => __( 'Enable'),\n 'type' => 'checkbox',\n 'description' => __( 'Enable this shipping.'),\n 'default' => 'yes'\n ),\n \n 'title' => array(\n 'title' => __( 'Title'),\n 'type' => 'text',\n 'description' => __( 'Title to be display on site'),\n 'default' => __( 'Delivery')\n ),\n 'coast' => array(\n 'title' => __( 'Coast'),\n 'type' => 'text',\n 'description' => __( 'Coast'),\n 'default' => 1000\n ),\n \n );\n }", "private function SetupOrderManagementForm($order=array())\n\t\t{\n\t\t\t$GLOBLS['CurrentTab'] = 0;\n\n\t\t\tif($_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\t\t$postData = $_POST;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$postData = $order;\n\t\t\t}\n\n\t\t\t$orderFields = array(\n\t\t\t\t'OrderBillFirstName'\t=> 'ordbillfirstname',\n\t\t\t\t'OrderBillLastName'\t\t=> 'ordbilllastname',\n\t\t\t\t'OrderBillCompany'\t\t=> 'ordbillcompany',\n\t\t\t\t'OrderBillPhone'\t\t=> 'ordbillphone',\n\t\t\t\t'OrderBillStreet1'\t\t=> 'ordbillstreet1',\n\t\t\t\t'OrderBillStreet2'\t\t=> 'ordbillstreet2',\n\t\t\t\t'OrderBillSuburb'\t\t=> 'ordbillsuburb',\n\t\t\t\t'OrderBillZip'\t\t\t=> 'ordbillzip',\n\t\t\t\t'OrderShipFirstName'\t=> 'ordshipfirstname',\n\t\t\t\t'OrderShipLastName'\t\t=> 'ordshiplastname',\n\t\t\t\t'OrderShipCompany'\t\t=> 'ordshipcompany',\n\t\t\t\t'OrderShipPhone'\t\t=> 'ordshipphone',\n\t\t\t\t'OrderShipStreet1'\t\t=> 'ordshipstreet1',\n\t\t\t\t'OrderShipStreet2'\t\t=> 'ordshipstreet2',\n\t\t\t\t'OrderShipSuburb'\t\t=> 'ordshipsuburb',\n\t\t\t\t'OrderShipZip'\t\t\t=> 'ordshipzip',\n\t\t\t\t'CustomerEmail'\t\t\t=> 'custconemail',\n\t\t\t\t'CustomerPassword'\t\t=> 'custpassword',\n\t\t\t\t'CustomerPassword2'\t\t=> 'custpassword2',\n\t\t\t\t'CustomerStoreCredit'\t=> 'custstorecredit',\n\t\t\t\t'CustomerGroup'\t\t\t=> 'custgroupid',\n\t\t\t\t'CustomerType'\t\t\t=> 'customerType',\n\t\t\t\t'OrderComments'\t\t\t=> 'ordcustmessage',\n\t\t\t\t'OrderNotes'\t\t\t=> 'ordnotes',\n\t\t\t\t'OrderId'\t\t\t\t=> 'orderid',\n\t\t\t\t'OrderTrackingNo'\t\t=> 'ordtrackingno',\n\t\t\t\t'AnonymousEmail'\t\t=> 'anonymousemail',\n\t\t\t);\n\n\t\t\t$GLOBALS['HideSelectedCustomer'] = 'display: none';\n\t\t\t$GLOBALS['HideCustomerSearch'] = '';\n\t\t\t$GLOBALS['HideAddressSelects'] = 'display: none';\n\n\t\t\tif(isset($postData['ordcustid']) && $postData['ordcustid'] > 0) {\n\t\t\t\t$GLOBALS['CurrentTab'] = 1;\n\t\t\t\t$GLOBALS['CustomerType'] = 'existing';\n\t\t\t\t$query = \"\n\t\t\t\t\tSELECT *\n\t\t\t\t\tFROM [|PREFIX|]customers WHERE customerid='\".(int)$postData['ordcustid'].\"'\n\t\t\t\t\";\n\t\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\t\t$existingCustomer = $GLOBALS['ISC_CLASS_DB']->Fetch($result);\n\t\t\t\tif($existingCustomer['customerid']) {\n\t\t\t\t\t$GLOBALS['HideSelectedCustomer'] = '';\n\t\t\t\t\t$GLOBALS['HideCustomerSearch'] = 'display: none';\n\t\t\t\t\t$GLOBALS['HideHistoryLink'] = 'display: none';\n\n\t\t\t\t\t$GLOBALS['CustomerId'] = $existingCustomer['customerid'];\n\t\t\t\t\t$GLOBALS['CustomerFirstName'] = isc_html_escape($existingCustomer['custconfirstname']);\n\t\t\t\t\t$GLOBALS['CustomerLastName'] = isc_html_escape($existingCustomer['custconlastname']);\n\n\t\t\t\t\t$GLOBALS['CustomerPhone'] = '';\n\t\t\t\t\tif($existingCustomer['custconphone']) {\n\t\t\t\t\t\t$GLOBALS['CustomerPhone'] = isc_html_escape($existingCustomer['custconphone']) . '<br />';\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['CustomerEmail'] = '';\n\t\t\t\t\tif($existingCustomer['custconemail']) {\n\t\t\t\t\t\t$GLOBALS['CustomerEmail'] = '<a href=\"mailto:'.isc_html_escape($existingCustomer['custconemail']).'\">'.isc_html_escape($existingCustomer['custconemail']).'</a><br />';\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['CustomerCompany'] = '';\n\t\t\t\t\tif($existingCustomer['custconcompany']) {\n\t\t\t\t\t\t$GLOBALS['CustomerCompany'] = isc_html_escape($existingCustomer['custconcompany']).'<br />';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Grab the addresses\n\t\t\t\t\t$addresses = $this->LoadCustomerAddresses($existingCustomer['customerid']);\n\t\t\t\t\t$GLOBALS['AddressJson'] = 'OrderManager.LoadInAddresses('.isc_json_encode($addresses).');';\n\t\t\t\t\tif(!empty($addresses)) {\n\t\t\t\t\t\t$GLOBALS['HideAddressSelects'] = '';\n\t\t\t\t\t\t$GLOBALS['DisableAddressSelects'] = 'disabled=\"disabled\"';\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['SelectedCustomer'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('OrdersCustomerSearchResult');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(isset($postData['ordcustid']) && $postData['ordcustid'] == 0) {\n\t\t\t\tif(!isset($postData['customerType'])) {\n\t\t\t\t\t$GLOBALS['CurrentTab'] = 2;\n\t\t\t\t}\n\t\t\t\telse if($postData['customerType'] == 'anonymous') {\n\t\t\t\t\t$GLOBALS['CurrentTab'] = 2;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$GLOBALS['CurrenTab'] = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Customer and order custom fields\n\t\t\t */\n\t\t\t$GLOBALS['OrderCustomFormFieldsAccountFormId'] = FORMFIELDS_FORM_ACCOUNT;\n\t\t\t$GLOBALS['OrderCustomFormFieldsBillingFormId'] = FORMFIELDS_FORM_BILLING;\n\t\t\t$GLOBALS['OrderCustomFormFieldsShippingFormId'] = FORMFIELDS_FORM_SHIPPING;\n\t\t\t$GLOBALS['CustomFieldsAccountLeftColumn'] = '';\n\t\t\t$GLOBALS['CustomFieldsAccountRightColumn'] = '';\n\t\t\t$GLOBALS['CustomFieldsBillingColumn'] = '';\n\t\t\t$GLOBALS['CustomFieldsShippingColumn'] = '';\n\n\t\t\t$formIdx = array(FORMFIELDS_FORM_ACCOUNT, FORMFIELDS_FORM_BILLING, FORMFIELDS_FORM_SHIPPING);\n\n\t\t\t$fieldMap = array(\n\t\t\t\t'FirstName'\t\t=> 'firstname',\n\t\t\t\t'LastName'\t\t=> 'lastname',\n\t\t\t\t'Company'\t\t=> 'company',\n\t\t\t\t'Phone'\t\t\t=> 'phone',\n\t\t\t\t'AddressLine1'\t=> 'street1',\n\t\t\t\t'AddressLine2'\t=> 'street2',\n\t\t\t\t'City'\t\t\t=> 'suburb',\n\t\t\t\t'Zip'\t\t\t=> 'zip',\n\t\t\t\t'Country'\t\t=> 'country',\n\t\t\t\t'State'\t\t\t=> 'state'\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Now process the forms\n\t\t\t */\n\t\t\tforeach ($formIdx as $formId) {\n\t\t\t\t$formSessionId = 0;\n\t\t\t\tif ($formId == FORMFIELDS_FORM_ACCOUNT) {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * We are only using the real custom fields for the account section, so check here\n\t\t\t\t\t */\n\t\t\t\t\tif (!gzte11(ISC_MEDIUMPRINT)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($existingCustomer['custformsessionid'])) {\n\t\t\t\t\t\t$formSessionId = $existingCustomer['custformsessionid'];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (isset($postData['ordformsessionid'])) {\n\t\t\t\t\t\t$formSessionId = $postData['ordformsessionid'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * This part here gets all the existing fields\n\t\t\t\t */\n\t\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\t\t\t$fields = $GLOBALS['ISC_CLASS_FORM']->getFormFields($formId, true);\n\t\t\t\t} else if (isId($formSessionId)) {\n\t\t\t\t\t$fields = $GLOBALS['ISC_CLASS_FORM']->getFormFields($formId, false, $formSessionId);\n\t\t\t\t} else {\n\t\t\t\t\t$fields = $GLOBALS['ISC_CLASS_FORM']->getFormFields($formId);\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Get any selected country and state. This needs to be separate as we physically\n\t\t\t\t * print out each form field at a time so we need this information before hand\n\t\t\t\t */\n\t\t\t\tif ($formId !== FORMFIELDS_FORM_ACCOUNT) {\n\t\t\t\t\t$countryId = GetCountryIdByName(GetConfig('CompanyCountry'));\n\t\t\t\t\t$stateFieldId = 0;\n\t\t\t\t\tforeach (array_keys($fields) as $fieldId) {\n\t\t\t\t\t\tif (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'state') {\n\t\t\t\t\t\t\t$stateFieldId = $fieldId;\n\t\t\t\t\t\t} else if (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'country') {\n\t\t\t\t\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\t\t\t\t\t\t$country = $fields[$fieldId]->getValue();\n\t\t\t\t\t\t\t} if ($formId == FORMFIELDS_FORM_BILLING) {\n\t\t\t\t\t\t\t\t$country = @$order['ordbillcountry'];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$country = @$order['ordshipcountry'];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (trim($country) !== '') {\n\t\t\t\t\t\t\t\t$countryId = GetCountryIdByName($country);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Now we construct and build each form field\n\t\t\t\t */\n\t\t\t\t$column = 0;\n\t\t\t\tforeach (array_keys($fields) as $fieldId) {\n\n\t\t\t\t\tif ($formId == FORMFIELDS_FORM_ACCOUNT) {\n\n\t\t\t\t\t\tif ($fields[$fieldId]->record['formfieldprivateid'] !== '' || !gzte11(ISC_MEDIUMPRINT)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$fieldHTML = $fields[$fieldId]->loadForFrontend();\n\n\t\t\t\t\t\tif (($column%2) > 0) {\n\t\t\t\t\t\t\t$varname = 'CustomFieldsAccountLeftColumn';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$varname = 'CustomFieldsAccountRightColumn';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * We are using all the custom fields for the billing/shipping are, so check here\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (!gzte11(ISC_MEDIUMPRINT) && $fields[$fieldId]->record['formfieldprivateid'] == '') {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($formId == FORMFIELDS_FORM_BILLING) {\n\t\t\t\t\t\t\t$varname = 'CustomFieldsBillingColumn';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$varname = 'CustomFieldsShippingColumn';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Set the value for the private fields if this is NOT a post\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif ($_SERVER['REQUEST_METHOD'] !== 'POST' && $fields[$fieldId]->record['formfieldprivateid'] !== '') {\n\n\t\t\t\t\t\t\t$key = @$fieldMap[$fields[$fieldId]->record['formfieldprivateid']];\n\t\t\t\t\t\t\tif (trim($key) !== '') {\n\t\t\t\t\t\t\t\tif ($formId == FORMFIELDS_FORM_BILLING) {\n\t\t\t\t\t\t\t\t\t$key = 'ordbill' . $key;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$key = 'ordship' . $key;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (array_key_exists($key, $order)) {\n\t\t\t\t\t\t\t\t\t$fields[$fieldId]->setValue($order[$key]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add in any of the country/state lists if needed\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'country') {\n\t\t\t\t\t\t\t$fields[$fieldId]->setOptions(array_values(GetCountryListAsIdValuePairs()));\n\n\t\t\t\t\t\t\tif ($fields[$fieldId]->getValue() == '') {\n\t\t\t\t\t\t\t\t$fields[$fieldId]->setValue(GetConfig('CompanyCountry'));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$fields[$fieldId]->addEventHandler('change', 'FormFieldEvent.SingleSelectPopulateStates', array('countryId' => $fieldId, 'stateId' => $stateFieldId, 'inOrdersAdmin' => true));\n\n\t\t\t\t\t\t} else if (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'state' && isId($countryId)) {\n\t\t\t\t\t\t\t$stateOptions = GetStateListAsIdValuePairs($countryId);\n\t\t\t\t\t\t\tif (is_array($stateOptions) && !empty($stateOptions)) {\n\t\t\t\t\t\t\t\t$fields[$fieldId]->setOptions($stateOptions);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * We also do not what these fields\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'savethisaddress' || isc_strtolower($fields[$fieldId]->record['formfieldprivateid']) == 'shiptoaddress') {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS[$varname] .= $fields[$fieldId]->loadForFrontend() . \"\\n\";\n\t\t\t\t\t$column++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Add this to generate our JS event script\n\t\t\t */\n\t\t\t$GLOBALS['FormFieldEventData'] = $GLOBALS['ISC_CLASS_FORM']->buildRequiredJS();\n\n\t\t\t/**\n\t\t\t * Do we display the customer custom fields?\n\t\t\t */\n\t\t\tif (!gzte11(ISC_MEDIUMPRINT)) {\n\t\t\t\t$GLOBALS['HideCustomFieldsAccountLeftColumn'] = 'none';\n\t\t\t\t$GLOBALS['HideCustomFieldsAccountRightColumn'] = 'none';\n\t\t\t} else {\n\t\t\t\tif ($GLOBALS['CustomFieldsAccountLeftColumn'] == '') {\n\t\t\t\t\t$GLOBALS['HideCustomFieldsAccountLeftColumn'] = 'none';\n\t\t\t\t}\n\n\t\t\t\tif ($GLOBALS['CustomFieldsAccountRightColumn'] == '') {\n\t\t\t\t\t$GLOBALS['HideCustomFieldsAccountRightColumn'] = 'none';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$defaultValues = array(\n\t\t\t\t'custgroupid' => 0,\n\t\t\t\t'ordstatus' => 7\n\t\t\t);\n\n\t\t\tforeach($defaultValues as $postField => $default) {\n\t\t\t\tif(!isset($postData[$postField])) {\n\t\t\t\t\t$postData[$postField] = $default;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($orderFields as $templateField => $orderField) {\n\t\t\t\tif(!isset($postData[$orderField])) {\n\t\t\t\t\t$GLOBALS[$templateField] = '';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$GLOBALS[$templateField] = isc_html_escape($postData[$orderField]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(isset($postData['ordbillsaveAddress'])) {\n\t\t\t\t$GLOBALS['OrderBillSaveAddress'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\tif(isset($postData['ordshipsaveAddress'])) {\n\t\t\t\t$GLOBALS['OrderShipSaveAddress'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\tif(isset($postData['shippingUseBilling'])) {\n\t\t\t\t$GLOBALS['ShippingUseBillingChecked'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\tif(isset($postData['billingUseShipping'])) {\n\t\t\t\t$GLOBALS['BillingUseShippingChecked'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\t$GLOBALS['OrderStatusOptions'] = $this->GetOrderStatusOptions($postData['ordstatus']);\n\n\t\t\t$customerClass = GetClass('ISC_ADMIN_CUSTOMERS');\n\t\t\t$GLOBALS['CustomerGroupOptions'] = $customerClass->GetCustomerGroupsAsOptions($postData['custgroupid']);\n\n\t\t\t$GLOBALS['PaymentMethodsList'] = $this->GetPaymentProviderList($postData);\n\n\t\t\tif(!empty($order)) {\n\t\t\t\t$GLOBALS['HideEmailInvoice'] = 'display: none';\n\t\t\t}\n\t\t\telse if(isset($postData['emailinvoice'])) {\n\t\t\t\t$GLOBALS['EmailInvoiceChecked'] = 'checked=\"checked\"';\n\t\t\t}\n\n\t\t\t$GLOBALS['Message'] = GetFlashMessageBoxes();\n\t\t}", "function editable_order_custom_field($order)\n\t\t{\n\n\t\t\t// Get custom post meta data from post_metadata\n\t\t\t$updated_delivery_type = $order->get_meta('_delivery_type');\n\t\t\t$updated_advance_payment = $order->get_meta('_advance_payment');\n\t\t\t$updated_call_status = $order->get_meta('_call_status');\n\n\t\t\t// Replace or update if data exist\n\t\t\t$deliveryType = $updated_delivery_type ? $updated_delivery_type : (isset($item_value) ? $item_value : '');\n\t\t\t$advancePayment = $updated_advance_payment ? $updated_advance_payment : (isset($item_value) ? $item_value : '');\n\t\t\t$CallStatus = $updated_call_status ? $updated_call_status : (isset($item_value) ? $item_value : '');\n\n\t\t\t// Display the custom editable field\n\t\t\twoocommerce_wp_select(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => 'delivery_type',\n\t\t\t\t\t'label' => __(\"Delivery Type:\", \"woocommerce\"),\n\t\t\t\t\t'value' => $deliveryType,\n\t\t\t\t\t'wrapper_class' => 'form-field-wide',\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'' => __('Select One', 'woocommerce'),\n\t\t\t\t\t\t'sundarban' => __('Sundarban', 'woocommerce'),\n\t\t\t\t\t\t'pathao' => __('Pathao', 'woocommerce'),\n\t\t\t\t\t\t'redx' => __('Redx', 'woocommerce')\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\twoocommerce_wp_select(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => 'call_status',\n\t\t\t\t\t'label' => __(\"Call Status:\", \"woocommerce\"),\n\t\t\t\t\t'value' => $CallStatus,\n\t\t\t\t\t'wrapper_class' => 'form-field-wide',\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'' => __('Select One', 'woocommerce'),\n\t\t\t\t\t\t'yes' => __('Yes', 'woocommerce'),\n\t\t\t\t\t\t'no' => __('No', 'woocommerce'),\n\t\t\t\t\t\t'wfc' => __('Waiting for Confirmation', 'woocommerce')\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t\n\t\t\t);\n\n\t\t\twoocommerce_wp_text_input(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => 'advance_payment',\n\t\t\t\t\t'label' => __(\"Advance Payment:\", \"woocommerce\"),\n\t\t\t\t\t'value' => $advancePayment,\n\t\t\t\t\t'wrapper_class' => 'form-field-wide',\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'min'\t\t=> '0'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// //get order status\n\t\t\t// $orderStatus = $order->get_status();\n\t\t\t// //readonly option\n\t\t\t// $readonly = array('readonly' => 'readonly');\n\n\t\t\t// //echo $orderStatus;\n\t\t\t// //if order not on hold advance payment \n\t\t\t// if($orderStatus == 'on-hold'){\n\t\t\t// \twoocommerce_wp_text_input(\n\t\t\t// \t\tarray(\n\t\t\t// \t\t\t'id' => 'advance_payment',\n\t\t\t// \t\t\t'label' => __(\"Advance Payment:\", \"woocommerce\"),\n\t\t\t// \t\t\t'value' => $advancePayment,\n\t\t\t// \t\t\t'wrapper_class' => 'form-field-wide',\n\t\t\t// \t\t\t'type' => 'number',\n\t\t\t// \t\t\t'min'\t\t\t=> 0\n\t\t\t// \t\t)\n\t\t\t// \t);\n\t\t\t// }else{\n\t\t\t// \twoocommerce_wp_text_input(\n\t\t\t// \t\tarray(\n\t\t\t// \t\t\t'id' => 'advance_payment',\n\t\t\t// \t\t\t'label' => __(\"Advance Payment:\", \"woocommerce\"),\n\t\t\t// \t\t\t'value' => $advancePayment,\n\t\t\t// \t\t\t'wrapper_class' => 'form-field-wide',\n\t\t\t// \t\t\t'type' => 'number',\n\t\t\t// \t\t\t'custom_attributes' => $readonly,\n\t\t\t// \t\t)\n\t\t\t// \t);\n\t\t\t// }\n\n\t\t\t\n\t\t}", "function ground_woocommerce_admin_order_billing_fields( $fields ) {\n\n\tglobal $post;\n\t$order = wc_get_order( $post->ID );\n\t$order_data = $order->get_meta( '_billing_invoice' );\n\n\tif ( '1' === $order_data ) {\n\n\t\t// Remove fields.\n\t\tunset( $fields['billing_first_name'] );\n\t\tunset( $fields['billing_last_name'] );\n\t\tunset( $fields['billing_address_1'] );\n\t\tunset( $fields['billing_address_2'] );\n\t\tunset( $fields['billing_city'] );\n\t\tunset( $fields['billing_postcode'] );\n\t\tunset( $fields['billing_country'] );\n\t\tunset( $fields['billing_state'] );\n\n\t\t$fields['customer_type'] = array(\n\t\t\t'label' => __( 'Tipologia cliente', 'ground' ),\n\t\t\t'show' => true,\n\t\t\t'type' => 'select',\n\t\t\t'options' => array(\n\t\t\t\t'azienda' => __( 'Società', 'ground' ),\n\t\t\t\t'individuale' => __( 'Ditta individuale/Professionista', 'ground' ),\n\t\t\t\t'pubblico' => __( 'Pubblica amministrazione', 'ground' ),\n\t\t\t\t'privato' => __( 'Cliente privato', 'ground' ),\n\t\t\t),\n\t\t);\n\n\t\t$fields['vat'] = array(\n\t\t\t'label' => __( 'P.IVA', 'ground' ),\n\t\t\t'show' => true,\n\t\t);\n\n\t\t$fields['fiscal_code'] = array(\n\t\t\t'label' => __( 'Codice fiscale', 'ground' ),\n\t\t\t'show' => true,\n\t\t);\n\n\t\t$fields['sdi'] = array(\n\t\t\t'label' => __( 'Codice destinatario (SDI)', 'ground' ),\n\t\t\t'show' => true,\n\t\t);\n\n\t\t$fields['pec'] = array(\n\t\t\t'label' => __( 'Pec', 'ground' ),\n\t\t\t'show' => true,\n\t\t);\n\t} else {\n\t\t$fields = array();\n\t}\n\n\treturn $fields;\n}", "function domica_custom_checkout_fields( $fields ) {\n $fields['billing']['billing_first_name']['placeholder'] = 'FIRST NAME';\n $fields['billing']['billing_first_name']['label'] = '';\n $fields['billing']['billing_last_name']['placeholder'] = 'LAST NAME';\n $fields['billing']['billing_last_name']['label'] = '';\n $fields['billing']['billing_phone']['placeholder'] = 'PHONE NUMBER';\n $fields['billing']['billing_phone']['label'] = '';\n $fields['billing']['billing_email']['placeholder'] = 'EMAIL ID';\n $fields['billing']['billing_email']['label'] = '';\n $fields['billing']['billing_country']['placeholder'] = 'COUNTRY';\n $fields['billing']['billing_country']['label'] = '';\n $fields['billing']['billing_state']['placeholder'] = 'STATE';\n $fields['billing']['billing_state']['label'] = '';\n $fields['billing']['billing_address_1']['placeholder'] = 'STREET';\n $fields['billing']['billing_address_1']['label'] = '';\n $fields['billing']['billing_address_2']['placeholder'] = 'APARTMENT';\n $fields['billing']['billing_address_2']['label'] = '';\n $fields['billing']['billing_city']['placeholder'] = 'CITY';\n $fields['billing']['billing_city']['label'] = '';\n $fields['billing']['billing_postcode']['placeholder'] = 'POSTAL CODE';\n $fields['billing']['billing_postcode']['label'] = '';\n $fields['billing']['billing_company']['placeholder'] = 'COMPANY NAME';\n $fields['billing']['billing_company']['label'] = '';\n $fields['order']['order_comments']['label'] = 'ORDER NOTE';\n return $fields;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the given boundary point [node, offset] to account for the fact that insertedNode was just inserted into its current position. This must be called AFTER insertedNode was already inserted.
public function modifyForInsert($insertedNode, $point) { // "For each boundary point whose node is the new parent of the affected // node and whose offset is greater than the new index of the affected // node, add one to the boundary point's offset." if ($point[0] === $insertedNode->parentNode && $point[1] > self::getWindow()->indexOf($insertedNode)) { return [$point[0], $point[1] + 1]; } return $point; }
[ "public function insert($offset, $value);", "function insertData($offset, $data) {\n\t\t\tif ($offset < 0 || $offset > $this->length)\n\t\t\t\tXML_DOMException::raise(INDEX_SIZE_ERR,\n\t\t\t\t\t'offset '.$offset.' is out of range');\n\t\t\t$this->data = substr($this->data, 0, $offset).$data.\n\t\t\t\tsubstr($this->data, $offset);\n\t\t\t$this->nodeValue = $this->data;\n\t\t\t$this->length = strlen($this->data);\n\t\t}", "abstract protected function update(Node $node);", "private function insertNode(Node $node, array $position): void\n {\n $relativeNode = $position[0];\n $position = $position[1];\n\n if ($position === 'beforebegin') {\n $relativeNode->parentNode->insertNode($node, $relativeNode);\n } elseif ($position === 'afterbegin') {\n $relativeNode->insertNode($node, $relativeNode->firstChild);\n } elseif ($position === 'beforeend') {\n $relativeNode->appendChild($node);\n } elseif ($position === 'afterend') {\n $relativeNode->parentNode->insertNode(\n $node,\n $relativeNode->nextSibling\n );\n }\n }", "public function addOffset($offset) {}", "public function insertBefore(self $child, self $newChild);", "private function _checkBoundary($newBoundary, $newBox) {}", "public function insertBefore (DOMNode $newnode , $refnode = null) {}", "public function addOffset($offset);", "function eatlas_spatial_publisher_node_update($node) {\n if ($node->type === EATLAS_SPATIAL_PUBLISHER_CONTENT_TYPE) {\n eatlas_spatial_publisher_regions_save($node);\n }\n}", "public function insertBefore (DOMNode $newnode, DOMNode $refnode = null) {}", "function array_insert(&$array, $offset, $object, $replace=false){\r\n \r\n if(is_array($array)){\r\n if($replace ){\r\n if($offset<0) $offset = 0;\r\n else if($offset > count($array)-1) $offset = count($array)-1;\r\n $a1 = array_slice($array, 0, $offset);\r\n $a2 = array_slice($array, $offset+1);\r\n array_push($a1, $object);\r\n $array = array_merge($a1, $a2);\r\n }else{ \r\n if($offset == 0){\r\n array_unshift($array, $object);\r\n }else if($offset >= count($array)){\r\n array_push($array, $object);\r\n }else{ \r\n $a1 = array_slice($array, 0, $offset);\r\n $a2 = array_slice($array, $offset);\r\n array_push($a1, $object);\r\n $array = array_merge($a1, $a2);\r\n }\r\n }\r\n } \r\n }", "public function insert($new, $pos);", "public function testUpdateNode()\n {\n $this->markTestIncomplete('We need a way to reliably create a node first.');\n }", "function insertSub ( &$_n, $_payload, $_pos )\n\t{\n\t\t\t//empty pointer from an internal node\n\t\tif ( ! is_object ( $_n ) )\n\t\t{\n\t\t\t//auto leaf\n\t\t\t$_n = new Node ( $_payload->payload [ $_pos ] );\n\t\t} \n\t\t\n\t\t\t//we placed the leaf in an appropriate position and will\n\t\t\t//now continue with our new internal node.\n\t\tif ( ord ( $_payload->payload [ $_pos ] ) < ord ( $_n->char ) )\n\t\t{\n\t\t\t$this->insertSub ( &$_n->left, $_payload, $_pos );\t\n\t\t\n\t\t} else if ( ord ( $_payload->payload [ $_pos ] ) > ord ( $_n->char ) )\n\t\t{\n\t\t\t$this->insertSub ( &$_n->right, $_payload, $_pos );\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\tif ( $_pos+1 == strlen ( $_payload->payload ) )\n\t\t\t{\n\t\t\t\t$_n->word = $_payload; \n\t\t\t\t$this->is_leaf = false;\n\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$this->insertSub ( &$_n->mid, $_payload, $_pos+1 );\n\t\t\n\t\t\t}\n\t\t}\t\t\n\t}", "public function insertAfterNode(Nodeable $node)\n {\n return $this->afterNode($node)->save();\n }", "function updateposition($itemid=0, $parent=0, $point_of_insertion=1) \n {\n $bindvars = array();\n $bindvars[1] = array();\n $bindvars[2] = array();\n $bindvars[3] = array();\n\n /* Opening space for the new node */\n $SQLquery[1] = \"UPDATE \" . $this->initialization_celkotable .\n \" SET \" . $this->initialization_celkoright_id . \" = \" . $this->initialization_celkoright_id . \" + 2\n WHERE \" . $this->initialization_celkoright_id . \">= ?\";\n $bindvars[1][] = $point_of_insertion;\n\n $SQLquery[2] = \"UPDATE \" . $this->initialization_celkotable .\n \" SET \" . $this->initialization_celkoleft_id . \" = \" . $this->initialization_celkoleft_id . \" + 2\n WHERE \" . $this->initialization_celkoleft_id . \">= ?\";\n $bindvars[2][] = $point_of_insertion;\n // Both can be transformed into just one SQL-statement, but I dont know if every database is SQL-92 compliant(?)\n\n $SQLquery[3] = \"UPDATE \" . $this->initialization_celkotable . \" SET \" .\n $this->initialization_celkoparent_id . \" = ?,\" .\n $this->initialization_celkoleft_id . \" = ?,\" .\n $this->initialization_celkoright_id . \" = ?\n WHERE id = ?\";\n $bindvars[3] = array($parent, $point_of_insertion, $point_of_insertion + 1,$itemid);\n\n $dbconn = xarDB::getConn();\n for ($i=1;$i<4;$i++) if (!$dbconn->Execute($SQLquery[$i],$bindvars[$i])) return;\n }", "public function offsetSet($offset, $value)\n {\n if ($this->_notSpecialType($value, $offset)) {\n if ($this->_contentToTag) {\n $this->appendAttrib($this->_contentToTag, $value);\n\n } else {\n if ($this->_defaultChildTag && $this->_notAllowedChild($value)) {\n\n if ($this->_addtoLastChild && $this->_lastChild) {\n if (null === $offset) {\n $this->_lastChild[] = $value;\n } else {\n $this->_lastChild[$offset] = $value;\n }\n return;\n }\n\n $value = $this->_createDefaultTag($value, $offset);\n }\n\n // Set as last child when this is a new item only.\n if (! isset($offset, $this->_content[$offset])) {\n $this->_lastChild = $value;\n }\n\n if (null === $offset) {\n $this->_content[] = $value;\n } else {\n $this->_content[$offset] = $value;\n }\n }\n }\n }", "public abstract function moveBelow($node);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for activityTaskListRangeGet GET Task basic info on range start_date end_date.
public function testActivityTaskListRangeGet() { }
[ "protected function activityMeetingListRangeGetRequest($start_date, $end_date, $index)\n {\n // verify the required parameter 'start_date' is set\n if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $start_date when calling activityMeetingListRangeGet'\n );\n }\n // verify the required parameter 'end_date' is set\n if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $end_date when calling activityMeetingListRangeGet'\n );\n }\n // verify the required parameter 'index' is set\n if ($index === null || (is_array($index) && count($index) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $index when calling activityMeetingListRangeGet'\n );\n }\n\n $resourcePath = '/activity/meeting/list_range';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($start_date !== null) {\n $queryParams['start_date'] = ObjectSerializer::toQueryValue($start_date);\n }\n // query params\n if ($end_date !== null) {\n $queryParams['end_date'] = ObjectSerializer::toQueryValue($end_date);\n }\n // query params\n if ($index !== null) {\n $queryParams['index'] = ObjectSerializer::toQueryValue($index);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "private function get_task_date_range($task=NULL)\n\t{\n\t\tif(is_null($task)) $this->_logger->handle_error('get_task_date_range: $task cannot be null.');\n\n\t\t$range = false;\n\t\tswitch(intval($task->date_type))\n\t\t{\n\t\t\tcase REL_CAL:\n\t\t\tcase REL_LFD:\n\t\t\tcase REL_CROPSTART:\n\t\t\t\t$min_val = $task->from_rel_number;\n\t\t\t\t$max_val = ((intval($task->is_range)>0)&&(intval($task->to_rel_number)!==0))? $task->to_rel_number : $min_val;\n\t\t\tbreak;\n\n\t\t\tcase NON_REL_CAL:\n\t\t\t\t$min_val = $task->from_rel;\n\t\t\t\t$max_val = (intval($task->is_range)>0)? $task->to_rel : $min_val;\n\t\t\tbreak;\n\n\t\t}\n\n\t\tif(isset($min_val)&&isset($max_val)) $range = array($min_val,$max_val);\n\n\t\treturn $range;\n\t}", "function event_list_range($mysqli, $start, $end)\n{\n\t$where = 'start_time>=\\'' . date(MYSQL_DATETIME_FMT, $start) . '\\' AND\n\t start_time<=\\'' . date(MYSQL_DATETIME_FMT, $end) . '\\'';\n\treturn __event_list($mysqli, $where);\n}", "private function _get_range()\n\t{\n\t\t// --------------------------------------\n\t\t// Initiate range array (faux object)\n\t\t// --------------------------------------\n\n\t\t$range = array(\n\t\t\t'start_date' => NULL,\n\t\t\t'start_time' => NULL,\n\t\t\t'end_date' => NULL,\n\t\t\t'end_time' => NULL\n\t\t);\n\n\t\t// --------------------------------------\n\t\t// Passed, Active and Upcoming\n\t\t// --------------------------------------\n\n\t\tforeach (array('passed', 'active', 'upcoming') AS $key)\n\t\t{\n\t\t\t$range[$key] = ! ($this->_get_param('show_'.$key) == 'no');\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Get field IDs from param\n\t\t// --------------------------------------\n\n\t\t$range['fields'] = $this->_get_event_field_ids();\n\n\t\t// --------------------------------------\n\t\t// Site IDs\n\t\t// --------------------------------------\n\n\t\t$range['site_id'] = implode('|', ee()->TMPL->site_ids);\n\n\t\t// Return it\n\t\treturn $range;\n\t}", "public function test_api_filter_date_range()\n {\n $this->get([\n 'filters[date_range]' => '25-10-2020:10-11-2020',\n ]);\n\n $response = (string) $this->response->getBody();\n\n $this->assertArrayHasKey('data', json_decode($response, 1));\n\n $this->assertCount(5, json_decode($response, 1)['data']);\n }", "public function getByRange($dateStart, $dateEnd, $timeStart = null, $timeEnd = null,\r\n $limit = null, $offset = null, $loadMeta = true)\r\n {\r\n if ($dateStart instanceof DateTime) {\r\n $dateStart = $dateStart->format('Y-m-d');\r\n }\r\n\r\n if (! preg_match('/^([0-9]{4})\\-(0?[1-9]|1[0-2])\\-(0?[1-9]|[1-2][0-9]|3[0-1])$/', $dateStart)) {\r\n throw new InvalidArgumentException('Invalid start date passed for getting reservations by range');\r\n }\r\n\r\n if ($dateEnd instanceof DateTime) {\r\n $dateEnd = $dateEnd->format('Y-m-d');\r\n }\r\n\r\n if (! preg_match('/^([0-9]{4})\\-(0?[1-9]|1[0-2])\\-(0?[1-9]|[1-2][0-9]|3[0-1])$/', $dateEnd)) {\r\n throw new InvalidArgumentException('Invalid end date passed for getting reservations by range');\r\n }\r\n\r\n $where = array('date >= \"' . $dateStart . '\"', 'date <= \"' . $dateEnd . '\"');\r\n\r\n if ($timeStart && preg_match('/^(00|0?[1-9]|1[0-9]|2[0-4])\\:(00|0[0-9]|[1-5][0-9])(\\:(00|0[0-9]|[1-5][0-9]))?$/', $timeStart)) {\r\n $where[] = 'time_start < \"' . $timeEnd . '\"';\r\n }\r\n\r\n if ($timeEnd && preg_match('/^(00|0?[1-9]|1[0-9]|2[0-4])\\:(00|0[0-9]|[1-5][0-9])(\\:(00|0[0-9]|[1-5][0-9]))?$/', $timeEnd)) {\r\n $where[] = 'time_end > \"' . $timeStart . '\"';\r\n }\r\n\r\n return $this->getBy($where, 'date, time_start ASC', $limit, $offset, $loadMeta);\r\n }", "public function testCanInterpretRangeRules()\n {\n $task = new Zend_Scheduler_Task();\n $task->setTime(mktime(23, 59, 59, 12, 31, 2006));\n\n $task->setMonths('October-December');\n $this->assertTrue($task->isScheduled(), 'Standard month range rule was not interpreted correctly');\n\n $task->setMonths('November-February');\n $this->assertTrue($task->isScheduled(), 'Wrap-around month range rule was not interpreted correctly');\n\n $task->setDays('25-31');\n $this->assertTrue($task->isScheduled(), 'Day range rule was not interpreted correctly');\n\n $task->setDays('25-3');\n $this->assertTrue($task->isScheduled(), 'Wrap-around day range rule was not interpreted correctly');\n\n $task->setDays('25-last');\n $this->assertTrue($task->isScheduled(), \"Day range rule using keyword 'last' was not interpreted correctly\");\n\n $task->setDays('last-3');\n $this->assertTrue($task->isScheduled(), \"Wrap-around day range rule using keyword 'last' was not interpreted correctly\");\n\n $task->setWeekdays('Sunday-Wednesday');\n $this->assertTrue($task->isScheduled(), 'Weekday range rule was not interpreted correctly');\n\n $task->setWeekdays('Friday-Wednesday');\n $this->assertTrue($task->isScheduled(), 'Wrap-around weekday range rule was not interpreted correctly');\n\n $task->setHours('18-23');\n $this->assertTrue($task->isScheduled(), 'Hour range rule was not interpreted correctly');\n\n $task->setHours('18-5');\n $this->assertTrue($task->isScheduled(), 'Wrap-around hour range rule was not interpreted correctly');\n\n $task->setMinutes('30-59');\n $this->assertTrue($task->isScheduled(), 'Minute range rule was not interpreted correctly');\n\n $task->setMinutes('50-10');\n $this->assertTrue($task->isScheduled(), 'Wrap-around minute range rule was not interpreted correctly');\n }", "public function lGetRange($key, $start, $end) { }", "public function lGetRange($key, $start, $end) {}", "public function findMatchesForDateRange($start, $end) {\r\n $resource = 'matches/?dateFrom=' . $start . '&dateTo=' . $end.'&status=SCHEDULED' ;\r\n\r\n $response = file_get_contents($this->baseUri . $resource, false, \r\n stream_context_create($this->reqPrefs));\r\n \r\n return json_decode($response);\r\n }", "public function testSelecteeSheetDateRange() : void\n {\n $dateRange = self::$client->get(array('a' => 'FTEdata/selecteeSheetDateRange', 'startDate' => 'date', 'endDate' => 'date'));\n $this->assertEquals('Invalid Date', $dateRange);\n }", "public function testGenericResourceControllerIndexQueryRange()\n {\n // Clear tasks collection\n GenericModel::setCollection('tasks');\n GenericModel::truncate();\n\n // Create some tasks and set priority\n for ($i = 1; $i < 11; $i++) {\n $task = $this->getAssignedTask();\n $task->priority = $i;\n $task->save();\n }\n\n // Query parameters\n $queryParams = [\n 'priority' => '1 >=<5',\n ];\n\n // Set request and call controller\n $request = new Request();\n $request->setMethod('GET');\n\n $request->query = new ParameterBag($queryParams);\n\n $controller = new GenericResourceController($request);\n $response = $controller->index($request);\n $this->assertCount(5, $response);\n\n // Query parameters\n $queryParams = [\n 'priority' => '7 >=< 10',\n ];\n\n // Set request and call controller\n $request = new Request();\n $request->setMethod('GET');\n\n $request->query = new ParameterBag($queryParams);\n\n $controller = new GenericResourceController($request);\n $response = $controller->index($request);\n $this->assertCount(4, $response);\n }", "public function activityMeetingListRangeGet($start_date, $end_date, $index)\n {\n list($response) = $this->activityMeetingListRangeGetWithHttpInfo($start_date, $end_date, $index);\n return $response;\n }", "public function test_historical_asset_value_range(){\n $response = $this->get('/api/crypto/historical/asset/value/btc/usd/1587340800/1587427200/1h');\n $response->assertStatus(200);\n assert(count($response->json()['data']) == 24);\n\n $response = $this->get('/api/crypto/historical/asset/value/btc/usd/1587340800/1587427200/xxx');\n $response->assertStatus(404);\n $response->assertExactJson(array(\"message\" => \"Time range not supported\"));\n\n $response = $this->get('/api/crypto/historical/asset/value/btc/usd/1587340800/1587380400/12h');\n $response->assertStatus(404);\n $response->assertExactJson(array(\"message\" => \"Range not between start and end\"));\n }", "public function createRange(\\DateTimeInterface $begin, \\DateTimeInterface $end): Range;", "public function getAllBetween(int $from, int $to)\n {\n }", "public function retrieveDateRange($start, $end) {\n\t\t\t$query =\n\t\t\t\t\"SELECT run_timestamp, keyname, content_date, score\n\t\t\t\tFROM \" . Scorcher::DBTABLE . \"\n\t\t\t\tWHERE content_date\n\t\t\t\tBETWEEN '$start'\n\t\t\t\tAND '$end'\n\t\t\t\tORDER BY content_date ASC\";\n\t\t\t$result = Scorcher::executeQuery($query);\n\t\t\techo \"<b>Date range retrieved:</b> <br />\\n\";\n\t\t\tScorcher::printRows($result);\n\t\t}", "function getRange($start, $end)\r\n{\r\n $outputarray = array();\r\n\r\n for($i=$start; $i<=$end; ++$i)\r\n {\r\n $outputarray[]=$i;\r\n }\r\n return $outputarray;\r\n}", "public function createRange();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ | Other Methods | Register the GeoIP manager.
private function registerGeoIpManager() { $this->singleton(Contracts\DriverFactory::class, function ($app) { return new DriverManager($app); }); $this->singleton(Contracts\GeoIPDriver::class, function ($app) { /** @var \Arcanedev\GeoIP\Contracts\DriverFactory $manager */ $manager = $app[Contracts\DriverFactory::class]; return $manager->driver(); }); }
[ "private function setupGeoIP(): void\n {\n geoip_setup_custom_directory(CHANDLER_ROOT . \"/3rdparty/maxmind/\");\n }", "public function load_geo_ip () {\r\n\t\tinclude_once CIT_FNS_DIR . '/geoplugin.class.php';\r\n\t\t$this->gc = new geoPlugin();\r\n\t}", "private function registerUpdateGeoIpCommand()\n {\n $this->app->singleton('firewall.updategeoip.command', function () {\n return new UpdateGeoIpCommand();\n });\n\n $this->commands('firewall.updategeoip.command');\n }", "function appthemes_register_geo_settings() {\n\tnew APP_Geo_Settings_Admin( APP_Geocoder_Registry::get_options() );\n}", "private function registerManager()\n\t{\n\t\t$this->app->bindShared('cerbero.affiliate.manager', function($app)\n\t\t{\n\t\t\treturn new AffiliateManager($app);\n\t\t});\n\t}", "public function __construct()\n {\n $this->geo = new GeoIP;\n $this->geo->request();\n\n }", "protected function init()\n\t{\n\t\t$this->registry = ipsRegistry::instance();\n\t\t$this->registry->init();\n\t}", "private function registerIpList()\n {\n $this->app->singleton('firewall.iplist', function () {\n return new IpList($this->getFirewallModel());\n });\n }", "public static function createGeocoder()\n {\n return new FreeGeoIp(new FopenHttpAdapter());\n }", "abstract function register($registerManager);", "public function hasGeoip();", "private function registerIpList()\n {\n $this->app->singleton('firewall.ip.list', function($app) {\n return new IpList(\n $app['firewall.config'],\n $app['firewall.cache'],\n $app['firewall.ip.address'],\n $app['firewall.countries']\n );\n });\n }", "public function useIpGeolocation()\n {\n return $this->getConfig()->useIpGeolocation($this->getStore());\n }", "protected function set_geocoder() {\n $this->partial(\"Initializing geocoder ... \");\n $client = new HttpClient();\n $provider = new GeocodeProvider($client, null, $this->get_geocode_api_key());\n $this->geocoder = new StatefulGeocoder($provider, 'en');\n $this->success(\"OK\");\n }", "protected function registerManager() {\n $this->app->bindShared('compleet', function($app) {\n $manager = new CompleetManager($app);\n\n return $manager;\n });\n }", "public function getIpAddressProvider()\n {\n return [\n [new GeoIPs($this->getAdapter($_SERVER['GEOIPS_API_KEY']), $_SERVER['GEOIPS_API_KEY'])],\n [new GeoPlugin($this->getAdapter())],\n [new FreeGeoIp($this->getAdapter())],\n [Nominatim::withOpenStreetMapServer($this->getAdapter(), 'en')],\n //[new MaxMind($this->getAdapter($_SERVER['MAXMIND_API_KEY']), $_SERVER['MAXMIND_API_KEY'])],\n //[new IpInfoDb($this->getAdapter($_SERVER['IPINFODB_API_KEY']), $_SERVER['IPINFODB_API_KEY'])],\n ];\n }", "public function process_location_manager() {\n\t SLP_AJAX_Location_Manager::get_instance();\n }", "function googlemaploc_init() {\n\tregister_setting('googlemaploc_plugin_options', 'googlemaploc_options', 'googlemaploc_validate_options');\n}", "protected function registerNotifier()\n {\n $this->app->singleton('antares.notifier', function ($app) {\n return new NotifierManager($app);\n });\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use the CrmAddressRelatedByCrmAccountId relation CrmAddress object
public function useCrmAddressRelatedByCrmAccountIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN) { return $this ->joinCrmAddressRelatedByCrmAccountId($relationAlias, $joinType) ->useQuery($relationAlias ? $relationAlias : 'CrmAddressRelatedByCrmAccountId', '\models\models\CrmAddressQuery'); }
[ "public function useCrmAccountRelatedByCrmAddressIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinCrmAccountRelatedByCrmAddressId($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'CrmAccountRelatedByCrmAddressId', '\\models\\models\\CrmAccountQuery');\n }", "public function getAddress(CustomerModel $customer, $addressId);", "public function getRelatedAddress() {\n\t\treturn $this->relatedAddress;\n\t}", "public function clientaddress()\n {\n return $this->hasOne('App\\Models\\System\\Client\\ClientAddress', 'address_id');\n }", "public function addresses()\n {\n return $this->belongsToMany(AddressProxy::modelClass(), 'customer_addresses');\n }", "public function getCustomerAddressId();", "public function useCrmAccountRelatedByCrmAccountIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinCrmAccountRelatedByCrmAccountId($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'CrmAccountRelatedByCrmAccountId', '\\models\\models\\CrmAccountQuery');\n }", "public function addresses()\n {\n return $this->hasMany('App\\Models\\Address', 'card_id')->orderBy('id');\n }", "public function getAddressObject();", "public function address()\n {\n return $this->hasOne(CompanyAddress::class);\n }", "public function billing_address()\n {\n return $this->hasOne(AddressProxy::modelClass(), 'saas_subscription_recurring_profile_id');\n }", "function getContactAddressFromCRM($oCRM){\n //our query\n $sQuery = \"\";\n\n //the query\n $sQuery = \"SELECT crm.contacts.id as owner, crm.contact_info.fonction, crm.infos.id, crm.infos.adr1, crm.infos.adr2, crm.infos.adr3, crm.infos.cp, crm.infos.cedex, crm.infos.ville, crm.infos.pays_id, crm.infos.tel1, crm.infos.tel2,\"; \n $sQuery .= \"crm.infos.email1, crm.infos.email2, crm.infos.site\" . \"\\r\\n\";\n $sQuery .= \"FROM crm.infos, crm.contact_info, crm.contacts\" . \"\\r\\n\";\n $sQuery .= \"WHERE crm.infos.id = crm.contact_info.info_id\" . \"\\r\\n\";\n $sQuery .= \"AND crm.contact_info.contact_id = crm.contacts.id\" . \"\\r\\n\";\n\n //open\n $oCRM->open();\n //the select query\n $ary_ = $oCRM->selectRequest($sQuery, explode(\", \", \"owner, fonction, id, adr1, adr2, adr3, cp, cedex, ville, pays_id, tel1, tel2, email1, email2, site\"), null);\n //close\n $oCRM->close();\n\n //return the result\n return $ary_;\n}", "public function billing_address()\n {\n return $this->hasOne(Address::class, 'id', 'billing_address_id')->withTrashed();\n }", "public function customerAddresses()\n {\n return $this->hasMany(CustomerAddress::class, CustomerAddress::FIELD_ID_CUSTOMER, self::FIELD_ID);\n }", "public function address()\n {\n return $this->hasmany('App\\Models\\Address');\n }", "public function invoiceAddress() {\n $result = $this->purchases->flatInvoice();\n foreach ($result as $key => $value) {\n $getAdress = $this->purchases->companyAddress($value->CustomerCompanyID);\n $data = array('Params' => $getAdress[0]->Params);\n $response = $this->purchases->invoiceAdressupdate($value->InvoiceID, $data);\n echo $response . \"<br/>\";\n }\n }", "public function hydrateAddressList()\n {\n // initialize the contact profile\n if (is_null($this->contactProfile)) { $this->initContactProfile(); }\n\n $this->tableGateway->setTable('v_company_address');\n $addressRows = $this->tableGateway->findBy('companyId', $this->entity->getId());\n\n foreach($addressRows as $row) {\n $address = $this->serializer->denormalize($row, Address::class, 'array');\n $this->contactProfile->addAddress($address);\n }\n\n $this->entity->setContactProfile($this->contactProfile);\n return $this->entity;\n }", "public function address()\n {\n return $this->has_many('Address');\n }", "public function setCustomerAndAddressFields()\n {\n\n $addressEntityType = $this->eavConfigModel->getEntityType('customer_address');\n $customerEntityType = $this->eavConfigModel->getEntityType('customer');\n $entityTypeIds = [];\n $entityTypeIds[] = $customerEntityType->getEntityTypeId();\n $entityTypeIds[] = $addressEntityType->getEntityTypeId();\n\n $attributes = $this->eavAttributeCollections->addFieldToFilter('entity_type_id', array('in' => $entityTypeIds));\n\n $eavCustomerField = [];\n $eavAddressField = [];\n foreach ($attributes as $key => $attribute) {\n if ($attribute->getEntityTypeId() == 1) {\n $eavCustomerField[] = $attribute->getData();\n }else{\n $eavAddressField[] = $attribute->getData();\n }\n } \n $this->eavAddressFields = $eavAddressField;\n $this->eavCustomerFields = $eavCustomerField;\n\n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Kill the Chat / Game server only usable by Admin
function kill_server( $type ) { $config = file_get_contents( "assets/servers.xml" ); $xml = xml2array( $config ); $server = get_value_by_path( $xml, 'servers/' . $type . 'server/server' ); $port = get_value_by_path( $xml, 'servers/' . $type . 'server/port' ); $server = $server['value']; $port = $port['value']; // connect to the server $socket = socket_create( AF_INET, SOCK_STREAM, SOL_TCP ); socket_set_option( $socket, SOL_SOCKET, SO_SNDTIMEO, array( "sec" => 2, "usec" => 0 ) ); if ( @socket_connect( $socket, $server, $port ) ) { // identify to the server (must be admin to TERMinate) $msg = "PHPSESSION=" . session_id(); socket_write( $socket, $msg, strlen( $msg ) ); $data = @socket_read( $socket, 1024 ); $response = xml2array( $data ); $identified = get_value_by_path( $response, "s/i" ); $ok = ( intval( $identified['value'] ) == 1 ); if ( $ok ) { // terminate the server socket_write( $socket, "TERM", strlen( "TERM" ) ); // close the connection while ( $data = @socket_read( $socket, 1024 ) ) { // wait for server to close. } @socket_close( $socket ); return; } @socket_close( $socket ); } $server = ( $type == "game" ) ? "Game" : "Chat"; $serverProcess = exec( "ps aux | grep rups" . $server . "Server | grep -v grep | awk '{print $2'}" ); if ( intval( $serverProcess ) > 0 ) { exec( "kill -9 $serverProcess" ); exec( "screen -wipe" ); } }
[ "public function killPlayer($player) { // to test\n if($this->loggedIn === false) {\n return false;\n }\n $data = $this->exec($this->socket, 'admin.killPlayer ' . $player);\n return $data; // 4 testing\n if ($data[0] == \"OK\") {\n return true;\n } else {\n return false;\n }\n }", "function Admin_Disconnection(){\n unset($_SESSION['Admin']);\n}", "public function actionKillall()\n {\n\n foreach(Player::find()->where(['status'=>10])->all() as $pM)\n {\n printf(\"Logging out %d\\n\",$pM->id);\n OpenVPN::logout($pM->id);\n }\n }", "function kill_plesk_account()\n {\n $login = $this->order_data['dom_user'];\n $data=<<<EOF\n<packet version=\"1.3.4.0\">\n<client>\n<del>\n<filter>\n<login>$login</login>\n</filter>\n</del>\n</client>\n</packet>\nEOF;\n $contents = $this->plesk_request($data);\n $return = $this->anaRes($contents);\n if($this->error)\n {\n $result['response'] = $this->error;\n $result['result'] = 0;\n }\n else\n {\n $result['response'] = \"OK\";\n $result['result'] = 1;\n $this->error = false;\n }\n $this->result = $result;\n return $this->result;\n }", "private function commandModUnMute()\n {\n $unmuted_name = trim(substr($this->message, 8));\n client_unmute($this->player->socket, $unmuted_name);\n }", "public function kill_server() {\n\t\tglobal $wp_rest_server;\n\n\t\t$this->controllers = [];\n\t\t$this->command_formats = [];\n\t\t$this->server = false;\n\t\t$this->is_internal = false;\n\t\t$this->cache = [];\n\t\t$wp_rest_server = false;\n\t}", "public static function killAll()\n {\n shell_exec(self::CMD[config('minecraft.edition')]['killall'],);\n }", "public function disconnectNow(): void {\n // TODO: Send ScriptSharePacket with \"send:lobby\"\n }", "public function destroyServer()\n {\n }", "function unmute(){\n\t\t\tglobal $db, $prefix, $x7c, $txt;\n\t\t\t$voiced = $x7c->room_data['voiced'];\n\t\t\t$their_id = $this->user_info->profile['id'];\n\t\t\t$room_id = $x7c->room_data['id'];\n\t\t\t$voiced = explode(\";\",$voiced);\n\t\t\t$key = array_search(\"-$their_id\",$voiced);\n\t\t\tunset($voiced[$key]);\n\t\t\t$voiced = implode(\";\",$voiced);\n\t\t\t$db->DoQuery(\"UPDATE {$prefix}rooms SET voiced='$voiced' WHERE id='$room_id'\");\n\t\t\t// Alert the room that they have a new operator\n\t\t\tinclude_once(\"./lib/message.php\");\n\t\t\talert_room($x7c->room_name,$txt[132],$this->user);\n\t\t}", "public function killSessions(){\n\t\t\t$kill_function = new sessionKiller ;\n\t\t\t$kill_function->killLoginSessions() ;\n\t\t}", "public function kill() {\n\t\t$this->_connexion = null;\n\t}", "public function kill(): void {}", "public function stopServer() {\n\t\t$this -> _serverRunning = 0;\n\t}", "static function deconnexion_admin() {\n\n unset($_SESSION['nom']);\n unset($_SESSION['prenoms']);\n unset($_SESSION['email']);\n unset($_SESSION['password']);\n unset($_SESSION['privilege']);\n return TRUE;\n }", "function exitToMainLobby() {\n $user = getUsername();\n if ($this->db->getUserLobby($user) != 0) {\n $this->db->moveUserToLobby($user, $this->mainLobby);\n }\n }", "function adminlogout($nick) {\n\n // Check if user is still in chat, if yes then use breakframes code\n // Read each line of onlinelog into an array\n $online_array = file(\"online.txt\");\n // Get each line of the online array, explode the seperator (,), check if user is still in chat\n foreach ($online_array as $user_on) {\n $fields = explode(\",\",$user_on);\t\n // check if in chat\n if ($fields[0] == \"$nick\" && $fields[1] == 2){\n $framed = 1;\n }\n }\n\n // Update onlinelog to show we are now logged out\n writeonline($nick, 0);\n\n // Update chatlog with adminlogout message\n writemessage($nick, 15, null, \"adminlogout\", null);\n\n // Clear message log if no one is in chat\n clearchat();\n\n if ($framed == 1) {\n // Exit minichat (frames) and load index page\n breakframes(\"/index.php\");\n } else {\n // Just load the index page\n Header(\"Location: /index.php\");\n }\n}", "public function logoff();", "public function onKill()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if all items status is completed
protected function isAllItemsCompleted() { $complete = true; /** @var \Magento\Support\Model\Backup\AbstractItem $item*/ foreach ($this->getItems() as $item) { if ($item->getStatus() != \Magento\Support\Model\Backup\AbstractItem::STATUS_COMPLETE) { $complete = false; break; } } return $complete; }
[ "public function is_done()\n {\n $completedStatusList = array(\n 'completed',\n 'passed',\n 'succeeded',\n 'failed'\n );\n\n if ($this->status_is($completedStatusList)) {\n if (self::debug > 2) {\n error_log(\n 'learnpath::is_done() - Item ' . $this->get_id(\n ) . ' is complete',\n 0\n );\n }\n\n return true;\n } else {\n if (self::debug > 2) {\n error_log(\n 'learnpath::is_done() - Item ' . $this->get_id(\n ) . ' is not complete',\n 0\n );\n }\n\n return false;\n }\n }", "public function isComplete();", "public function isCompleted()\n {\n return $this->status == 'Complete'\n && $this->amount > 0.1\n && !empty($this->product_list);\n }", "public function orderComplete(){\n if($this->status == \"complete\") return true;\n return false;\n }", "public function updateStatus()\n {\n $done = true;\n\n if ($this->items->isNotEmpty()) {\n $items = $this->items()->with('salesOrderItems')->get();\n\n foreach ($items as $item) {\n $quantityOrdered = $item->salesOrderItems->sum('quantity');\n if ($item->quantity - $quantityOrdered > 0) {\n $done = false;\n break;\n }\n }\n } elseif ($this->groupItems->isNotEmpty()) {\n $groupItems = $this->groupItems()->with('salesOrderItems')->get();\n\n foreach ($groupItems as $groupItem) {\n $quantityOrdered = $groupItem->salesOrderItems->sum('quantity');\n if ($groupItem->quantity - $quantityOrdered > 0) {\n $done = false;\n break;\n }\n }\n }\n\n $this->form()->update(['done' => $done]);\n }", "function checkAllDetailComplete(){\n\t\tif(!$this->loaded())\n\t\t\tthrow new \\Exception(\"jobcrad model must loaded\");\n\t\t\t\t\n\t\t$all_complete = false;\n\t\t\n\t\t$jd_detail = $this->add('xepan\\production\\Model_Jobcard_Detail')\n\t\t\t\t\t->addCondition('jobcard_id',$this->id)->getRows();\n\n\t\t$total_received_qty = 0;\n\t\t$total_complete_qty = 0;\n\t\tforeach ($jd_detail as $temp) {\n\t\t\tif($temp['status'] == \"Received\")\n\t\t\t\t$total_received_qty += $temp['quantity'];\n\t\t\t \n\t\t\tif($temp['status'] == \"Completed\")\n\t\t\t\t$total_complete_qty += $temp['quantity'];\n\t\t}\n\t\t\t\t\n\t\tif($total_received_qty == $total_complete_qty ){\n\t\t\t$all_complete = true;\n\t\t}\n\n\t\treturn $all_complete;\n\n\t}", "public function isCompleted() : bool\n {\n return in_array($this->getOrderStatus(), [self::AUTHORISED, self::COMPLETED]);\n }", "public function isDone()\n {\n $pendingCount = $this->getBulkByStatus('PENDING')->count();\n if ($pendingCount === 0) {\n return true;\n }\n return false;\n }", "protected function hasCompleted() {\n return !(bool)$this->expectedStep();\n }", "public function isCompletedScrapped()\n {\n return $this->statuses->where('name', 'Completed scrapped')->isNotEmpty();\n }", "private function ticketIsComplete() : bool\n {\n return $this->jiraCompleted && $this->bbCompleted && $this->dirCompleted;\n }", "public function shouldBeCompleted()\n {\n return $this->pulse_survey_results_open()->count() <= 0;\n }", "public function check_completed()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t// Set the language to Dutch (TODO: set to language of participant?)\n\t\treset_language(L::DUTCH);\n\n\t\t// Get all testinvites that have not yet been completed\n\t\t$testinvites = $this->testInviteModel->get_not_completed_testinvites(); \n\t\tforeach ($testinvites as $testinvite)\n\t\t{\n\t\t\t$testsurvey = $this->testInviteModel->get_testsurvey_by_testinvite($testinvite);\n\t\t\t// If the survey still exists in LimeSurvey...\n\t\t\tif ($this->surveyModel->get_survey_by_id($testsurvey->limesurvey_id))\n\t\t\t{\n\t\t\t\t// Check with LimeSurvey whether the survey has actually been completed\n\t\t\t\t$result = $this->surveyModel->get_result_by_token($testsurvey->limesurvey_id, $testinvite->token);\n\t\t\t\tif ($result) \n\t\t\t\t{\n\t\t\t\t\t// If there is actually a result row, set the survey to completed\n\t\t\t\t\t$this->testInviteModel->set_completed($testinvite->id, $result->submitdate);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function isCompleted(): bool;", "public function isComplete()\n {\n return $this->state == self::STATE_COMPLETE;\n }", "public static function areAllTasksCompleted()\n {\n $completedTasks = self::getCompletedTasksCount();\n $totalTasks = $completedTasks + self::getActiveTasksCount();\n return $totalTasks === $completedTasks;\n }", "public function isIscompleted()\n {\n return $this->getIscompleted();\n }", "public function isCompleted()\n {\n $db = db::singleton();\n $transactions = TABLE_TRANSACTION;\n $custom = $this->getCustom();\n\n $sql = \"SELECT uid_paypal\n FROM {$transactions}\n INNER JOIN {$this->tabla}\n USING (custom)\n WHERE payment_status LIKE 'Completed'\n AND custom LIKE '{$custom}'\";\n\n return (bool) $db->query($sql, 0, 0);\n }", "public function hasCompleted(): bool\n {\n return $this->getJobState() === Constants::JOB_STATE_COMPLETED;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an array of class names of Prerequisite classes This way a wizard can define dependencies like "database uptodate" or "reference index updated"
public function getPrerequisites(): array { return [ DatabaseUpdatedPrerequisite::class ]; }
[ "public function getPrerequisites() : array {}", "public function getDependencies()\n {\n return [CategoryFixtures::class, StateFixtures::class, UserFixtures::class, CountyFixtures::class,];\n }", "public function getDependencies()\n {\n return [CategoryFixtures::class, CountyFixtures::class, StateFixtures::class, UserFixtures::class];\n }", "public function getReferencedClasses(): array\n\t{\n\t}", "public function get_dependancies() {\n\n return array();\n }", "abstract function get_prerequisites();", "function getDependencies()\n {\n return [\n UserFixtures::class,\n FuelTypeFixtures::class\n ];\n }", "public function getDependencies()\n {\n $dependencies = array();\n if ($this->extendsClassDefinition) {\n $classDefinition = $this->extendsClassDefinition;\n if (method_exists($classDefinition, 'increaseDependencyRank')) {\n $dependencies[] = $classDefinition;\n }\n }\n\n if ($this->implementedInterfaceDefinitions) {\n foreach ($this->implementedInterfaceDefinitions as $interfaceDefinition) {\n if (method_exists($interfaceDefinition, 'increaseDependencyRank')) {\n $dependencies[] = $interfaceDefinition;\n }\n }\n }\n return $dependencies;\n }", "public function getList(){\n $classes = $this->all();\n\n //For each class\n foreach($classes as $key => $class) {\n $class->prereq = [];\n \n //Get the prereq\n $prereq = $this->prerequisite($class->id);\n \n //Add to the class list\n foreach ($prereq as $req) {\n $class->prereq[] = $req;\n }\n\n //Instead of numeric, make associative\n $classes[strtolower($class->course)] = $class;\n unset($classes[$key]);\n }\n\n return $classes;\n }", "public function getDependencies(): array\n {\n return [CategoryFixtures::class, UserFixtures::class];\n }", "private function getDependencies(string $class): array\n {\n if (!isset(self::$dependencies[$class])) {\n self::$dependencies[$class] = $this->getExtractor()->fromClassName($class);\n }\n\n return self::$dependencies[$class];\n }", "public function getDependencies()\n {\n return [\n CategoryFixtures::class,\n OrganizationFixtures::class,\n ThematicFixtures::class,\n UserFixtures::class,\n ];\n }", "function getRequiredByObjectClasses() {\n\t\treturn $this->required_by_object_classes;\n\t}", "public function getClassNames(): array;", "public function getWizardSteps() {\n return array(\n InstallStepDatabase::NAME => new InstallStepDatabase(),\n InstallStepSecurity::NAME => new InstallStepSecurity(),\n );\n }", "public function getClasses()\n {\n return array();\n }", "public function getDependencies()\n {\n return [\n SubcategoryFixtures::class,\n UserFixtures::class\n ];\n }", "public function getExpectedClasses()\n {\n return array();\n }", "public function getUsedClasses(): array;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a collection of Notification objects related by a onetomany relationship to the current object. It will also schedule objects for deletion based on a diff between old objects (aka persisted) and new objects from the given Propel collection.
public function setNotifications(PropelCollection $notifications, PropelPDO $con = null) { $notificationsToDelete = $this->getNotifications(new Criteria(), $con)->diff($notifications); $this->notificationsScheduledForDeletion = unserialize(serialize($notificationsToDelete)); foreach ($notificationsToDelete as $notificationRemoved) { $notificationRemoved->setAssignment(null); } $this->collNotifications = null; foreach ($notifications as $notification) { $this->addNotification($notification); } $this->collNotifications = $notifications; $this->collNotificationsPartial = false; return $this; }
[ "public function setNotifications(Collection $notifications, ConnectionInterface $con = null)\n {\n /** @var ChildNotification[] $notificationsToDelete */\n $notificationsToDelete = $this->getNotifications(new Criteria(), $con)->diff($notifications);\n\n\n $this->notificationsScheduledForDeletion = $notificationsToDelete;\n\n foreach ($notificationsToDelete as $notificationRemoved) {\n $notificationRemoved->setTransition(null);\n }\n\n $this->collNotifications = null;\n foreach ($notifications as $notification) {\n $this->addNotification($notification);\n }\n\n $this->collNotifications = $notifications;\n $this->collNotificationsPartial = false;\n\n return $this;\n }", "public function setNotifications(Collection $notifications, ConnectionInterface $con = null)\n {\n /** @var ChildNotification[] $notificationsToDelete */\n $notificationsToDelete = $this->getNotifications(new Criteria(), $con)->diff($notifications);\n\n\n $this->notificationsScheduledForDeletion = $notificationsToDelete;\n\n foreach ($notificationsToDelete as $notificationRemoved) {\n $notificationRemoved->setNote(null);\n }\n\n $this->collNotifications = null;\n foreach ($notifications as $notification) {\n $this->addNotification($notification);\n }\n\n $this->collNotifications = $notifications;\n $this->collNotificationsPartial = false;\n\n return $this;\n }", "public function touchOwners()\n {\n foreach ($this->getTouchedRelations() as $relation) {\n $this->$relation()->touch();\n\n if ($this->$relation instanceof self) {\n $this->$relation->fireModelEvent('saved', false);\n\n $this->$relation->touchOwners();\n } elseif ($this->$relation instanceof Collection) {\n $this->$relation->each->touchOwners();\n }\n }\n }", "public function syncManyFollowings(Collection $entities);", "public function setOOEntrys(PropelCollection $oOEntrys, PropelPDO $con = null)\n\t{\n\t\t$this->oOEntrysScheduledForDeletion = $this->getOOEntrys(new Criteria(), $con)->diff($oOEntrys);\n\n\t\tforeach ($oOEntrys as $oOEntry) {\n\t\t\t// Fix issue with collection modified by reference\n\t\t\tif ($oOEntry->isNew()) {\n\t\t\t\t$oOEntry->setUser($this);\n\t\t\t}\n\t\t\t$this->addOOEntry($oOEntry);\n\t\t}\n\n\t\t$this->collOOEntrys = $oOEntrys;\n\t}", "public function syncNotificationsWithTracked()\n {\n $notificationSettings = $this->notificationSettings;\n $tracking = $this->tracking;\n\n foreach ($tracking as &$trackedNTI)\n {\n if (!isset($trackedNTI['notifications']))\n {\n $trackedNTI['notifications'] = $this->getDefaultNotificationSettings();\n }\n }\n\n $this->tracking = $tracking;\n }", "public function initafNotificationsRelatedByCreatedFor()\n\t{\n\t\t$this->collafNotificationsRelatedByCreatedFor = array();\n\t}", "public function initNotifications($overrideExisting = true)\n {\n if (null !== $this->collNotifications && !$overrideExisting) {\n return;\n }\n $this->collNotifications = new PropelObjectCollection();\n $this->collNotifications->setModel('Notification');\n }", "public function addMany(NotificationCollection $NotificationCollection)\n {\n foreach ($NotificationCollection as $Notification) {\n $this->add($Notification);\n }\n }", "public function setAgendaIgrejas(PropelCollection $agendaIgrejas, PropelPDO $con = null)\n\t{\n\t\t$this->agendaIgrejasScheduledForDeletion = $this->getAgendaIgrejas(new Criteria(), $con)->diff($agendaIgrejas);\n\n\t\tforeach ($agendaIgrejas as $agendaIgreja) {\n\t\t\t// Fix issue with collection modified by reference\n\t\t\tif ($agendaIgreja->isNew()) {\n\t\t\t\t$agendaIgreja->setIgreja($this);\n\t\t\t}\n\t\t\t$this->addAgendaIgreja($agendaIgreja);\n\t\t}\n\n\t\t$this->collAgendaIgrejas = $agendaIgrejas;\n\t}", "public function setNotify($notify)\n {\n foreach ($this->criteria as $criteria) {\n $criteria->setNotify($notify);\n }\n }", "public function setNotificacions(PropelCollection $notificacions, PropelPDO $con = null)\n {\n $notificacionsToDelete = $this->getNotificacions(new Criteria(), $con)->diff($notificacions);\n\n\n $this->notificacionsScheduledForDeletion = $notificacionsToDelete;\n\n foreach ($notificacionsToDelete as $notificacionRemoved) {\n $notificacionRemoved->setEmpleado(null);\n }\n\n $this->collNotificacions = null;\n foreach ($notificacions as $notificacion) {\n $this->addNotificacion($notificacion);\n }\n\n $this->collNotificacions = $notificacions;\n $this->collNotificacionsPartial = false;\n\n return $this;\n }", "public function touchOwners()\n {\n foreach ($this->touches as $relation) {\n if ($this->$relation instanceof self) {\n $this->$relation->touch();\n $this->$relation->touchOwners();\n } elseif (is_array($this->$relation)) {\n foreach ($this->$relation as $relation) {\n $relation->touchOwners();\n }\n }\n }\n }", "private function ormCascadeUpdate()\n {\n foreach ($this->orm['relations'] as $class => $relDetail)\n {\t \n\t // Make sure the related object is available. It should always be.\n\t if (!isset($this->$class))\n\t {\n\t continue;\n\t }\n\t \n\t // $ref will be a pointer to the related object.\t \n\t $ref = $this->$class;\n\n\t if ($ref->isDirty())\n\t {\n\t $ref->ormUpdate(); \n\t }\n }\n }", "public function setNotificacions(PropelCollection $notificacions, PropelPDO $con = null)\n {\n $notificacionsToDelete = $this->getNotificacions(new Criteria(), $con)->diff($notificacions);\n\n\n $this->notificacionsScheduledForDeletion = $notificacionsToDelete;\n\n foreach ($notificacionsToDelete as $notificacionRemoved) {\n $notificacionRemoved->setSucursal(null);\n }\n\n $this->collNotificacions = null;\n foreach ($notificacions as $notificacion) {\n $this->addNotificacion($notificacion);\n }\n\n $this->collNotificacions = $notificacions;\n $this->collNotificacionsPartial = false;\n\n return $this;\n }", "public function initNotificationsRelatedByUserId($overrideExisting = true)\n {\n if (null !== $this->collNotificationsRelatedByUserId && !$overrideExisting) {\n return;\n }\n $this->collNotificationsRelatedByUserId = new ObjectCollection();\n $this->collNotificationsRelatedByUserId->setModel('\\Models\\Notification');\n }", "public function notify(): void {\n foreach($this->observers as $obs) {\n $obs->update($this);\n\n $this->notifications[] = $this->getFavorites();\n }\n }", "public function setNotificacionsRelatedById_receptor(PropelCollection $notificacionsRelatedById_receptor, PropelPDO $con = null)\n\t{\n\t\t$this->notificacionsRelatedById_receptorScheduledForDeletion = $this->getNotificacionsRelatedById_receptor(new Criteria(), $con)->diff($notificacionsRelatedById_receptor);\n\n\t\tforeach ($notificacionsRelatedById_receptor as $notificacionRelatedById_receptor) {\n\t\t\t// Fix issue with collection modified by reference\n\t\t\tif ($notificacionRelatedById_receptor->isNew()) {\n\t\t\t\t$notificacionRelatedById_receptor->setUsuarioRelatedById_receptor($this);\n\t\t\t}\n\t\t\t$this->addNotificacionRelatedById_receptor($notificacionRelatedById_receptor);\n\t\t}\n\n\t\t$this->collNotificacionsRelatedById_receptor = $notificacionsRelatedById_receptor;\n\t}", "public function setPhotos(PropelCollection $photos, PropelPDO $con = null)\n\t{\n\t\t$this->photosScheduledForDeletion = $this->getPhotos(new Criteria(), $con)->diff($photos);\n\n\t\tforeach ($photos as $photo) {\n\t\t\t// Fix issue with collection modified by reference\n\t\t\tif ($photo->isNew()) {\n\t\t\t\t$photo->setUser($this);\n\t\t\t}\n\t\t\t$this->addPhoto($photo);\n\t\t}\n\n\t\t$this->collPhotos = $photos;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transform event into column for the db table
protected function eventIntoColumn(array $event){ if (empty($event)) { return array(); } $data = array(); foreach ($event as $name => $value) { if(!is_scalar($value)){ if (empty($value)){ $value = null; //} else if($value instanceof Exception) { // $value = $value->getMessage()."\r\n\r\n".$value->getTraceAsString(); //} else if (method_exists($value, 'toString')) { // $value = $value->toString(); } else if (is_array($value)) { $value = json_encode($value, JSON_UNESCAPED_UNICODE); } else { $value = null; } } $data[$name] = $value; } return $data; }
[ "function add_events_columns( $columns ) {\n\treturn array_merge( $columns, array(\n\t\t'event_date' => __ ( 'Event Date' ),\n\t) );\n}", "public function preHydrate ( Doctrine_Event $event ) {\n\n\t\t$CI = & get_instance();\n\t\t$dbms = $CI->db->dbdriver;\n\t\t$date_format = $CI->config->item('date_format');\n\t\t$data = $event->data;\n\n foreach ($event->getInvoker()->getColumns() as $FieldName => $Field) {\n\n if (!array_key_exists($FieldName, $data)) continue;\n\n if ($Field['type'] == 'date' && !is_null($data[$FieldName])) {\n $data[$FieldName] = mdate($date_format['in_out_format'], strtotime($data[$FieldName]));\n }\n\n }\n\n $event->data = $data;\n\n }", "protected function queryAndFormat(){\n $columnSettings = $this->eventList->getQueryColumnSettings();\n foreach($this->eventList->get() AS $row){\n $data = new \\stdClass();\n foreach($columnSettings AS $columnName => $definition){\n switch( $definition[1] ){\n case EventList::COLUMN_CAST_BOOL:\n $data->{$columnName} = (bool)$row[$columnName];\n break;\n case EventList::COLUMN_CAST_INT:\n $data->{$columnName} = (int)$row[$columnName];\n break;\n case EventList::COLUMN_CAST_TIME:\n if( $definition[2] === EventList::COLUMN_CAST_TIME_UTC ){\n $data->{$columnName} = (new DateTime($row[$columnName], $this->timezoneUTC))->format('c');\n }else{ // $definition[2] === EventList::COLUMN_CAST_TIME_LOCAL\n $data->{$columnName} = (new DateTime($row[$columnName], new DateTimeZone($row['derivedTimezone'])))->format('c');\n }\n break;\n default:\n $data->{$columnName} = $row[$columnName];\n break;\n }\n }\n array_push($this->formatted, $data);\n }\n }", "protected function mapEventIntoColumn(array $event, array $columnMap = null)\n {\n if (empty($event)) {\n return [];\n }\n\n $data = [];\n foreach ($event as $name => $value) {\n if (is_array($value)) {\n foreach ($value as $key => $subvalue) {\n if (isset($columnMap[$name][$key])) {\n if (is_scalar($subvalue)) {\n $data[$columnMap[$name][$key]] = $subvalue;\n continue;\n }\n\n $data[$columnMap[$name][$key]] = var_export($subvalue, true);\n }\n }\n } elseif (isset($columnMap[$name])) {\n $data[$columnMap[$name]] = $value;\n }\n }\n return $data;\n }", "function AppEventInfoPostTable()\n {\n $event=$this->Event();\n \n $tabledata=\n array\n (\n array\n (\n \"Name\",\"Date\",\"Status\"\n ),\n array\n (\n \"Place\",\"Place_Address\",\"Place_Site\",\n ),\n array\n (\n \"EventStart\",\"EventEnd\",\"Inscriptions_Public\",\n ),\n );\n\n $table=\n array_merge\n (\n $this->EventInfoRow($event),\n $this->EventsObj()->MyMod_Item_Table\n (\n 0,\n $event,\n $tabledata\n )\n );\n\n $this->AppEventTableGroup\n (\n $table,\n $event,\n \"Event_Inscriptions_Title\",\n array(\"StartDate\",\"EndDate\",\"EditDate\",)\n );\n \n \n return $table;\n }", "public function formatEvent(string $sql): string\n {\n return DumpFormatter::formatEvent($sql);\n }", "private function _prepare_date_in ( Doctrine_Event $event ) {\n\n\t\t$CI = & get_instance();\n\t\t$dbms = $CI->db->dbdriver;\n\t\t$date_format = $CI->config->item('date_format');\n\n $Model = $event->getInvoker();\n foreach ($Model->getTable()->getColumns() as $FieldName => $Field) {\n\n if ($Field['type'] == 'date' && !is_null($Model->$FieldName)) {\n \t$Model->$FieldName = mdate($date_format[$dbms], mysql_to_unix(str_ireplace('T', ' ', $Model->$FieldName)));\n }\n\n }\n\n }", "public function mergeWith($event)\n {\n foreach ($this->columns as $field) {\n if ($this->{$field} !== $event->{$field} && !is_array($this->{$field})) {\n $this->{$field} .= self::$mergeSpacer . $event->{$field};\n }\n if (is_array($this->{$field})) {\n $terms = array_merge($event->{$field}, $this->{$field});\n $this->{$field} = array_unique($terms);\n }\n }\n }", "function event_column_values( $col, $id ) {\n\t\tglobal $ep_models;\n\t\t$post = get_post( $id );\n\n\t\tswitch( $col ) {\n\t\t\tcase 'regs': \n\t\t\t\t$no = $ep_models['events']->get_registration_number( $post->ID );\n\t\t\t\t$val = $no->reg_approved . \" (<span class = 'ep_reg_pending' style = 'color: #020661'>\" . $no->reg_pending . \"</span>, <span class = 'ep_reg_cancelled' style = 'color: #7a1506'>\" . $no->reg_cancelled .\"</span>)\";\n\t\t\t\tbreak;\n\t\t\tcase 'starts':\n\t\t\t\t$val = ( true == ( $date = get_post_meta( $post->ID, '_ep_start', true ) ) )? date( get_option( 'date_format' ), $date ) : '&mdash;';\n\t\t\t\t$val .= '<br />';\n\t\t\t\t$val .= ( true == ( $date = get_post_meta( $post->ID, '_ep_start', true ) ) )? date( get_option( 'time_format' ), $date ) : '&mdash;';\n\t\t\t\tbreak;\n\t\t\tcase 'ends':\n\t\t\t\t$val = ( true == ( $date = get_post_meta( $post->ID, '_ep_end', true ) ) )? date( get_option( 'date_format' ), $date ) : '&mdash;';\n\t\t\t\t$val .= '<br />';\n\t\t\t\t$val .= ( true == ( $date = get_post_meta( $post->ID, '_ep_end', true ) ) )? date( get_option( 'time_format' ), $date ) : '&mdash;';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$val = '';\n\t\t}\n\n\t\techo $val;\n\t}", "public function from_legacy_event_to_data(\\calendar_event $legacyevent);", "protected function _prepareColumns() {\r\n $this->addColumn('event_id', array(\r\n 'header' => Mage::helper('events')->__('ID'),\r\n 'align' => 'right',\r\n 'width' => '50px',\r\n 'index' => 'event_id',\r\n ));\r\n\r\n $this->addColumn('title', array(\r\n 'header' => Mage::helper('events')->__('Event Title'),\r\n 'align' => 'left',\r\n 'index' => 'title',\r\n ));\r\n\r\n $this->addColumn('destination', array(\r\n 'header' => Mage::helper('events')->__('Destination Page'),\r\n 'align' => 'left',\r\n 'index' => 'destination',\r\n ));\r\n\r\n $this->addColumn('date', array(\r\n 'header' => Mage::helper('events')->__('Event Date'),\r\n 'align' => 'right',\r\n 'sortable' => true,\r\n 'index' => 'date',\r\n 'type' => 'date',\r\n ));\r\n\r\n $this->addColumn('enddate', array(\r\n 'header' => Mage::helper('events')->__('Event End Date'),\r\n 'align' => 'right',\r\n 'sortable' => true,\r\n 'index' => 'enddate',\r\n 'type' => 'date',\r\n ));\r\n\r\n\r\n $this->addColumn('action', array(\r\n 'header' => Mage::helper('events')->__('Action'),\r\n 'align' => 'center',\r\n 'width' => '70px',\r\n 'getter' => 'getEventId',\r\n 'actions' => array(\r\n array(\r\n 'caption' => Mage::helper('events')->__('Delete'),\r\n 'url' => array('base' => '*/*/delete'),\r\n 'field' => 'event_id',\r\n ),\r\n ),\r\n 'sortable' => false,\r\n 'filter' => false,\r\n 'type' => 'action',\r\n ));\r\n\r\n return parent::_prepareColumns();\r\n }", "private function addColumnEvents(){\n\n\t\t\tadd_action( 'wp_ajax_saveColumnType', function(){\n\n\t\t\t\tparent::setPostGlobal();\n\n\t\t\t\t( new ColumnHandler() )->saveType();\n\t\t\t\tdie();\n\n\t\t\t});\n\n\n\n\t\t\t//save lightbox data:\n\t\t\tadd_action( 'wp_ajax_saveColumnProperties', function(){\n\n\t\t\t\tparent::setPostGlobal();\n\t\t\t\t\n\t\t\t\techo ( new ColumnHandler() )->saveProperties();\n\t\t\t\tdie();\n\n\t\t\t});\n\n\n\t\t\tadd_action( 'wp_ajax_refreshColumn', function(){\n\n\t\t\t\tparent::setPostGlobal();\n\n\t\t\t\t( new ColumnHandler() )->refreshColumn();\n\t\t\t\tdie();\n\n\t\t\t});\n\n\t\t}", "protected function mapEventToType(string $a_event): string\n {\n return ($a_event == \"updateStatus\" ? \"lp_event\" : ( $a_event == \"addParticipant\" ? \"member_event\" : \"unknown\"));\n }", "public function serialize(Event $event): string;", "abstract public function mapColumnsWithDB();", "public function selectEvent(){\n return $this->connect->getData(\"SELECT * FROM `tbl_events`\");\n }", "public function col_eventname($raw) {\n // Event name.\n $eventname = $raw->action;\n\n return $eventname;\n }", "function ChangeColumnName($db){\n $db->query(\"ALTER TABLE `inventory` CHANGE `Date_Received` `Date_Updated` VARCHAR(25);\");\n }", "protected function transformColumnsForExport()\n {\n $this->collection->transform(function ($record) {\n $this->transformColumns($record);\n\n return $record;\n });\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Plugin Name: Gadu widget Description: Adds a widget to provide your GaduGadu IM status. Author: Dcn. James Konicki Version: alpha 0.5 Author URI: Plugin URI: Based on the gadugadu PHP script as found at The Mirage project WWW: Gadu is released under the GNU General Public License (GPL) WWW:
function widget_gadu_init() { if ( !function_exists('register_sidebar_widget') ) return; function widget_gadu($args) { extract($args); $gaduoptions = get_option('widget_gadu'); $title = $gaduoptions['gtitle']; $janbr = $gaduoptions['janbr']; $gplace = "http://www.gadu-gadu.pl/users/status.asp?id=".$janbr."&styl=2"; $gicons_baseurl = get_bloginfo('wpurl') . "/wp-content/plugins/gadu-gadu/images/"; $gimageurl=$gicons_baseurl; echo $before_widget . $before_title . $title . $after_title; $gfile = fopen ($gplace, "r"); $gstatus = fgets($gfile, 2); switch ($gstatus) { case 1: echo '<img src="'.$gimageurl.'gg-off.png" style="border: 0; vertical-align:middle" alt="Niedostępny" /> Niedostępny'; break; case 2: echo '<img src="'.$gimageurl.'gg-on.png" style="border: 0; vertical-align:middle" alt="Dostępny" /> Dostępny'; break; case 3: echo '<img src="'.$gimageurl.'gg-hoo.png" style="border: 0; vertical-align:middle" alt="Zaraz wracam" /> Zaraz wracam'; break; default: echo '<img src="'.$gimageurl.'gg-off.png" style="border: 0; vertical-align:middle" alt="Gadu-Gadu unknown" /> Niewiadomy'; break; } fclose($gfile); echo '<br />'; echo '<a href="gg:'.$janbr.'">Dodaj '.$janbr.'</a> do swojej listy kontaktów.'; echo $after_widget; } // Options form for the widget - called in the Sidebar Widgets of the Presentation tab function widget_gadu_control() { // Collect our widget's options. $gaduoptions = get_option('widget_gadu'); // This is for handing the control form submission. if ( !is_array($gaduoptions) ) $gaduoptions = array('gtitle'=>'', 'janbr'=>'0'); if ( $_POST['gadu-submit'] ) { $gaduoptions['gtitle'] = strip_tags(stripslashes($_POST['gadu-title'])); $gaduoptions['janbr'] = strip_tags(stripslashes($_POST['gadu-janbr'])); update_option('widget_gadu', $gaduoptions); } $title = htmlspecialchars($gaduoptions['gtitle'], ENT_QUOTES); $janbr = htmlspecialchars($gaduoptions['janbr'], ENT_QUOTES); // The control form for editing options. echo '<p><label for="gadu-title">' . __('Title:') . ' <input style="width: 200px;" type="text" id="gadu-title" name="gadu-title" value="'.$title.'" /></label></p>'; echo '<p><label for="gadu-janbr">' . __('Numer twojego konta:') . ' <input style="width: 100px;" type="text" id="gadu-janbr" name="gadu-janbr" value="'.$janbr.'" /></label></p>'; echo '<input type="hidden" name="gadu-submit" id="gadu-submit" value="1" />'; } // Register the widget and control // This registers our widget so it appears with the other available // widgets and can be dragged and dropped into any active sidebars. register_sidebar_widget(array('Gadu', 'widgets'), 'widget_gadu'); // This registers the (optional!) widget control form. register_widget_control('Gadu', 'widget_gadu_control'); }
[ "function wpb_load_widget() {\r\n\tregister_widget( 'gocargo_widget_contact_info' );\r\n}", "function wpb_load_widget() {\n\tregister_widget( 'webcamcimagrappa_widget' );\n}", "function jeba_load_widget() {\n register_widget( 'jeba_custom_widget' );\n}", "function stocktwits_widget ($widget_title=0, $username=0, $limit=0)\n{\n global $g_StockTwits_Plugin;\n echo $g_StockTwits_Plugin->GetWidgetHTML ($widget_title, $username, $limit);\n}", "function widget_japanesewotdwidget_init() \r\n{\r\n\tif ( !function_exists('register_sidebar_widget') )\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\t\t\r\n\tfunction widget_japanesewotdwidget($args) \r\n {\r\n\t\textract($args);\r\n\t\t\t\r\n\t\techo $before_widget;\r\n\t\techo $before_title .\"Japanese Word of the Day\". $after_title;\r\n\r\n\t\t$wotd_code = \"<script src='http://www.hitsalive.com/japanese_wotd/japanese.php?link=WP' language='javascript' type='text/javascript'></script>\";\r\n \r\n\t\techo '<div style=\"margin-top:5px;text-align:left;\">'.$wotd_code.'</div>';\r\n\t\techo $after_widget;\r\n\t}\r\n\r\n\t\r\n\tfunction widget_japanesewotdwidget_control() \r\n {\r\n\t\techo '<p style=\"text-align:left;\">Brought to you by <b>Declan Software</b> - Language Learning Software for serious students.</p>';\r\n\t}\r\n\r\n\tregister_widget_control(array('Japanese Word of the Day', 'widgets'), 'widget_japanesewotdwidget_control', 200, 200);\r\n\r\n\tregister_sidebar_widget(array('Japanese Word of the Day', 'widgets'), 'widget_japanesewotdwidget');\r\n}", "function gfe_load_widget() {\r\n\tregister_widget( 'gfe_widget' );\r\n\tregister_widget( 'gfe_roster_widget' );\r\n}", "function wpb_load_widget() {\n\n\tregister_widget( 'weather_app_basic_widget' );\n\n}", "function i4_lms_register_widgets() {\n register_widget('I4Web_LMS_Announcements_Widget');\n\n}", "function una_add_dash_widget1() { // Function\n wp_add_dashboard_widget ( // Register\n 'unamuno_dash_widget1', // Slug\n 'Policy &amp; Profiles', // Title\n 'una_dash_widget_display1' // Display\n );\n}", "function widget_cmf_adsPlugin_init() {\r\n\tif ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') ){\r\n\t\treturn;\r\n\t}\r\n\r\n\tfunction widget_cmf_ads($args) {\r\n\t\textract($args);\r\n\t\t$options = get_option('widget_cmf_ads');\r\n\t\t$title = empty($options['title']) ? 'CMF Ads' : $options['title'];\r\n\t\t$generated_code = $options['generated_code'];\r\n\t\t\t\t\t\t\r\n\t\techo $before_widget;\r\n\t\techo $before_title . $title . $after_title;\r\n\t\techo $generated_code;\r\n\t\techo $after_widget;\r\n\t}\r\n\t\t\t\r\n\t\t\t\r\n\r\n\tfunction widget_cmf_ads_control() {\r\n\t\t$options = $newoptions = get_option('widget_cmf_ads');\r\n\t\tif ($_POST['cmf_ads-submit']) {\r\n\t\t\t$newoptions['title'] = strip_tags(stripslashes($_POST['cmf_ads-title']));\r\n\t\t\t$newoptions['site_id'] = strip_tags(stripslashes($_POST['cmf_ads-site_id']));\r\n\t\t\t$newoptions['widget_style'] = strip_tags(stripslashes($_POST['cmf_ads_widget_style']));\r\n\t\t\t$newoptions['cmf_link'] = strip_tags(stripslashes($_POST['cmf_ads_cmf_link']));\r\n\t\t\t$newoptions['center'] = strip_tags(stripslashes($_POST['cmf_ads_center_widget']));\r\n\t\t\t\r\n\t\t\tif ($newoptions['widget_style'] == 1){\r\n\t\t\t\t$height = '125';\r\n\t\t\t\t$width = '125';\r\n\t\t\t} elseif ($newoptions['widget_style'] == 2) {\r\n\t\t\t\t$height = '150';\r\n\t\t\t\t$width = '125';\r\n\t\t\t} elseif ($newoptions['widget_style'] == 3) {\r\n\t\t\t\t$height = '125';\r\n\t\t\t\t$width = '250';\r\n\t\t\t} elseif ($newoptions['widget_style'] == 4) {\r\n\t\t\t\t$height = '125';\r\n\t\t\t\t$width = '375';\r\n\t\t\t} elseif ($newoptions['widget_style'] == 5) {\r\n\t\t\t\t$height = '250';\r\n\t\t\t\t$width = '125';\r\n\t\t\t} elseif ($newoptions['widget_style'] == 6) {\r\n\t\t\t\t$height = '375';\r\n\t\t\t\t$width = '125';\r\n\t\t\t} elseif ($newoptions['widget_style'] == 7) {\r\n\t\t\t\t$height = '250';\r\n\t\t\t\t$width = '250';\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\tif ($newoptions['center'] == '1') {\r\n $strCenter = \" text-align: center;\";\r\n } else {\r\n $strCenter = \"\";\r\n }\r\n $generatedcode = '<div id=\"CMF-Widget\" style=\"margin: 5px auto 0 auto;'.$strCenter.' width: ' . $width . 'px;\">';\r\n\t\t\t\r\n\t\t\t$generatedcode = $generatedcode . '<script type=\"text/javascript\" src=\"http://www.cmfads.com/widget/cmf-v2.0.js?siteid=' . $newoptions['site_id'] . '&amp;width=' . $width . '&amp;height=' . $height . '\"></script>';\r\n\t\t\t\r\n\t\t\tif (($newoptions['cmf_link'] == '1') && ($newoptions['widget_style'] != '2')) {\r\n\t\t\t\t$generatedcode = $generatedcode . '<p class=\"CMF-Advertise\"><a href=\"http://www.cmfads.com/cp/site-advertise.php?id=' . $newoptions['site_id'] . '\">Advertise via CMF Ads</a></p>';\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\t$generatedcode = $generatedcode . '</div>';\r\n\t\t\t\r\n\t\t\t$newoptions['generated_code'] = $generatedcode;\r\n\t\t}\r\n\t\t\r\n\t\tif ( $options != $newoptions ) {\r\n\t\t\t$options = $newoptions;\r\n\t\t\tupdate_option('widget_cmf_ads', $options);\r\n\t\t}\r\n\t\t\r\n\t\t$site_id = $options['site_id'];\r\n\t\t$widget_style = $options['widget_style'];\r\n\t\t$title = $options['title'];\r\n\t\t$center = $options['center'];\r\n\t\t$cmf_link = $options['cmf_link'];\r\n\t\t\r\n\t\techo '<div>';\r\n\t\techo '<label for=\"cmf_ads-title\" style=\"line-height:35px;display:block;\">Widget Title: <input type=\"text\" id=\"cmf_ads-title\" name=\"cmf_ads-title\" value=\"' . $title . '\" /></label>';\r\n\t\techo '<label for=\"cmf_ads-site_id\" style=\"line-height:35px;display:block;\">CMF Site ID: <input type=\"text\" id=\"cmf_ads-site_id\" name=\"cmf_ads-site_id\" value=\"' . $site_id . '\" size=\"8\" /></label>';\r\n\t\techo '<label for=\"cmf_ads_widget_style\">Ad Style: </label><select id=\"cmf_ads_widget_style\" name=\"cmf_ads_widget_style\" size=\"1\"><option value=\"1\" ';\r\n\t\tselected('1', $widget_style);\r\n\t\techo '>1x1 widget, no bottom bar</option><option value=\"2\" ';\r\n\t\tselected('2', $widget_style);\r\n\t\techo '>1x1 widget with bottom bar</option><option value=\"3\" ';\r\n\t\tselected('3', $widget_style);\r\n\t\techo '>2 across, 1 down</option>\r\n\t\t<option value=\"4\" ';\r\n\t\tselected('4', $widget_style);\r\n\t\techo '>3 across, 1 down</option>\r\n\t\t<option value=\"5\" ';\r\n\t\tselected('5', $widget_style);\r\n\t\techo '>1 across, 2 down</option>\r\n\t\t<option value=\"6\" ';\r\n\t\tselected('6', $widget_style);\r\n\t\techo '>1 across, 3 down</option>\r\n\t\t<option value=\"7\" ';\r\n\t\tselected('7', $widget_style);\r\n\t\techo '>2 across, 2 down</option></select>';\r\n\t\techo '<p><label for=\"cmf_ads_cmf_link\">Show Advertise with CMF link: </label><input type=\"checkbox\" id=\"cmf_ads_cmf_link\" name=\"cmf_ads_cmf_link\" value=\"1\" ';\r\n\t\tchecked('1', $cmf_link );\r\n\t\techo '/></p>';\r\n\t\techo '<p><label for=\"cmf_ads_center_widget\">Centre Widget: </label><input type=\"checkbox\" id=\"cmf_ads_center_widget\" name=\"cmf_ads_center_widget\" value=\"1\" ';\r\n\t\tchecked('1', $center );\r\n\t\techo '/></p>';\r\n\t\techo '<input type=\"hidden\" name=\"cmf_ads-submit\" id=\"cmf_ads-submit\" value=\"1\" />';\r\n\t\techo '</div>';\r\n\t}\r\n\t\r\n\tregister_sidebar_widget('CMF Ads Widget', 'widget_cmf_ads');\r\n\tregister_widget_control('CMF Ads Widget', 'widget_cmf_ads_control', 300, 300);\r\n}", "public function widget_script() {\n\t\ttry {\n\t\t\t$token = ConnectToken::load(\n\t\t\t\tStore::get_instance()->get_store_token(),\n\t\t\t\tCertProvider::create()->get_stored_cert()\n\t\t\t);\n\t\t\t$api_url = UrlProvider::create( $token )->get_api_url();\n\n\t\t\t$widget_url = sprintf(\n\t\t\t\t$api_url . '/api/v1/script/%s/widget.js',\n\t\t\t\t$token->get_store_uuid()\n\t\t\t);\n\n\t\t\twp_register_script(\n\t\t\t\t'livechat-widget',\n\t\t\t\t$widget_url,\n\t\t\t\tarray(),\n\t\t\t\t$this->module->get_plugin_version(),\n\t\t\t\t$in_footer = true\n\t\t\t);\n\t\t\twp_enqueue_script( 'livechat-widget' );\n\t\t} catch ( Exception $exception ) {\n\t\t\techo wp_kses(\n\t\t\t\t( new TrackingCodeHelper() )->render(),\n\t\t\t\tarray(\n\t\t\t\t\t'script' => array(\n\t\t\t\t\t\t'type' => array(),\n\t\t\t\t\t),\n\t\t\t\t\t'noscript' => array(),\n\t\t\t\t\t'a' => array(\n\t\t\t\t\t\t'href' => array(),\n\t\t\t\t\t\t'rel' => array(),\n\t\t\t\t\t\t'target' => array(),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "function register_demo_widget(){\r\n register_widget('DemoWidget');\r\n}", "function register_Zappy_Ads_300x100_Widget() {\n register_widget('Zappy_Ads_300x100_Widget');\n}", "function register_CraniumFitteds_Ad_Widget() {\n register_widget( 'CraniumFitteds_Ad_Widget' );\n}", "function bulldog_newsletter_subscribe_widget(){\n\t\n\trequire_once( trailingslashit( BULLDOG_NEWSLETTER_DIR ) . 'widget-subscribe-box.php' );\n\tregister_widget( 'Widget_Subscribe_Box' );\n}", "function vantage_register_widgets(){\n\tregister_widget('Vantage_Social_Media_Widget');\n\tregister_widget('Vantage_CircleIcon_Widget');\n\tregister_widget('Vantage_Headline_Widget');\n}", "function hotpro_load_widget() {register_widget( 'data_hotpro_widget' );}", "function WeblizarTwitterWidget() {\r\n\tregister_widget( 'WeblizarTwitter' );\r\n}", "function vip_powered_wpcom_widget_init() {\n\tregister_widget('WPCOM_Widget_VIP_Powered');\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the ASM Group ID (if set) to a V3 Email from a V2 Email for API V3 the ASM setting is an object and is optional for API V3 the ASM group_id is mandatory for each object
private static function set_asm_group_id_v3( SendGridV3\Mail $email_v3, SendGrid\Email $email_v2 ) { if ( ! $email_v2->smtpapi->asm_group_id ) { return; } $asm = new SendGridV3\ASM(); if ( is_string( $email_v2->smtpapi->asm_group_id ) ) { $asm->setGroupId( intval( trim( $email_v2->smtpapi->asm_group_id ) ) ); } else { $asm->setGroupId( $email_v2->smtpapi->asm_group_id ); } $email_v3->setASM( $asm ); }
[ "public function setIdGroup($idGroup){\n $this->idGroup = $idGroup;\n\n }", "public function setIdGroup($id_group)\n\t{\n\t\t$this->id_group = $id_group;\n\t\treturn $this;\n\t}", "public function setGroup($id);", "public function setAsmGroupId($groupId) {\n $this->smtpapi->setASMGroupID($groupId);\n\n return $this;\n }", "public function setGroup($group)\n {\n $payload = '';\n for ($i = 0; $i < count($group) && $i < 4; $i++) {\n $payload .= pack('c', ord($group[$i]));\n }\n for ($i = count($group); $i < 4; $i++) {\n $payload .= pack('c', 0);\n }\n\n $this->sendRequest(self::FUNCTION_SET_GROUP, $payload);\n }", "public function setGroupData($groupData) { $this->_groupData = $groupData; }", "public function update_email_group(Request $request, $id){\n\n $slug = $request->slug;\n $data['organization'] = $this->organization->getUrl($slug);\n $results = $this->email_group->save($request, $id);\n\n if($results['status'] == false)\n {\n return back()->withErrors($results['results'])->withInput();\n }else{\n $this->activityLog->log_activity(Auth::user()->id,'Updated Email Group','Updated the Email Group', $data['organization']->id);\n\n return redirect('/organization/'.$slug.'/administrator/email-group')->with('message', 'Successfully Updated Email Group');\n \n }\n \n }", "public function setGroup( $group )\r\n\t{\r\n\t\t$this->group = $group;\r\n\t}", "public function setAsmGroupId($groupId)\n {\n $this->smtpapi->setASMGroupID($groupId);\n return $this;\n }", "public function setGroup($group)\n {\n $this->currentGroup = $group;\n }", "private function setCustomerGroupValue()\n {\n $value = $this->getData(self::$groupAttributeCode);\n try {\n $group = $this->groupRepository->getById($value);\n $this->setCustomAttribute(self::$groupAttributeCode, $group->getCode());\n } catch (NoSuchEntityException $e) {\n $this->setCustomAttribute(self::$groupAttributeCode, 'N/A');\n }\n }", "public function setGroupId(&$data)\n {\n $data['User']['group_id'] = 2;\n\n }", "private function setCustomerGroupValue()\n {\n $value = $this->getData(self::$customerGroupAttributeCode);\n try {\n $group = $this->groupRepository->getById($value);\n $this->setCustomAttribute(self::$customerGroupAttributeCode, $group->getCode());\n } catch (NoSuchEntityException $e) {\n $this->setCustomAttribute(self::$customerGroupAttributeCode, 'N/A');\n }\n }", "public function setVersionGroup( $group, $message = null ) {\n\t\t$this->versionGroup = $group;\n\t\t$this->versionGroupMessage = $message;\n\t}", "function setMimeGroup() {\n if (isset($this->params['group_id'])) {\n $mimeGroup = $this->mimeObj->getMimeGroup($this->params['group_id']);\n $data = array('mimegroup_icon' => $this->params['group_icon']);\n $condition = array('mimegroup_id' => $this->params['group_id']);\n $this->databaseUpdateRecord($this->mimeObj->tableMimeGroups, $data, $condition);\n if (isset($mimeGroup[$this->params['lng_id']])) {\n $dataTrans = array('mimegroup_title' => $this->params['group_title']);\n $conditionTrans = array(\n 'mimegroup_id' => $this->params['group_id'],\n 'lng_id' => $this->params['lng_id'],\n );\n return $this->databaseUpdateRecord(\n $this->mimeObj->tableMimeGroupsTrans, $dataTrans, $conditionTrans\n );\n } else {\n return $this->addMimeGroupTrans(\n $this->params['group_id'], $this->params['lng_id'], $this->params['group_title']\n );\n }\n $this->addMsg(MSG_ERROR, $this->_gt('Mimegroup could not be updated.'));\n }\n }", "public function updateChannelGroupRequest($id, $inlineObject4)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling updateChannelGroup'\n );\n }\n // verify the required parameter 'inlineObject4' is set\n if ($inlineObject4 === null || (is_array($inlineObject4) && count($inlineObject4) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $inlineObject4 when calling updateChannelGroup'\n );\n }\n\n $resourcePath = '/channel-groups/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\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($inlineObject4)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($inlineObject4));\n } else {\n $httpBody = $inlineObject4;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires Bearer authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function SupportSetGroup($id){\n\t if($this->support){\n return $this->support->SetGroup($id);\n }\n return false;\t\n\t}", "public function set_group_id( $group_id = 0 ) {\n\t\tglobal $wpdb;\n\n\t\t$group_id = (int)$group_id;\n\t\t// Add line before, set group\n\t\tif ( !$this->exists( ) ) {\n\t\t\t$this->add( );\n\t\t}\n\n\t\t// Set group if line exist\n\t\tif ( $this->exists( ) ) {\n\t\t\t$wpdb->update( $wpdb->bea_mm_connections, array( 'group_id' => $group_id ), array( 'id' => $this->obj->id ), array( '%d' ), array( '%d' ) );\n\t\t\t$this->obj->group_id = $group_id;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function set_group($group = array())\n\t{\n\t\tif ($group)\n\t\t\t$this->groupBy = $group;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Search multiple translations with key combinations. Each $context field may be a single value, an array of values or ''. Example: array('term', array(1,2), '') This will be mapped into the following conditions (provided language code is 'es') array('type' => 'term', 'objectid' => array(1,2), 'property' => '', 'language' => 'es') And will result in these combinations to search for array('type' => 'term', 'objectid' => 1, 'property' => '', 'language' => 'es') array('type' => 'term', 'objectid' => 2, 'property' => '', 'language' => 'es')
public function multiple_translation_search($context, $langcode) { // First, build conditions and identify the variable field. $keys = array('type', 'objectid', 'property'); $conditions = array_combine($keys, $context) + array('language' => $langcode); // Find existing searches in cache, compile remaining ones. $translations = $search = array(); foreach ($this->multiple_combine($conditions) as $combination) { $cached = $this->multiple_cache_get($combination); if (isset($cached)) { // Cache hit. Merge and remove value from search. $translations += $cached; } else { // Not in cache, add to search conditions skipping duplicated values. // As array_merge_recursive() has some bug in PHP 5.2, http://drupal.org/node/1244598 // we use our simplified version here, instead of $search = array_merge_recursive($search, $combination); foreach ($combination as $key => $value) { if (!isset($search[$key]) || !in_array($value, $search[$key], TRUE)) { $search[$key][] = $value; } } } } // If we've got any search values left, find translations. if ($search) { // Load translations for conditions and set them to the cache $loaded = $this->multiple_translation_load($search, $langcode); if ($loaded) { $translations += $loaded; } // Set cache for each of the multiple search keys. foreach ($this->multiple_combine($search) as $combination) { $list = $loaded ? $this->string_filter($loaded, $combination) : array(); $this->multiple_cache_set($combination, $list); } } return $translations; }
[ "public function runFilter( array $context )\n {\n foreach ( $context as $element )\n {\n $element->translation = self::leetify( $element->translation );\n }\n }", "function filter_search_get_supported_contexts() {\n\t\n\t$result = [\n\t\t'questions' => [\n\t\t\t'handler' => 'questions',\n\t\t\t'search_params' => [\n\t\t\t\t'type' => 'object',\n\t\t\t\t'subtype' => 'question',\n\t\t\t],\n\t\t],\n\t\t'blog' => [\n\t\t\t'handler' => 'blog',\n\t\t\t'search_params' => [\n\t\t\t\t'type' => 'object',\n\t\t\t\t'subtype' => 'blog',\n\t\t\t],\n\t\t],\n\t\t'poll' => [\n\t\t\t'handler' => 'poll',\n\t\t\t'search_params' => [\n\t\t\t\t'type' => 'object',\n\t\t\t\t'subtype' => 'poll',\n\t\t\t],\n\t\t],\n\t\t'discussion' => [\n\t\t\t'handler' => 'discussion',\n\t\t\t'search_params' => [\n\t\t\t\t'type' => 'object',\n\t\t\t\t'subtype' => 'discussion',\n\t\t\t],\n\t\t],\n\t];\n\t\n\treturn elgg_trigger_plugin_hook('supported_context', 'filter_search', $result, $result);\n}", "public function contextIntersection()\n {\n $lemma1_values = $lemma2_values = // arrays with searched lemmas for select field [5559=>'ЛЕВЫЙ (adjective)']\n $sentence_list = // array of sentences [text of sentence, wordforms joined with comma)\n $lemma_list = []; // array of pairs lemma_id=>frequency in the context set\n \n if ($this->url_args['search_lemma1']) {\n $lemma1_id = $this->url_args['search_lemma1'];\n $lemma1_values[$lemma1_id] = Lemma::getLemmaWithPOSByID($lemma1_id);\n } \n \n if ($this->url_args['search_lemma2']) {\n $lemma2_id = $this->url_args['search_lemma2'];\n $lemma2_values[$lemma2_id] = Lemma::getLemmaWithPOSByID($lemma2_id);\n } \n \n if ($this->url_args['search_lemma1'] && $this->url_args['search_lemma2']) {\n list($sentence_list1,$context_lemmas1, $lemma_strings1) = \n Lemma::lemmaContext($lemma1_id);\n\n list($sentence_list2,$context_lemmas2, $lemma_strings2) = \n Lemma::lemmaContext($lemma2_id);\n \n foreach (array_intersect(array_keys($sentence_list1),array_keys($sentence_list2)) as $sentence_id) {\n $sentence_list[$sentence_id]['sentence'] = $sentence_list1[$sentence_id]['sentence'];\n \n $sentence_list[$sentence_id]['wordforms'] = \n array_merge($sentence_list1[$sentence_id]['wordforms'],$sentence_list2[$sentence_id]['wordforms']);\n \n }\n \n foreach (array_intersect(array_keys($context_lemmas1),array_keys($context_lemmas2)) as $lemma_id) {\n $lemma_list[$lemma_id]['lemma'] = $lemma_strings1[$lemma_id];\n $lemma_list[$lemma_id]['freq1'] = $context_lemmas1[$lemma_id];\n $lemma_list[$lemma_id]['freq2'] = $context_lemmas2[$lemma_id];\n }\n//print \"<P>\".sizeof($lemma_list); \n\n//print \"<P>\".sizeof($context_lemmas1); \n//print \"<P>\".sizeof($context_lemmas2); \n \n $dist = (sizeof($lemma_list)*sizeof($lemma_list)) / (sizeof($context_lemmas1)*sizeof($context_lemmas2));\n }\n \n return view('lemma.context_intersection')\n ->with(array(\n 'lemma1_values' => $lemma1_values, \n 'lemma2_values' => $lemma2_values, \n 'lemma_list' => $lemma_list, \n 'sentence_list' => $sentence_list, \n 'dist' => $dist,\n 'args_by_get' => $this->args_by_get,\n 'url_args' => $this->url_args,\n )\n );\n }", "public function searchWords()\n\t{\n\t\tglobal $modSettings, $context;\n\n\t\tif (count($this->_searchWords) > 0)\n\t\t{\n\t\t\treturn $this->_searchWords;\n\t\t}\n\n\t\t$orParts = [];\n\t\t$this->_searchWords = [];\n\t\t$searchArray = $this->_searchArray->getSearchArray();\n\t\t$excludedWords = $this->_searchArray->getExcludedWords();\n\n\t\t// All words/sentences must match.\n\t\tif (!empty($searchArray) && empty($this->_searchParams['searchtype']))\n\t\t{\n\t\t\t$orParts[0] = $searchArray;\n\t\t}\n\t\t// Any word/sentence must match.\n\t\telse\n\t\t{\n\t\t\tforeach ($searchArray as $index => $value)\n\t\t\t{\n\t\t\t\t$orParts[$index] = array($value);\n\t\t\t}\n\t\t}\n\n\t\t// Make sure the excluded words are in all or-branches.\n\t\tforeach ($orParts as $orIndex => $andParts)\n\t\t{\n\t\t\tforeach ($excludedWords as $word)\n\t\t\t{\n\t\t\t\t$orParts[$orIndex][] = $word;\n\t\t\t}\n\t\t}\n\n\t\t// Determine the or-branches and the fulltext search words.\n\t\tforeach ($orParts as $orIndex => $andParts)\n\t\t{\n\t\t\t$this->_searchWords[$orIndex] = array(\n\t\t\t\t'indexed_words' => array(),\n\t\t\t\t'words' => array(),\n\t\t\t\t'subject_words' => array(),\n\t\t\t\t'all_words' => array(),\n\t\t\t\t'complex_words' => array(),\n\t\t\t);\n\n\t\t\t$this->_searchAPI->setExcludedWords($excludedWords);\n\n\t\t\t// Sort the indexed words (large words -> small words -> excluded words).\n\t\t\tusort($orParts[$orIndex], array($this->_searchAPI, 'searchSort'));\n\n\t\t\tforeach ($orParts[$orIndex] as $word)\n\t\t\t{\n\t\t\t\t$is_excluded = in_array($word, $excludedWords);\n\t\t\t\t$this->_searchWords[$orIndex]['all_words'][] = $word;\n\t\t\t\t$subjectWords = text2words($word);\n\n\t\t\t\tif (!$is_excluded || count($subjectWords) === 1)\n\t\t\t\t{\n\t\t\t\t\t$this->_searchWords[$orIndex]['subject_words'] = array_merge($this->_searchWords[$orIndex]['subject_words'], $subjectWords);\n\n\t\t\t\t\tif ($is_excluded)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_excludedSubjectWords = array_merge($this->_excludedSubjectWords, $subjectWords);\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$this->_excludedPhrases[] = $word;\n\t\t\t\t}\n\n\t\t\t\t// Have we got indexes to prepare?\n\t\t\t\t$this->_searchAPI->prepareIndexes($word, $this->_searchWords[$orIndex], $this->_excludedIndexWords, $is_excluded, $this->_excludedSubjectWords);\n\t\t\t}\n\n\t\t\t// Search_force_index requires all AND parts to have at least one fulltext word.\n\t\t\tif (!empty($modSettings['search_force_index']) && empty($this->_searchWords[$orIndex]['indexed_words']))\n\t\t\t{\n\t\t\t\t$context['search_errors']['query_not_specific_enough'] = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ($this->_searchParams->subject_only && empty($this->_searchWords[$orIndex]['subject_words']) && empty($this->_excludedSubjectWords))\n\t\t\t{\n\t\t\t\t$context['search_errors']['query_not_specific_enough'] = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Make sure we aren't searching for too many indexed words.\n\t\t\t$this->_searchWords[$orIndex]['indexed_words'] = array_slice($this->_searchWords[$orIndex]['indexed_words'], 0, 7);\n\t\t\t$this->_searchWords[$orIndex]['subject_words'] = array_slice($this->_searchWords[$orIndex]['subject_words'], 0, 7);\n\t\t\t$this->_searchWords[$orIndex]['words'] = array_slice($this->_searchWords[$orIndex]['words'], 0, 4);\n\t\t}\n\n\t\treturn $this->_searchWords;\n\t}", "public function getTranslationByContexts(): array\n {\n $contexts = [];\n\n foreach ($this->getTranslations() as $value) {\n $context = $value->getContext();\n if ($context === null) {\n continue;\n }\n if (!isset($contexts[$context])) {\n $contexts[$context] = [];\n }\n $contexts[$context][] = $value->withContext(null);\n }\n\n return $contexts;\n }", "public function _searchConflicts(array $context)\n {\n $conflicts = array();\n\n foreach (array_keys($context) as $arrayKey) {\n $arrayVal = $context[$arrayKey];\n $status = null;\n\n if ($this->_isMazeProperty($arrayVal)) {\n $status = $arrayVal[self::FIELD_STATUS];\n\n if (is_numeric($status) && ($status / 1000) < 1) {\n $conflicts[$arrayKey] = $arrayVal;\n }\n } else if (is_array($arrayVal)) {\n $inDeep = $this->_searchConflicts($arrayVal);\n if (!empty($inDeep)) {\n foreach ($inDeep as $key => $value) {\n $propertyPath = $arrayKey . self::PATH_SEPERATOR . $key;\n\n $conflicts[$propertyPath] = $value;\n }\n }\n }\n }\n\n return $conflicts;\n }", "public static function get_for_context($context) {\n // find out which fields we have, and what tables to look for the values\n // in\n $fields = field::get_for_context_level($context->contextlevel);\n $fieldarray = array();\n $data_types = array();\n foreach ($fields as $field) {\n $fieldarray[$field->id] = $field;\n $data_types[$field->data_type()] = true;\n }\n $fields = $fieldarray;\n\n // load the values from the database, and sort them into the fields\n $values = array();\n $default_values = array();\n foreach ($data_types as $datatype => $unused) {\n $fielddatatype = \"field_data_{$datatype}\";\n $records = $fielddatatype::find(new OR_filter(array(new field_filter('contextid', $context->id),\n new field_filter('contextid', null))));\n foreach ($records as $record) {\n if (!isset($fields[$record->fieldid]) || $fields[$record->fieldid]->data_type() != $datatype) {\n // nonexistent field, or this data isn't supposed to come from this table\n continue;\n }\n if ($record->contextid) {\n if (!isset($values[$record->fieldid])) {\n $values[$record->fieldid] = array();\n }\n $values[$record->fieldid][] = $record->data;\n } else {\n if (!isset($default_values[$record->fieldid])) {\n $default_values[$record->fieldid] = array();\n }\n $default_values[$record->fieldid][] = $record->data;\n }\n }\n }\n\n // create the final result\n $result = array();\n foreach ($fields as $field) {\n // If multivalued, copy the whole array; otherwise just copy the\n // first value. If a value for the context is set, then use that\n // value; otherwise use the default value.\n if ($field->multivalued) {\n if (!empty($values[$field->id])) {\n $result[$field->shortname] = $values[$field->id];\n } else if (!empty($default_values[$field->id])) {\n $result[$field->shortname] = $default_values[$field->id];\n }\n } else {\n if (!empty($values[$field->id])) {\n $result[$field->shortname] = $values[$field->id][0];\n } else if (!empty($default_values[$field->id])) {\n $result[$field->shortname] = $default_values[$field->id][0];\n }\n }\n }\n return $result;\n }", "private function translateFacets() {\n $found_ids = array();\n $found_results = array();\n $translated_terms = array();\n $facets = $this->facetComponent->getFacets();\n foreach ($facets as $key => $facet) {\n // The key should start with 'category_' or 'location_'\n $start = substr($key, 0, 9);\n if (in_array($start, array('category_', 'location_'))) {\n $items = $facet->getResult()->getItems();\n foreach ($items as $item) {\n $found_ids[$item->getValue()] = $item->getValue();\n }\n }\n }\n\n // Translate the facets.\n if ($translations = culturefeed_search_term_translations($found_ids, TRUE)) {\n\n // Preferred language.\n $preferred_language = culturefeed_search_get_preferred_language();\n\n // Translate the facets labels.\n foreach ($facets as $key => $facet) {\n // The key should start with 'category_' or 'location_'\n $start = substr($key, 0, 9);\n if (in_array($start, array('category_', 'location_'))) {\n $items = $facet->getResult()->getItems();\n foreach ($items as $item) {\n // Translate if found.\n if (!empty($translations[$item->getValue()][$preferred_language])) {\n $item->setLabel($translations[$item->getValue()][$preferred_language]);\n }\n }\n }\n }\n\n }\n\n }", "function ctools_context_match_required_contexts($required, $contexts) {\n $return = array();\n if (!is_array($required)) {\n return $return;\n }\n\n foreach ($required as $r) {\n $context = drupal_clone(array_shift($contexts));\n $context->identifier = $r['identifier'];\n $context->page_title = isset($r['title']) ? $r['title'] : '';\n $context->keyword = $r['keyword'];\n $return[ctools_context_id($r, 'requiredcontext')] = $context;\n }\n\n return $return;\n}", "public function specificEventContextOverviewAutoComplete($term=\"\", $SelectCourse=\"\", $from=\"\", $to=\"\", $ThresholdSelect=\"\", $Threshold=\"\")\n\t{\n\t\tinclude('../one_connection.php');\n\n\t\t// $in is a part of the second query, an example format of $in: (' Assignment 4 - Marks, Semester 2, 2013',' News forum, Semester 2, 2012')\n\t\t$in='(';\n\t\t$sql = \"SELECT Context, COUNT( `Id` ) count\n\t\tFROM event\n\t\tWHERE CourseName='{$SelectCourse}' and EventTime between '{$from}' and '{$to}' and DataSourceType=1\n\t\tGROUP BY Context\n\t\tHAVING count{$ThresholdSelect}{$Threshold}\";\n\t\t$query = mysql_query($sql);\n\t\twhile($row=mysql_fetch_array($query)){\n\t\t\t$in.='\\''.$row['Context'].'\\',';\n\t\t}\n\t\t$in=rtrim($in, \",\");\n\t\t$in.=')';\n\t\t\n\t\t//term is the text that user inputs\n\t\t$sql = \"select distinct concat(`Prefix`,':',`Context`) EventContext\n\t\tfrom event \n\t\twhere Prefix LIKE '$term%' and Context in {$in}\";\n\t\t$query = mysql_query($sql);\n\t\twhile($row = mysql_fetch_array($query)){\n\t\t\t$result[] = array( \n\t\t \t\t'label' => $row['EventContext'] \n\t\t\t); \n\t\t}\n\t\tmysql_close($link);\n\t\treturn json_encode($result);\n\t}", "public function translateContext($context, $text);", "public function expand_list_search_context_where_properties()\n {\n return array(\n 'contexts' => array(),\n 'meta_whitelist' => array(\n 'subject', 'heading', 'note'\n ),\n );\n }", "public function action_search()\n\t{\n\t\tglobal $context, $txt;\n\n\t\t// If they provided some search parameters, we need to extract them\n\t\tif (isset($this->_req->post->params))\n\t\t{\n\t\t\t$context['search_params'] = $this->_searchParamsFromString();\n\t\t}\n\n\t\t// Set up the search criteria, type, what, age, etc\n\t\tif (isset($this->_req->post->search))\n\t\t{\n\t\t\t$context['search_params']['search'] = un_htmlspecialchars($this->_req->post->search);\n\t\t\t$context['search_params']['search'] = htmlspecialchars($context['search_params']['search'], ENT_COMPAT);\n\t\t}\n\n\t\tif (isset($context['search_params']['userspec']))\n\t\t{\n\t\t\t$context['search_params']['userspec'] = htmlspecialchars($context['search_params']['userspec'], ENT_COMPAT);\n\t\t}\n\n\t\t// 1 => 'allwords' / 2 => 'anywords'.\n\t\tif (!empty($context['search_params']['searchtype']))\n\t\t{\n\t\t\t$context['search_params']['searchtype'] = 2;\n\t\t}\n\n\t\t// Minimum and Maximum age of the message\n\t\tif (!empty($context['search_params']['minage']))\n\t\t{\n\t\t\t$context['search_params']['minage'] = (int) $context['search_params']['minage'];\n\t\t}\n\t\tif (!empty($context['search_params']['maxage']))\n\t\t{\n\t\t\t$context['search_params']['maxage'] = (int) $context['search_params']['maxage'];\n\t\t}\n\n\t\t$context['search_params']['show_complete'] = !empty($context['search_params']['show_complete']);\n\t\t$context['search_params']['subject_only'] = !empty($context['search_params']['subject_only']);\n\n\t\t// Create the array of labels to be searched.\n\t\t$context['search_labels'] = array();\n\t\t$searchedLabels = isset($context['search_params']['labels']) && $context['search_params']['labels'] != '' ? explode(',', $context['search_params']['labels']) : array();\n\t\tforeach ($context['labels'] as $label)\n\t\t{\n\t\t\t$context['search_labels'][] = array(\n\t\t\t\t'id' => $label['id'],\n\t\t\t\t'name' => $label['name'],\n\t\t\t\t'checked' => empty($searchedLabels) || in_array($label['id'], $searchedLabels),\n\t\t\t);\n\t\t}\n\n\t\t// Are all the labels checked?\n\t\t$context['check_all'] = empty($searchedLabels) || count($context['search_labels']) === count($searchedLabels);\n\n\t\t// Load the error text strings if there were errors in the search.\n\t\tif (!empty($context['search_errors']))\n\t\t{\n\t\t\tTxt::load('Errors');\n\t\t\t$context['search_errors']['messages'] = array();\n\t\t\tforeach ($context['search_errors'] as $search_error => $dummy)\n\t\t\t{\n\t\t\t\tif ($search_error === 'messages')\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$context['search_errors']['messages'][] = $txt['error_' . $search_error];\n\t\t\t}\n\t\t}\n\n\t\t$context['page_title'] = $txt['pm_search_title'];\n\t\t$context['sub_template'] = 'search';\n\t\t$context['linktree'][] = array(\n\t\t\t'url' => getUrl('action', ['action' => 'pm', 'sa' => 'search']),\n\t\t\t'name' => $txt['pm_search_bar_title'],\n\t\t);\n\t}", "public function test_course_searched_context_validation() {\n $course = $this->getDataGenerator()->create_course();\n $reactforum = $this->getDataGenerator()->create_module('reactforum', array('course' => $course->id));\n $context = context_module::instance($reactforum->cmid);\n $params = array(\n 'context' => $context,\n 'other' => array('searchterm' => 'testing'),\n );\n\n \\mod_reactforum\\event\\course_searched::create($params);\n }", "public function test_get_tags_by_area_in_contexts_multiple_tags_multiple_contexts() {\n $tagnames = ['foo', 'bar', 'baz', 'bop', 'bam', 'bip'];\n $collid = core_tag_collection::get_default();\n $tags = core_tag_tag::create_if_missing($collid, $tagnames);\n $user1 = $this->getDataGenerator()->create_user();\n $user2 = $this->getDataGenerator()->create_user();\n $user3 = $this->getDataGenerator()->create_user();\n $context1 = context_user::instance($user1->id);\n $context2 = context_user::instance($user2->id);\n $context3 = context_user::instance($user3->id);\n $component = 'core';\n $itemtype = 'user';\n\n // User 1 tags: 'foo', 'bar'.\n core_tag_tag::set_item_tags($component, $itemtype, $user1->id, $context1, array_slice($tagnames, 0, 2));\n // User 2 tags: 'bar', 'baz'.\n core_tag_tag::set_item_tags($component, $itemtype, $user2->id, $context2, array_slice($tagnames, 1, 2));\n // User 3 tags: 'bop', 'bam'.\n core_tag_tag::set_item_tags($component, $itemtype, $user3->id, $context3, array_slice($tagnames, 3, 2));\n\n $result = core_tag_tag::get_tags_by_area_in_contexts($component, $itemtype, [$context1, $context2]);\n // Both User 1 and 2 have tagged using 'bar' but we don't\n // expect duplicate tags in the result since they are the same\n // tag.\n //\n // User 3 has tagged 'bop' and 'bam' but we aren't searching in\n // that context so they shouldn't be in the results.\n $expected = ['foo', 'bar', 'baz'];\n $actual = array_map(function($t) {\n return $t->name;\n }, $result);\n\n sort($expected);\n sort($actual);\n\n $this->assertEquals($expected, $actual);\n }", "function ctools_context_keyword_substitute($string, $keywords, $contexts) {\n // Ensure a default keyword exists:\n $keywords['%%'] = '%';\n\n // Match contexts to the base keywords:\n $context_keywords = array();\n foreach ($contexts as $context) {\n if (isset($context->keyword)) {\n $context_keywords[$context->keyword] = $context;\n }\n }\n\n // Look for context matches we we only have to convert known matches.\n $matches = array();\n if (preg_match_all('/%([a-zA-Z0-9%:_-]+)/us', $string, $matches)) {\n foreach ($matches[1] as $keyword) {\n // Ignore anything it finds with %%.\n if ($keyword[0] == '%') {\n continue;\n }\n\n // If the keyword is already set by something passed in, don't try to\n // overwrite it.\n if (!empty($keywords['%' . $keyword])) {\n continue;\n }\n\n // Figure out our keyword and converter, if specified.\n if (strpos($keyword, ':')) {\n list($context, $converter) = explode(':', $keyword, 2);\n }\n else {\n $context = $keyword;\n if (isset($context_keywords[$keyword])) {\n $plugin = ctools_get_context($context_keywords[$context]->plugin);\n\n // Fall back to a default converter, if specified.\n if ($plugin && !empty($plugin['convert default'])) {\n $converter = $plugin['convert default'];\n }\n }\n }\n\n if (empty($context_keywords[$context]) || !empty($context_keywords[$context]->empty)) {\n $keywords['%' . $keyword] = '';\n }\n else if (!empty($converter)) {\n $keywords['%' . $keyword] = ctools_context_convert_context($context_keywords[$context], $converter);\n }\n else {\n $keywords['%' . $keyword] = $context_keywords[$keyword]->title;\n }\n }\n }\n return strtr($string, $keywords);\n}", "protected function match($arContexts)\n {\n $matched = array();\n $notMatched = array();\n $arContextsHelper = $arContexts;\n\n $loops = 0;\n do {\n foreach (array_keys($arContexts) as $uid) {\n /* @var $context AbstractContext */\n $context = $arContexts[$uid];\n\n if ($context->getDisabled()) {\n continue;\n }\n\n // resolve dependencies\n $arDeps = $context->getDependencies($arContextsHelper);\n $unresolvedDeps = count($arDeps);\n foreach ($arDeps as $depUid => $enabled) {\n if ($enabled) {\n if (isset($matched[$depUid])) {\n $arDeps[$depUid] = (object) array(\n 'context' => $matched[$depUid],\n 'matched' => true\n );\n $unresolvedDeps--;\n } elseif (isset($notMatched[$depUid])) {\n $arDeps[$depUid] = (object) array(\n 'context' => $notMatched[$depUid],\n 'matched' => false\n );\n $unresolvedDeps--;\n }\n } else {\n $arDeps[$depUid] = (object) array(\n 'context' => $arContextsHelper[$depUid],\n 'matched' => 'disabled'\n );\n $unresolvedDeps--;\n }\n // FIXME: what happens when dependency context is not\n // available at all (e.g. deleted)?\n }\n if ($unresolvedDeps > 0) {\n // not all dependencies available yet, so skip this\n // one for now\n continue;\n }\n\n if ($context->match($arDeps)) {\n $matched[$uid] = $context;\n } else {\n $notMatched[$uid] = $context;\n }\n unset($arContexts[$uid]);\n }\n } while (count($arContexts) > 0 && ++$loops < 10);\n\n return $matched;\n }", "public function getFallbackCandidates(array $context = []);", "private function get_context_fields( $context ) {\n\t\t$fields = array();\n\t\tforeach( $this->schema['properties'] as $key => $args ) {\n\t\t\tif ( empty( $args['context'] ) || in_array( $context, $args['context'] ) ) {\n\t\t\t\t$fields[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $fields;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create Create workout from workout model
public function create(AbstractWorkoutFormModel $workoutModel): Workout;
[ "public function actionCreate()\n {\n $model = new Worktime();\n if ($model->load(Yii::$app->request->post())) {\n $model->day_time = strtotime($model->day_time)-60*60*6;\n if($model->validate())\n {\n $model->pr_name = $this->projectList[$model->pr_id];\n $model->person_id = $_SESSION['__id'];\n $model->commit_time =time();\n }\n if($model->save())\n {\n $link_time=date('Y-m',$model->day_time+60*60*6); //工时时间日期\n $exa = Statistics::findOne(['y_month'=>$link_time,'pr_name'=>$model->pr_name]);\n if($exa!==null) //月份亦存在\n {\n if($exa->contain!=='0'){\n $exa->contain = $exa->contain . ',' . $model->id . ',';\n }else{\n $exa->contain = $model->id . ',';\n }\n }\n else //月份不存在,创建\n {\n $exa =new Statistics();\n $exa->y_month = $link_time;\n $exa->pr_name = $model->pr_name;\n $exa->contain = (string)$model->id.',';\n }\n $exa->save();\n return $this->redirect(['index']);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n 'projectList' => $this->projectList,\n ]);\n\n }", "function save_workout_from_object($workout)\r\n{\r\n\r\n}", "public function actionCreate()\n {\n $model = new Workplace();\n\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new Work();\n\n $dataRequest['Work'] = Yii::$app->request->getBodyParams();\n\n if ($model->load($dataRequest)) {\n $model->doc_date = date('Y-m-d');\n $model->doc_time = date('H:i');\n $model->user_id = Yii::$app->user->identity->id;\n $model->status = 0;\n\n// print_r(Yii::$app->user->identity->username);\n//\n// print_r($model->attributes);\n// exit();\n if ($model->save()) {\n // return $this->redirect(['view', 'id' => $model->id]);\n return $this->apiCreated($model);\n }\n }\n\n return $this->apiValidate($model->errors);\n }", "public function create( $data ) {\n\t\t// echo json_encode($data) . \" -- \";\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// Insert the workout_log entry\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// if the json_workout is set:\n\t\t//\n\t\t// 1) validate json_workout's structure\n\t\t// 2) store the original json_workout in the database as original_json_workout\n\t\t// 2) create a version of json_workout to store in the database\n\t\t// 3) create a list of exercises and equipment used in json_workout\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// If the participation id and workout id already exist in workout_log, abort\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\tif ( property_exists($data,'participation_id') && !is_null($data->participation_id) && !empty($data->participation_id) && is_numeric($data->participation_id) &&\n\t\t property_exists($data,'workout_id') && !is_null($data->workout_id) && !empty($data->workout_id) && is_numeric($data->workout_id) ) {\n\t\t\t$key['calendar_event_participation_id'] = $data->participation_id;\n\t\t\t$key['library_workout_id'] = $data->workout_id;\n\t\t\t$return = $this->perform('table_workoutdb_workout_log->getForAndKeys',$key,'id');\n\t\t\tif ( $return['status'] >= 300 ) {\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t\tif ( count($return['response']) > 0 ) {\n\t\t\t\treturn $this->return_handler->results(400,\"This workout has already been logged!\",new stdClass);\n\t\t\t}\n\t\t}\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// a valid participant_id must be passed in\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\tif ( !property_exists($data,'participation_id') || is_null($data->participation_id) || empty($data->participation_id) || !is_numeric($data->participation_id) ) {\n\t\t\treturn $this->return_handler->results(400,\"a valid participation_id must be provided\",new stdClass());\n\t\t}\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// get the user\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t$return = $this->perform('action_user->getForParticipation',$data->participation_id);\n\t\tif ( $return['status'] >= 300 ) {\n\t\t\treturn $return;\n\t\t}\n\t\tif ( $return['status'] > 200 ) {\n\t\t\treturn $this->return_handler->results(400,\"Invalid user_id\",new stdClass());\n\t\t}\n\t\t$user = $return['response'];\n\t\t//print_r($user);\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// set the user_id, height and weight\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t$data->user_id = $user->id;\n\t\t$data->height = clone $user->height;\n\t\t$data->weight = clone $user->weight;\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// if participant_id is passed in but start is not, use participant_id to lookup the start\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\tif ( !property_exists($data,'start') || is_null($data->start) || empty($data->start) || !is_numeric($data->start) ) {\n\t\t\t$return = $this->perform('action_calendar_event->getForParticipation',$data->participation_id);\n\t\t\tif ( $return['status'] >= 300 ) {\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t\tif ( $return['status'] > 200 ) {\n\t\t\t\treturn $this->return_handler->results(400,\"Invalid participation_id\",new stdClass());\n\t\t\t}\n\t\t\t$data->start = $return['response']->start;\n\t\t}\n\t\t// ---------------------------------------------------------------------------------\n\t\t// set gender\n\t\t// ---------------------------------------------------------------------------------\n\t\t$gender = \"both\";\n\t\tif ( $user->gender == \"M\" ) {\n\t\t\t$gender = \"male\";\n\t\t} else if ( $user->gender == \"F\" ) {\n\t\t\t$gender = \"female\";\n\t\t}\n\t\t// ========================================================================================================\n\t\t// Format and validate the workout log\n\t\t// ========================================================================================================\n\t\t// Deal with Aliases\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\tif ( property_exists($data,'workout_recording_type_id') ) {\n\t\t\t$data->library_workout_recording_type_id = $data->workout_recording_type_id;\n\t\t}\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// If workout log is based on a workout, set the time limit recording type based on the workout\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\tif ( property_exists($data,'workout_id') && !is_null($data->workout_id) ) {\n\t\t\t$return = $this->perform('table_workoutdb_library_workout->getForId',$data->workout_id);\n\t\t\tif ( $return['status'] > 200 ) {\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t\t$workout = $return['response'];\n\t\t\t\n\t\t\t// print_r($workout);\n\t\t\tif ( property_exists($workout,'time_limit') ) {\n\t\t\t\t$data->time_limit = clone $workout->time_limit;\n\t\t\t}\n\t\t\t$data->library_workout_recording_type_id = $workout->library_workout_recording_type_id;\n\t\t}\n\t\t\n\t\t// var_dump($data);\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// Validate Result\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\tif ( !is_null($data->library_workout_recording_type_id) &&\n\t\t ( $data->library_workout_recording_type_id == 0 ||\n\t\t $data->library_workout_recording_type_id == 1 ||\n\t\t $data->library_workout_recording_type_id == 2 ) ) {\n\t\t\tif ( !property_exists($data,'result_unit') || !property_exists($data->result_unit,'input') || !is_numeric($data->result_unit->input) || ((string) ((int) $data->result_unit->input)) != $data->result_unit->input ) {\n\t\t\t\treturn $this->return_handler->results(400,\"Result must be an Integer.\",new stdClass());\n\t\t\t}\n\t\t}\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// validate the workoutlog, create a storable json of the workoutlog,\n\t\t// create an exercise and equipment list for the workoutlog\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t$this->load->library('simplify');\n\t\t$return = $this->simplify->workout_log($data->log);\n\t\tif ( $return['status'] >= 300 ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t$log = clone $return['response']->workout_log;\n\t\t\n\t\t$exercises = $return['response']->exercises;\n\t\t$equipment = $return['response']->equipment;\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// if auto_calculate_result exists and is set to true, auto calculate the results\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\tif ( property_exists($data,'auto_calculate_result') && $data->auto_calculate_result &&\n\t\t !is_null($data->library_workout_recording_type_id) && $data->library_workout_recording_type_id >= 2 && $data->library_workout_recording_type_id <= 5 ) {\n\t\t\t$return = $this->perform('this->autoCalculate',$data,$user->id);\n\t\t\tif ( $return['status'] >= 300 ) {\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t\t$auto = $return['response'];\n\t\t\t\n\t\t\tif ( !property_exists($data,'result_unit') ) {\n\t\t\t\t$data->result_unit = new stdClass();\n\t\t\t}\n\t\t\t\n\t\t\tswitch ($data->library_workout_recording_type_id) {\n\t\t\t\tcase 2: // repeats\n\t\t\t\t\t$data->result_unit->id = $auto->repeats->id;\n\t\t\t\t\t$data->result_unit->input = $auto->repeats->value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3: // weight\n\t\t\t\t\t$data->result_unit->id = $auto->weight->id;\n\t\t\t\t\t$data->result_unit->input = $auto->weight->value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4: // distance\n\t\t\t\t\t$data->result_unit->id = $auto->distance->id;\n\t\t\t\t\t$data->result_unit->input = $auto->distance->value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5: // height\n\t\t\t\t\t$data->result_unit->id = $auto->height->id;\n\t\t\t\t\t$data->result_unit->input = $auto->height->value;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\t$data->auto_calculate_result = false;\n\t\t}\n\t\t//---------------------------------------------------------------------------------------------------------\n\t\t// Load the needed lookup tables\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t$return = $this->perform('action_workout->setupNeededLookupTables');\n\t\tif ( $return['status'] > 300 ) {\n\t\t\treturn $return;\n\t\t}\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// Create the workoutlog summary\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t$return_summary_complete = $this->perform('action_workout->createWorkoutSummary',$log->complete_round);\n\t\t$return_summary_incomplete = $this->perform('action_workout->createWorkoutSummary',$log->incomplete_round);\n\t\t\n\t\t$summary = new stdClass();\n\t\t$summary->complete_round = clone $return_summary_complete->{$gender};\n\t\t$summary->incomplete_round = clone $return_summary_incomplete->{$gender};\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// move the re-formatted log and new log summary into the data to be updated\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t$data->original_json_log = json_encode($data->log);\n\t\tunset($data->log);\n\t\t$data->json_log = json_encode($log);\n\t\t$data->json_log_summary = json_encode($summary);\n\t\t// print_r($data);\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// insert the entry\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t$return_create = $this->perform('table_workoutdb_workout_log->insert',$data);\n\t\tif ( $return_create['status'] >= 300 ) {\n\t\t\treturn $return_create;\n\t\t}\n\t\t\n\t\t$this->id = $return_create['response']->id;\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// create the cross reference entries only\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\tif ( count($exercises) > 0 ) {\n\t\t\t$this->id = $return_create['response']->id;\n\t\t\t$this->database_name = 'workoutdb';\n\t\t\t$this->table_name = 'workout_log';\n\t\t\t$this->xref_table_name = 'workout_log_library_exercise';\n\t\t\t$this->xrefed_table_name = 'library_exercise';\n\t\t\t$return = $this->perform('this->post_xref_list',$exercises);\n\t\t\tif ( $return['response'] >= 300 ) {\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t}\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// create the cross reference entries only\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\tif ( count($equipment) > 0 ) {\n\t\t\t$this->id = $return_create['response']->id;\n\t\t\t$this->database_name = 'workoutdb';\n\t\t\t$this->table_name = 'workout_log';\n\t\t\t$this->xref_table_name = 'workout_log_library_equipment';\n\t\t\t$this->xrefed_table_name = 'library_equipment';\n\t\t\t$return = $this->perform('this->post_xref_list',$equipment);\n\t\t\tif ( $return['response'] >= 300 ) {\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t}\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t// Now that everything worked, delete the workout_log_pending entry\n\t\t// --------------------------------------------------------------------------------------------------------\n\t\t$key['calendar_event_participation_id'] = $data->participation_id;\n\t\t$key['library_workout_id'] = $data->workout_id;\n\t\t$return = $this->perform('table_workoutdb_workout_log_pending->getForAndKeys',$key,'id');\n\t\tif ( $return['status'] >= 300 ) {\n\t\t\treturn $return;\n\t\t}\n\t\t\n\t\tforeach( $return['response'] as $pending ) {\n\t\t\t$return = $this->perform('table_workoutdb_workout_log_pending->delete',$pending->id);\n\t\t\tif ( $return['status'] >= 300 ) {\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $return_create;\n\t}", "public function actionCreate()\n {\n $model = new Workshops();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->Id_workshop]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $this->layout = '@app/views/layouts/main';\n \n $model = new WorksystemTask();\n $model->loadDefaultValues();\n $model->scenario = WorksystemTask::SCENARIO_CREATE;\n $_wsAction = WorksystemAction::getInstance();\n $post = Yii::$app->request->post(); \n \n if ($model->load($post)) {\n $_wsAction->CreateTask($model, $post);\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'itemTypes' => $this->getItemTypes(),\n 'items' => $this->getCollegesForSelects(),\n 'itemChilds' => !empty($model->item_id) ? $this->getChildrens($model->item_id) : [],\n 'courses' => !empty($model->item_child_id) ? $this->getChildrens($model->item_child_id) : [],\n 'taskTypes' => $this->getWorksystemTaskTypes(),\n 'teams' => $this->getUserTeam(),\n ]);\n }\n }", "public function saveAssignWorkout($data){\n $arr = array();\n foreach ($data['workout'] as $value) {\n array_push($arr, ['gym_id' => $this->GYM_ID, 'customer_id' => $data['member_id'], 'workout_plan_id' => $value, 'created_at' => now(), 'updated_at' => now()]);\n }\n\n $result = AssignedWorkout::insert($arr);\n return $result;\n }", "public\n function actionCreate()\n {\n $model = new Works();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function workout()\n {\n return $this->belongsTo('App\\Models\\Workout');\n }", "public function actionCreate()\n {\n $model = new WorkPackage();\n $type = Yii::$app->request->get('type');\n if (!empty($type)) {\n $model->type = $type;\n }\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // 更新session\n if ($model->type == HanziTask::TYPE_SPLIT) {\n Yii::$app->session->set('curSplitPackage', $model->attributes);\n } elseif ($model->type == HanziTask::TYPE_INPUT) {\n Yii::$app->session->set('curRecognizePackage', $model->attributes);\n } elseif ($model->type == HanziTask::TYPE_DEDUP) {\n Yii::$app->session->set('curDedupPackage', $model->attributes);\n } elseif ($model->type == HanziTask::TYPE_GAOLI_SPLIT) {\n Yii::$app->session->set('curGaoliSplitPackage', $model->attributes);\n }\n\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new ProjectBuildingStoreyPartRooms();\n if($p = Yii::$app->request->get('ProjectBuildingStoreyPartRooms')){\n $model->project_building_storey_part_id = !empty($p['project_building_storey_part_id']) ? $p['project_building_storey_part_id'] : null;\n }\n $m = $this->findPartById($p['project_building_storey_part_id']);\n if ($model->load(Yii::$app->request->post())) {\n if($model->sub_net_area==null){\n $model->sub_net_area = $model->net_area;\n }\n if($model->name==null){\n $model->name = $model->roomType->name;\n }\n if($model->mark==null){ \n $model->mark = $m ? (count($m->projectBuildingStoreyPartRooms)+1) : 1;\n }\n if($model->save()){\n return $this->redirect(['/project-building-storey-parts/view', 'id' => $model->project_building_storey_part_id]);\n } \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new SbmWorkOrder();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate($idEstimateWorkPackages,$idWbs,$idBR)\n {\n\t\t$ewp = EstimateWorkPackages::findOne(['idEstimateWorkPackages'=>$idEstimateWorkPackages]); // Wbs::findOne(['id'=>$parent_node_id]);\n\t\tif($ewp->isFinished()){\n\t\t\tYii::$app->session->addFlash('error',\"Оценка трудозатрат закрыта(отправлена в банк). Для корректировки необходимо связаться с менеджером проекта\");\n\t\t\t\treturn $this->redirect(['index', 'id_node' => $idWbs ,'idBR' => $idBR, 'idEWP'=>$idEstimateWorkPackages]);\n\t\t\t}\n $modelWOS = new WorksOfEstimate();\n $result = $modelWOS->addWork($idEstimateWorkPackages,$idWbs,'Название работы','Описание работы');\n if($result<0){\n\t\t\t\tYii::$app->session->addFlash('error',\"Ошибка сохранения работ \");\n\t\t\t\treturn $this->redirect(['index','id_node'=>$idWbs,'idBR' => $idBR]); \n\t }else{\n\t\t\t\treturn $this->redirect(['update', 'idWorksOfEstimate'=>$modelWOS->idWorksOfEstimate,'idWbs' => $idWbs ,'idBR' => $idBR, 'idEstimateWorkPackages'=>$idEstimateWorkPackages]);\n\t }\n\t \n\t //$modelWOS->idEstimateWorkPackages = $idEstimateWorkPackages;\n\t //$modelWOS->idWbs = $idWbs;\n\t //$modelWOS->WorkName = 'Название работы';\n\t //$modelWOS->WorkDescription = 'Описание работы';\n\t //$modelWOS->save();\n\t //if($modelWOS->hasErrors()){\n\t\t\t\t//Yii::$app->session->addFlash('error',\"Ошибка сохранения работ \");\n\t\t\t\t//return $this->redirect(['index','id_node'=>$idWbs,'idBR' => $idBR]); \n\t //}else{\n\t\t\t\t////return $this->redirect(['index', 'id_node' => $idWbs ,'idBR' => $idBR, 'idEWP'=>$idEstimateWorkPackages]);\n\t\t\t\t//return $this->redirect(['update', 'idWorksOfEstimate'=>$modelWOS->idWorksOfEstimate,'idWbs' => $idWbs ,'idBR' => $idBR, 'idEstimateWorkPackages'=>$idEstimateWorkPackages]);\n\t //}\n\t \n }", "public function actionCreate()\n {\n $model = new WorkInProgress();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function createTask($work) {\n\t\t$this->item->createTasks($work, $this);\n\t\tforeach($this->getDocumentLineDetails()->each() as $old) {\t// there should only be one...\n\t\t\t$old->createTask($work, $this);\n\t\t}\n\t}", "public function createWorks()\n {\n $this->render('create');\n }", "public function createSubcoursework(Request $request){\n $courseworkId = $request->input('courseworkId');\n $name = $request->input('name');\n $releaseDate = $request->input('releaseDate');\n $maxMarks = $request->input('maxMarks');\n $weighting = $request->input('weighting');\n $displayMarks = $request->input('displayMarks');\n $displayPercentage = $request->input('displayPercentage');\n\n $roleId = Auth::user()->role_id;\n $coursework = Coursework::where('id', $courseworkId)->first();\n if(!$coursework){throwException();}\n\n if($roleId == 4){\n $convenorMap = ConvenorCourseMap::where('user_id', Auth::user()->id)\n ->where('course_id', $coursework->course->id)->first();\n if(!$convenorMap || ($convenorMap && $convenorMap->status==0)){\n throwException(); // not a convenor or was a convenor\n }\n } else if ($roleId == 5){\n $deptMap = DeptAdminDeptMap::where('user_id', Auth::user()->id)\n ->where('department_id', $coursework->course->department->id)->first();\n if(!$deptMap || ($deptMap && $deptMap->status == 0)){\n // user is not a dept admin for the dept of the course\n throwException();\n }\n }\n\n $subcoursework = new SubCoursework();\n $subcoursework->coursework_id = $courseworkId;\n $subcoursework->name = $name;\n $subcoursework->display_to_students = $releaseDate;\n $subcoursework->display_marks = $displayMarks;\n $subcoursework->display_percentage = $displayPercentage;\n $subcoursework->weighting_in_coursework = $weighting;\n $subcoursework->max_marks = $maxMarks;\n $subcoursework->save();\n }", "public function createWorkoutSummary($p_workout) {\n\t\t// echo \"<br />WORKOUT<br />\";\n\t\t$time_limit = \"\";\n\t\t$repeats = \"\";\n\t\t$sets_summary = new stdClass();\n\t\t$sets_summary->both = array();\n\t\t$sets_summary->male = array();\n\t\t$sets_summary->female = array();\n\t\t$finish = \"\";\n\t\tforeach( $p_workout as $key => $value ) {\n\t\t\tswitch ($key) {\n\t\t\t\tcase 'time_limit':\n\t\t\t\t\t$time_limit = $this->format_time_limit($value);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'repeats':\n\t\t\t\t\t$repeats = $this->format_repeats($value);\n\t\t\t\t\t$finish = $this->format_finish($value);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'set':\n\t\t\t\t\t// where $sets_summary is an object {\"sets_summary\":{ \"male\":[\"male summary\",\"break summary\"],\"female\":[\"female summary\",\"break summary\"],\"both\":[\"both male and female summary\",\"break summary\"]}}\n\t\t\t\t\t$sets_summary = $this->summarySets($value);\n\t\t\t\t\t// print_r($sets_summary);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$workout_finish = $this->format_workout_finish($time_limit,$finish);\n\t\t\n\t\t$summary = new stdClass();\n\t\t$summary->both = new stdClass();\n\t\t$summary->male = new stdClass();\n\t\t$summary->female = new stdClass();\n\t\t\n\t\tforeach( $summary as $key => &$value ) {\n\t\t\t$value->set = array();\n\t\t\tif ( count($sets_summary) > 0 ) {\n\t\t\t\t$value->set = $sets_summary->{$key};\n\t\t\t}\n\t\t\t$value->finish = $workout_finish;\n\t\t}\n\t\t\n\t\treturn $summary;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Applies the current grid configuration
protected function applyGridConfig() { $config = $this->getGridConfig(); if ($this->_isSubmit) { $delete = ArrayHelper::getValue($_POST, 'deleteFlag', 0) == 1; $this->saveGridConfig($config, $delete); return Yii::$app->controller->refresh(); } else { $this->loadGridConfig($config); $this->setWidgetColumns(); $this->loadAttributes($this->_model); } $this->applyFilter(); $this->applySort(); $this->applyPageSize(); $this->applyTheme(); $this->applyColumns(); return null; }
[ "abstract protected function prepareAndGetGridConfig();", "protected function _processDefaults()\n {\n //TODO: remember processed config\n $grid = $this->grid;\n $c =& $grid['config'];\n\n\n if (!empty($c['data_mode']) && $c['data_mode'] === 'local') {\n unset($c['data_url']);\n\n //IMPORTANT: edit_url_required is used when local mode grid needs to be saved through edit_url\n //ex) ProductReviewGrid on product edit form\n if (empty($c['edit_url_required']) || !$c['edit_url_required']) {\n unset($c['edit_url']);\n }\n\n }\n\n if (empty($c['grid_url'])) {\n $c['grid_url'] = $this->BRequest->currentUrl();\n }\n if (empty($c['page_size_options'])) {\n $c['page_size_options'] = [10, 25, 50, 100];\n }\n if (empty($c['state']['ps'])) {\n $c['state']['ps'] = $c['page_size_options'][0];\n }\n if (!isset($c['state']['s'])) {\n $c['state']['s'] = '';\n }\n if (!isset($c['state']['sd'])) {\n $c['state']['sd'] = 'asc';\n }\n if (empty($c['search'])) {\n $c['search'] = new stdClass;\n }\n if (empty($c['row_id_column'])) {\n $c['row_id_column'] = 'id';\n }\n unset($c);\n\n // fetch request parameters\n if (empty($grid['request'])) {\n $grid['request'] = $this->BRequest->get();\n }\n\n\n $this->grid = $grid;\n }", "abstract public function setupGrid();", "public function getGridConfig();", "public function prepareGrid();", "function cs_reset_task_grid_settings() {\n\t$task_grid = cs_get_theme_support( 'task_grid' );\n\n\tif ( ! empty( $task_grid['default_rows'] ) ) {\n\t\tupdate_option( 'communityservice_catalog_rows', absint( $task_grid['default_rows'] ) );\n\t}\n\n\tif ( ! empty( $task_grid['default_columns'] ) ) {\n\t\tupdate_option( 'communityservice_catalog_columns', absint( $task_grid['default_columns'] ) );\n\t}\n}", "public function applyConfig($config);", "protected function customizeColumnsConfig()\n {\n \n }", "public function getConfiguration($gridName);", "private function updateGrid(): void\n {\n for ($i = 0, $iMax = count($this->grid); $i < $iMax; $i++) {\n for ($j = 0, $jMax = count($this->grid[0]); $j < $jMax; $j++) {\n $this->applyRules($i, $j);\n }\n }\n }", "final public function applyconfigoptions() {}", "protected function applyTheme()\n {\n $theme = ArrayHelper::getValue($this->_module->themeConfig, $this->theme, $this->_module->defaultTheme);\n if (!is_array($theme) || empty($theme)) {\n return;\n }\n $this->gridOptions = ArrayHelper::merge($theme, $this->gridOptions);\n }", "protected function configureGrid($fields)\n {\n $this->grid->setModel($this->model, $fields);\n }", "protected function cellSettings()\n {\n $this->SetCellPadding(\n RC_Config::get('tcpdf::config.cell_padding')\n );\n\n $this->setCellHeightRatio(\n RC_Config::get('tcpdf::config.cell_height_ratio')\n );\n }", "protected function _setGridMode()\n {\n\n switch ($this->dispatcher->getParam(self::MODE)) {\n case \"edit\":\n self::$mode = self::EDIT;\n\n if (in_array(Grid::EDIT, $this->dispatcher->getParams()) && in_array(Grid::NEW, $this->dispatcher->getParams())) {\n self::$mode = self::NEW;\n }\n\n $this->view->pick('grid/' . self::EDIT);\n break;\n case \"details\":\n self::$mode = self::DETAILS;\n $this->view->pick('grid/' . self::DETAILS);\n break;\n case \"delete\":\n self::$mode = self::DELETE;\n $this->view->pick('grid/' . self::DELETE);\n break;\n default:\n self::$mode = self::TABLE;\n $this->_convertGridTableParams();\n $this->view->pick('grid/' . self::TABLE);\n break;\n }\n }", "protected function configuration() {}", "abstract public function setupColumns(&$grid);", "protected function mergeConfigs()\n {\n parent::mergeConfigs();\n\n $this->mergeConfigFrom(\n __DIR__.'/DashboardIntegration/config/ecommerce_dashboard.php', 'webmagic.dashboard.ecommerce'\n );\n }", "public function plotGrid() {\n\t\t$this->plotAtt['grid'] = \"set grid\\n\";\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get an instance of the associated Grammar for this Extractor.
protected function makeGrammar(): Grammar { $class = $this->config['grammar']; $config = Arr::get($this->config, 'config', []); return new $class($config); }
[ "public function getGrammar()\n {\n return $this->_grammar;\n }", "public function getQueryGrammar()\r\n {\r\n return new Grammar();\r\n }", "public function getGrammar()\n {\n return $this->grammar;\n }", "public function getGrammar()\n {\n return $this->m_grammar;\n }", "public function getGrammar(): Grammar|null;", "protected function grammar()\n\t{\n\t\tif (isset ( $this->grammar ))\n\t\t\treturn $this->grammar;\n\n\t\tif (isset ( \\Laravel\\Database::$registrar [$this->driver ()] )) {\n\t\t\treturn $this->grammar = \\Laravel\\Database::$registrar [$this->driver ()] ['query'] ();\n\t\t}\n\n\t\tswitch ($this->driver ()) {\n\t\t\tcase 'mysql' :\n\t\t\t\treturn $this->grammar = new Query\\Grammars\\MySQL ( $this );\n\n\t\t\tcase 'sqlite' :\n\t\t\t\treturn $this->grammar = new Query\\Grammars\\SQLite ( $this );\n\n\t\t\tcase 'sqlsrv' :\n\t\t\t\treturn $this->grammar = new Query\\Grammars\\SQLServer ( $this );\n\n\t\t\tcase 'pgsql' :\n\t\t\t\treturn $this->grammar = new Query\\Grammars\\Postgres ( $this );\n\n\t\t\tdefault :\n\t\t\t\treturn $this->grammar = new Query\\Grammars\\Grammar ( $this );\n\t\t}\n\t}", "public function grammar()\n {\n return $this->grammar;\n }", "public function getQueryGrammar()\n {\n return $this->grammar;\n }", "public function getQueryGrammar()\n {\n if (!$this->queryGrammar) {\n $this->useDefaultQueryGrammar();\n }\n\n return $this->queryGrammar;\n }", "public function getGrammar()\n {\n\n return $this->getEndpoint()->getGrammar();\n\n }", "public function getGrammar();", "public function getAbnfGrammar()\n {\n return $this->abnf_grammar;\n }", "public function getDefaultGrammar(): Grammar|null;", "public function getQueryGrammar()\n {\n return $this->queryGrammar;\n }", "public function getGrammar() {\r\n return($this->findParentRow('Application_Model_DbTable_Grammars', 'Grammars'));\r\n }", "public function getDefaultQueryGrammar()\n {\n return new Grammar;\n }", "public function getQueryGrammar() {\n return $this->queryGrammar;\n }", "public function getDefaultGrammar(): Grammar|null\n {\n return null;\n }", "public function getGrammar()\n {\n return $this->segment;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the DOMXPath query string used to retrieve the secondary type list
protected function getSecondaryTypeListQuery() { return $this->secondaryTypeListQuery; }
[ "public function getQueryTypes();", "private function getOptionsListXpath() {\n return sprintf(Dropdown::OPTIONS_LIST_XPATH,$this::$keyWord);\n }", "public function getQueryType();", "public static function formatExcludeAsXpath(): string\n {\n $exclude = [];\n $not = [\n 'dtd',\n 'external-parsed-entity',\n 'oembed',\n 'xhtml',\n 'xml-patch',\n ];\n\n $exclude = \\array_merge($exclude, \\array_map(static function ($e) {\n return \\sprintf('not(contains(@type, \"%s\"))', $e);\n }, $not));\n\n return \\implode(' and ', $exclude);\n }", "public function getXPath($type)\n {\n $variable = $type . 'XPath';\n if (isset($this->$variable)) {\n return $this->$variable;\n }\n throw new OpenDocument_Exception('No XPath for ' . $type);\n }", "public function getQueryTypes(): array;", "function basex_get_paper_types(){\n\n\t\t$xquery = 'for $x in distinct-values(//PublicationType) order by $x return element option { attribute value {$x}, $x }';\n\t\treturn basex_query($xquery);\n\n\t}", "public function undergraduateQuery()\n {\n return \"default:courseCodes/default:courseCode[default:courseNumber<'500']/parent::*/parent::*\";\n }", "function queryString($medium, $titleType, $venue, $authorType, $pid){\n if ($venue != \"\"){\n return \"//dblpperson/r/{$medium}[{$titleType}/text()=\\\"{$venue}\\\"]/{$authorType}[@pid=\\\"{$pid}\\\"]\";\n }\n else {\n return \"//dblpperson/r/{$medium}/{$authorType}[@pid=\\\"{$pid}\\\"]\";\n }\n}", "private function getXPath()\n {\n return sprintf(\"//services/%s\", $this->getPluginName());\n }", "protected function getTypeQuery()\n\t{\n\t\treturn $this->getConfigData('type_query');\n\t}", "public function types()\n {\n return $this->all('rdf:type');\n }", "public function getSecondaryTypes()\n {\n return $this->secondaryTypes;\n }", "public function getSecondaryType()\n {\n return $this->getValueObject('secondary_type');\n }", "function buildQuery_prop_type($srchqry)\r\n\t{\r\n\t\tglobal $mainframe;\r\n\t\t//$param = $this->getState('prop_type');\r\n\t \r\n ## re-writing this functionality - Rich S Wyatt - 10/19/2010\r\n \r\n \r\n $fragment = \"(\"; \r\n \r\n $zz = 0; \r\n foreach($srchqry as $k=>$v)\r\n {\r\n if(count($v) > 0 || $v == true)\r\n {\r\n if(count($v) > 0 && $v != 1)\r\n {\r\n \r\n if($zz != 0)\r\n {\r\n $fragment .= \" OR \"; \r\n }\r\n $fragment .= \" (\". FIELDNAME_LISTING_PROP_TYPE . \" = '\". $k . \"' AND\"; \r\n $fragment .= \"( \"; \r\n $z = 0; \r\n foreach($v as $kk=>$vv)\r\n {\r\n if($z == 0)\r\n {\r\n $fragment .= FIELDNAME_LISTING_SUB_TYPE . \" = '\". $vv . \"' \"; \r\n }\r\n else\r\n {\r\n $fragment .= \"OR \". FIELDNAME_LISTING_SUB_TYPE . \" = '\". $vv . \"' \"; \r\n }\r\n \r\n $z++; \r\n }\r\n \r\n $fragment .= \"))\"; \r\n }\r\n if($v == 1)\r\n {\r\n // this is without subtypes\r\n if($zz != 0)\r\n {\r\n $fragment .= \" OR \"; \r\n }\r\n $fragment .= \" (\". FIELDNAME_LISTING_PROP_TYPE . \" = '\". $k . \"' \"; \r\n \r\n $fragment .= \")\"; \r\n } \r\n $zz++; \r\n }\r\n \r\n }\r\n $fragment .= \")\";\r\n /*\r\n\t\t$fragment = \"(\" . FIELDNAME_LISTING_SUB_TYPE . \" = '\";\r\n\r\n\t\tif ($param[0] === '0' ) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\t$fragment .= implode(\"' OR \" . FIELDNAME_LISTING_SUB_TYPE . \" = '\",$param);\r\n\t\t}\r\n\t\t\r\n\t\t$fragment .= \"'\";\r\n\t\t\r\n\t\t//CUSTOM BCO INTEGRATION\r\n\t\tif(in_array('land',$param)) {\r\n\t\t\t$fragment .= \" OR \" . FIELDNAME_LISTING_SUB_TYPE . \" = 'Farm/Ranch'\";\r\n\t\t\t$fragment .= \" OR \" . FIELDNAME_LISTING_SUB_TYPE . \" = 'Sf/Mf/Acreage'\";\r\n\t\t}\r\n\t\tif(in_array('partial',$param)) {\r\n\t\t\t$fragment .= \" OR \" . FIELDNAME_LISTING_SUB_TYPE . \" LIKE '%partial%'\";\r\n\t\t}\r\n\t\t//EOF\r\n\t\t\r\n\t\t$fragment .= \")\";\r\n **/\r\n\t\treturn $fragment; \r\n\t}", "function getPositionalQueryTypes();", "public function getTagsDropDownResultsXpath() {\n\t\treturn $this->tagsDropDownResultXpath;\n\t}", "function getResourceListType()\n\t{\n\t\tif (is_object($this->res_node))\n\t\t{\n\t\t\t$children = $this->res_node->child_nodes();\n\t\t\tif (is_object($children[0]))\n\t\t\t{\n\t\t\t\treturn $children[0]->get_attribute(\"Type\");\n\t\t\t}\n\t\t}\n\t}", "private function get_sitemap_type() {\n\t\tglobal $wp_current_filter;\n\n\t\treturn substr( substr( end( $wp_current_filter ), strlen( self::FILTER_PREFIX ) ), 0, -strlen( self::FILTER_SUFFIX ) );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filter the query by a related \Member object
public function filterByMember($member, $comparison = null) { if ($member instanceof \Member) { return $this ->addUsingAlias(MemberMutasiTableMap::COL_ID_MEMBER, $member->getId(), $comparison); } elseif ($member instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this ->addUsingAlias(MemberMutasiTableMap::COL_ID_MEMBER, $member->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByMember() only accepts arguments of type \Member or Collection'); } }
[ "public function filterMembers()\n {\n return $this->team->where('id', Auth::user()->getTeam()->id)->with([\n 'members' => function ($query) {\n $query->where('slug', 'like', '%' . $this->request->get('q') . '%');\n },\n ])->first()->members;\n }", "public function filterOwnedOrManaged();", "function filterByOwner($user_id);", "function mgm_get_members_with_sql_filter($sql_filter =''){\r\r\n\r\r\n\tglobal $wpdb;\t\r\r\n\t// init \r\r\n\t$members = array();\r\r\n\t// get members\t\t\r\r\n\t$sql = \"SELECT `ID` FROM `{$wpdb->users}` WHERE ID != 1 {$sql_filter}\";\t\r\r\n\t// mgm_log($sql);\r\r\n\t// users\r\r\n\t$users = $wpdb->get_results($sql);\t\r\r\n\t// check\r\r\n\tif($users){\r\r\n\t\t// loop\r\r\n\t\tforeach($users as $user){\t\t\t\r\r\n\t\t\t// member object\r\r\n\t\t\t$members[]= $user->ID;\t\r\r\n\t\t}\t\r\r\n\t}\r\r\n\t\r\r\n\t//mgm_log(mgm_array_dump($members,true));\r\r\n\t// return\r\r\n\treturn $members;\r\r\n\r\r\n}", "protected function addFilterByRelation($relation)\n {\n $entity = $this->getEntity();\n// $queryClass = $this->getQueryClassName();\n $foreignEntity = $relation->getForeignEntity();\n\n// $foreignBuilder = $this->getObjectClassName();\n $fkStubObjectBuilder = $this->getBuilder()->getNewObjectBuilder($foreignEntity);\n $this->getDefinition()->declareUse($fkStubObjectBuilder->getFullClassName());\n\n $fkPhpName = '\\\\' . $this->getClassNameFromBuilder($fkStubObjectBuilder, true);\n $relationName = $this->getRelationPhpName($relation);\n $objectName = '$' . $foreignEntity->getCamelCaseName();\n\n $description = \"Filter the query by a related $fkPhpName object.\";\n\n $body = \"\nif ($objectName instanceof $fkPhpName) {\n return \\$this\";\n foreach ($relation->getFieldObjectsMapArray() as $map) {\n list ($localColumnObject, $foreignColumnObject) = $map;\n $body .= \"\n ->addUsingAlias(\" . $localColumnObject->getFQConstantName() . \", \" . $objectName . \"->get\" . $foreignColumnObject->getName() . \"(), \\$comparison)\";\n }\n $body .= \";\";\n if (!$relation->isComposite()) {\n $localColumnConstant = $relation->getLocalField()->getFQConstantName();\n $foreignColumnName = $relation->getForeignField()->getName();\n $keyColumn = $relation->getForeignEntity()->hasCompositePrimaryKey() ? $foreignColumnName : 'PrimaryKey';\n $body .= \"\n} elseif ($objectName instanceof ObjectCollection) {\n if (null === \\$comparison) {\n \\$comparison = Criteria::IN;\n }\n\n return \\$this\n ->addUsingAlias($localColumnConstant, {$objectName}->toKeyValue('$keyColumn', '$foreignColumnName'), \\$comparison);\";\n}\n $body .= \"\n} else {\";\n if ($relation->isComposite()) {\n $body .= \"\n throw new PropelException('filterBy$relationName() only accepts arguments of type $fkPhpName');\";\n } else {\n $body .= \"\n throw new PropelException('filterBy$relationName() only accepts arguments of type $fkPhpName or Collection');\";\n }\n $body .= \"\n}\n\";\n\n $methodName = \"filterBy$relationName\";\n $variableParameter = new PhpParameter($foreignEntity->getCamelCaseName());\n\n if ($relation->isComposite()) {\n $variableParameter->setType($fkPhpName);\n $variableParameter->setTypeDescription(\"The related object to use as filter\");\n } else {\n $variableParameter->setType(\"$fkPhpName|ObjectCollection\");\n $variableParameter->setTypeDescription(\"The related object(s) to use as filter\");\n }\n\n $this->addMethod($methodName)\n ->addParameter($variableParameter)\n ->addSimpleDescParameter('comparison', 'string', 'Operator to use for the column comparison, defaults to Criteria::EQUAL', null)\n ->setDescription($description)\n ->setType(\"\\$this|\" . $this->getQueryClassName())\n ->setTypeDescription(\"The current query, for fluid interface\")\n ->setBody($body);\n\n }", "public function getMembersExceptMe(){\n return $this->hasMany('App\\Models\\RoomsMembersModel', 'room_id', 'id')->where(\"user_id\", \"!=\" ,Auth::id())->get();\n }", "public function filterBymemberProfile($memberProfile, $comparison = null)\n {\n if ($memberProfile instanceof memberProfile) {\n return $this\n ->addUsingAlias(UserPeer::ID, $memberProfile->getId(), $comparison);\n } elseif ($memberProfile instanceof PropelObjectCollection) {\n return $this\n ->usememberProfileQuery()\n ->filterByPrimaryKeys($memberProfile->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterBymemberProfile() only accepts arguments of type memberProfile or PropelCollection');\n }\n }", "public function filterByEventMember($eventMember, $comparison = null)\n {\n if ($eventMember instanceof EventMember) {\n return $this\n ->addUsingAlias(EventPeer::ID, $eventMember->getEventId(), $comparison);\n } elseif ($eventMember instanceof PropelObjectCollection) {\n return $this\n ->useEventMemberQuery()\n ->filterByPrimaryKeys($eventMember->getPrimaryKeys())\n ->endUse();\n } else {\n throw new PropelException('filterByEventMember() only accepts arguments of type EventMember or PropelCollection');\n }\n }", "public function filterBySide(Side $side) {\n// $criteria = Criteria::create();\n// $expr = Criteria::expr();\n// $criteria->where($expr->eq('details.side',$side));\n $p = function($e) use ($side) {\n return $e->getSide() == $side;\n };\n return $this->filter($p);\n }", "public function filterUser(int|UniqueId $id): self;", "public function getAllMembersConnectedToMember($member_id){\n \n $all_members = [];\n $criteria = new CDbCriteria();\n $criteria->select = '*';\n $criteria->condition='member_id=:id ';\n $criteria->params = array(':id'=>$member_id);\n $members= MemberHasMembers::model()->findAll($criteria);\n \n \n foreach($members as $member){\n $all_members[] = $member['other_member_id'];\n }\n return $all_members;\n }", "public function filterByMemberId($memberId = null, $comparison = null)\n {\n if (is_array($memberId)) {\n $useMinMax = false;\n if (isset($memberId['min'])) {\n $this->addUsingAlias(PdnPertanyaanUmumPeer::MEMBER_ID, $memberId['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($memberId['max'])) {\n $this->addUsingAlias(PdnPertanyaanUmumPeer::MEMBER_ID, $memberId['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PdnPertanyaanUmumPeer::MEMBER_ID, $memberId, $comparison);\n }", "private static function buildNameQuery(Member $member): string\n {\n // webling's FILTER seems to be caseINsensitive, so dont bother\n \n $firstName = self::escape($member->firstName->getWeblingValue());\n $lastName = self::escape($member->lastName->getWeblingValue());\n \n $query = [];\n if ($member->firstName->getWeblingValue()) {\n $query[] = \"`{$member->firstName->getWeblingKey()}` FILTER '$firstName'\";\n }\n \n if ($member->lastName->getWeblingValue()) {\n $query[] = \"`{$member->lastName->getWeblingKey()}` FILTER '$lastName'\";\n }\n \n return implode(' AND ', $query);\n }", "public function filterUnjoinedRelation($related)\n {\n $this->query->whereHas($related, function ($q) use ($related) {\n $this->callRelatedLocalSetup($related, $q);\n\n // If we defined it locally then we're running the closure on the related model here right.\n foreach ($this->getLocalRelation($related) as $closure) {\n // Run in context of the related model locally\n $closure($q);\n }\n\n if (count($filterableRelated = $this->getRelatedFilterInput($related)) > 0) {\n $q->filter($filterableRelated);\n }\n\n return $q;\n });\n }", "public function filterByMembership(string $type);", "public static function getQueryEnabledForAssociation($id)\r\n {\r\n $q = Doctrine_Query::create()\r\n ->from('Member m')\r\n ->where('m.association_id = ?', $id)\r\n ->andWhere('m.state = ?', self::STATE_ENABLED)\r\n ->orderBy('m.firstname ASC');\r\n\r\n return $q;\r\n }", "public function member()\n {\n return $this->belongsTo(Member::class, 'member_id', 'id');\n }", "public function member()\n {\n return $this->belongsTo(Member::class);\n }", "public function filterByMembers($members = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($members)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $members)) {\n\t\t\t\t$members = str_replace('*', '%', $members);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(UserPeer::MEMBERS, $members, $comparison);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns fullName for given id
public function getFullNameByUserId($id) { return $this->getUserById($id)->getFullName(); }
[ "public function getFullNameByUserId($id);", "private function get_patient_name_by_id($id) {\n\t\t$dataArr = Patients::select('first_name', 'middle_name', 'last_name')->where('id', $id)->get()->toArray();\n\t\t\n\t\treturn $dataArr[0]['first_name'].' '.$dataArr[0]['middle_name'].' '.$dataArr[0]['last_name'];\n\t}", "public function getReportingPersonName($id){\n $query = $this->conn->prepare(\"SELECT CONCAT(e.first_name, ' ', e.last_name) as full_name FROM `employee` INNER JOIN employee e on employee.reporting_person = e.id WHERE employee.reporting_person =:id\");\n $query->bindParam(\"id\", $id, PDO::PARAM_STR);\n $query->execute();\n $result = $query->fetch();\n if($result){\n return $result['full_name'];\n }\n return '-';\n }", "public function getAccountUserFullName($id) {\n $this->db->select('id,first_name,middle_name,last_name,name_extension');\n $this->db->from('account a');\n $this->db->where(\"a.id\", $id);\n $query = $this->db->get();\n $res = $query->row_array();\n return $res['first_name'] . \" \" . $res['middle_name'] . \". \" . $res['last_name'] . \" \" . $res['name_extension'];\n }", "public function idtoName($id) {\n global $wpdb;\n $staff_profile = $wpdb->prefix . 'er_staff_profile';\n $row = $wpdb->get_row(\"SELECT `first_name`, `last_name` FROM $staff_profile WHERE id = $id\");\n\n return $row->first_name . ' ' . $row->last_name;\n }", "public static function GetFullName($accountid){\n\n $fullname = DB::table('accountinfo')\n ->where('accountid', $accountid)\n ->value('fullname');\n return $fullname;\n\n }", "public static function GetUserName($id) {\n \n return User::find($id) ? User::find($id)->name : '' ;\n }", "public function getUserName($id)\n {\n if (($user = $this->container->get('user')->find($id))) {\n return $user->getDisplayName();\n }\n return $id;\n }", "public static function partyName($id)\n {\n $party = Party::find($id);\n return $party->name;\n }", "public function admin_getUserName($id) {\r\n\t\t$this->autoRender = false;\r\n\r\n\t\t// If a User ID is specified, find it in the table\r\n\t\tif (!empty($id)) {\r\n\t\t\t$user = $this->User->find(\r\n\t\t\t\t'first',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t\t'id' => $id\r\n\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t\t);\r\n\r\n\t\t\t// And return the name\r\n\t\t\treturn $user;\r\n\r\n\t\t// Otherwise return blank\r\n\t\t} else {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}", "private function personsName()\r\n {\r\n $html = $this->_html;\r\n $get = $this->_get;\r\n $db = $this->_db;\r\n if (!empty($get['personid'])) {\r\n $sql = <<< EOT\r\n SELECT\r\n Person.Surname, \r\n Person.FirstNames \r\n FROM Person \r\n WHERE Person.ID = %d\r\nEOT;\r\n $sql = sprintf($sql, intval($get['personid']));\r\n $result = $db->query($sql);\r\n if ($db->rowCount($result) > 0) {\r\n $row = $db->fetch($result);\r\n $firstNames = $db->unescape($row['FirstNames']);\r\n $lastName = $db->unescape($row['Surname']);\r\n $fullName = $html->text($firstNames.' '.$lastName);\r\n }\r\n }\r\n return $fullName;\r\n }", "public function getRecipientNameById(int $id): string\n {\n return $this->user->find($id)->name;\n }", "public function fetchNameById($id)\r\n {\r\n return $this->findColumnByPk($id, 'name');\r\n }", "private function farmName($id){\n\n\t\t$selected_farm = Farms::select('name')\n\t\t\t\t\t\t\t\t\t\t ->where('id',$id)\n\t\t\t\t\t\t\t\t\t\t ->first();\n\n\t\treturn $selected_farm->name;\n\n\t}", "public function get_user_by_firstname($id)\n\t{\n\t\t$this->db->select('first_name');\n\t\t$this->db->where('id', $id);\n\t\t$query = $this->db->get('users');\n\t\t$d = array_shift($query->result_array());\n\t\treturn $d['first_name'];\n\t}", "private function getAtherName($id)\n { \n\n\n $query = \"SELECT * FROM authors WHERE id= {$id}\";\n $result = $this->conn->query($query);\n $row= $result->fetch_assoc();\n $authorName=$row['name'];\n \n return $authorName;\n\n }", "function getLocationName($id)\n\t{\n\t\t$ret = $this->getLocationData($id);\n\t\treturn $ret['name'];\n\t}", "public function getTheNameOfThePayee($id){\n \n $criteria = new CDbCriteria();\n $criteria->select = '*';\n $criteria->condition='id=:id';\n $criteria->params = array(':id'=>$id);\n $payee= SubscriptionPayment::model()->find($criteria);\n \n $name = $this->getThisUsersName($payee['paid_by_id']);\n return $name; \n \n }", "public function get_name($id = FALSE)\n\t{\n\t\t$query = $this->db->select('nama')->get_where('mybf_people', array('id' => $id));\n\t\t$data_people = $query->row_array();\n\t\treturn $data_people['nama'];\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the event bus configuration
public function getEventBusConfig() { if ($this->eventBusConfig !== null) { return $this->eventBusConfig; } if (!isset($this->rawConfig['eventbus'])) { return new EventBusConfig(); } $baseConf = $this->rawConfig['eventbus']; return new EventBusConfig($baseConf); }
[ "public function getEventsConfig()\n {\n return $this->eventsConfig;\n }", "protected function getEventBus()\n\t{\n\t\tif ( $this->getConfig() instanceof OLPBlackbox_Config\n\t\t\t&& $this->getConfig()->event_bus instanceof OLP_IEventBus)\n\t\t{\n\t\t\treturn $this->getConfig()->event_bus; \n\t\t}\n\t\t\n\t\treturn NULL;\n\t}", "protected function getConfiguration() {\n if (empty($this->configuration)) {\n $configuration = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['programmevents'];\n if (is_string($configuration)) {\n $configuration = unserialize($configuration);\n }\n\n // set default values if no global conf found\n if (empty($configuration)) {\n $configuration = array(\n 'pid' => 0,\n 'archiveFolder' => 'fileadmin/import_events/backup/',\n 'inboxFolder' => 'fileadmin/import_events/',\n 'templateArchiveFilePrefix' => 'Y-m-d_',\n 'inboxFilename' => '155.xml',\n 'enableDevLog' => false,\n 'maxBackups' => 5\n );\n }\n $this->configuration = $configuration;\n }\n return $this->configuration;\n }", "function event_config() {\n\t\tif (isset($this->configs['event'])) { return $this->configs['event']; }\n\t\t\t\n\t\t$file = CONF::inc_dir().'etc/event/event_config.inc.php';\n\t\t\t\n\t\tif (!file_exists($file)) { return new Error('No event config-file found'); }\n\n\t\t// PHPLint is unhappy with this, TODO: figure out how to make it happy, strix 2012-02-17\n\t\tinclude($file);\n\t\t$this->configs['event'] = $conf;\n\n\t\treturn $conf;\n\t}", "public function getBus(): EventBusInterface;", "public function getConfig()\n {\n return $this->builderConfig;\n }", "protected function getConfig()\n {\n return [\n 'queue' => config('queue.connections.kafka.queue'),\n 'brokers' => config('queue.connections.kafka.brokers'),\n 'consumer_group_id' => config('queue.connections.kafka.consumer_group_id'),\n ];\n }", "public function getConfig(){\n return $this->getClient()->getConfig();\n }", "public function getEmailConfiguration ()\n {\n return $this->_emailConfig;\n }", "public static function config() {\n return self::$config;\n }", "public function get_config(){\r\n\t\treturn $this->config;\r\n\t}", "private function getAmqpConfig()\n {\n if ($this->amqpConfig === null) {\n $this->amqpConfig = \\Magento\\Framework\\App\\ObjectManager::getInstance()->get(AmqpConfig::class);\n }\n\n return $this->amqpConfig;\n }", "public function getMessengerConfig()\n {\n return Tinebase_Config::getInstance()->getConfigAsArray(Tinebase_Model_Config::MESSENGERCONFIG, 'Tinebase', array());\n }", "public function getApplicationConfig()\n {\n return $this->applicationConfig;\n }", "public function getConfig()\n {\n return $this->bkmConfig;\n }", "public function getConfig()\n\t{\n\t\treturn $this->getServiceLocator()->get('config');\n\t}", "public function getConfiguration()\n {\n return $this->_config;\n }", "public static function getConfiguration() {\n\t\t\treturn Application::instance()->config;\n\t\t}", "public function getConfig()\n {\n return $this->_invoiceConfig;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper functions for generating a unique pubId. A pubId looks like "Ab1C2dE3f4g5Hi6".
public static function generatePubId($bytes = 20, $chars = 20, $spacing = 5) { $raw = preg_replace('/[^a-zA-Z0-9]/', '', base64_encode(random_bytes($bytes))); // This conversion from bytes to alphanumerics is a bit lossy. To ensure we // end up with enough characters, we take a few extra bytes. // Take {$chars} alphanumerics, and intersperse dashes (AbC1-dE2f-gHi3). $pubId = ''; for ($i = 0; $i < $chars; $i++) { if ($i > 0 && $i % $spacing == 0) { $pubId .= '-'; } $pubId .= $raw{$i}; } return $pubId; }
[ "public static function generatePubid() {\n\t\treturn random_string(static::$pubid_length);\n\t}", "private function generatePublicId(): string\n {\n return (string) mt_rand(10000000, 99999999);\n }", "public function generateId( ) {\n\t\tstatic $inc = 0;\n\n\t\t$ts = pack('N', time());\n\t\t$m = substr(md5(gethostname()), 0, 3);\n\t\t$pid = pack('n', 1); //posix_getpid()\n\t\t$trail = substr(pack('N', $inc++), 1, 3);\n\n\t\t$bin = sprintf(\"%s%s%s%s\", $ts, $m, $pid, $trail);\n\t\t$id = '';\n\t\tfor ($i = 0; $i < 12; $i++) {\n\t\t\t$id .= sprintf(\"%02X\", ord($bin[$i]));\n\t\t}\n\t\treturn strtolower($id);\n\t}", "function id_gen($str=''){\n\t$pats = array('/','+');\n\t$subs = array('_','-');\n\treturn str_replace($pats,$subs,substr(base64_encode(md5($str,true)),0,22));\n}", "static function makeID() {\n return uniqid();\n }", "function generateNewUuid() {\n return uniqid(\"CSC490\");\n}", "public function generate_unique_id() {\n\n\t require_once( ABSPATH . 'wp-includes/class-phpass.php');\n\t $hasher = new PasswordHash( 8, false );\n\t return md5( $hasher->get_random_bytes( 32 ) );\n\n\t }", "function CreateID() {\n $result = \"\";\n $length = 16;\n for ($i=0; $i < $length; $i++) {\n $result.= dechex(mt_rand(0,$length-1));\n }\n return $result;\n }", "public function generateId() {\n\t\treturn uniqid();\n\t}", "static function generate() {\n //e.g. output: 372472a2-d557-4630-bc7d-bae54c934da1\n //word*2-, word-, (w)ord-, (w)ord-, word*3\n $guidstr = \"\";\n for ($i=1;$i<=16;$i++)\n {\n $b = (int)rand(0,0xff);\n if ($i == 7) { $b &= 0x0f; $b |= 0x40; } // version 4 (random)\n if ($i == 9) { $b &= 0x3f; $b |= 0x80; } // variant\n $guidstr .= sprintf(\"%02s\", base_convert($b,10,16));\n if ($i == 4 || $i == 6 || $i == 8 || $i == 10) { $guidstr .= '-'; }\n }\n return $guidstr;\n }", "function ptr_create_rand_id($email){\r\n return $email.rand(0,2147483647);\r\n}", "public function makeId(){\n// \t$quan2 = substr(str_shuffle(str_repeat(\"123456780\", 15)), 0, 1);\n \t$quan = 20;\n \t$s = substr(str_shuffle(str_repeat(\"0123456789\", 15)), 0, $quan);\n \treturn $s;\n }", "function generate_id() {\r\n\t\t\t\t$rand = mt_rand(10000000,99999999);\r\n\t\t\t\t\r\n\t\t\t\t$member_id = \"1212\".strval($rand);\r\n\t\t\t\t\r\n\t\t\t\treturn $member_id;\r\n\t\t\t}", "private function makeId()\n {\n $random = mt_rand();\n $random = md5($random);\n $random = substr($random, 0, 12);\n $name = $this->config['name'];\n $length = strlen($name);\n if ($length > 22) {\n $name = substr($name, 0, 22);\n }\n return $name . '-' . $random;\n }", "private function generateKey(){\n return uniqid(rand(), true);\n }", "protected function generateRandomId(){\n return Keygen::numeric(7)->prefix(mt_rand(1, 9))->generate(true);\n }", "public function create_guid() { \n $guid = '';\n $namespace = rand(11111, 99999);\n $uid = uniqid('', true);\n $data = $namespace;\n $data .= $_SERVER['REQUEST_TIME'];\n $data .= $_SERVER['HTTP_USER_AGENT'];\n $data .= $_SERVER['REMOTE_ADDR'];\n $data .= $_SERVER['REMOTE_PORT'];\n $hash = strtoupper(hash('ripemd128', $uid . $guid . md5($data)));\n $guid = substr($hash, 0, 8) . '-' .\n substr($hash, 8, 4) . '-' .\n substr($hash, 12, 4) . '-' .\n substr($hash, 16, 4) . '-' .\n substr($hash, 20, 12);\n return $guid;\n }", "private function _generateUniqueId()\n {\n $rand = uniqid(rand(10, 99));\n $time = microtime(true);\n $micro = sprintf('%06d', ($time - floor($time)) * 1000000);\n $date = new DateTime(date('Y-m-d H:i:s.' . $micro, $time));\n return sha1($date->format('YmdHisu'));\n }", "public static function getUniqId()\n\t{\n\t\t// NOTE: Casting to int will overflow on 32-bit PHP (for Windows) without giving 19-digit value\n\t\treturn sprintf('%.0f%03d', 10000000*microtime(true), mt_rand(1, 999));\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
own function to get standard path from a JsonPointer object
public function getNormalizedPathFromPointer(JsonPointer $pointer = null) { $result = array_map( function ($path) { return sprintf(is_numeric($path) ? '[%d]' : '.%s', $path); }, $pointer->getPropertyPaths() ); return trim(implode('', $result), '.'); }
[ "public function getPathProperty($object);", "public function path($pointer = false) {\n\t\tif(is_numeric($pointer) && $pointer > 0)\n\t\t\treturn $this->trace((int) $pointer);\n\t\treturn '/'.implode('/', $this->segments);\n\t}", "function getpath($path) {\n $findnode = array_shift($path); //pop the first value off the path, we will pass the rest of the path into the delegated object when we find it\n if (isset($findnode)) {\n //each path is a reference into one of our arrays\n if (array_key_exists($findnode, $this->root)) {\n return $this->root[$findnode]->getpath($path);\n } elseif (array_key_exists($findnode, $this->fields)) {\n return $this->fields[$findnode];\n } elseif (array_key_exists($findnode, $this->values)) {\n return $this->values[$findnode]->getpath($path);\n } elseif (array_key_exists($findnode, $this->statements)) {\n return $this->statements[$findnode]->getpath($path);\n }\n //we don't go looking down 'next', that isn't path referenceable for the purpose of getting a text value\n } else {\n //we reached the end of the path, return what we have.\n return \"$this\";\n }\n }", "public function evaluate($jsonDocument)\n {\n $currentReference = $jsonDocument;\n $currentPath = '';\n\n foreach ($this->getPath() as $part) {\n if (is_array($currentReference)) {\n// if (!preg_match('~^([1-9]*[0-9]|-)$~', $part)) {\n// throw new NonexistentJsonPointerReferenceException(\n// \"Failed to evaluate pointer '$this->_pointer'. Invalid pointer path '$part' for Array at path '$currentPath'.\"\n// );\n// }\n if ($part === '-' || !array_key_exists($part, $currentReference)) {\n throw new NonexistentJsonPointerReferenceException(\n \"Failed to evaluate pointer '$this->_pointer'. Array has no member $part at path '$currentPath'.\"\n );\n }\n $currentReference = $currentReference[$part];\n } elseif ($currentReference instanceof \\ArrayAccess) {\n if (!$currentReference->offsetExists($part)) {\n throw new NonexistentJsonPointerReferenceException(\n \"Failed to evaluate pointer '$this->_pointer'. Array has no member $part at path '$currentPath'.\"\n );\n }\n $currentReference = $currentReference[$part];\n } elseif (is_object($currentReference)) {\n if (!isset($currentReference->$part) && !property_exists($currentReference, $part)) {\n throw new NonexistentJsonPointerReferenceException(\n \"Failed to evaluate pointer '$this->_pointer'. Object has no member $part at path '$currentPath'.\"\n );\n }\n $currentReference = $currentReference->$part;\n } else {\n throw new NonexistentJsonPointerReferenceException(\n \"Failed to evaluate pointer '$this->_pointer'. Value at path '$currentPath' is neither an array nor an object.\"\n );\n }\n\n $currentPath = \"$currentPath/$part\";\n }\n\n return $currentReference;\n }", "public function _getObjectPath(){\n if(null === $this->_path || !$this->_path instanceof Path){\n $this->_path = New Path();\n }\n return $this->_path;\n }", "public function getPointerForPath($path);", "public function getRequestedResponsePath()\n {\n $path= null;\n $data = json_decode($this->grabResponse(), false, 512, defined(\"JSON_THROW_ON_ERROR\") ? JSON_THROW_ON_ERROR:0);\n if (is_array($data)) {\n foreach ($data as $index => $rpc) {\n if (isset($rpc->id) and $rpc->id == $this->getCurrentJsonRpcId()) {\n $path = '$.' . $index . '.';\n }\n }\n } else if (is_object($data) && $data->id == $this->getCurrentJsonRpcId()) {\n $path = \"$.\";\n }\n if ($path===null) {\n throw new RuntimeException(\"JSONRPC response is not valid or does not contain an object with the request id.\");\n }\n return $path;\n }", "function get_leaf($data, $path) {\n $path = substr($path, strlen(JSON2MySQL::SEPARATOR));\n $leafs = explode(JSON2MySQL::SEPARATOR, $path);\n $i = 0;\n $result[$i] = $data;\n foreach($leafs as $p) {\n $i++;\n $result[$i] = $result[$i-1][$p];\n }\n return $result[$i];\n }", "function path($gp) { \n\n // object= directory action=show path=\n \n if ($gp['object'] !== \"path\") {\n add_error_message(\"DAFE0001: path: internal error - bad object - \" . $gp['object']);\n $gp['action'] = 'show'; $gp['ID'] = NULL; $gp['object'] = \"path\";\n}\n \n if ($gp['action'] === \"show\") {\n \n show_path($gp['path'], isset($gp['offset']) ? $gp['offset'] : 0 );\n \n } else {\n \n report_bad_parms(\"path\");\n \n }\n \n}", "private function getTestPath(stdClass $item): string\n {\n $path_str = '';\n\n $path = $this->tree->getNodePath((int)$item->ref_id);\n while ($node = current($path)) {\n $prepend = empty($path_str) ? '' : \"{$path_str} > \";\n $path_str = $prepend . $node['title'];\n next($path);\n }\n\n return $path_str;\n }", "private function getTestPath( stdClass $item )\n\t{\n\t\t/**\n\t\t * @var $tree ilTree\n\t\t */\n\t\tglobal $tree;\n\t\t\n\t\t$path_str = '';\n\n\t\t$path = $tree->getNodePath($item->ref_id);\n\t\twhile ($node = current($path))\n\t\t{\n\t\t\t$prepend = empty($path_str) ? '' : \"{$path_str} > \";\n\t\t\t$path_str = $prepend . $node['title'];\n\t\t\tnext($path);\n\t\t}\n\n\t\treturn $path_str;\n\t}", "function get_path($data, $path)\r\n {\r\n $path = explode('/', $path);\r\n\r\n while (null !== ($part = array_shift($path))) {\r\n if (!is_array($data) || !isset($data[$part])) {\r\n return null;\r\n }\r\n $data = $data[$part];\r\n }\r\n\r\n return $data;\r\n }", "function path($key=NULl,$self=FALSE,$root=TRUE){\n if(is_null($key)) \n $key = $this->pi;\n else if(!isset($this->str[$key])) \n return array();\n $res = $self?array($key):array();\n while(!is_null($this->str[$key]['u']))\n array_unshift($res,$key = $this->str[$key]['u']);\n if(!$root) array_shift($res);\n return $res;\n }", "protected function resolveJSONPointer(Reference $reference, $schema)\n {\n $pointer = $reference->getFragment();\n\n if (empty($pointer)) {\n return $schema;\n }\n\n // Separate pointer into tokens\n $tokens = explode('/', $pointer);\n //\n array_shift($tokens);\n // Unescape token\n $tokens = array_map(function ($token) {\n $token = str_replace('~0', '/', $token);\n $token = str_replace('~1', '~', $token);\n\n return $token;\n }, $tokens);\n\n $propertyPath = implode(\".\", $tokens);\n $propertyAccessor = PropertyAccess::createPropertyAccessor();\n\n return $propertyAccessor->getValue($schema, $propertyPath);\n }", "abstract function getPathParser();", "function getPath() {\n\t\t$this->_checkArgs(2, 'getPath');\n\t\t$this->checkNodeType();\n\t\textract($this->__dataVars());\n\t\t$identifier = $this->parseIdentifier($this->args[1]);\n\n\t\t$id = $this->_getNodeId($class, $identifier);\n\t\t$nodes = $this->Acl->{$class}->getPath($id);\n\n\t\tif (empty($nodes)) {\n\t\t\t$this->error(\n\t\t\t\tsprintf(__(\"Supplied Node '%s' not found\", true), $this->args[1]),\n\t\t\t\t__(\"No tree returned.\", true)\n\t\t\t);\n\t\t}\n\t\t$this->out(__('Path:', true));\n\t\t$this->hr();\n\t\tfor ($i = 0; $i < count($nodes); $i++) {\n\t\t\t$this->_outputNode($class, $nodes[$i], $i);\n\t\t}\n\t}", "public function pathToString() {\n\t\t\treturn $this->key . ($this->next ? '.' . $this->next->pathToString() : '');\n\t\t}", "public function get_path() {\n\t\treturn $this->path;\n\t}", "public function get_location_path($p_obj)\n {\n $l_return = [];\n $l_parentid = $p_obj;\n\n while (($l_parentid = $this->get_parent_id_by_object($l_parentid)) !== false)\n {\n if (in_array($l_parentid, $l_return))\n {\n throw new RuntimeException(_L('LC__CATG__LOCATION__RECURSION_IN_OBJECT') . ' #' . $l_parentid . ' \"' . $this->get_obj_name_by_id_as_string($l_parentid) . '\"');\n } // if\n\n if ($l_parentid != C__OBJ__ROOT_LOCATION)\n {\n $l_return[] = $l_parentid;\n } // if\n } // while\n\n return $l_return;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns filtered corporate customers notes list
public function customersCorporateNotesList(Request\CustomersNotesRequest $request): ?CustomersNotesResponse { $response = $this->client->customersCorporateNotesList( Serializer::serializeArray($request->filter), $request->page, $request->limit ); return Deserializer::deserializeArray($response->getResponseBody(), CustomersNotesResponse::class); }
[ "function get_customer_notes() {\n\t\tglobal $woocommerce, $post;\n\t\t$notes = array();\n\n\t\t$args = array(\n\t\t\t#'post_id' \t=> 0,\n\t\t\t'approve' \t=> 'approve',\n\t\t\t'type' \t\t=> 'customer_note',\n\t\t\t'meta_key' => 'customer_id',\n\t\t\t'meta_value' => $this->user_id,\n\t\t);\n\t\tremove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );\n\t\tif( defined( 'WC_VERSION') && floatval(WC_VERSION) >= 2.2 ){\n\t\t\tremove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_webhook_comments' ), 10, 1 );\n\t\t}\n\n\t\t$comments = get_comments($args);\n\n\t\tadd_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );\n\t\tif( defined( 'WC_VERSION') && floatval(WC_VERSION) >= 2.2 ){\n\t\t\tadd_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_webhook_comments' ), 10, 1 );\n\t\t}\n\n\t\t#print_r($comments);\n\n\t\tforeach ( $comments as $comment ) {\n\t\t\t\t$comment->comment_content = make_clickable( $comment->comment_content );\n\t\t\t\t$notes[] = $comment;\n\t\t}\n\n\t\treturn (array) $notes;\n\n\t}", "public function notes()\n {\n $this->CI->db->where('rel_type', 'customer');\n $this->CI->db->where('rel_id', $this->customerId);\n\n return $this->CI->db->count_all_results('notes');\n }", "public function getMyNotes() {\n $notes = Auth::user()->note;\n $myNotes = array();\n foreach ($notes as $note) {\n if($note->owner == Auth::user()->email) {\n $myNotes[] = $note;\n }\n }\n return $myNotes;\n }", "public function get_delivery_notes()\n\t{\n\t\t$filter = array(\n\t\t\t\"class_id\" => CL_SHOP_DELIVERY_NOTE,\n\t\t\t\"customer\" => $this->id(),\n\t\t);\n\t\t$ol = new object_list($filter);\n\t\treturn $ol;\n\t}", "public function getCustomerCareNoteDetails($care_id){\n $notes = $this->customerCareNote::where('customer_care_id',$care_id)->get();\n return $notes;\n }", "function get_admin_notes($cID) {\r\n global $db;\r\n $admin_notes = array();\r\n\r\n $notes_query = $db->Execute(\"select * from \" . TABLE_CUSTOMERS_ADMIN_NOTES . \" where customers_id = '\" . $cID . \"'\");\r\n if ($notes_query->RecordCount() > 0) {\r\n while (!$notes_query->EOF) {\r\n //gather info about the admin author\r\n $admin_data = $db->Execute(\"select admin_name, admin_email from \" . TABLE_ADMIN . \" where admin_id = '\" . $notes_query->fields['admin_id'] . \"'\");\r\n\r\n $admin_notes[] = array('date' => $notes_query->fields['date_added'],\r\n 'name' => $admin_data->fields['admin_name'],\r\n 'email' => $admin_data->fields['admin_email'],\r\n 'notes' => $notes_query->fields['notes'],\r\n 'karma' => $notes_query->fields['karma']);\r\n $notes_query->MoveNext();\r\n }\r\n return $admin_notes;\r\n }\r\n else {\r\n return false;\r\n }\r\n}", "public function getCustomerNotes()\n {\n if (array_key_exists(\"customerNotes\", $this->_propDict)) {\n return $this->_propDict[\"customerNotes\"];\n } else {\n return null;\n }\n }", "public function getNotes();", "public function notes()\n {\n return $this->hasMany(CustomerNote::class)->orderBy('created_at', 'desc');\n }", "function GetAllNotesForContact()\r\n{\r\n\t$userInfo = CheckUser();\t\r\n\r\n\tif($userInfo == null)\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\r\n\t$contactId = get_param('contact_id');\r\n\r\n\t$notes = ModelGetAllNotesForContact($userInfo['id'], $contactId);\r\n\r\n\techo json_encode($notes);\r\n}", "function recipientCustomerList() {\n $varOrderBy = $_POST['sort_by'] ? \"{$_POST['sort_by']} ASC\" : \"CustomerFirstName ASC\";\n $arrClms = array('pkCustomerID', 'CustomerFirstName', 'CustomerEmail', 'CustomerLastName', 'CustomerDateAdded');\n $varTable = TABLE_CUSTOMER;\n $arrRes = $this->select($varTable, $arrClms, $varID, $varOrderBy);\n return $arrRes;\n }", "public function getNotes(): array {\n return array_filter($this->collection, function ($item) {\n return $item instanceof Note;\n });\n }", "public function get_user_notes(){\n $user_id = (int) $_COOKIE['user_id'];\n $sql = 'SELECT * from '. static::$table_name .' AS N JOIN notes_subject AS S';\n $sql .=' ON N.user_id =' .\"'\". self::$database->escape_string($user_id) .\"'\";\n $sql .= ' AND N.user_id = S.user_id AND N.note_id = S.note_id JOIN notes_tag AS T ON N.user_id = T.user_id AND N.note_id = T.note_id';\n\n return static::find_by_sql($sql);\n }", "public function get_notes()\n {\n $obj = new View();\n if (! $this->authorized()) {\n $obj->view('json', array('msg' => 'Not authorized'));\n return;\n }\n \n $queryobj = new Icloud_model();\n $sql = \"SELECT COUNT(1) as total,\n COUNT(CASE WHEN `notes_enabled` = 1 THEN 1 END) AS 'yes',\n COUNT(CASE WHEN `notes_enabled` = 0 THEN 1 END) AS 'no'\n from icloud\n LEFT JOIN reportdata USING (serial_number)\n WHERE\n \".get_machine_group_filter('');\n $obj->view('json', array('msg' => current($queryobj->query($sql))));\n }", "protected function getAllCustomers()\n {\n return Mage::getModel('customer/customer')\n ->getCollection()\n ->addAttributeToSelect('*');\n }", "public function getCustomerNoteCategories(): array\n {\n $json = $this->_guzzle\n ->request('GET', 'crunchi/api/Admin/CustomerNoteCategory')\n ->getBody()\n ->getContents();\n\n $categories = [];\n foreach (\\json_decode($json) as $category) {\n $categories[] = new CustomerNoteCategory(\n $category->ID,\n $category->Description,\n $category->SortOrder,\n $category->IsActive,\n $category->IsCancelAutoship,\n $category->ShowOnExtranet\n );\n }\n\n return $categories;\n }", "function Get_All_Regular_Notes()\n {\n if (isset($this->regular_notes))\n return $this->regular_notes;\n\n\n $this->regular_notes = Array();\n for ($notenum_loop = 1; $notenum_loop <= $this->Get_Total_Notes_Count(); $notenum_loop++) {\n if ($this->Get_Note_Header_By_ID_Num($notenum_loop)['Deleted'] != \"D\") {\n array_push($this->regular_notes, $this->Get_Note_With_Header_Data_By_ID_Num($notenum_loop));\n }\n }\n\n return $this->regular_notes;\n }", "public function getAllCreditNotes()\n {\n $query = $this->select()\n ->order('idCreditNote ASC');\n try {\n $creditNoteRowset = $this->fetchAll($query);\n\n return $creditNoteRowset;\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function customer_notes(){\n return $this->hasMany('App\\Modules\\CableManagement\\Models\\CustomerNotes', 'users_id');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Set image as post thumbnail from URL
public static function setPostThumbnailFromUrl($image_url,$post_id) { // Check if post exists if(!self::postWithIdExists($post_id)){ throw new \Exception(sprintf("Post with ID '%s' is not exists.",$post_id)); } else{ try{ // Upload image to website $attachment_id = Utils::uploadImage($image_url)['attachment_id']; // Set attachment as post's thumbnail $done = set_post_thumbnail($post_id,$attachment_id); if(!$done){ throw new \ErrorException(); } } catch(\Exception $e){ // Error handling during upload throw new \Exception(sprintf("Error has occurred during upload image: '%s'",$e->getMessage())); } catch(\ErrorException $ee){ // Error handling during set_post_thumbnail function throw new \Exception("Unknown error has occurred during set_post_thumbnail function, try again."); } } }
[ "function set_post_thumbnail($post, $thumbnail_id)\n {\n }", "public function add_thumbnail( $post ) {\n\t\tif ( isset( $this->properties['post_thumbnail'] ) ) {\n\t\t\t$attributes = array(\n\t\t\t\t'tmp_name' => download_url( $this->properties['post_thumbnail']['url'] ),\n\t\t\t\t'name' => $this->properties['post_thumbnail']['name'] . '.jpg',\n\t\t\t\t'type' => 'image/jpg',\n\t\t\t);\n\n\t\t\tif ( ! is_wp_error( $attributes['tmp_name'] ) ) {\n\t\t\t\t$media = media_handle_sideload( $attributes, $post );\n\n\t\t\t\tif ( ! is_wp_error( $media ) ) {\n\t\t\t\t\tset_post_thumbnail( $post, $media );\n\t\t\t\t} else {\n\t\t\t\t\tunlink( $attributes['url'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function buildThumbnail();", "public function setThumbnail() {\n if (is_null($this->media->images)) {\n $this->media->images = array();\n }\n\n // add thumbnail item to image media array\n if (isset($this->raw_item->thumbnail)) {\n // create article image array\n $image = array();\n $image['src'] = $this->raw_item->thumbnail->url;\n $image['width'] = ((isset($this->raw_item->thumbnail->width)) ? $this->raw_item->thumbnail->width : 0);\n $image['height'] = ((isset($this->raw_item->thumbnail->height)) ? $this->raw_item->thumbnail->height : 0);\n $image['alt'] = \"\";\n $image['title'] = \"\";\n $this->media->images[] = $image;\n }\n }", "function wp_ajax_set_post_thumbnail()\n{\n}", "function setFeaturedImage($post_id, $url)\n{\n $image_name = 'wp-nasa-image.jpg';\n $upload_dir = wp_upload_dir(); // Set upload folder\n $image_data = file_get_contents($url); // Get image data\n $unique_file_name = wp_unique_filename($upload_dir['path'], $image_name); // Generate unique name\n $filename = basename($unique_file_name); // Create image file name\n\n // Check folder permission and define file location\n if (wp_mkdir_p($upload_dir['path'])) {\n $file = $upload_dir['path'] . '/' . $filename;\n } else {\n $file = $upload_dir['basedir'] . '/' . $filename;\n }\n\n // Create the image file on the server\n file_put_contents($file, $image_data);\n\n // Check image file type\n $wp_filetype = wp_check_filetype($filename, null);\n\n // Set attachment data\n $attachment = array(\n 'post_mime_type' => $wp_filetype['type'],\n 'post_title' => sanitize_file_name($filename),\n 'post_status' => 'inherit'\n );\n\n // Create the attachment\n $attach_id = wp_insert_attachment($attachment, $file, $post_id);\n\n // Include image.php\n require_once(ABSPATH . 'wp-admin/includes/image.php');\n\n // Define attachment metadata\n $attach_data = wp_generate_attachment_metadata($attach_id, $file);\n\n // Assign metadata to attachment\n wp_update_attachment_metadata($attach_id, $attach_data);\n\n // And finally assign featured image to post\n set_post_thumbnail($post_id, $attach_id);\n}", "public function getThumbnailUrl();", "function setThumbnail($url)\n\t{\n\t\tif ($this->summary_is_set) {\n\t\t\treturn;\n\t\t}\n\t\t$summary = $this->addElement('summary');\n\t\t$summary->setAttribute('type','xhtml');\n\t\t$div = $summary->appendChild($this->dom->createElement('div'));\n\t\t$div->setAttribute('xmlns',Dase_Atom::$ns['h']);\n\t\t$thumbnail = $div->appendChild($this->dom->createElement('img'));\n\t\t$thumbnail->setAttribute('src',$url);\n\t\t$this->summary_is_set = true;\n\t}", "function wp_ajax_set_attachment_thumbnail()\n {\n }", "function wp_ajax_set_attachment_thumbnail()\n{\n}", "public function withThumbnail($imagePath);", "public function withThumbnail(): self\n {\n return $this->afterCreating(function ($post) {\n // TODO: Use a media present in the storage for better performance.\n $post->addMediaFromUrl($this->getThumbnailUrl())->toMediaCollection('thumbnail');\n });\n }", "function sp_get_thumb_url($post_ID){\r\n return wp_get_attachment_url( get_post_thumbnail_id( $post_ID ) );\r\n}", "function set_post_thumbnail( $post, $thumbnail_id ) {\n\t$post = get_post( $post );\n\t$thumbnail_id = absint( $thumbnail_id );\n\t$attachment = false;\n\n\t// Get the attachment from the main blog.\n\tif ( $thumbnail_id ) {\n\t\tswitch_to_main_blog();\n\t\t$attachment = get_post( $thumbnail_id );\n\t\trestore_current_blog();\n\t}\n\n\tif ( $post && $thumbnail_id && $attachment ) {\n\t\tif ( wp_get_attachment_image( $thumbnail_id, 'thumbnail' ) ) {\n\t\t\treturn update_post_meta( $post->ID, '_thumbnail_id', $thumbnail_id );\n\t\t} else {\n\t\t\treturn delete_post_meta( $post->ID, '_thumbnail_id' );\n\t\t}\n\t}\n\n\treturn false;\n}", "function kleo_get_post_thumbnail_url( $post_id = null ) {\n $image_url = '';\n\n $thumb = get_post_thumbnail_id( $post_id );\n //all good. we have a featured image\n $featured_image_url = wp_get_attachment_url( $thumb );\n if ( $featured_image_url ) {\n $image_url = $featured_image_url;\n } elseif ( sq_option( 'blog_get_image', 1 ) == 1 ) {\n global $post;\n if (! is_object($post) && $post_id != NULL ) {\n $post = setup_postdata( get_post($post_id) );\n }\n ob_start();\n ob_end_clean();\n if (isset($post->post_content)) {\n $output = preg_match_all('|<img.*?src=[\\'\"](.*?)[\\'\"].*?>|i', $post->post_content, $matches);\n $image_url = isset($matches[1][0]) ? $matches[1][0] : null;\n }\n }\n\n //Defines a default image\n if ( empty( $image_url ) ) {\n $image_url = sq_option_url('blog_default_image', '');\n }\n\n return $image_url;\n}", "public static function permalink_thumbnail($post_id = NULL, $size = \"large\"){\n $thumbnail_src = '';\n // Get Featured Image\n if (function_exists('has_post_thumbnail') && has_post_thumbnail($post_id)) {\n $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), $size);\n $thumbnail_src = esc_attr($thumbnail[0]);\n }\n // Get first image included in the post\n if ($thumbnail_src == NULL) {\n $thumbnail_src = ShareaholicUtilities::post_first_image();\n }\n if ($thumbnail_src == NULL){\n return NULL;\n } else {\n return $thumbnail_src;\n }\n }", "public function getThumbnail();", "function pluton_blog_entry_thumbnail( $args = '' ) {\n\techo pluton_get_blog_entry_thumbnail( $args );\n}", "function spacemonkey_post_thumbnail() {\n\t\tif ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( is_singular() ) :\n\t\t\t?>\n\n\t\t\t<div class=\"post-thumbnail\">\n\t\t\t\t<?php the_post_thumbnail(); ?>\n\t\t\t</div><!-- .post-thumbnail -->\n\n\t\t<?php else : ?>\n\n\t\t<a class=\"post-thumbnail\" href=\"<?php the_permalink(); ?>\" aria-hidden=\"true\">\n\t\t\t<?php\n\t\t\tthe_post_thumbnail( 'post-thumbnail', array(\n\t\t\t\t'alt' => the_title_attribute( array(\n\t\t\t\t\t'echo' => false,\n\t\t\t\t) ),\n\t\t\t) );\n\t\t\t?>\n\t\t</a>\n\n\t\t<?php\n\t\tendif; // End is_singular().\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Listen to the Client retrieved event and add the hashed client_id parameter and decrypt the secret.
public function retrieved(Client $oauth_client) { $oauth_client->setAttribute('client_id', $this->encode($oauth_client->getAttribute('id'))); $oauth_client->setAttribute('secret', decrypt($oauth_client->getAttribute('secret'))); }
[ "private static function getClientSecret()\n {\n return DB::table('oauth_clients')\n ->where('id',self::CLIENT_ID)->first()->secret;\n }", "public function client_credentials()\n {\n $this->server->addGrantType(new OAuth2\\GrantType\\ClientCredentials($this->storage, array(\n \"allow_credentials_in_request_body\" => true,\n )));\n $this->server->handleTokenRequest($this->request)->send();\n }", "public function client_credentials(){\n\t\t$this->server->addGrantType(new OAuth2\\GrantType\\ClientCredentials($this->storage, array(\n \t\t\"allow_credentials_in_request_body\" => true\n\t\t)));\n\t\t$this->server->handleTokenRequest($this->request)->send();\n\t}", "public function getClientSecret(){\n\t\t\treturn $this->client_secret;\n\t\t}", "public function onConnect($client) {\n\t\t$id = $client->getId();\n\t\t$this->clients[$id] = $client;\n\t}", "public function getClientSecret() {\n\t\treturn $this->client_secret;\n\t}", "public function afterDecrypt($handler){ }", "public function getClientSecretKey()\n {\n return 'client_secret';\n }", "public function afterEncrypt($handler){ }", "function libcal_v1_1_client_secret_cb( $args ) {\n\t$options = get_option( 'libcal-api-v1_1-settings' );\n\t?>\n\t<input id='libcal_field-client_secret' name='libcal-api-v1_1-settings[client_secret]' size='60' type='text' value='<?php echo $options['client_secret']; ?>' />\n\t<?php\n}", "public function getClientSecret() {\n\t\treturn $this->client->getClientSecret();\n\t}", "public function getWebhookSecret();", "private function handleClientId ( )\n\t{\n\t\t$this->cid = '';\n\n\t\tif ( array_key_exists( static::COOKIE_CLIENTID, $_COOKIE ) )\n\t\t\t$this->cid = (string)$_COOKIE[static::COOKIE_CLIENTID];\n\n\t\t/**\n\t\t * There is no cookie for client id or one we got from client side is\n\t\t * malformed. It means it is either expired or solution was never used\n\t\t * from this browser instance.\n\t\t */\n\t\tif ( ( $this->cid == '' ) || ( strlen( $this->cid ) > 32 ) )\n\t\t\t$this->cid = substr( _fw_rand_hash( ), 0, 32 );\n\t\t\n\t\t_fw_set_cookie( self::COOKIE_CLIENTID, $this->cid, time( ) + static::COOKIE_EXPIRATION * 24 * 60 * 60 );\n\t}", "public function secretReqHandler( $secret_key ) {\r\n \r\n global $wpdb;\r\n \r\n $table_name = $wpdb->prefix . 'coins_alerts';\r\n \r\n $query_result = $wpdb->query(\r\n $wpdb->prepare( \"SELECT id FROM $table_name WHERE secret_key = %s\", $secret_key )\r\n );\r\n \r\n if ( ! $query_result ) {\r\n \r\n wp_redirect( home_url() );\r\n die();\r\n \r\n }\r\n \r\n if ( ! isset( $_COOKIE['ca_secret_key'] ) ) {\r\n setcookie( 'ca_secret_key', $secret_key, time() + YEAR_IN_SECONDS, '/' );\r\n }\r\n \r\n $this->showMyAlertsPage( 0, $secret_key );\r\n \r\n }", "public function client_id_callback() {\n\t\t$this\n\t\t\t->render_text_field( 'client_id' )\n\t\t\t->render_description(\n\t\t\t\t__( 'The client ID of the Azure AD application representing this blog.', 'aad-sso-wordpress' )\n\t\t\t)\n\t\t\t->render_constant_message( 'client_id' );\n\t}", "public function getClientKey()\n {\n return $this->getParameter('clientKey');\n }", "public function getClientKey()\n {\n return $this->client_key;\n }", "public function getClientIdKey()\n {\n return 'client_key';\n }", "public function getClientById($client_id);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns element from 'configuration_bit' list at given offset
public function getConfigurationBitAt($offset) { return $this->get(self::CONFIGURATION_BIT, $offset); }
[ "public function offsetGet($offset) {\n $hash = md5($offset);\n if (isset($this->items[$hash])) {\n return $this->items[$hash];\n }\n\n $indexElement = $this->findInIndex($offset);\n\n if (!empty($indexElement)) {\n return $indexElement;\n }\n\n return $this->findElement($offset);\n }", "public function offsetGet($offset);", "public function findOneByOffset($offset)\n {\n $extensions = $this->findAll();\n $extensions = array_values($extensions);\n $offset = (int)$offset;\n if (!empty($extensions[$offset])) {\n return $extensions[$offset];\n }\n return null;\n }", "public function getbit($key, $offset) {\n return $this->string->getbit($key, $offset);\n }", "static function bit_get($value, $bit_position) {\n return Utils::bit_test($value, $bit_position) ? 1 : 0;\n }", "public function getbit(string $key, int $offset): int\r\n\t{\r\n\t\treturn $this->connection->getBit($key, $offset);\r\n\t}", "public function itemAt($offset) {\n $slice = array_slice($this->items, $offset, 1);\n return $slice[0];\n }", "public function offsetGet($offset) {\n\t\treturn $this->values[$offset];\n\t}", "public function offsetGet($offset){\r\n return $this->collection[$offset];\r\n }", "public function getFlagAt($offset) {\n return $this->get(self::FLAG, $offset);\n }", "function zen_get_configuration_key_value($lookup) {\r\n global $db;\r\n $configuration_query= $db->Execute(\"select configuration_value from \" . TABLE_CONFIGURATION . \" where configuration_key='\" . $lookup . \"'\");\r\n $lookup_value= $configuration_query->fields['configuration_value'];\r\n if ( $configuration_query->RecordCount() == 0 ) {\r\n $lookup_value='<span class=\"lookupAttention\">' . $lookup . '</span>';\r\n }\r\n return $lookup_value;\r\n}", "public function readBit ()\n\t{\n\t\tif ($this->isEOF ())\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$bit = $this->dataArray[$this->cursor];\n\t\t\t$this->cursor++;\n\t\t\treturn $bit;\n\t\t}\n\t}", "public function offsetGet($offset)\n {\n return $this->boardingCards[$offset];\n }", "public function getFieldConfiguration($index) {\n\t\treturn $this->fields[$index];\n\t}", "public function getBuildAt($offset)\n {\n return $this->get(self::BUILD, $offset);\n }", "function getConfigValueElement($name, $index)\r\n {\r\n $cfg_item = $this->getConfigItem($name);\r\n if ($cfg_item && is_array($cfg_item->value) && !empty($cfg_item->value[$index]))\r\n return $cfg_item->value[$index];\r\n else\r\n return NULL;\r\n }", "public function getBlackListAt($offset)\n {\n return $this->get(self::_BLACK_LIST, $offset);\n }", "public function appendConfigurationBit(\\ConfigurationBit $value)\n {\n return $this->append(self::CONFIGURATION_BIT, $value);\n }", "public function offsetGet($offset)\n {\n return $this->_values[$offset];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
list total rank all
public function listTotalRankAll($rankStart = 1, $fetchSize = 10) { $start = $rankStart > 0 ? ($rankStart - 1) : 0; $sql = "SELECT u.uid,(u.cash + u.total_slave_price + u.total_gift_price) as rank_total FROM slave_user AS u ORDER BY rank_total DESC LIMIT $start, $fetchSize"; return $this->_rdb->fetchAll($sql); }
[ "public static function get_all_ranks()\n {\n }", "public function getRankCollection()\n {\n return Mage::getSingleton('core/session')->getToosoRankCollection();\n }", "public function getRanks()\n {\n $request = \"SELECT * FROM rank\";\n $request = $this->connexion->query($request);\n $ranks = $request->fetchAll(PDO::FETCH_ASSOC);\n return $ranks;\n }", "public function get_list_ranks() {\n\t\techo json_encode($this -> employee_model -> get_list_ranks());\n\t}", "public function getQueryRanklist()\n {\n return $this->get(self::_QUERY_RANKLIST);\n }", "public function getRanking(): array\n {\n return $this->ranking;\n }", "public function findRanking() {\r\n\r\n $betScoreRepository = $this->app['em']->getRepository('App\\Model\\Entity\\Betscore');\r\n\r\n $userRepository =$this->app['em']->getRepository('App\\Model\\Entity\\Players');\r\n $currentUser = $userRepository->getUserByUsername($this->app['security']->getToken()->getUser()->getUsername());\r\n\r\n $betScorePlayers = $betScoreRepository->findScores($this->lid);\r\n\r\n $rank = 1;\r\n $totalUsers = count($userRepository->getUserByLeague($this->lid));\r\n foreach($betScorePlayers as $k => $v) {\r\n $player = $v[0]->getIdplayers();\r\n if ($player == $currentUser) {\r\n return $rank .'e/' . $totalUsers;\r\n }\r\n $rank++;\r\n }\r\n return $totalUsers.'/' .$totalUsers;\r\n }", "public function listRanks()\n {\n $ranks = array(\n '' => \"No Rank\",\n -1 => \"Speeding Ticket\",\n 1 => \"1\",\n 2 => \"2\",\n 3 => \"3\",\n 4 => \"4\",\n 5 => \"5\",\n 6 => \"6\",\n 7 => \"7\",\n 8 => \"8\",\n 98 => \"No Show\",\n 99 => \"DQ\",\n );\n return $ranks;\n }", "public function getRanking()\n {\n }", "public function getRankListCount()\n {\n return $this->count(self::_RANK_LIST);\n }", "public function getRankingList() {\n\t\treturn $this->rankingList;\n\t}", "public function getTotalRanked()\n {\n if ($this->total_ranks == -1 && !$this->expStorage->isRelay) {\n $q = 'SELECT Count(*) as nbRanked\n FROM exp_ranks\n WHERE rank_challengeuid IN (' . $this->getUidSqlString() . ')'\n . ' GROUP BY rank_playerlogin'\n . ' HAVING COUNT(*) > 5';\n\n $data = $this->db->execute($q);\n\n if ($data->recordCount() == 0) {\n $this->total_ranks = -1;\n } else {\n $vals = $data->fetchStdObject();\n $this->total_ranks = $data->recordCount();\n }\n }\n\n return $this->total_ranks;\n }", "public function getRank();", "private function getRankedUsers(){\n $scoreRepo = $this->getDoctrine()->getManager()->getRepository('AppBundle:Score');\n $userManager = $this->get('fos_user.user_manager');\n $users = $userManager->findUsers();\n\n $ranks = array();\n\n // For each user\n foreach ($users as $user) {\n // get scores\n $totalPoints = 0;\n $scores = $scoreRepo->findBy(array('user' => $user));\n foreach ($scores as $score) {\n //die(var_dump($score));\n // make total\n $totalPoints += $score->getNbPoints();\n\n }\n // store in array (user, totalScore)\n $rank = array(\n 'user' => $user,\n 'nbPoints' => $totalPoints,\n );\n $ranks[] = $rank;\n }\n\n // Sort from lowest to highest\n usort($ranks, function($a, $b){\n return $a['nbPoints'] <= $b['nbPoints'];\n });\n return $ranks;\n }", "public function display_rank() {\n\t\treturn $this->Rank->display();\n\t}", "public function getTotalScoreRank()\n {\n return $this->get('totalScoreRank', 0);\n }", "public function rank_by_cards(){\n\t\tarsort($this->cardArray);\n\t\t$it = 1;\n\t\tforeach($this->cardArray as $x => $x_value) {\n\t\t echo \"Team=\" . $x . \", Rank=\" . $it . \", Score=\" . $x_value;\n\t\t echo \"<br>\";\n\t\t $it++;\n\t\t}\n\t}", "public function getRankingByCompany();", "public static function getRanks() {\n\t\treturn array_values( self::$rankMap );\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a query for an update operation The query will append at the end : WHERE $condition_key = '$condition_value' AND ... from the $conditions parameters
public static function GetUpdateQuery($table, $keys_and_values, $conditions) { $q = new QSqlQuery(); $q->update()->{$table}->set(); foreach ($keys_and_values as $key => $value) $q->{$key}->eq()->val($value); $q->where(); $pos = 0; foreach ($conditions as $key => $value) { if ($pos > 0) $q->and(); $q->{$key}->eq()->val($value); $pos++; } return $q; }
[ "public function Update($data,$conditions='',$addtional_conditions=''){\n $update_start=\"UPDATE $this->table_name SET \";\n $sql_end=';';\n\n if (is_array($conditions)){\n $condition='WHERE ';\n foreach ($conditions as $key => $value) {\n if ($value==NULL) {$value='NULL';} else {$value=\"'$value'\";}\n $condition.=\"($key = $value) AND \";\n }\n $condition=substr($condition, 0, strlen($condition)-4);\n $conditions=$condition;\n }\n \n if (is_array($data)){\n $pairs='';\n foreach ($data as $key => $value) {\n if ($value==NULL) {$value='NULL';} else {$value=\"'$value'\";}\n $pairs.= \"$key = $value,\";\n }\n $pairs=substr($pairs, 0, strlen($pairs)-1);\n $pairs.=' ';\n $data=$pairs;\n }\n $sql=$update_start.$data.$conditions.$addtional_conditions.$sql_end;\n $ret=$this->db_link->query($sql);\n return $ret;\n }", "public function constructUpdateQuery()\n {\n $tablesUsed = array();\n $updateString = $this->constructUpdateString($tablesUsed, true);\n $condString = $this->constructCondString($tablesUsed);\n\n return 'UPDATE ' . implode(', ', $tablesUsed) . ' SET ' . $updateString . ' WHERE ' . $condString;\n }", "protected function prepareUpdate() {\r\n\t\t$this->params = array ();\r\n\r\n\t\t$query = \"UPDATE \";\r\n\t\tforeach ( $this->from as $k => $v ) {\r\n\t\t\t$query .= ($k ? \", \" : \"\") . $v;\r\n\t\t}\r\n\t\t$query .= \" SET \";\r\n\r\n\t\tforeach ( $this->fields as $k => $v ) {\r\n\t\t\t$query .= ($k ? \", \" : \"\") . $v [0] . \"=\";\r\n\t\t\tif ($v [2]) {\r\n\t\t\t\t$query .= $v [1];\r\n\t\t\t} else {\r\n\t\t\t\t$query .= \"?\";\r\n\t\t\t\t$this->params [] = $v [1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->prepareWhere ( $query );\r\n\r\n\t\treturn $query;\r\n\t}", "function sqlUpdate($table, $fields_values, $conditions = \"\"){\nglobal $_shibahug__conn;\n$where_clause = _shibahug_formatWhere($conditions);\n$sql = \"UPDATE $table SET \".$fields_values.$where_clause;\nif ($_shibahug__conn->query($sql) !== TRUE) {\ndie(\"ShibaHug Error: sqlUpdate failed (\" . $_shibahug__conn->connect_error.\" | \" . $_shibahug__conn->error.\")\");\n}\n}", "public function updateWhere(array $conditions, array $data);", "abstract public static function updates($clause = \"\");", "function dataUpdate($relation, $fields, $conditions = array()) {\n if ( !is_array($fields) || empty($fields) || !is_array($conditions)) {\n return FALSE;\n }\n \n $db = connect();\n if (!$db) {\n return FALSE;\n }\n \n $params = array_values($fields);\n foreach ($fields as $key => $value) {\n $updates[] = $key . \"=?\";\n }\n $updates = implode(\",\", $updates);\n \n $query = \"UPDATE $relation SET $updates\";\n \n if ( !empty($conditions) ) {\n $p = parseConditions($conditions);\n if (!$p) {\n return FALSE;\n }\n \n $params = array_merge($params, $p[\"params\"]);\n $query .= \" WHERE \".implode(\" AND \", $p[\"fields\"]);\n }\n \n $stmt = $db->prepare($query);\n if (!$stmt) {\n disconnect($db);\n return FALSE;\n }\n \n $result = $stmt->execute($params); \n disconnect($db); \n return $result;\n}", "public function updateSpecific($cols, $conditions, $table) \n {\n $values = array();\n $prepReq = \"UPDATE \".$table.\" SET\";\n foreach ($cols as $col) \n { \n $prepReq = $prepReq.\" \".$col[0].\" = ?,\"; \n array_push($values, $col[1]);\n }\n $prepReq = substr_replace($prepReq ,\"\",-1); //remove last coma\n\n if(sizeof($conditions) != 0) \n {\n $prepReq = $prepReq . \" WHERE\";\n foreach ($conditions as $condition) \n { \n $prepReq = $prepReq.\" \".$condition[0].\" = ? and\"; \n array_push($values, $condition[1]);\n }\n $prepReq = substr_replace($prepReq ,\"\",-4); //remove last \" AND\"\n } \n else \n { \n $prepReq = $prepReq . \" WHERE 1\"; \n }\n\n $req = $this->db->prepare($prepReq);\n $res = $req->execute($values);\n return $res;\n\n }", "protected function compileUpdate()\n\t{\n\t\t$params = [];\n\t\t$query = 'UPDATE ';\n\t\t$query .= $this->quoteTable($this->table) . ' ';\n\t\t$query .= 'SET ';\n\n\t\t$separator = '';\n\t\tforeach ($this->values as $identifier => $value) {\n\t\t\t$query .= $separator . $this->quoteIdentifier($identifier) . ' = ';\n\t\t\tlist($valueQuery, $valueParams) = $this->compileValue($value, $identifier);\n\t\t\t$params = array_merge($params, $valueParams);\n\t\t\t\n\t\t\t\n\t\t\t$query .= $valueQuery;\n\t\t\t$separator = ', ';\n\t\t}\n\n\t\tif (count($this->where) > 0) {\n\t\t\tlist($whereQuery, $whereParams) = $this->compileConditions($this->where);\n\t\t\t$query.= ' WHERE ' . $whereQuery;\n\t\t\t$params = array_merge($params, $whereParams);\n\t\t}\n\n\t\treturn [$query, $params];\n\t}", "function query_update($table, $data_array, $attribute, $condition_value){\n if(gettype($table) == \"string\" && gettype($data_array) == \"array\"){\n\n $req_str = \"update \".$table.\" set \";\n foreach ($data_array as $key => $value){\n if($value == \"string\"){\n $req_str = $req_str.$key.\" = '\".$value.\"'\";\n } else{\n $req_str = $req_str.$key.\" = \".$value;\n }\n }\n $req_str.\" where \".$attribute.\" = \".$condition_value;\n\n return $req_str;\n }\n else {\n return null;\n }\n }", "private function getUpdateQuery()\n {\n if (isset($this->parts['from'][0]['alias'])) {\n $fromClause = $this->parts['from'][0]['alias'].' FROM '.$this->getFromClause();\n } else {\n $fromClause = $this->parts['from'][0]['table'];\n }\n\n $setClause = array();\n\n foreach ($this->parts['set'] as $idenfier => $value) {\n $setClause[] = $this->getExpressionBuilder()->equal($idenfier, $value);\n }\n\n return 'UPDATE '.$fromClause.\n ' SET '.implode(', ', $setClause).\n (($this->parts['where'] !== null) ? ' WHERE '.$this->parts['where'] : null);\n }", "function compileQueryUpdate(array $statement);", "public function exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields = false);", "protected function prepareUpdate()\n {\n $join = $this->getDetail('join');\n $statement = 'UPDATE ' .\n $this->quote($this->getDetail('table')) .\n $this->prepareUpdateSetPart();\n\n if (!empty($join)) {\n $statement .= ' FROM ' . $this->prepareTablePart($this->getDetail('table'));\n }\n\n $statement .= $this->processJoin($join) .\n $this->processConditions($this->getDetail('conditions'));\n return $statement;\n }", "public function getUpdateQuery();", "private function getUpdateSQL()\n {\n $table = $this->sqlParts['from']['table'] . ($this->sqlParts['from']['alias'] ? ' '\n . $this->sqlParts['from']['alias'] : '');\n\n $query = 'UPDATE ' . $table\n . ' SET ' . implode(\", \", $this->sqlParts['set'])\n . ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string)$this->sqlParts['where']) : '');\n\n return $query;\n }", "public static function updateAll($condition, $attributes);", "public function Update($table, $params, $cond = null){\n $sql = \"UPDATE \".$table.\" SET \";\n\n $x = 1;\n foreach ($params as $key => $value) {\n if($x != count($params)) $sql .= str_replace(':', '', $key).\"=\".$key.\", \";\n else $sql .= str_replace(':', '', $key).\"=\".$key;\n\n $x++;\n }\n\n if($cond != null)\n $sql .= \" WHERE \".$cond;\n\n try {\n\n $stmt = $this->db->prepare($sql);\n $stmt->execute($params);\n\n return 1;\n } catch (\\Exception $e) {\n\n }\n\n\n }", "static function update($table,$info,$conditions=\"\"){\n \n\t\t$query = \"UPDATE `\".$table.\"` SET\";\n \n\t\tforeach($info as $title => $value)\t\t\t\n\t\t\t$query .= \" `\".$title.\"` = '\".self::escape($value).\"',\";\n \n\t\t$query = substr($query,0,-1);\t\t\n\t\t$query .= \" \".self::clean_where($conditions);\n \n\t\tmysql_query($query);\n \n\t\tif(self::$DEBUG == true)\t\t\t\n\t\t\techo \"[DEBUG (sql->update[\".$table.\"]): \".$query.\"]\";\n \n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Provide extra queries to shrink the database.
function hook_shrinkdb_extra_queries() { $queries = []; // Remove files not referenced. if (drush_module_exists('file')) { $queries[] = "DELETE fm FROM file_managed fm LEFT JOIN file_usage fu ON fm.fid = fu.fid WHERE fu.fid IS NULL"; } return $queries; }
[ "public function database_maintenance() {\n\t\t\tblcContainerHelper::cleanup_containers();\n\t\t\tblc_cleanup_instances();\n\t\t\tblc_cleanup_links();\n\n\t\t\tblcUtility::optimize_database();\n\t\t}", "function dbClean()\n {\n #mysql_query(\"truncate table `keywordgroup`\");\n mysql_query(\"truncate table `semantic`\");\n #mysql_query(\"truncate table `syntactic`\");\n }", "public function query() {\n $this->ensureMyTable();\n parent::query();\n }", "function optimize()\n\t{\n\n\t\t// fetch information on all the tables in the database\n\t\t$tables = $this->get_table_status();\n\n\t\t// iterate through the database's tables, and if it has overhead (unused, lost space), optimize it\n\t\tforeach ($tables as $table) if ($table['Data_free'] > 0) $this->query('OPTIMIZE TABLE `' . $table['Name'] . '`');\n\n\t}", "public function shrink() {\n // Wildcard dice do not shrink\n }", "private function truncateAffectedTables()\n {\n DB::statement('SET foreign_key_checks = 0');\n\n foreach (['books', 'tags', 'tags_books'] as $table)\n {\n DB::table($table)->truncate();\n }\n\n DB::statement('SET foreign_key_checks = 1');\n }", "public final function optimize() {\r\n try {\r\n Main::$_oDbStatic->query(\"OPTIMIZE TABLE\r\n \" . SQL_PREFIX . \"blogs,\r\n \" . SQL_PREFIX . \"comments,\r\n \" . SQL_PREFIX . \"calendars,\r\n \" . SQL_PREFIX . \"contents,\r\n \" . SQL_PREFIX . \"downloads,\r\n \" . SQL_PREFIX . \"gallery_albums,\r\n \" . SQL_PREFIX . \"gallery_files,\r\n \" . SQL_PREFIX . \"migrations,\r\n \" . SQL_PREFIX . \"logs,\r\n \" . SQL_PREFIX . \"sessions,\r\n \" . SQL_PREFIX . \"users\");\r\n }\r\n catch (AdvancedException $e) {\r\n Main::$_oDbStatic->rollBack();\r\n AdvancedException::reportBoth('0109 - ' . $e->getMessage());\r\n exit('SQL error.');\r\n }\r\n\r\n try {\r\n $oQuery = Main::$_oDbStatic->prepare(\"DELETE FROM\r\n \" . SQL_PREFIX . \"sessions\r\n WHERE\r\n date < :date\");\r\n\r\n # Half a year\r\n $iDate = time() - 15552000;\r\n $oQuery->bindParam('date', $iDate, PDO::PARAM_INT);\r\n return $oQuery->execute();\r\n }\r\n catch (AdvancedException $e) {\r\n Main::$_oDbStatic->rollBack();\r\n AdvancedException::reportBoth('0109 - ' . $e->getMessage());\r\n exit('SQL error.');\r\n }\r\n }", "protected function doPurgeDatabase()\n {\n }", "public function truncate()\n\t{\n\t\tforeach ( $this->grammar->compileTruncate( $this ) as $sql => $bindings )\n\t\t{\n\t\t\t$this->connection->statement( $sql, $bindings );\n\t\t}\n\t}", "public static function cleanup() {\n\t\tDB::table(DB_FIELDS)\n\t\t\t->leftJoin(DB_OBJECTS, DB_FIELDS . '.object_id', '=', DB_OBJECTS . '.id')\n\t\t\t->whereNull(DB_OBJECTS . '.id')\n\t\t\t->delete();\n\t}", "public function truncateSQL(){\n\n\t\t$strSQL = \"TRUNCATE \" . $this->tblName;\n\n\t\t$this->query($strSQL);\n\n\t}", "function tidy_database()\n{\n\tglobal $_CLASS;\nreturn;\n\t$remove_date = $_CLASS['core_user']->time - (3 * 62 * 24 * 3600);\n\n\t$sql = 'DELETE FROM ' . FORUMS_TRACK_TABLE . '\n\t\tWHERE mark_time < ' . $remove_date;\n\t$_CLASS['core_db']->query($sql);\n\n\tset_config('database_last_gc', $_CLASS['core_user']->time, true);\n}", "protected function resetDatabase()\n {\n $database = oxDb::getDb();\n $database->execute(\"TRUNCATE oxarticles\");\n $database->execute(\"TRUNCATE oxdiscount\");\n $database->execute(\"TRUNCATE oxobject2discount\");\n $database->execute(\"TRUNCATE oxprice2article\");\n $tables = $database->getCol(\"SHOW TABLES\");\n if (in_array('oxfield2shop', $tables)) {\n $database->execute(\"TRUNCATE oxfield2shop\");\n }\n $database->execute(\"TRUNCATE oxuser\");\n $database->execute(\"TRUNCATE oxobject2group\");\n $database->execute(\"TRUNCATE oxgroups\");\n }", "protected function clear() {\n\t\tglobal $wpdb;\n\n\t\t// For the PreparedSQLPlaceholders issue, see: https://github.com/WordPress/WordPress-Coding-Standards/issues/1903.\n\t\t// For the DirectDBQuery issue, see: https://github.com/WordPress/WordPress-Coding-Standards/issues/1947.\n\t\t// phpcs:disable WordPress.DB -- Table names should not be quoted and truncate queries can not be cached.\n\t\t$wpdb->query(\n\t\t\t$wpdb->prepare(\n\t\t\t\t'TRUNCATE TABLE %1$s',\n\t\t\t\tModel::get_table_name( 'Indexable' )\n\t\t\t)\n\t\t);\n\t\t$wpdb->query(\n\t\t\t$wpdb->prepare(\n\t\t\t\t'TRUNCATE TABLE %1$s',\n\t\t\t\tModel::get_table_name( 'Indexable_Hierarchy' )\n\t\t\t)\n\t\t);\n\t\t// phpcs:enable\n\t}", "public function truncateLaratrustTables()\n {\n Schema::disableForeignKeyConstraints();\n DB::table('permission_role')->truncate();\n DB::table('permission_user')->truncate();\n DB::table('role_user')->truncate();\n \\App\\User::truncate();\n \\App\\Role::truncate();\n \\App\\Permission::truncate();\n Schema::enableForeignKeyConstraints();\n }", "public function truncateLaratrustTables()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n DB::table('permission_role')->truncate();\n DB::table('permission_user')->truncate();\n DB::table('role_user')->truncate();\n \\App\\User::truncate();\n \\App\\Role::truncate();\n \\App\\Permission::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n }", "public function truncateLaratrustTables()\n {\n Schema::disableForeignKeyConstraints();\n DB::table('permission_role')->truncate();\n DB::table('permission_user')->truncate();\n // DB::table('role_user')->truncate();\n // \\App\\User::truncate();\n \\App\\Role::truncate();\n \\App\\Permission::truncate();\n Schema::enableForeignKeyConstraints();\n }", "function shrink() {\n $this->hideLinks();\n foreach (array_keys($this->tables) as $name) {\n $this->tables[$name]->shrink();\n }\n while(gtk::events_pending()) gtk::main_iteration();\n $this->redrawLinks();\n }", "public static function breeze_ajax_purge_database() {\n\t\t//check security\n\t\tcheck_ajax_referer( '_breeze_purge_database', 'security' );\n\n\t\t$type = array( 'revisions', 'drafted', 'trash', 'comments', 'trackbacks', 'transient' );\n\t\tself::optimize_database( $type );\n\n\t\techo json_encode( array( 'clear' => true ) );\n\t\texit;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/! \brief List existing object types
protected function _listTypes() { global $config; $types = objects::types(); $result = array(); foreach ($types as $type) { $infos = objects::infos($type); $result[$type] = $infos['name']; } return $result; }
[ "public function get_object_types();", "public function getObjectTypeList();", "public function getAllObjectTypes() {\r\n\t\t$dbh = $this->dbh;\r\n\t\t$result = $dbh->query(\"select name from app_object_types\");\r\n\r\n\t\t$num = $dbh->getNumRows($result);\r\n\t\t$ret = array();\r\n\t\tfor ($i = 0; $i < $num; $i++)\r\n\t\t{\r\n\t\t\t$row = $dbh->getRow($result, $i);\r\n\t\t\t$ret[] = $row['name'];\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "function get_object_type_names() {\n\t$mobject_kinds = get_mobject_kinds();\n\t$type_names = [];\n\tforeach ( $mobject_kinds as $kind ) {\n\t\t$type_names[] = $kind->type_name;\n\t}\n\treturn $type_names;\n}", "public static function getAllTypes() {\n $query = Zend_Registry::getInstance()->entitymanager->createQuery('select t from Default_Model_Objecttype t group by t.name');\n return $query->getResult();\n }", "public function get_object_types() {\n\t\treturn $this->object_types;\n\t}", "public function getTodoTypeListAction(){\n /** @var Object_Todo $todo */\n $this->getDeviceSession()->getUserId();\n $todo = new Object_Todo();\n $this->_helper->json($todo->getClass()->getFieldDefinition('Todo_type'));\n }", "public static function getObjectTypeMap() {\n $types = readChapter(CHAP_OBJTYPE);\n return array_flip(array_map('strtolower', $types));\n }", "public function attachmentObjTypes();", "public function get_object_subtypes()\n {\n }", "public function getAllTypeNames();", "public function getTypes()\n {\n }", "public static function _getActivatedObjTypes()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$query = \"SELECT DISTINCT(obj_type) FROM adv_md_record_objs amo \".\n\t\t\t\"JOIN adv_md_record amr ON amo.record_id = amr.record_id \".\n\t\t\t\"WHERE active = 1 \";\n\t\t$res = $ilDB->query($query);\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\n\t\t{\n\t\t\t$obj_types[] = $row->obj_type; \n\t\t}\n\t\treturn $obj_types ? $obj_types : array(); \n\t}", "function sloodle_get_installed_object_types()\n {\n // Fetch all sub-directories of the \"mod\" directory\n \n // Go through each object to parse names and version numbers.\n // Object names should have format \"name-version\" (e.g. \"chat-1.0\").\n // We will skip anything that does not match this format.\n // We will also skip anything with a \"noshow\" file in the folder.\n\n\treturn SloodleObjectConfig::AllAvailableAsNameVersionHash();\n\n }", "private function getOpenGraphObjectTypes() : array\n {\n return [\n 'books' => ObjectBook::class,\n 'business' => ObjectBusiness::class,\n 'fitness' => ObjectFitness::class,\n 'game' => ObjectGame::class,\n 'music' => ObjectMusic::class,\n 'place' => ObjectPlace::class,\n 'product' => ObjectProduct::class,\n 'profile' => ObjectProfile::class,\n 'restaurant' => ObjectRestaurant::class,\n 'video' => ObjectVideo::class,\n ];\n }", "abstract public function get_object_type();", "public function get_types()\n\t{\n\t\treturn $this->driver_query('type_list', FALSE);\n\t}", "function get_mobject_kinds() {\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . WPM_PREFIX . 'mobject_kinds';\n\t$kinds = wp_cache_get( 'get_mobject_kinds', CACHE_GROUP );\n\tif ( ! $kinds ) {\n\t\t$results = $wpdb->get_results( \"SELECT * FROM $table_name\" );\n\t\t$kinds = [];\n\t\tforeach ( $results as $result ) {\n\t\t\t$kinds[] = new ObjectKind( $result );\n\t\t}\n\t\twp_cache_add( 'get_mobject_kinds', $kinds, CACHE_GROUP );\n\t}\n\treturn $kinds;\n}", "public function get_object_subtypes() {\n\t\treturn $this->provider->get_object_subtypes();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method is responsible for validating the value passed to the setPaymentMethod method This method is willingly generated in order to preserve the oneline inline validation within the setPaymentMethod method This has to validate that the property which is being set is the only one among the given choices
public function validatePaymentMethodForChoiceConstraintsFromSetPaymentMethod($value) { $message = ''; if (is_null($value)) { return $message; } $properties = [ 'AccountState', 'AdditionalAccount', 'AdditionalAccountsCount', 'AmountPastDue', 'BankAccountInfo', 'BankModifyDate', 'BillingCycleDate', 'CCExp', 'CCInfo', 'CCModifyDate', 'CurrentBalance', 'LastAmountPaid', 'LastInvoiceAmount', 'LastInvoiceDate', 'LastPaymentDate', 'PastDue', ]; try { foreach ($properties as $property) { if (isset($this->{$property})) { throw new \InvalidArgumentException(sprintf('The property PaymentMethod can\'t be set as the property %s is already set. Only one property must be set among these properties: PaymentMethod, %s.', $property, implode(', ', $properties)), __LINE__); } } } catch (\InvalidArgumentException $e) { $message = $e->getMessage(); } return $message; }
[ "public function validate_fields() {\r\n\t\t$choose_payment = $_POST['ecpay_choose_payment'];\r\n\t\t$payment_desc = $this->get_payment_desc($choose_payment);\r\n\t\tif ($_POST['payment_method'] == $this->id && !empty($payment_desc)) {\r\n\t\t\t$this->ecpay_choose_payment = $choose_payment;\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\twc_add_notice( __( 'Invalid payment method.' ).$payment_desc, 'error' );\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function check_option_value()\n {\n // beacasue values of select tag can be change by the developer mode.\n // those changed values instead of original values can be sent to process and can be easly stored in database.\n // so this is also very important step to see.\n // this step is mainly for hackers or other users who have malicious intension.\n\n foreach ($this->properties as $property) {\n //checking constant is defined or NOT\n if (defined(\"self::\" . $this->combine[$property])) {\n // $set will be an array\n $set = constant(\"self::\".$this->combine[$property]);\n if (has_exclusion_of($this->$property, $set, $case_insensitive=false)) {\n $this->errors[] = \"'\".$this->$property.\"'\" .' is not valid value for ' . ucfirst($property);\n }\n } //if\n } //foreach\n }", "public function check_option_value()\n {\n // beacasue values of select tag can be change by the developer mode.\n // those changed values instead of original values can be sent to process and can be easly stored in database.\n // so this is also very important step to see.\n // this step is mainly for hackers or other users who have malicious intension.\n\n foreach ($this->properties as $property) {\n //checking constant is defined or NOT\n if (defined(\"self::\" . $this->combine[$property])) {\n // $set will be an array\n $set = constant(\"self::\".$this->combine[$property]);\n if (has_exclusion_of($this->$property, $set, $case_insensitive=false)) {\n $this->errors[] = \"'\".$this->$property.\"'\" .' is not valid value for ' . ucfirst($property);\n }\n } elseif($property == 'YearOfPassing'){\n $set = $this->combine[$property];\n $set = $this->$set; // $set will be an array\n if (has_exclusion_of($this->$property, $set, $case_insensitive=false)) {\n $this->errors[] = \"'\".$this->$property.\"'\" .' is not valid value for ' . ucfirst($property);\n }\n \n } //elseif\n } //foreach\n }", "public function validateChosenPaymentMethod()\n {\n if (isset($_POST['paynl_bank']) && $_POST['paynl_bank']) {\n $_SESSION['paynl_bank'] = htmlspecialchars($_POST['paynl_bank']);\n } else {\n unset($_SESSION['paynl_bank']);\n }\n return true;\n }", "public function validate()\n\t{\n\t\t/**\n * to validate payment method is allowed for billing country or not\n */\n $paymentInfo = $this->getInfoInstance();\n\n if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) {\n $billingCountry = $paymentInfo->getOrder()->getBillingAddress()->getCountryId();\n } else {\n $billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId();\n }\n if (!$this->canUseForCountry($billingCountry)) {\n Mage::throwException(Mage::helper('payment')->__('Selected payment type is not allowed for billing country.'));\n }\n\n\t\t // Validate CPF format \n\t\t if ($this->_typeIdentification == 'cpf'){\n\t\t\tif (!preg_match(\"/(\\d{2}[.]?\\d{3}[.]?\\d{3}[\\/]?\\d{4}[-]?\\d{2})|(\\d{3}[.]?\\d{3}[.]?\\d{3}[-]?\\d{2})$/\",$paymentInfo->getAdditionalInformation('national_identification_number'))){\n\t\t\t\tMage::throwException(Mage::helper('payment')->__('CPF is not valid.'));\n\t\t\t}\n\t\t }\n\n\t\t // Validate CPN format\n\t\tif ($this->_typeIdentification == 'cpn'){\n\t\t\tif (!preg_match(\"/^[a-zA-Z]{4}\\d{6}[a-zA-Z]{6}\\d{2}$/\",$paymentInfo->getAdditionalInformation('national_identification_number'))){\n\t\t\t\tMage::throwException(Mage::helper('payment')->__('CPN is incorrect.'));\n\t\t\t}\n\t\t }\n\t\t\n return $this;\n\t}", "function ChoiceValidator ()\n {\n\n parent::Validator();\n\n $this->params['choices'] = array();\n $this->params['choices_error'] = 'Invalid value';\n $this->params['sensitive'] = FALSE;\n $this->params['valid'] = TRUE;\n\n }", "public function validatePayment() {\n if($this->payment_method == 'CreditCard') {\n if(empty($this->firstname))\n $this->addError('firstname', Yii::t('lang', 'email_readings_error_2'));\n if(empty($this->lastname))\n $this->addError('lastname', Yii::t('lang', 'email_readings_error_3'));\n if(empty($this->cardnumber))\n $this->addError('cardnumber', Yii::t('lang', 'addfunds_7'));\n if((empty($this->month))||(empty($this->year)))\n $this->addError('month', Yii::t('lang', 'email_readings_error_5'));\n if(($this->cardnumber == '4005550000000019')&&($this->user_id != '9615'))\n $this->addError('month', 'Invalid card number');\n }\n if($this->payment_method == 'PayPal') {\n if(empty($this->firstname))\n $this->addError('firstname', Yii::t('lang', 'email_readings_error_2'));\n if(empty($this->lastname))\n $this->addError('lastname', Yii::t('lang', 'email_readings_error_3'));\n }\n }", "public function setHasPaymentMethodAttribute($value)\n {\n $this->setParam('hasPaymentMethod', !empty($value));\n }", "public function payment_choicesCheckVars()\n {\n $this->site->page_id = 10203;\n $msgs = $this->site->messages = $this->db->get_text(true, $this->site->page_id);\n\n\n //make sure payment choice is made..\n if (!isset($_POST['c']['payment_type']) || !$_POST['c'][\"payment_type\"] || !is_object(geoPaymentGateway::getPaymentGateway($_POST['c'][\"payment_type\"]))) {\n //payment type not send, or set to something invalid.\n $this->addError();\n $this->error_variables[\"choices_box\"] = geoString::fromDB($msgs[500308]);\n }\n\n if (isset($_POST['c']) && is_array($_POST['c'])) {\n //set billing info so it is used the next time the page\n //is loaded, if something has failed. (so user does not\n //have to re-enter info every time)\n\n $this->order->setBillingInfo($_POST['c']);\n $this->user_data['billing_info'] = $_POST['c'];\n\n //make sure e-mail is valid...\n if (!isset($_POST['c']['email']) || !$_POST['c']['email'] || !geoString::isEmail($_POST['c']['email'])) {\n $this->addError()\n ->addErrorMsg('billing_email', $msgs[500309]);\n }\n if (isset($_POST['c']['payment_type']) && $this->isRecurringCart()) {\n $gateway = geoPaymentGateway::getPaymentGateway($_POST['c']['payment_type']);\n if ($gateway && $gateway->isRecurring() && $gateway->getRecurringAgreement()) {\n //make sure the recurring agreement was agreed upon\n if (!isset($_POST['c']['user_agreement']) || $_POST['c']['user_agreement'] != $_POST['c']['payment_type']) {\n //user did not agree!\n $this->addError()\n ->addErrorMsg('gateway_recurring_agreement', $msgs[500766]);\n }\n }\n }\n }\n geoPaymentGateway::callUpdate('geoCart_payment_choicesCheckVars');\n }", "public function onChangePaymentMethod()\n {\n $rules = [\n 'id' => 'required|exists:offline_mall_payment_methods,id',\n ];\n\n $validation = Validator::make(post(), $rules);\n if ($validation->fails()) {\n throw new ValidationException($validation);\n }\n\n $id = post('id');\n\n $method = PaymentMethod::find($id);\n $this->cart->setPaymentMethod($method);\n $this->setData();\n\n return $this->updateForm(\n [\n 'method' => $method,\n ]\n );\n }", "public static function restrict_by_payment_method() {\n\t\tglobal $typenow;\n\n\t\tif ( 'shop_subscription' !== $typenow ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$selected_gateway_id = ( ! empty( $_GET['_payment_method'] ) ) ? $_GET['_payment_method'] : ''; ?>\n\n\t\t<select class=\"wcs_payment_method_selector\" name=\"_payment_method\" id=\"_payment_method\" class=\"first\">\n\t\t\t<option value=\"\"><?php esc_html_e( 'Any Payment Method', 'woocommerce-subscriptions' ) ?></option>\n\t\t\t<option value=\"none\" <?php echo esc_attr( 'none' == $selected_gateway_id ? 'selected' : '' ) . '>' . esc_html__( 'None', 'woocommerce-subscriptions' ) ?></option>\n\t\t<?php\n\n\t\tforeach ( WC()->payment_gateways->get_available_payment_gateways() as $gateway_id => $gateway ) {\n\t\t\techo '<option value=\"' . esc_attr( $gateway_id ) . '\"' . ( $selected_gateway_id == $gateway_id ? 'selected' : '' ) . '>' . esc_html( $gateway->title ) . '</option>';\n\t\t}?>\n\t\t</select> <?php\n\t}", "public function testPaymentValidationWithAllowedSpecificCountry(): void\n {\n $quote = $this->getFixtureQuote();\n $this->prepareCheckoutModel($quote);\n\n $quote->getPayment()->getMethodInstance()->validate();\n }", "public function testValidatePaymentWithOneOffEnabled() {\n $payment = $this->payment;\n $payment->line_items['line_item_name']->recurrence->interval_unit = NULL;\n $e = $this->getValidationException($payment);\n $this->assertEmpty($e);\n }", "protected function _isValidPaymentType()\n\t{\n\t\treturn in_array($this->getPaymentType(), $this->_acceptedPaymentTypes);\n\t}", "public function setEnforcePaymentMethod($value)\n {\n return $this->setParameter('enforcePaymentMethod', $value);\n }", "public function validatePayment()\n\t{\n\n\t\t$paymentId = \\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('paymentid');\n//\t\tif ($paymentId === 'c_novation_pay') {\n//\t\t\treturn 'mmcnovationpaystandarddispatcher?fnc=setExpressCheckout';\n//\t\t}\n\n\t\treturn parent::validatePayment();\n\t}", "public function validate() {\n if ($this->isRequired() && (empty($this->getValue()))) {\n $this->getFormState()->validationError($this->getName(), \\Quanta\\Common\\Localization::t('This item is required!'));\n }\n }", "public function getAcceptedPaymentMethod();", "public function cleanChosenPaymentMethod()\n {\n $this->session->delete(Session::CHOSEN_PAYMENT_METHOD);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disapprove burn request form.
public function disapproveForm($burn_id) { $daily = fetch_row("SELECT start_date, status_id FROM burns WHERE burn_id = ?;", $burn_id); if (in_array($daily['status_id'], array(2,4))) { // Under Review, it can be approved. $html = "<div> <button class=\"btn btn-danger btn-block\" onclick=\"BurnReview.disapprove($burn_id)\">Disapprove <strong>".$daily['start_date']."</strong></button> <button class=\"btn btn-default btn-block\" onclick=\"cancel_modal()\">Cancel</button> </div>"; } elseif ($daily['status_id'] == 3) { // Revision Requested. Check for edit. if ($this->reviewCheck($burn_id)) { $message = "The burn plan has been edited since the last review but not re-submitted."; $button = "<button class=\"btn btn-default btn-block\" onclick=\"BurnReview.notify($burn_id)\">Notify Submitter to Resubmit</button>"; } else { $message = "The burn plan has not been edited since the last review."; $button = "<button class=\"btn btn-default btn-block\" onclick=\"BurnReview.notify($burn_id)\">Notify Submitter to Revise</button>"; } $html = "<div> <p class=\"text-center\">$message</p> $button <button class=\"btn btn-default btn-block\" onclick=\"cancel_modal()\">Cancel</button> </div>"; } else { $html = "<div> <p class=\"text-center\">The burn plan cannot be disapproved from its current status.</p> <button class=\"btn btn-default btn-block\" onclick=\"cancel_modal()\">Cancel</button> </div>"; } return $html; }
[ "public function unapprove() {\n\t\t$this->_editState(0);\n\t}", "public function unapprove() {\n\n\t\tcheck_admin_referer( 'wpforms-unapprove-users' );\n\n\t\t$this->do_unapprove();\n\t}", "public function unapprove()\n {\n return $this->update(['approved' => false]);\n }", "public function rejectAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') && $this->_getParam('user_reason') )\n\t\t{\t// TODO: validate and write entry to database\n\t\t\t// TODO: add success message to view\n\t\t\tif( $this->db->rejectRefund( $this->_getParam('user'), $this->_getParam('user_reason') ) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// TODO: If the refunds period has closed, parse request logs against refund list, update rejected users\n\t\t$this->view->user_options = $this->db->getRefunds('REQUESTED');\n\t}", "public function approveForm($burn_id)\n {\n\n $daily = fetch_row(\"SELECT start_date, status_id FROM burns WHERE burn_id = ?;\", $burn_id);\n\n if (in_array($daily['status_id'], array(2,4))) {\n // Under Review, it can be approved.\n $html = \"<div>\n <button class=\\\"btn btn-success btn-block\\\" onclick=\\\"BurnReview.approve($burn_id)\\\">Approve <strong>\".$daily['start_date'].\"</strong></button>\n <button class=\\\"btn btn-default btn-block\\\" onclick=\\\"cancel_modal()\\\">Cancel</button>\n </div>\";\n } elseif ($daily['status_id'] == 3) {\n // Revision Requested. Check for edit.\n if ($this->reviewCheck($burn_id)) {\n $message = \"The burn plan has been edited since the last review but not re-submitted.\";\n $button = \"<button class=\\\"btn btn-default btn-block\\\" onclick=\\\"BurnReview.notify($burn_id)\\\">Notify Submitter to Resubmit</button>\";\n } else {\n $message = \"The burn plan has not been edited since the last review.\";\n $button = \"<button class=\\\"btn btn-default btn-block\\\" onclick=\\\"BurnReview.notify($burn_id)\\\">Notify Submitter to Revise</button>\";\n }\n\n $html = \"<div>\n <p class=\\\"text-center\\\">$message</p>\n $button\n <button class=\\\"btn btn-default btn-block\\\" onclick=\\\"cancel_modal()\\\">Cancel</button>\n </div>\";\n } else {\n $html = \"<div>\n <p class=\\\"text-center\\\">The burn plan cannot be approved from its current status.</p>\n <button class=\\\"btn btn-default btn-block\\\" onclick=\\\"cancel_modal()\\\">Cancel</button>\n </div>\";\n }\n\n return $html;\n }", "public function skipApproval();", "public function disapproveCompanyAction() {\n $id = $this->_request->getParam(\"id\", 0);\n $company = $this->getService(\"company\")->getTable()->findOneById($id);\n\n if (!$company || $company->status != Companies_Model_Company::STATUS_TAKEN) {\n $this->_redirectNotFoundPage();\n }\n\n $this->getService(\"company\")->disapprove($company);\n $this->_redirectToRequestPage();\n }", "function cancel() {\n $model = $this->getModel('Request', 'Easysdi_shopModel');\n $id = JFactory::getApplication()->getUserState('com_easysdi_shop.edit.request.id');\n $model->checkin($id);\n $this->setRedirect(JRoute::_('index.php?option=com_easysdi_shop&view=requests', false));\n }", "public function decline() {\n header('Content-type: application/json');\n $requestId = input(\"requestid\");\n Database::table(\"requests\")->where(\"id\", $requestId)->update(array(\"status\" => \"Declined\"));\n $request = Database::table(\"requests\")->where(\"id\", $requestId)->first();\n $sender = Database::table(\"users\")->where(\"id\", $request->sender)->first();\n $documentLink = env(\"APP_URL\").\"/document/\".$request->document;\n $send = Mail::send(\n $sender->email, \"Signing invitation declined by \".$request->email,\n array(\n \"title\" => \"Signing invitation declined.\",\n \"subtitle\" => \"Click the link below to view document.\",\n \"buttonText\" => \"View Document\",\n \"buttonLink\" => $documentLink,\n \"message\" => $request->email.\" has declined the signing invitation you had sent. Click the link above to view the document.<br><br>Thank you<br>\".env(\"APP_NAME\").\" Team\"\n ),\n \"withbutton\"\n );\n $actionTakenBy = escape($request->email);\n /*\n * Check, whether IP address register is allowed in .env\n * If yes, then capture the user's IP address\n */\n if (env('REGISTER_IP_ADDRESS_IN_HISTORY') == 'Enabled') {\n $actionTakenBy .= ' ['.getUserIpAddr().']';\n }\n $activity = '<span class=\"text-primary\">'.$actionTakenBy.'</span> declined a signing invitation of this document.';\n Signer::keephistory($request->document, $activity, \"default\");\n $notification = '<span class=\"text-primary\">'.escape($request->email).'</span> declined a signing invitation of this <a href=\"'.url(\"Document@open\").$request->document.'\">document</a>.';\n Signer::notification($sender->id, $notification, \"decline\");\n if (!$send) { exit(json_encode(responder(\"error\", \"Oops!\", $send->ErrorInfo))); }\n exit(json_encode(responder(\"success\", \"Declined!\", \"Request declined and sender notified.\",\"reload()\")));\n }", "public function submitDischargeRequest() {\n\t\t$facility = new CMS_Facility(input()->facility);\n\t\t$datetime = datetime(strtotime(input()->datetime));\n\t\t$schedule = new CMS_Schedule(input()->schedule);\n\t\t$patient = new CMS_Patient_Admit($schedule->patient_admit);\n\t\t\t\t\n\t\t// validate facility\n\t\tif ($facility->valid() == false) {\n\t\t\tfeedback()->error(\"Invalid facility selected.\");\n\t\t}\n\t\t// validate schedule\n\t\tif ($schedule->valid() == false) {\n\t\t\tfeedback()->error(\"Invalid scheduling selected.\");\n\t\t}\n\t\t\n\t\t/*\n\t\t * VALIDATE CONDITIONAL FIELDS BASED ON DISCHARGE TO SELECTION\n\t\t *\n\t\t * Note: Need to validate conditional inputs based on the discharge_to selection as different fields\n\t\t * will appear for different selected values.\n\t\t *\n\\\t\t */\n\n\t\tif (input()->datetime == '') {\n\t\t\tfeedback()->error(\"You must select the date and time of discharge.\");\n\t\t\t$this->redirect();\n\t\t}\n\t\t\n\t\t$dischargeToOptions = db()->enumOptions(\"schedule\", \"discharge_to\");\n\t\tif (input()->discharge_to == '' || ! in_array(input()->discharge_to, $dischargeToOptions)) {\n\t\t\tfeedback()->error(\"You must select a discharge type.\");\n\t\t\t$this->redirect(SITE_URL . \"/?page=facility&action=discharge_details&schedule={$schedule->pubid}\");\n\t\t} else {\n\t\t\t$discharge_to = input()->discharge_to;\n\t\t\t\n\t\t\tif ($discharge_to == \"General Discharge\") {\n\t\t\t\tif (input()->discharge_disposition == '') {\n\t\t\t\t\tfeedback()->error(\"You must select a discharge disposition.\");\n\t\t\t\t\t$this->redirect(SITE_URL . \"/?page=facility&action=discharge_details&schedule={$schedule->pubid}\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (input()->service_disposition == '' && input()->discharge_disposition != 'Hospice') {\n\t\t\t\t\tfeedback()->error(\"You must select a service disposition.\");\n\t\t\t\t\t$this->redirect(SITE_URL . \"/?page=facility&action=discharge_details&schedule={$schedule->pubid}\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif ($discharge_to == \"Transfer to another AHC facility\") {\n\t\t\t\t$transfer_facility = new CMS_Facility(input()->transfer_facility);\n\t\t\t\tif ($schedule->transfer_request != 1) {\n\t\t\t\t\t$schedule->transfer_request = 1;\n\t\t\t\t}\n\t\t\t\t$schedule->discharge_location_id = input()->discharge_location_id;\n\t\t\t\t$schedule->transfer_to_facility = $transfer_facility->id;\n\t\t\t\t$schedule->transfer_from_facility = $facility->id;\n\t\t\t\t$schedule->transfer_comment = input()->discharge_comment;\n\t\t\t\t\n\t\t\t\tif ($transfer_facility->valid() == false) {\n\t\t\t\t\tfeedback()->error(\"You must select a valid transfer facility.\");\n\t\t\t\t}\n\t\t\t\t$datetime_discharge_transfer = date('Y-m-d 13:00:00', strtotime(input()->datetime));\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif ($discharge_to == \"Transfer to other facility\") {\n\t\t\t\tif (input()->discharge_location_id == '') {\n\t\t\t\t\tfeedback()->error(\"You must enter a discharge facility name.\");\n\t\t\t\t\t$this->redirect(SITE_URL . \"/?page=facility&action=discharge_details&schedule={$schedule->pubid}\");\n\t\t\t\t} else {\n\t\t\t\t\t$schedule->discharge_location_id = input()->discharge_location_id;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (input()->service_disposition == '') {\n\t\t\t\t\tfeedback()->error(\"You must select a service disposition.\");\n\t\t\t\t\t$this->redirect(SITE_URL . \"/?page=facility&action=discharge_details&schedule={$schedule->pubid}\");\n\t\t\t\t}\n\t\t\t} \n\t\t\t\n\t\t\tif ($discharge_to == \"In-Patient Hospice\") {\n\t\t\t\tif (input()->discharge_location_id == '') {\n\t\t\t\t\tfeedback()->error(\"You must enter a discharge facility name.\");\n\t\t\t\t\t$this->redirect(SITE_URL . \"/?page=facility&action=discharge_details&schedule={$schedule->pubid}\");\n\t\t\t\t} else {\n\t\t\t\t\t$schedule->discharge_location_id = input()->discharge_location_id;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t/*\n\t\t * VALIDATE CONDITIONAL FIELDS BASED ON DISCHARGE DISPOSITION SELECTION\n\t\t *\n\t\t * Note: Fields will be validated depending on the selected value of the patients'\n\t\t * selected discharge disposition.\n\t\t *\n\t\t */\t\t\n\t\t\n\t\tif (input()->discharge_disposition == \"Home\") {\n\t\t\tif (input()->service_disposition == '') {\n\t\t\t\tfeedback()->error(\"You must select a service disposition.\");\n\t\t\t\t$this->redirect(SITE_URL . \"/?page=facility&action=discharge_details&schedule={$schedule->pubid}\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (input()->discharge_disposition == \"Group Home\" || input()->discharge_disposition == \"Assisted Living\" || input()->discharge_disposition == \"SNF\") {\n\t\t\tif (input()->discharge_location_id == '') {\n\t\t\t\tfeedback()->error(\"You must enter a discharge facility name.\");\n\t\t\t\t$this->redirect(SITE_URL . \"/?page=facility&action=discharge_details&schedule={$schedule->pubid}\");\n\t\t\t} else {\n\t\t\t\t$schedule->discharge_location_id = input()->discharge_location_id;\n\t\t\t}\n\t\t\t\n\t\t\tif (input()->service_disposition == '') {\n\t\t\t\tfeedback()->error(\"You must select a service disposition.\");\n\t\t\t\t$this->redirect(SITE_URL . \"/?page=facility&action=discharge_details&schedule={$schedule->pubid}\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (input()->discharge_disposition == \"Hospice\") {\n\t\t\tif (input()->discharge_location_id == '') {\n\t\t\t\tfeedback()->error(\"You must enter a discharge facility name.\");\n\t\t\t\t$this->redirect(SITE_URL . \"/?page=facility&action=discharge_details&schedule={$schedule->pubid}\");\n\t\t\t} else {\n\t\t\t\t$schedule->discharge_location_id = input()->discharge_location_id;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\t\t\n\t\t\n\t\t/*\n\t\t * VALIDATE CONDITIONAL FIELDS BASED ON SERVICE DISPOSITION SELECTION\n\t\t *\n\t\t * Note: \n\t\t *\n\t\t */\n\t\t\n\t\tif (input()->service_disposition == \"Other Home Health\") {\n\t\t\tif (input()->home_health_org == '') {\n\t\t\t\tfeedback()->error(\"You must enter the name of the home health agency.\");\n\t\t\t\t$this->redirect(SITE_URL . \"/?page=facility&action=discharge_details&schedule={$schedule->pubid}\");\n\t\t\t} else {\n\t\t\t\t$schedule->home_health_id = input()->home_health_org;\n\t\t\t}\n\t\t}\n\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t/*\n\t\t * VALIDATE DISCHARGE ADDRESS\n\t\t *\n\t\t * Note: \n\t\t *\n\t\t */\n\t\t \n\t\tif (input()->discharge_address_checkbox == 1) {\n\n\t\t\t// Address\n\t\t\tif (input()->discharge_address == '') {\n\t\t\t\tfeedback()->error(\"Please enter the discharge Street Address.\");\n\t\t\t\t$this->redirect();\n\t\t\t} else {\n\t\t\t\t$schedule->discharge_address = input()->discharge_address;\n\t\t\t}\n\n\t\t\t// City\n\t\t\tif (input()->discharge_city == '') {\n\t\t\t\tfeedback()->error(\"Please enter the discharge City.\");\n\t\t\t\t$this->redirect();\n\t\t\t} else {\n\t\t\t\t$schedule->discharge_city = input()->discharge_city;\n\t\t\t}\n\n\t\t\t// State\n\t\t\tif (input()->discharge_state == '') {\n\t\t\t\tfeedback()->error(\"Please enter the discharge State.\");\n\t\t\t\t$this->redirect();\n\t\t\t} else {\n\t\t\t\t$validate = Validate::is_USAState(input()->discharge_state);\n\t\t\t\tif ($validate->success() == false) {\n\t\t\t\t\tfeedback()->error(\"Please correct the State.\") . $validate->message();\n\t\t\t\t} else {\n\t\t\t\t\t$schedule->discharge_state = input()->discharge_state;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Zip\n\t\t\tif (input()->discharge_zip == '') {\n\t\t\t\tfeedback()->error(\"Please enter the discharge Zip.\");\n\t\t\t\t$this->redirect();\n\t\t\t} else {\n\t\t\t\t$validate = Validate::is_zipcode(input()->discharge_zip);\n\t\t\t\tif ($validate->success() == false) {\n\t\t\t\t\tfeedback()->error(\"Please correct the Zip.\");\n\t\t\t\t} else {\n\t\t\t\t\t$schedule->discharge_zip = input()->discharge_zip;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Phone\n\t\t\tif (input()->discharge_phone != '') {\n\t\t\t\t$validate = Validate::is_phone(input()->discharge_phone);\n\t\t\t\tif ($validate->success() == false) {\n\t\t\t\t\tfeedback()->error(\"Please correct the Phone number.\");\n\t\t\t\t} else {\n\t\t\t\t\t$schedule->discharge_phone = input()->discharge_phone;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\tif (input()->flag_readmission) {\n\t\t\t$schedule->flag_readmission = input()->flag_readmission;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// breakpoint\n\t\tif (feedback()->wasError()) {\n\t\t\t$this->redirect(auth()->getRecord()->homeURL());\n\t\t}\n\t\t\n\t\t$transfer = $schedule->getTransferSchedule();\n\t\t\n\t\t$schedule->discharge_to = input()->discharge_to;\n\t\t$schedule->discharge_disposition = input()->discharge_disposition;\n\t\t$schedule->service_disposition = input()->service_disposition;\n\t\t$schedule->datetime_discharge = date('Y-m-d H:i:s', strtotime(input()->datetime));\n\t\t$schedule->discharge_comment = input()->discharge_comment;\n\t\t$schedule->discharge_datetime_modified = date('Y-m-d H:i:s', strtotime('now'));\n\t\t$schedule->discharge_site_user_modified = auth()->getRecord()->id;\n\t\t$schedule->status = \"Discharged\";\n\t\t\t\t\n\t\t\n\t\t// If this is a transfer need to discharge the patient and then schedule them for an admission at the new location\n\t\t\t\n\t\ttry {\n\t\t\n\t\t\t$schedule->save();\n\t\t\t\n\t\t\t if ($discharge_to == 'Transfer to another AHC facility') {\n\t\t\t // create new transfer schedule record if we didn't already find one\n\t\t\t if ($transfer == false) {\n\t\t $transfer = new CMS_Schedule;\n\t\t // default status if new transfer\n\t\t $transfer->status = 'Under Consideration';\n\t\t \n\t\t // Get current patient_admit record\n\t\t $patient = new CMS_Patient_Admit($schedule->patient_admit);\n\t\t \n\t\t $new_record = CMS_Patient_Admit::cloneTransferPatient($patient->id, $facility->id);\n\t\t \n\t\t $new_record->save();\n\t\t\t } else {\n\t\t\t if ($facility->id != $transfer->facility) {\n\t\t\t // reset status if you're changing the facility of an existing transfer\n\t\t\t $transfer->status = 'Under Consideration'; \n\t\t\t }\n\t\t\t }\n\t\t\t $transfer->facility = $transfer_facility->id;\n\t\t\t $transfer->patient_admit = $new_record->id;\n\t\t\t $transfer->datetime_admit = $datetime_discharge_transfer;\n\t\t\t \n\t\t\t\t\t\n\t\t\t \n\t\t\t $transfer->save();\n\t\t\t \t\t\t \n\t\t\t // save transfer record association to this schedule\n\t\t\t $schedule->discharge_transfer_schedule = $transfer->id;\n\t\t\t $schedule->save();\n\t\t\t \n\t\t\t // send notification email\n/*\n\t\t\t CMS_Notify_Event::trigger(\"facility_transfer_inbound\", $facility, $schedule, $transfer);\n\t\t\t CMS_Notify_Event::trigger(\"facility_transfer_outbound\", $transfer_facility, $schedule, $transfer);\n*/\n\t\t\t \n\t\t\t} else {\n\t\t\t // delete any existing transfer schedule record; it's no longer needed\n\t\t\t if ($transfer != false) {\n\t\t\t CMS_Schedule::delete($transfer);\n\t\t\t }\n\t\t\t // clear from original schedule\n\t\t\t $schedule->discharge_transfer_schedule = '';\n\t\t\t $schedule->save();\n\t\t\t}\n\t\t\tfeedback()->conf(\"Discharge has been scheduled.\");\n\t\t\t$this->redirect(SITE_URL . \"/?page=facility&id={$facility->pubid}&action=manage_discharges\");\n\n\t\t\t\n\t\t\t// send notification\n\t\t\tCMS_Notify_Event::trigger(\"discharge_scheduled\", $schedule);\n\t\t\tfeedback()->conf(\"The discharge is complete for {$patient->first_name} {$patient->last_name}.\");\n\t\t\t$this->redirect(SITE_URL . \"/?page=facility&action=manage_discharges&facility={$facility->pubid}\");\n\t\t} catch (ORMException $e) {\n\t\t\tfeedback()->error(\"Unable to save discharge request.\");\n\t\t\t$this->redirect(SITE_URL . \"/?page=facility&action=discharge_details&schedule={$schedule->pubid}\");\n\t\t}\n\t\t\n\t}", "public function reject()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_CREATED) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_REJECTED;\n $this->withdrawal->save();\n // create a credit transaction on user account to return funds\n $accountService = new AccountService($this->withdrawal->account);\n $accountService->transaction($this->withdrawal, $this->withdrawal->amount);\n }\n }", "function mfcs_request_uncancel_0_form_submit($form, &$form_state) {\n $user = cf_current_user();\n\n $clicked_id = '';\n if (isset($form_state['triggering_element']['#id'])) {\n $clicked_id = $form_state['triggering_element']['#id'];\n }\n\n $request_id = (int) $form['form']['request_id']['#value'];\n\n if ($clicked_id == 'request-uncancel-submit-no') {\n if (empty($form_state['values']['redirect_to'])) {\n if (empty($request_id)) {\n $form_state['redirect'] = mfcs_build_redirect_array('requests');\n }\n else {\n $form_state['redirect'] = mfcs_build_redirect_array('requests/view-0/' . $request_id);\n }\n }\n else {\n $form_state['redirect'] = $form_state['values']['redirect_to'];\n }\n\n return;\n }\n\n mfcs_include(MFCS_INCLUDE_WORKFLOW);\n\n $previous = NULL;\n $uncancelled = TRUE;\n try {\n $query = db_select('mfcs_field_top_status', 'mfts');\n\n $query->fields('mfts');\n\n $query->condition('mfts.request_id', $request_id);\n $query->condition('mfts.revision', $form['form']['request']['#value']['current']['top']['status'], '<');\n $query->condition('mfts.value', MFCS_REQUEST_STATUS_CANCELLED, '<>');\n $query->condition('mfts.value', MFCS_REQUEST_STATUS_CLOSED_ACCEPTED_CANCELLED, '<>');\n\n $query->range(0, 1);\n $query->orderBy('mfts.revision', 'desc');\n\n $previous = $query->execute()->fetchAll();\n }\n catch (Error $e) {\n cf_error::on_query_execution($e);\n\n $uncancelled = FALSE;\n }\n catch (Exception $e) {\n cf_error::on_query_execution($e);\n\n $uncancelled = FALSE;\n }\n\n if (!isset($previous[0]) || !is_object($previous[0])) {\n $uncancelled = FALSE;\n }\n\n $extra = array();\n if (isset($form_state['values']['decision']['message'])) {\n $extra['revisions']['message'] = $form_state['values']['decision']['message'];\n }\n\n if ($uncancelled) {\n $uncancelled = mfcs_workflow_set_status($request_id, $previous[0]->value, NULL, $extra);\n }\n\n if ($uncancelled) {\n mfcs_workflow_step_review($request_id, $user, MFCS_REVIEW_DECISION_UNCANCEL, MFCS_REVIEW_RESTRICTIONS_NONE, $extra['revisions']['message']);\n\n $parameters = array();\n $parameters['changed_by'] = $user->uid;\n $parameters['changed_type'] = 'user';\n $parameters['uncancelled'] = TRUE;\n mfcs_send_workflow_emails($request_id, $parameters);\n\n // perform check against this request to see if new problems are detected or existing problems are resolved.\n mfcs_include(MFCS_INCLUDE_MISCELLANEOUS);\n mfcs_miscellaneous_check_requests_for_problems($request_id);\n }\n else {\n form_set_error('form', 'An error occurred while trying to uncancel the request. Please contact the support staff.');\n watchdog(MFCS_WATCHDOG_ID, 'An error occured while trying to uncancel the request: @request_id.', array('@request_id' => $request_id), WATCHDOG_ERROR);\n\n $form_state['rebuild'] = TRUE;\n $form_state['redirect'] = FALSE;\n $form_state['submitted'] = FALSE;\n\n return;\n }\n\n // assign auto_cancel locked code.\n $locked_object = mfcs_load_request_locks($request_id, array('auto_cancel'));\n if ($locked_object !== FALSE) {\n if ($locked_object === TRUE || is_null($locked_object->auto_cancel)) {\n // when auto_cancel is set to NULL (or is not defined), set it to TRUE.\n // once auto_cancel lock is TRUE, the auto_cancel process will no longer attempt to auto-cancel a given request.\n mfcs_set_request_locks($request_id, array('auto_cancel' => 't'));\n }\n }\n\n // redirect after submitting.\n if (empty($form_state['values']['redirect_to'])) {\n if (empty($request_id)) {\n $form_state['redirect'] = mfcs_build_redirect_array('requests');\n }\n else {\n $form_state['redirect'] = mfcs_build_redirect_array('requests/list-0');\n }\n }\n else {\n $form_state['redirect'] = $form_state['values']['redirect_to'];\n }\n}", "public function approveForm($burn_project_id)\n {\n\n $burn = fetch_row(\"SELECT project_name, project_number, status_id FROM burn_projects WHERE burn_project_id = $burn_project_id;\");\n\n if ($burn['status_id'] == 2) {\n // Under Review, it can be approved.\n $html = \"<div>\n <button class=\\\"btn btn-success btn-block\\\" onclick=\\\"BurnProjectReview.approve($burn_project_id)\\\">Approve <strong>\".$burn['project_number'].\"</strong></button>\n <button class=\\\"btn btn-default btn-block\\\" onclick=\\\"cancel_modal()\\\">Cancel</button>\n </div>\";\n } elseif ($burn['status_id'] == 3) {\n // Revision Requested. Check for edit.\n if ($this->reviewCheck($burn_project_id)) {\n $message = \"The burn plan has been edited since the last review but not re-submitted.\";\n $button = \"<button class=\\\"btn btn-default btn-block\\\" onclick=\\\"BurnProjectReview.notify($burn_project_id)\\\">Notify Submitter to Resubmit</button>\";\n } else {\n $message = \"The burn plan has not been edited since the last review.\";\n $button = \"<button class=\\\"btn btn-default btn-block\\\" onclick=\\\"BurnProjectReview.notify($burn_project_id)\\\">Notify Submitter to Revise</button>\";\n }\n\n $html = \"<div>\n <p class=\\\"text-center\\\">$message</p>\n $button\n <button class=\\\"btn btn-default btn-block\\\" onclick=\\\"cancel_modal()\\\">Cancel</button>\n </div>\";\n }\n\n return $html;\n }", "public function dismiss_request_api_notice() {\n\t\t\tupdate_option( 'wc_nps_show_request_api_notice', 'no' );\n\t\t}", "public function cutiFormApproval(){\n if(!$this->role->can(\"approval-vacation\")){\n redirectWithMessage([[ returnMessage()['vacationForm']['accessRight']['approval'] , 0]], getLastVisitedPage());\n }\n\n //get the id of the vacation data\n $idVacationForm = filterUserInput($_GET['v']);\n $approval = filterUserInput($_GET['a']);\n\n //check whether this account match with the person that should be approve this vacation data\n $thisAccount = substr($_SESSION['sim-id'], 3, -3);\n\n $builder = App::get('builder');\n $vacationData = $builder->getSpecificData('form_vacation', ['*'], ['id'=>$idVacationForm], '', 'Document');\n $accountShouldBeApprove = $vacationData[0]->approved_by;\n\n if($accountShouldBeApprove != $thisAccount){\n redirectWithMessage([[ returnMessage()['vacationForm']['accessRight']['specificApproval'] , 0]], getLastVisitedPage());\n }\n\n if($approval==0){\n //reject\n $updateApproval=2;\n }elseif($approval=1){\n //approved\n $updateApproval=1;\n }else{\n redirectWithMessage([['Maaf, terjadi kesalahan untuk proses persetujuan. Mohon ulangi lagi', 0]], getLastVisitedPage());\n }\n\n //update this vacation data as approved\n $approveThisVacationData = $builder->update(\"form_vacation\", ['approved'=>$updateApproval, 'updated_by'=>$thisAccount], ['id'=>$idVacationForm], '', 'Document');\n\n if(!$approveThisVacationData ){\n recordLog('Cuti', \"Approval data cuti gagal\");\n redirect(getLastVisitedPage());\n exit();\n }else{\n recordLog('Cuti', \"Approval data cuti berhasil\");\n }\n\n $builder->save();\n\n //redirect to form page with message\n redirectWithMessage([[ returnMessage()['vacationForm']['updateSuccess'], 1]], getLastVisitedPage());\n\n }", "private function approve() {\n\n }", "public function requestaCanceladmin()\n\t{\n\t\t$datas = self::$data;\n\t\t$this->create_history($this->input->post('contract_id'), 7, 'BY ADMIN : ' . html_escape($this->input->post('messagetoBuyer', true)), '');\n\t\t$this->change_contract_status($this->input->post('contract_id'), 7);\n\t\t$invoice_id \t= $this->database->_get_single_data('tbl_contracts', array('contract_id' => $contract_id), 'invoice_id');\n\t\t$this->_change_invoice_status($invoice_id, 3);\n\t\t$this->database->_update_to_table('tbl_disputes', array('status' => 1), array('contract_id' => $this->input->post('contract_id')));\n\t\tif ($datas['settings'][0]['email_notifications'] === '1') {\n\t\t\t$this->email_op->_user_email_notification('accept-cancel', $this->input->post('contract_id'));\n\t\t}\n\t\tredirect($this->session->userdata('url'));\n\t\treturn;\n\t}", "public function deny()\n {\n $this->transitionTo(ReservationState::DENIED);\n $this->removeFromCalendar();\n $this->sendDenialMessage();\n }", "public function notRequireAction(){\r\n \t\t\r\n \t\t/**\r\n \t\t * get form id\r\n \t\t */\r\n \t\t$form_id = $this->getAttribute('form_id');\r\n \t\t\r\n \t\t/**\r\n \t\t * get set_id\r\n \t\t */\r\n \t\t$set_id = $this->getAttribute('set_id');\r\n \t\t\r\n \t\t/**\r\n \t\t * get form entry id\r\n \t\t */\r\n \t\t$form_entry_id = $this->getAttribute('form_entry_id');\r\n \t\t\r\n \t\t/**\r\n \t\t * set as non display\r\n \t\t */\r\n \t\t$this->wpcms->requireChange($form_entry_id, 0, 'form_entry_tab');\t\t\r\n \t\t\r\n \t\t/**\r\n \t\t * page redirect list\r\n \t\t */\r\n \t\t$url_array = array(\r\n \t\t\t'form_set', 'index',\r\n \t\t\t'form_id',\tmake_id($form_id),\r\n \t\t\t//'set_id',\tmake_id($set_id),\r\n \t\t);\r\n \t\t$url = $this->makeUrl($url_array);\r\n \t\t$this->redirect($url);\r\n \t\t\r\n \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the call type for rule set ids
protected function getCallTypeByRuleSetIds($rule_set_ids) { $rule_set_in = implode(',', $rule_set_ids); $query = " SELECT rscpv.rule_set_id, rscpv.parm_value AS call_type FROM rule_set_component_parm_value AS rscpv JOIN rule_component AS rc ON rc.rule_component_id = rscpv.rule_component_id JOIN rule_component_parm AS rcp ON rcp.rule_component_parm_id = rscpv.rule_component_parm_id WHERE rscpv.rule_set_id IN ({$rule_set_in}) AND rc.name_short = 'datax_call_types' AND rcp.parm_name = 'teletrack_update' "; $results = $this->db->query($query); $call_type_values = array(); while ($row = $results->fetch()) { $call_type_values[$row['rule_set_id']] = $row['call_type']; } return $call_type_values; }
[ "public function getCallType();", "public function getCallSetId()\n {\n return $this->call_set_id;\n }", "public function getCallType()\n\t{\n\t\treturn $this->type;\n\t}", "public function getCallType()\n {\n if (array_key_exists(\"callType\", $this->_propDict)) {\n return $this->_propDict[\"callType\"];\n } else {\n return null;\n }\n }", "private function getCallTypes() {\n $db = Mage::getSingleton('core/resource')->getConnection('core_read');\n $sq = \"SELECT * FROM call_type\";\n $call_type_tmp = $db->fetchAll($sq);\n $call_type = array();\n foreach ($call_type_tmp as $d) {\n $call_type[$d['call_type_id']] = $d['name'];\n }\n return $call_type;\n }", "public static function getCallTypeFromSourceId($source_id)\n\t{\n\t\t$call_type = array_search($source_id, self::$source_ids);\n\t\t\n\t\tif (!$call_type)\n\t\t{\n\t\t\t$call_type = 'UNDEFINED';\n\t\t}\n\t\t\n\t\treturn $call_type;\n\t}", "public function getRuleTypeId()\n {\n return $this->iRuleTypeDatabaseId;\n }", "public function getResourceTypeId();", "public function getDataXCallType($loan_type_id)\n\t{\n\t\t$this->getBusinessRules($loan_type_id);\n\t\treturn $this->business_rules['IDV_CALL'];\n\t}", "public function getRuleType()\n {\n return $this->ruleType;\n }", "function getRuleType()\n {\n return $this->ruleType;\n }", "public function getLastCallType()\n {\n return $this->lastCallType;\n }", "private function getCSORuleSetIDs()\n\t\t{\n\t\t\t$query = \"\n\t\t\t-- eCash 3.5 : File: \" . __FILE__ . \", Method: \" . __METHOD__ . \", Line: \" . __LINE__ . \"\n\t\t\t\tSELECT \n\t\t\t\t\trs.rule_set_id\n\t\t\t\tFROM\n\t\t\t\t\trule_set_component_parm_value rscpv\n\t\t\t\tJOIN\n\t\t\t\t\trule_component_parm rcp ON rscpv.rule_component_parm_id = rcp.rule_component_parm_id\n\t\t\t\tJOIN\n\t\t\t\t\trule_set rs ON rscpv.rule_set_id = rs.rule_set_id\n\t\t\t\tJOIN \n\t\t\t\t\trule_component rc ON rcp.rule_component_id = rc.rule_component_id\n\t\t\t\tWHERE \n\t\t\t\t\trcp.parm_name = 'loan_type_model'\n\t\t\t\tAND\n\t\t\t\t\trscpv.parm_value = 'CSO'\n\t\t\t\";\n\t\t\n\t\t\t$result = $this->db->Query($query);\n\t\t\t$results = array();\n\n\t\t\twhile($row = $result->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$rule_sets[] = $row['rule_set_id'];\t\n\t\t\t}\n\n\t\t\treturn $rule_sets;\n\t\t}", "public function getRuleId();", "abstract public function getTypeId () : string;", "public function getMCallerIDSubaddrType()\n {\n return $this->getKey('MCallerIDSubaddrType');\n }", "public function idTypes();", "public function getLastCallConnectorType()\n {\n if ($this->getClientType() === 'SOAP') {\n if (in_array(strtolower($this->lastCallType), ['update'], true)) {\n return strtolower($this->lastCallType);\n }\n switch (strtolower($this->lastCallEndpoint)) {\n case 'getdata':\n case 'getdatawithoptions':\n return 'get';\n\n case 'getattachment':\n return 'subject';\n\n case 'generateotp':\n return 'token';\n\n case 'getproductversion':\n return 'versioninfo';\n }\n // We're assuming endpoint 'Execute'.\n $args = array_change_key_case($this->lastCallArguments);\n if (!empty($args['reportid'])) {\n return 'report';\n }\n if (!empty($args['subjectid'])) {\n return 'subject';\n }\n if (!empty($args['dataid'])) {\n // The only possible value for a Data Connector is\n // 'GetXmlSchema' but we'll always return 'data' here.\n return 'data';\n }\n return '?';\n } else {\n // REST client.\n if (strtolower($this->lastCallType) !== 'get') {\n return 'update';\n }\n $endpoint = strtolower($this->lastCallEndpoint);\n $pos = strpos($endpoint, '/');\n if ($pos === false) {\n // The only endpoint we know here is 'profitversion'.\n return $endpoint === 'profitversion' ? 'versioninfo' : $endpoint;\n }\n $connector_type = substr($endpoint, 0, $pos);\n if ($connector_type === 'connectors') {\n return 'get';\n }\n if (substr($connector_type, -9) === 'connector') {\n // e.g. subject, report\n return strpos($connector_type, 0, strlen($connector_type) - 9);\n }\n // The only endpoint we know here is 'metainfo'.\n return $connector_type === 'metainfo' ? 'data' : $connector_type;\n }\n }", "public function getIdType()\n {\n\n return $this->id_type;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of Adjoints
public function getAdjoints() { return $this->adjoints; }
[ "public function getValueRelation();", "public function getAdjective()\n {\n return static::randomElement($this->getAdjectives());\n }", "public function getMandatPieceJointeDads() {\n return $this->mandatPieceJointeDads;\n }", "public function getValue();", "public function getJoiningValue()\n {\n if (array_key_exists(\"joiningValue\", $this->_propDict)) {\n return $this->_propDict[\"joiningValue\"];\n } else {\n return null;\n }\n }", "public function getObjectiveValue()\n {\n return $this->objective_value;\n }", "public function getPieceJointe()\n {\n return $this->pieceJointe;\n }", "public function getSimpleValue()\n {\n return $this->child->getAttribute($this->getForeignKeyName());\n }", "public function getAttenuation();", "public function getPieceJointe() {\n return $this->pieceJointe;\n }", "public function getValue(){\n return $this->value2 ? $this->value2 : $this->value1;\n }", "public function getAttorney()\n {\n return $this->get(self::ATTORNEY);\n }", "public function getA()\n {\n return $this->a;\n }", "public function getAdjunto()\n {\n return $this->adjunto;\n }", "public function getAdResult()\n {\n return $this->readOneof(49);\n }", "public function getMandatPieceJointeDucsedi() {\n return $this->mandatPieceJointeDucsedi;\n }", "public function getPiecesJointes();", "public function getTarget()\n\t{\n\t\t$id=$this->id;\n\t\t$sql=\"SELECT IF(SUM(target) IS NULL, 0, SUM(target)) AS val FROM participant WHERE kegiatan=$id\";\n\t\treturn Yii::app()->db->createCommand($sql)->queryScalar();\n\t}", "public function adjectives(): array;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Setup replies collection data ticket data is in registry, loaded by ticket view content block
protected function setupReplies() { $ticket = Mage::registry('ticket'); if($ticket) { $ticketId = $ticket->getTicketId(); if ($ticketId > 0) { $this->_replies = Mage::getModel('inchoo_ticket/reply') ->getCollection() ->setOrder('reply_id','DESC') ->addFilter('ticket_id', $ticketId); } } }
[ "function set_ticket_data() {\n\n // Get codeigniter object instance\n $CI = &get_instance();\n\n // Verify if ticket's ID is numeric\n if ( is_numeric( $CI->input->get('ticket', true) ) ) {\n\n // Get ticket\n $ticket = $CI->tickets_model->get_ticket($CI->input->get('ticket', true));\n\n // If ticket exists will be added ticket in the queue\n if ( $ticket ) {\n\n // Add the ticket in the queue\n md_set_component_variable('support_single_ticket', $ticket);\n\n // Get ticket's replies\n $replies = $CI->tickets_model->get_ticket_replies($CI->input->get('ticket', true));\n\n // Verify if the ticket has replies\n if ( $replies ) {\n\n // Add the ticket's replies in the queue\n md_set_component_variable('support_single_ticket_replies', $replies);\n \n }\n\n }\n\n }\n \n }", "public function load_ticket_replies() {\n\n // Check if data was submitted\n if ( $this->CI->input->post() ) {\n\n // Add form validation\n $this->CI->form_validation->set_rules('ticket_id', 'Ticket ID', 'trim|integer|required');\n \n $ticket_id = $this->CI->input->post('ticket_id');\n\n // Check form validation\n if ($this->CI->form_validation->run() !== false ) {\n\n // Gets ticket's replies\n $replies = $this->CI->tickets_model->get_ticket_replies($ticket_id);\n\n if ($replies) {\n\n $data = array(\n 'success' => TRUE,\n 'content' => $replies,\n 'cdate' => time()\n );\n\n echo json_encode($data);\n\n } else {\n\n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('ticket_no_replies_found')\n );\n\n echo json_encode($data);\n\n }\n\n }\n\n }\n\n }", "public function initTicketsRelatedByUserId()\n\t{\n\t\t$this->collTicketsRelatedByUserId = array();\n\t}", "public function load_tickets() {\n \n // Load tickets by page\n (new MidrubBaseAdminCollectionSupportHelpers\\Tickets)->load_tickets();\n \n }", "function initData() {\n\t\tAppLocale::requireComponents(LOCALE_COMPONENT_APP_DEFAULT, LOCALE_COMPONENT_PKP_SUBMISSION);\n\n\t\t$monograph = $this->getMonograph();\n\t\t$this->setData('submissionId', $monograph->getId());\n\n\t\t$chapter = $this->getChapter();\n\t\tif ($chapter) {\n\t\t\t$this->setData('chapterId', $chapter->getId());\n\t\t\t$this->setData('title', $chapter->getTitle());\n\t\t\t$this->setData('subtitle', $chapter->getSubtitle());\n\t\t} else {\n\t\t\t$this->setData('title', null);\n\t\t\t$this->setData('subtitle', null);\n\t\t}\n\t}", "function the_ticket_replies() {\n\n // Get ticket's replies\n $replies = md_the_component_variable('support_single_ticket_replies');\n\n // Verify if ticket has replies\n if ( $replies ) {\n return $replies;\n } else {\n return false;\n }\n \n }", "private function seedDemoReplies($tickets)\n {\n $bodies = json_decode($this->fs->get(database_path('seeds/demo/demo-reply-bodies.json')), true);\n $agent = $this->user->where('email', 'agent@demo.com')->first();\n\n $replies = $tickets->map(function (Ticket $ticket) use ($bodies, $agent) {\n return collect($bodies)->random(10)->map(function ($body, $index) use ($ticket, $agent) {\n $isEven = $index % 2 == 0;\n $date = Carbon::now()->addHours(rand(-1, -24));\n\n return [\n 'body' => $body,\n 'user_id' => ($isEven ? $agent->id : $ticket->user_id),\n 'ticket_id' => $ticket->id,\n 'created_at' => $date,\n 'updated_at' => $date,\n ];\n });\n })->flatten(1)->toArray();\n\n $this->reply->insert($replies);\n }", "function initData() {\n\t\tif ($this->reviewFormId != null) {\n\t\t\t$conference =& Request::getConference();\n\t\t\t$reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO');\n\t\t\t$reviewForm =& $reviewFormDao->getReviewForm($this->reviewFormId, ASSOC_TYPE_CONFERENCE, $conference->getId());\n\n\t\t\tif ($reviewForm == null) {\n\t\t\t\t$this->reviewFormId = null;\n\t\t\t} else {\n\t\t\t\t$this->_data = array(\n\t\t\t\t\t'title' => $reviewForm->getTitle(null), // Localized\n\t\t\t\t\t'description' => $reviewForm->getDescription(null), // Localized\n 'templateForDirector' => $reviewForm->getTemplateForDirector(null), // Localized\n 'templateSurvey' => $reviewForm->getTemplateSurvey(null) // Localized\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function initRespostaForums($overrideExisting = true)\n\t{\n\t\tif (null !== $this->collRespostaForums && !$overrideExisting) {\n\t\t\treturn;\n\t\t}\n\t\t$this->collRespostaForums = new PropelObjectCollection();\n\t\t$this->collRespostaForums->setModel('RespostaForum');\n\t}", "public function __construct()\n {\n $this->tickets = array();\n }", "public function testCollectionTicketCommentsAdd()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function initRecibos()\n\t{\n\t\t$this->collRecibos = array();\n\t}", "function initData() {\n\t\tif ($this->reviewFormElementId != null) {\n\t\t\t$journal =& Request::getJournal();\n\t\t\t$reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO');\n\t\t\t$reviewFormElement =& $reviewFormElementDao->getReviewFormElement($this->reviewFormElementId);\n\n\t\t\tif ($reviewFormElement == null) {\n\t\t\t\t$this->reviewFormElementId = null;\n\t\t\t\t$this->_data = array(\n\t\t\t\t\t'included' => 1\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$this->_data = array(\n\t\t\t\t\t'question' => $reviewFormElement->getQuestion(null), // Localized\n\t\t\t\t\t'required' => $reviewFormElement->getRequired(),\n\t\t\t\t\t'included' => $reviewFormElement->getIncluded(),\n\n\t\t\t\t\t'elementType' => $reviewFormElement->getElementType(),\n\t\t\t\t\t'possibleResponses' => $reviewFormElement->getPossibleResponses(null) //Localized\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function initAvaliacaoRespostaForums($overrideExisting = true)\n\t{\n\t\tif (null !== $this->collAvaliacaoRespostaForums && !$overrideExisting) {\n\t\t\treturn;\n\t\t}\n\t\t$this->collAvaliacaoRespostaForums = new PropelObjectCollection();\n\t\t$this->collAvaliacaoRespostaForums->setModel('AvaliacaoRespostaForum');\n\t}", "public function replies_for_graph() {\n\n // Load replies for graph\n (new MidrubBaseUserAppsCollectionChatbotHelpers\\Replies)->replies_for_graph();\n\n }", "protected function _initCollection()\n {\n $entity = ucfirst($this->_getRequestData('entity'));\n $className = str_replace(self::ENTITY_PLACEHOLDER, $entity, self::COLLECTION_CLASS_TEMPLATE);\n $collection = new $className($this->_getDataContainer(self::DC_MODEL));\n $this->_addDataContainer(self::DC_COLLECTION, $collection);\n }", "public function initQuestionOffensives()\n\t{\n\t\t$this->collQuestionOffensives = array();\n\t}", "public function replies() {\n return $this->hasMany('App\\Models\\TicketReply', 'ticketreply_ticketid', 'ticket_id');\n }", "public function update_reply() {\n\n // Update reply\n (new MidrubBaseUserAppsCollectionChatbotHelpers\\Replies)->update_reply();\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make sure the addresses belong to this collection only, so they will never be modified
protected function createPrivateAddresses() { $this->ensureNotLocked(); if (!$this->id) { throw new \UnderflowException('Product collection must be saved before creating unique addresses.'); } $canSkip = StringUtil::deserialize($this->iso_checkout_skippable, true); $objBillingAddress = $this->getBillingAddress(); $objShippingAddress = $this->getShippingAddress(); // Store address in address book if ($this->iso_addToAddressbook && $this->member > 0) { if (null !== $objBillingAddress && $objBillingAddress->ptable != MemberModel::getTable() && !\in_array('billing_address', $canSkip, true) ) { $objAddress = clone $objBillingAddress; $objAddress->pid = $this->member; $objAddress->tstamp = time(); $objAddress->ptable = MemberModel::getTable(); $objAddress->store_id = $this->store_id; $objAddress->save(); $this->updateDefaultAddress($objAddress); } if (null !== $objBillingAddress && null !== $objShippingAddress && $objBillingAddress->id != $objShippingAddress->id && $objShippingAddress->ptable != MemberModel::getTable() && !\in_array('shipping_address', $canSkip, true) ) { $objAddress = clone $objShippingAddress; $objAddress->pid = $this->member; $objAddress->tstamp = time(); $objAddress->ptable = MemberModel::getTable(); $objAddress->store_id = $this->store_id; $objAddress->save(); $this->updateDefaultAddress($objAddress); } } /** @var Config $config */ $config = $this->getRelated('config_id'); $billingFields = (null === $config) ? array() : $config->getBillingFields(); $shippingFields = (null === $config) ? array() : $config->getShippingFields(); if (null !== $objBillingAddress && ($objBillingAddress->ptable != static::$strTable || $objBillingAddress->pid != $this->id) ) { $arrData = array_intersect_key( $objBillingAddress->row(), array_merge(array_flip($billingFields), ['country' => '']) ); $objNew = new Address(); $objNew->setRow($arrData); $objNew->pid = $this->id; $objNew->tstamp = time(); $objNew->ptable = static::$strTable; $objNew->store_id = $this->store_id; $objNew->save(); $this->setBillingAddress($objNew); if (null !== $objShippingAddress && $objBillingAddress->id == $objShippingAddress->id) { $this->setShippingAddress($objNew); // Stop here, we do not need to check shipping address return; } } if (null !== $objShippingAddress && ($objShippingAddress->ptable != static::$strTable || $objShippingAddress->pid != $this->id) ) { $arrData = array_intersect_key( $objShippingAddress->row(), array_merge(array_flip($shippingFields), ['country' => '']) ); $objNew = new Address(); $objNew->setRow($arrData); $objNew->pid = $this->id; $objNew->tstamp = time(); $objNew->ptable = static::$strTable; $objNew->store_id = $this->store_id; $objNew->save(); $this->setShippingAddress($objNew); } elseif (null === $objShippingAddress) { // Make sure to set the shipping address to null if collection has no shipping // see isotope/core#2014 $this->setShippingAddress(null); } }
[ "private function createAddressesCollection()\n {\n $this->addresses = new Addresses($this->connection);\n }", "private function ignoreAddressValidation()\n {\n $this->quote->getBillingAddress()->setShouldIgnoreValidation(true);\n if (!$this->quote->getIsVirtual()) {\n $this->quote->getShippingAddress()->setShouldIgnoreValidation(true);\n }\n }", "public function RemoveDuplicateAddresses() {\n\t\t\t/*\n\t\t\t * 1) Obtain household/s of the person.\n\t\t\t * 2) For each household, check for duplication of addresses\n\t\t\t * 3) If duplication found, remove.\n\t\t\t */\t\n\t\t\tif (!$this->__get('_HouseholdParticipation')){\n\t\t\t\t$objHouseholdArray = $this->__get('_HouseholdParticipationArray');\n\t\t\t\tforeach ($objHouseholdArray as $objHousehold) {\n\t\t\t\t\t$objAddressArray = $objHousehold->GetAddressArray();\n\t\t\t\t\t$this->RemoveRedundantAddresses($objAddressArray);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->RemoveRedundantAddresses($this->__get('_HouseholdParticipation'));\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t* 1) Get all addresses, both personal and associated households\n\t\t\t* 2) check for duplication of addresses\n\t\t\t* 3) If duplication found, remove. When removing, always remove personal before houshold\n\t\t\t*/\n\t\t\t$objAddressArray = $this->GetAllAssociatedAddressArray(null,false);\n\t\t\t$this->RemoveRedundantAddresses($objAddressArray);\n\t\t}", "private function ignoreAddressValidation()\n {\n $this->_quote->getBillingAddress()->setShouldIgnoreValidation(true);\n if (!$this->_quote->getIsVirtual()) {\n $this->_quote->getShippingAddress()->setShouldIgnoreValidation(true);\n }\n }", "public function testCollectionAddressReturnFalse(){\n $this->assertFalse($this->_consignment->getCollectionAddress(), 'Consignment should be returning false');\n }", "public function ClearAddresses()\n {\n $this->addresses = array();\n }", "protected function checkAddressDuplicates()\n {\n return true;\n }", "public function getAddressCollection()\n {\n return Mage::getResourceModel('customer/address_collection');\n }", "private function checkSchoolsWithoutAddresses()\n {\n if (!$this->getConfirmation('Check for open schools without addresses?')) {\n return;\n }\n\n $this->checkForEmptyField(\n $this->schools,\n 'school',\n 'Checking for open schools without addresses...',\n 'address'\n );\n }", "public function getItemsCollection()\n {\n if (is_null($this->_items)) {\n $this->_items = Mage::getModel('sales/quote_address_item')->getCollection()\n ->setAddressFilter($this->getId());\n\n if ($this->getId()) {\n foreach ($this->_items as $item) {\n $item->setAddress($this);\n }\n }\n }\n return $this->_items;\n }", "public function getAddressesCollection()\n {\n if (is_null($this->_addresses)) {\n $this->_addresses = Mage::getModel('sales/quote_address')->getCollection()\n ->setQuoteFilter($this->getId());\n\n if ($this->getId()) {\n foreach ($this->_addresses as $address) {\n $address->setQuote($this);\n }\n }\n }\n return $this->_addresses;\n }", "private function _saveAddress()\n\t {\n\t\t$slicer = new AddressSlicer($this->_advert->city . \", \" . $this->_advert->address);\n\n\t\tif ($slicer->valid() === true && isset($this->_advert->phone) === true)\n\t\t {\n\t\t\t$hash = sha1($slicer->hash . $this->_advert->phone);\n\t\t\tif ($this->_exists(\"addresses\", $hash) === false)\n\t\t\t {\n\t\t\t\t$this->_db->exec(\"INSERT INTO `addresses` SET \" .\n\t\t\t\t \"`city` = '\" . $this->_advert->city . \"', \" .\n\t\t\t\t \"`hash` = '\" . $hash . \"', \" .\n\t\t\t\t \"`address` = '\" . $slicer->address . \"', \" .\n\t\t\t\t \"`phone` = '\" . $this->_advert->phone . \"'\"\n\t\t\t\t);\n\t\t\t } //end if\n\n\t\t }\n\t\telse if (isset($this->_advert->phone) === true)\n\t\t {\n\t\t\t$hash = sha1($this->_advert->city . \", \" . $this->_advert->address . $this->_advert->phone);\n\t\t\tif ($this->_exists(\"addresses\", $hash) === false)\n\t\t\t {\n\t\t\t\t$this->_db->exec(\"INSERT INTO `addresses` SET \" .\n\t\t\t\t \"`city` = '\" . $this->_advert->city . \"', \" .\n\t\t\t\t \"`hash` = '\" . $hash . \"', \" .\n\t\t\t\t \"`address` = '\" . $this->_advert->address . \"', \" .\n\t\t\t\t \"`phone` = '\" . $this->_advert->phone . \"'\"\n\t\t\t\t);\n\t\t\t } //end if\n\n\t\t } //end if\n\n\t }", "function &getAddresses() { return $this->addresses; }", "public function testCanGetAddressCollectionAsArray()\n {\n $addressCollection = new AddressCollection();\n $address = mockery::mock(Address::class);\n $address->shouldReceive('toArray')->andReturn([]);\n\n $addressCollection->append($address);\n\n $this->assertCount(1, $addressCollection->toArray());\n\n }", "protected function removeInvalidAdresses()\n {\n //This resulted array should be repeated fields removed\n //and all not valid strings, and also trim and strtolower strings\n $this->addresses = array_unique($this->addresses);\n $this->addresses = array_map(array($this, 'clearAddressString'), $this->addresses);\n $this->addresses = array_filter($this->addresses, array($this, 'checkEmailAddress'));\n }", "public function initAddresses($overrideExisting = true)\n {\n if (null !== $this->collAddresses && !$overrideExisting) {\n return;\n }\n $this->collAddresses = new ObjectCollection();\n $this->collAddresses->setModel('\\MocApi\\Models\\Address');\n }", "public function requiresAddress()\n {\n return false;\n }", "public function address()\n {\n return $this->has_many('Address');\n }", "public function testGetUserAddressesCorrenctInput()\n { // testing with existing data\n $myUtils = oxUtils::getInstance();\n $myDB = oxDb::getDB();\n $myConfig = oxConfig::getInstance();\n\n $sUserID = $this->_aUsers[ $this->_aShops[ rand(0, count( $this->_aShops ) - 1 ) ] ][ rand( 0, count( $this->_aUsers[ 0 ] ) - 1 ) ];\n $oUser = new oxuser();\n $oAddress = $oUser->getUserAddresses( $sUserID );\n\n // each new created user is assigned to 1 new created address\n $sAddressId = $myDB->getOne('select oxid from oxaddress where oxuserid=\"'.$sUserID.'\"');\n $this->assertEquals( true, isset( $oAddress[$sAddressId] ) );\n\n $oAddress = $oUser->getUserAddresses( 'xxx' );\n $this->assertEquals( 0, count( $oAddress ) );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Total number of conversations used to generate this metric. Generated from protobuf field int64 conversation_count = 3;
public function getConversationCount() { return $this->conversation_count; }
[ "public function setConversationCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->conversation_count = $var;\n\n return $this;\n }", "public function getAnalyzedConversationsCount()\n {\n return $this->analyzed_conversations_count;\n }", "public function getConversationStateCount()\n {\n return $this->count(self::CONVERSATION_STATE);\n }", "public static function get_conversation_counts_returns() {\n return new external_single_structure(\n [\n 'favourites' => new external_value(PARAM_INT, 'Total number of favourite conversations'),\n 'types' => new external_single_structure(\n [\n \\core_message\\api::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL => new external_value(PARAM_INT,\n 'Total number of individual conversations'),\n \\core_message\\api::MESSAGE_CONVERSATION_TYPE_GROUP => new external_value(PARAM_INT,\n 'Total number of group conversations'),\n \\core_message\\api::MESSAGE_CONVERSATION_TYPE_SELF => new external_value(PARAM_INT,\n 'Total number of self conversations'),\n ]\n ),\n ]\n );\n }", "public function getTeamsChannelMessagesCount()\n {\n if (array_key_exists(\"teamsChannelMessagesCount\", $this->_propDict)) {\n return $this->_propDict[\"teamsChannelMessagesCount\"];\n } else {\n return null;\n }\n }", "public static function messagecount() {\n\t\t$messages = DB::table('messages')->where('receiver_id', Auth::id())->where('is_read', \"No\")->get();\n\t\t$replies = DB::table('replies')->where('receiver_id', Auth::id())->where('is_read', \"No\")->get();\n\t\t$icebreakers = DB::table('icebreakers')->where('receiver_id', Auth::id())->where('question1_answer', NULL)->get();\n\t\t$total = [];\n\n\t\tif($messages != null) {\n\t\t\tforeach($messages as $message) {\n\t\t\t\tarray_push($total, 1);\n\t\t\t}\n\t\t}\n\t\tif($replies != null) {\n\t\t\tforeach($replies as $reply) {\n\t\t\t\tarray_push($total, 1);\n\t\t\t}\n\t\t}\n\n\t\tif($icebreakers != null) {\n\t\t\tforeach($icebreakers as $ice) {\n\t\t\t\tarray_push($total, 1);\n\t\t\t}\n\t\t}\n\t\treturn count($total);\n\n\t\t// if($messages == null) {\n\t\t// return \"0\";\n\t\t// } else {\n\t\t// \tif($replies == null) {\n\t\t// \t\treturn count($messages);\n\t\t// \t} else {\n\t\t// \t\treturn (count($messages) + count($replies));\n\t\t// \t}\n\t\t// }\n\t}", "public function messageCount(): int\n {\n return $this->pluck('messageCount') ?? 0;\n }", "public static function count()\n {\n return count(Session::instance()->get('messages'));\n }", "public function getLabeledConversationsCount()\n {\n return $this->labeled_conversations_count;\n }", "public function setAnalyzedConversationsCount($var)\n {\n GPBUtil::checkInt64($var);\n $this->analyzed_conversations_count = $var;\n\n return $this;\n }", "public function outboundChannelCount();", "public function count() {\n return count($this->messages);\n }", "public static function get_number_of_messages () {\r\n\t\t$table_message = Database::get_main_table(TABLE_MESSAGE); \r\n\t\t$sql_query = \"SELECT COUNT(*) as number_messages FROM $table_message WHERE msg_status IN (0,1) AND user_receiver_id=\".api_get_user_id();\r\n\t\t$sql_result = api_sql_query($sql_query,__FILE__,__LINE__);\r\n\t\t$result = Database::fetch_array($sql_result);\r\n\t\treturn $result['number_messages'];\r\n\t}", "public function messagesCount()\n {\n return $this->hasOne(Message::class, 'campaign_id')\n ->selectRaw('campaign_id, count(*) as count')\n ->groupBy('campaign_id');\n }", "public static function get_unread_conversations_count_returns() {\n return new external_value(PARAM_INT, 'The count of unread messages for the user');\n }", "public function getCount()\n\t{\n\t\treturn (int) get_option( 'gs_messages_per_page' );\n\t}", "public function getStatsConversationsTotal()\n {\n\n return $this->stats_conversations_total;\n }", "public function getConversationCountTimeSeries()\n {\n return $this->conversation_count_time_series;\n }", "public function getParticipantsCount(): int;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }