query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
listlengths 0
30
| negative_scores
listlengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Operation deleteMetaformAsyncWithHttpInfo Deletes Metaform
|
public function deleteMetaformAsyncWithHttpInfo($realmId, $metaformId)
{
$returnType = '';
$request = $this->deleteMetaformRequest($realmId, $metaformId);
return $this->client
->sendAsync($request)
->then(
function ($response) use ($returnType) {
return [null, $response->getStatusCode(), $response->getHeaders()];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function deleteMetaformWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '';\n $request = $this->deleteMetaformRequest($realmId, $metaformId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\NotFound',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function restStorageLayoutDeleteAsyncWithHttpInfo($key_list)\n {\n $returnType = 'object';\n $request = $this->restStorageLayoutDeleteRequest($key_list);\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 delete_meta()\n {\n # process the request which it must be post and ajax request\n if (request()->isPost() && request()->isAjax()) {\n \n $objectId = request()->getPost('object-id', 'int');\n $object = request()->getPost('object', 'alphanum');\n \n $this->setJsonResponse();\n\n $object = PostMeta::findFirstByMeta_id($objectId);\n\n if(!$object) {\n $this->jsonMessages['messages'][] = [\n 'type' => 'warning',\n 'content' => 'Object not found!'\n ];\n return $this->jsonMessages;\n }\n $object->delete();\n\n \n $this->jsonMessages['messages'][] = [\n 'type' => 'success',\n 'content' => 'Object has been deleted!'\n ];\n return $this->jsonMessages;\n \n\n }\n }",
"public function deleteIdentityprovidersAdfsAsyncWithHttpInfo()\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\ModelEmpty';\n $request = $this->deleteIdentityprovidersAdfsRequest();\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 restStorageFrontendFileDeleteAsyncWithHttpInfo($key)\n {\n $returnType = 'object';\n $request = $this->restStorageFrontendFileDeleteRequest($key);\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 restStorageFrontendFilesDeleteAsyncWithHttpInfo($key_list)\n {\n $returnType = 'object';\n $request = $this->restStorageFrontendFilesDeleteRequest($key_list);\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 deleteMeasurementAsyncWithHttpInfo($body)\n {\n $returnType = '\\CureDAO\\Client\\Models\\CommonResponse';\n $request = $this->deleteMeasurementRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function deleteVoicemailMessagesAsyncWithHttpInfo()\n {\n $returnType = '';\n $request = $this->deleteVoicemailMessagesRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function deletemeta($meta) {\n\t\tif ($this->req ['auth_type'] == 'oauth') {\n\t\t\tif (( int ) $meta == 0) {\n\t\t\t\t$oRow = $this->oMetas->getById ( $meta );\n\t\t\t\tif (is_array ( $oRow )) {\n\t\t\t\t\t$meta = ( int ) $oRow ['idmeta'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (( int ) $meta > 0) {\n\t\t\t\t\n\t\t\t\t$oTableCompMetas = new Application_Model_Table ();\n\t\t\t\t$oTableCompMetas->setTable ( 'comp_metas' );\n\t\t\t\t$oTableCompMetas->setPrimary ( 'idcomp_meta' );\n\t\t\t\t$oSelect = $oTableCompMetas->fetchAll ( $oTableCompMetas->select ()->from ( $oTableCompMetas->getTable () )->where ( 'metas_idmeta=' . ( int ) $meta ) );\n\t\t\t\tif (isset ( $_GET ['force'] ) && $_GET ['force'] == 'yes') {\n\t\t\t\t\tif ($this->isExtendable ()) {\n\t\t\t\t\t\tif ($this->oMetas->deleteMeta ( $meta )) {\n\t\t\t\t\t\t\t$iGiveBudgetBack = $this->usr;\n\t\t\t\t\t\t\tif (isset ( $oRowToDelete->accounts_idaccount ) && ( int ) $oRowToDelete->accounts_idaccount > 0) {\n\t\t\t\t\t\t\t\t$iIdCreator = ( int ) $oRowToDelete->accounts_idaccount;\n\t\t\t\t\t\t\t\t$iGiveBudgetBack = ($iIdCreator > 0) ? $iIdCreator : $iGiveBudgetBack;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->setUsage ( $iGiveBudgetBack, array ('maxmetas' => - 1 ) );\n\t\t\t\t\t\t\t$this->addEntry ( 'response', array ('meta' => $meta, 'message' => 'META_WAS_DELETED', 'comps_affected' => ( int ) $oSelect->count () ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'MISSING_EXTEND_RIGHT' ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->isDeleteable ()) {\n\t\t\t\t\t\tif ($oSelect->count () == 0) {\n\t\t\t\t\t\t\t$oRowToDelete = $this->oMetas->fetchRow ( $this->oMetas->select ()->where ( $this->oMetas->getPrimary () . '=' . $meta ) );\n\t\t\t\t\t\t\tif ($this->oMetas->deleteMeta ( $meta )) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$iGiveBudgetBack = $this->usr;\n\t\t\t\t\t\t\t\tif (isset ( $oRowToDelete->accounts_idaccount ) && ( int ) $oRowToDelete->accounts_idaccount > 0) {\n\t\t\t\t\t\t\t\t\t$iIdCreator = ( int ) $oRowToDelete->accounts_idaccount;\n\t\t\t\t\t\t\t\t\t$iGiveBudgetBack = ($iIdCreator > 0) ? $iIdCreator : $iGiveBudgetBack;\n\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\t$this->setUsage ( $iGiveBudgetBack, array ('maxmetas' => - 1 ) );\n\t\t\t\t\t\t\t\t$this->addEntry ( 'response', array ('meta' => $meta, 'message' => 'META_WAS_DELETED' ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'META_IN_TOUCH_WITH_COMPOSITE' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'MISSING_DELETE_RIGHT' ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'META_NOT_FOUND' ) );\n\t\t\t}\n\t\t} else {\n\t\t\t$this->addEntry ( 'response', $this->oError->throwError ( 'OAUTH_ACCESS_ONLY' ) );\n\t\t}\n\t\treturn $this->getResponse ();\n\t}",
"public function restNewslettersDeleteAsyncWithHttpInfo()\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Entry[]';\n $request = $this->restNewslettersDeleteRequest();\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 deleteStoreAsyncWithHttpInfo($options)\n {\n $returnType = '';\n $request = $this->deleteStoreRequest($options);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function jobTemplateDeleteAsyncWithHttpInfo($project_id, $id, $x_phrase_app_otp = null, $branch = null)\n {\n $returnType = '';\n $request = $this->jobTemplateDeleteRequest($project_id, $id, $x_phrase_app_otp, $branch);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function deleteTranscoderStreamNameGroupAppConfigAsyncWithHttpInfo($server_name, $vhost_name, $template_name, $group_name, $app_name)\n {\n $returnType = '';\n $request = $this->deleteTranscoderStreamNameGroupAppConfigRequest($server_name, $vhost_name, $template_name, $group_name, $app_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function deleteTranscoderTemplateAppConfigAsyncWithHttpInfo($server_name, $vhost_name, $template_name, $app_name)\n {\n $returnType = '';\n $request = $this->deleteTranscoderTemplateAppConfigRequest($server_name, $vhost_name, $template_name, $app_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function deleteRateLimiterAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\InlineResponse200';\n $request = $this->deleteRateLimiterRequest($options);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function restStoragePluginsInboxDeleteAsyncWithHttpInfo($key_list)\n {\n $returnType = 'object';\n $request = $this->restStoragePluginsInboxDeleteRequest($key_list);\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 }",
"function acf_delete_metadata($post_id = 0, $name = '', $hidden = \\false)\n{\n}",
"public function restNewslettersFoldersDeleteAsyncWithHttpInfo()\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Folder[]';\n $request = $this->restNewslettersFoldersDeleteRequest();\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 }",
"protected function deleteMetaformRequest($realmId, $metaformId)\n {\n // verify the required parameter 'realmId' is set\n if ($realmId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $realmId when calling deleteMetaform'\n );\n }\n // verify the required parameter 'metaformId' is set\n if ($metaformId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $metaformId when calling deleteMetaform'\n );\n }\n\n $resourcePath = '/realms/{realmId}/metaforms/{metaformId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($realmId !== null) {\n $resourcePath = str_replace(\n '{' . 'realmId' . '}',\n ObjectSerializer::toPathValue($realmId),\n $resourcePath\n );\n }\n // path params\n if ($metaformId !== null) {\n $resourcePath = str_replace(\n '{' . 'metaformId' . '}',\n ObjectSerializer::toPathValue($metaformId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=utf-8'],\n ['application/json;charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function deleteLogLogentriesAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\InlineResponse200';\n $request = $this->deleteLogLogentriesRequest($options);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function deleteVoicemailMessageAsyncWithHttpInfo($messageId)\n {\n $returnType = '';\n $request = $this->deleteVoicemailMessageRequest($messageId);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function deleteIdentityprovidersCicAsyncWithHttpInfo()\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\ModelEmpty';\n $request = $this->deleteIdentityprovidersCicRequest();\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 }",
"function wp_ajax_delete_meta()\n {\n }",
"public function deleteMetaformAsync($realmId, $metaformId)\n {\n return $this->deleteMetaformAsyncWithHttpInfo($realmId, $metaformId)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"private function createDeleteForm(Metas $meta)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_crud_metas_delete', array('id' => $meta->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"public function deleteAsync(array $params = [])\n {\n return $this->handleMiddleware('delete', $params, function(MiddlewareRequest $request) {\n $params = $request->getApiMethodArguments();\n $data = $params;\n $response = $this->apiInstance->adcreativesDeleteAsync($data);\n return $response;\n });\n }",
"public function deleteWebhookByUrlAsyncWithHttpInfo($webhook)\n {\n $returnType = '\\ultracart\\v2\\models\\WebhookResponse';\n $request = $this->deleteWebhookByUrlRequest($webhook);\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 deleteApplicationAsyncWithHttpInfo($child_app_id)\n {\n $returnType = '';\n $request = $this->deleteApplicationRequest($child_app_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function deleteIdentityprovidersOktaAsyncWithHttpInfo()\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\ModelEmpty';\n $request = $this->deleteIdentityprovidersOktaRequest();\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 deleteIdentityprovidersSalesforceAsyncWithHttpInfo()\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\ModelEmpty';\n $request = $this->deleteIdentityprovidersSalesforceRequest();\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 }"
] |
[
"0.5838819",
"0.57411635",
"0.565875",
"0.56485075",
"0.55183464",
"0.5459609",
"0.5349008",
"0.5292359",
"0.5291271",
"0.527724",
"0.5269566",
"0.5264639",
"0.52588284",
"0.5251706",
"0.5244345",
"0.519797",
"0.5179577",
"0.51739717",
"0.51440215",
"0.5141018",
"0.5140271",
"0.51022804",
"0.50733143",
"0.50485814",
"0.503424",
"0.49422252",
"0.49258256",
"0.49082804",
"0.48966652",
"0.48937792"
] |
0.6610677
|
0
|
Operation findMetaform Finds single Metaform
|
public function findMetaform($realmId, $metaformId)
{
list($response) = $this->findMetaformWithHttpInfo($realmId, $metaformId);
return $response;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function findForm(){\n\n\t\t$results = $this->wpdb->get_results($this->wpdb->prepare(\"\n\t\t\tSELECT\n\t\t\t\t`form`.`id` \t\t\tas 'id',\n\t\t\t\t`form`.`label` \t\t\tas 'label',\n\t\t\t\t`form`.`confirm_submit` as 'confirm_submit',\n\t\t\t\t`form`.`date_available` as 'date_available',\n\t\t\t\t`form`.`date_expire` \tas 'date_expire'\n\t\t\tFROM `mark_reg_forms` as `form`\n\t\t\tWHERE\n\t\t\t\t`form`.`id` = %d\n\t\t\t\tAND `form`.`enabled` = 1\n\t\t\", $this->form_id));\n\n\t\tif(count($results)):\n\t\t\t$this->form_confirm_submit\t= $results[0]->confirm_submit;\n\t\t\t$this->form_label \t\t\t= $results[0]->label;\n\t\t\t$this->form_date_available\t= $results[0]->date_available;\n\t\t\t$this->form_date_expire\t\t= $results[0]->date_expire;\n\t\t\t$this->form_name\t\t\t= 'mark_reg_form_'.$this->form_id;\n\t\telse:\n\t\t\t$this->log(\"FORM NOT FOUND FOR ID: $this->form_id\");\n\t\tendif;\n\t}",
"public function getForm($object = null) : \\Dms\\Core\\Form\\IForm;",
"public function findFieldsForms($par) {\n\n $em = $this->getEntityManager();\n $entity = $em->getRepository('AppBundle:MedicalForms')->findOneBy($par);\n \n $user = null;\n if ($this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n }else{\n return array();\n }\n\n $entities = $em->getRepository('AppBundle:MedicalFormsFieldsets')->findBy(array(\"medicalForm\" => $entity->getId()), array(\"position\" => \"ASC\"));\n $entitiesAll = array();\n $entityset = (object) array(\"fieldset\" => '', \"fields\" => '');\n $classColor = array(\"azulOscuro blancoColor\", \"celeste\", \"rojo\", \"gris\", \"lila\", \"celeste\", \"rojoFuerte\", \"azulNormal\");\n $itc = 0;\n foreach ($entities as $entityFs) :\n $classC = ($entityFs->getType() == \"page\") ? $classColor[$itc] : \"\";\n $entityset = (object) array(\"fieldset\" => '', \"fields\" => '', \"classColor\" => $classC);\n $itc = ($entityFs->getType() == \"page\") ? (($itc === count($classColor) - 1) ? 0 : $itc + 1) : $itc;\n $entityset->fieldset = $entityFs;\n $rsm = new ResultSetMappingBuilder($em);\n $rsm->addRootEntityFromClassMetadata('AppBundle\\Entity\\MedicalFormsFields', 'f');\n if ($user !== NULL):\n $query = $em->createNativeQuery(\"SELECT F3.*,(CASE WHEN oi IS NULL THEN F3.orderid ELSE oi END) as oi ,(CASE F3.id WHEN F2.id THEN 1 ELSE 2 END) AS og, FV.value_data as value_temp, FV.key_enc as key_enc FROM medical_forms_fields F3 LEFT JOIN( SELECT F1.subgroup, F1.orderid as oi, F1.id FROM medical_forms_fields F1 WHERE F1.field='group' order by F1.orderid ) F2 ON F2.subgroup=F3.subgroup LEFT JOIN _mffd_\" . $entity->getFormName() . \" FV ON FV.medical_forms_field_name=F3.name AND FV.fos_user_id=:idu WHERE F3.medical_forms_fieldset_id=:id ORDER BY oi ASC, og ASC, orderid ASC \", $rsm);\n $query->setParameter('idu', $user->getId());\n else:\n $query = $em->createNativeQuery(\"SELECT F3.*,(CASE WHEN oi IS NULL THEN F3.orderid ELSE oi END) as oi ,(CASE F3.id WHEN F2.id THEN 1 ELSE 2 END) AS og FROM medical_forms_fields F3 LEFT JOIN( SELECT F1.subgroup, F1.orderid as oi, F1.id FROM medical_forms_fields F1 WHERE F1.field='group' order by F1.orderid) F2 ON F2.subgroup=F3.subgroup WHERE F3.medical_forms_fieldset_id=:id ORDER BY oi ASC, og ASC, orderid ASC \", $rsm);\n endif;\n $query->setParameter('id', $entityFs->getId());\n $entitiesFl = $query->getResult();\n $entityset->fields = $entitiesFl;\n array_push($entitiesAll, $entityset);\n endforeach;\n return $entitiesAll;\n }",
"public function actionMeta() {\n\t\ttry {\n\t\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.structure.controllers');\n\t\t\t$notice = false;\n\t\t\tif(isset($_POST[Html::modelName('sweelix\\yii1\\admin\\core\\models\\Meta')]) === true) {\n\t\t\t\tforeach($_POST[Html::modelName('sweelix\\yii1\\admin\\core\\models\\Meta')] as $swfMeta) {\n\t\t\t\t\t$formMeta = new FormMeta('content');\n\t\t\t\t\t$formMeta->attributes = $swfMeta;\n\t\t\t\t\t$formMeta->contentId = $this->currentContent->contentId;\n\t\t\t\t\tif($formMeta->validate() === true) {\n\t\t\t\t\t\tif(\\CPropertyValue::ensureBoolean($formMeta->metaModeOverride) === true) {\n\t\t\t\t\t\t\t$contentMeta = ContentMeta::model()->findByPk(array('contentId'=>$formMeta->contentId, 'metaId'=>$formMeta->metaId));\n\t\t\t\t\t\t\tif($contentMeta === null) {\n\t\t\t\t\t\t\t\t$contentMeta = new ContentMeta();\n\t\t\t\t\t\t\t\t$contentMeta->contentId = $formMeta->contentId;\n\t\t\t\t\t\t\t\t$contentMeta->metaId = $formMeta->metaId;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$contentMeta->contentMetaValue = $formMeta->metaValue;\n\t\t\t\t\t\t\t$contentMeta->save();\n\t\t\t\t\t\t\tunset($contentMeta);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tContentMeta::model()->deleteByPk(array(\n\t\t\t\t\t\t\t\t'contentId'=>$this->currentContent->contentId,\n\t\t\t\t\t\t\t\t'metaId'=>$formMeta->metaId\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\t$notice = true;\n\t\t\t}\n\t\t\t$realMetas = Meta::model()->findAll(array('order'=>'metaId ASC'));\n\t\t\t$metas = array();\n\t\t\tforeach($realMetas as $realMeta) {\n\t\t\t\t$contentMeta = ContentMeta::model()->findByAttributes(array(\n\t\t\t\t\t'contentId'=>$this->currentContent->contentId,\n\t\t\t\t\t'metaId'=>$realMeta->metaId\n\t\t\t\t));\n\t\t\t\t$formMeta = new FormMeta('content');\n\t\t\t\t$formMeta->attributes = $realMeta->attributes;\n\t\t\t\t$formMeta->contentId = $this->currentContent->contentId;\n\t\t\t\tif($contentMeta !== null) {\n\t\t\t\t\t$formMeta->metaValue = $contentMeta->contentMetaValue;\n\t\t\t\t\t$formMeta->metaModeOverride = true;\n\t\t\t\t} else {\n\t\t\t\t\t$formMeta->metaModeOverride = false;\n\t\t\t\t}\n\t\t\t\t$metas[] = $formMeta;\n\t\t\t}\n\t\t\t$contentCriteriaBuilder = new CriteriaBuilder('content');\n\t\t\t$contentCriteriaBuilder->filterBy('contentId', $this->currentContent->contentId);\n\n\t\t\t$this->setCurrentNode($this->currentContent->node);\n\t\t\tif(\\Yii::app()->request->isAjaxRequest === true) {\n\t\t\t\t$this->renderPartial('_meta', array(\n\t\t\t\t\t\t'content' => $this->currentContent,\n\t\t\t\t\t\t'metas'=>$metas,\n\t\t\t\t\t\t'contentsDataProvider' => $contentCriteriaBuilder->getActiveDataProvider(array('pagination' => false)),\n\t\t\t\t\t\t'notice' => $notice,\n\t\t\t\t));\n\t\t\t} else {\n\t\t\t\t$this->render('meta', array(\n\t\t\t\t\t'breadcrumb' => $this->buildBreadcrumb($this->currentContent->contentId),\n\t\t\t\t\t'mainMenu' => $this->buildMainMenu(2, 3),\n\t\t\t\t\t'metas'=>$metas,\n\t\t\t\t\t'content' => $this->currentContent,\n\t\t\t\t\t'node' => $this->currentNode,\n\t\t\t\t\t'contentsDataProvider' => $contentCriteriaBuilder->getActiveDataProvider(array('pagination' => false)),\n\t\t\t\t\t'notice' => $notice,\n\t\t\t\t));\n\t\t\t}\n\t\t} catch(\\Exception $e) {\n\t\t\t\\Yii::log('Error in '.__METHOD__.'():'.$e->getMessage(), \\CLogger::LEVEL_ERROR, 'sweelix.yii1.admin.structure.controllers');\n\t\t\tthrow $e;\n\t\t}\n\t}",
"abstract public function getForm($formId);",
"public function findForm($index, $options = array())\n {\n return $this->renderForm($index, $options, 'find');\n }",
"public function getMeta($model)\n {\n }",
"protected function findMetaformRequest($realmId, $metaformId)\n {\n // verify the required parameter 'realmId' is set\n if ($realmId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $realmId when calling findMetaform'\n );\n }\n // verify the required parameter 'metaformId' is set\n if ($metaformId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $metaformId when calling findMetaform'\n );\n }\n\n $resourcePath = '/realms/{realmId}/metaforms/{metaformId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($realmId !== null) {\n $resourcePath = str_replace(\n '{' . 'realmId' . '}',\n ObjectSerializer::toPathValue($realmId),\n $resourcePath\n );\n }\n // path params\n if ($metaformId !== null) {\n $resourcePath = str_replace(\n '{' . 'metaformId' . '}',\n ObjectSerializer::toPathValue($metaformId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=utf-8'],\n ['application/json;charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"abstract function getForm();",
"public function findMetaformAsync($realmId, $metaformId)\n {\n return $this->findMetaformAsyncWithHttpInfo($realmId, $metaformId)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getForm();",
"public function form() \n\t{\n\t\treturn belongsTo('App\\Form'); \n\t}",
"abstract protected function getForm();",
"public function getForm(): FormInterface;",
"public function getObject() {\n return $this->form->getObject();\n }",
"public function form()\n {\n return $this->hasOne('App\\Form')->whereNull('deleted_at');\n }",
"public function metaDetailAction() {\n\n //ONLY LOGGED IN USER CAN ADD OVERVIEW\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET LISTING ID AND OBJECT\n $listing_id = $this->_getParam('listing_id');\n\n \n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n Engine_Api::_()->core()->setSubject($sitereview); \n //GET LISTING TYPE ID\n $listingtype_id = $sitereview->listingtype_id;\n\n if(!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_helper->content\n ->setContentName(\"sitereview_dashboard_metadetails_listtype_$listingtype_id\")\n //->setNoRender()\n ->setEnabled();\n \n }\n \n Engine_Api::_()->sitereview()->setListingTypeInRegistry($listingtype_id);\n $listingType = Zend_Registry::get('listingtypeArray' . $listingtype_id);\n\n if (empty($listingType->metakeyword)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!$sitereview->authorization()->isAllowed($viewer, 'edit_listtype_' . $listingtype_id)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'sitereview_listing', \"metakeyword_listtype_$listingtype_id\")) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //SELECTED TAB\n $this->view->TabActive = \"metadetails\";\n\n //SET FORM\n $this->view->form = $form = new Sitereview_Form_Metainfo();\n\n $tableOtherinfo = Engine_Api::_()->getDbTable('otherinfo', 'sitereview');\n\n //POPULATE FORM\n $value['keywords'] = $tableOtherinfo->getColumnValue($listing_id, 'keywords');\n\n $form->populate($value);\n\n //CHECK FORM VALIDATION\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET FORM VALUES\n $values = $form->getValues();\n $tableOtherinfo->update(array('keywords' => $values['keywords']), array('listing_id = ?' => $listing_id));\n\n //SHOW SUCCESS MESSAGE\n $form->addNotice(Zend_Registry::get('Zend_Translate')->_('Your changes have been saved successfully.'));\n }\n }",
"public function testPresenceOfSeoMetaFieldsInFormAfterFormGenerationWithCustomizedModel(){\n //Change the local configuration for next tests\n Centurion_Config_Manager::set('seo.meta.types', array('description', 'keywords'));\n\n $form = new Seotable_Form_Model_Custo();\n\n $elements = $form->getElements();\n\n $this->assertArrayHasKey(\n Seo_Traits_Form_Model::FORM_META_FIELDS_PREFIX.'keywords',\n $elements,\n 'Error, the trait Seo was not add the element \"keywords\" for the Form'\n );\n\n $this->assertInstanceOf(\n 'Zend_Form_Element_TextArea',\n $elements[Seo_Traits_Form_Model::FORM_META_FIELDS_PREFIX.'keywords'],\n 'Error, the type of all Meta Fields in the form must be a textarea. It is not the case for \"keywords\"'\n );\n\n $displayGroups = $form->getDisplayGroups();\n\n $this->assertArrayHasKey(\n Seo_Traits_Form_Model::FORM_META_DISPLAYGROUP_NAME,\n $displayGroups,\n 'Error, the trait Seo was not create the display group \"meta_display_group\" to store Metas Fields'\n );\n\n $dgElements = $displayGroups[Seo_Traits_Form_Model::FORM_META_DISPLAYGROUP_NAME]->getElements();\n $this->assertEquals(\n 1,\n count($dgElements),\n 'Error, the displaygroup to store Metas Fields must contains only fields for meta (aka keywords)'\n );\n\n $this->assertArrayHasKey(\n Seo_Traits_Form_Model::FORM_META_FIELDS_PREFIX.'keywords',\n $dgElements,\n 'Error, the trait Seo was not add the element \"keywords\" for the Form'\n );\n }",
"function ga_formulario_instancia() {\n // ID del metabox\n $metabox_id = 'ga_enviar_receta';\n \n // No aplica el object_id ya que se va a generar automaticamente al crearlo.\n $object_id = 'fake-object-id';\n \n return cmb2_get_metabox($metabox_id, $object_id);\n}",
"public function getMeta(){\n // $this->meta();\n }",
"public function testExistentValuesOfSeoMetaFieldsInFormWithObjectInstance(){\n\n //Change the local configuration for next tests\n Centurion_Config_Manager::set('seo.meta.types', array('description', 'keywords'));\n\n $form = new Seotable_Form_Model_First();\n\n //Load instance\n $form->setInstance($form->getModel()->get(array('id' => 1)));\n\n $values = $form->getValues(true);\n\n $this->assertArrayHasKey(\n Seo_Traits_Form_Model::FORM_META_FIELDS_PREFIX.'description',\n $values,\n 'Error, the trait Seo was not add the element \"description\" for the Form'\n );\n\n $this->assertArrayHasKey(\n Seo_Traits_Form_Model::FORM_META_FIELDS_PREFIX.'keywords',\n $values,\n 'Error, the trait Seo was not add the element \"keywords\" for the Form'\n );\n\n $this->assertEquals(\n 'meta description first 1',\n $values[Seo_Traits_Form_Model::FORM_META_FIELDS_PREFIX.'description'],\n 'Error, the trait Seo was not loaded the good value for meta for the intance seotable/first_model:id:1'\n );\n\n $this->assertEquals(\n 'meta keywords first 1',\n $values[Seo_Traits_Form_Model::FORM_META_FIELDS_PREFIX.'keywords'],\n 'Error, the trait Seo was not loaded the good value for meta for the intance seotable/first_model:id:1'\n );\n }",
"public function getFormaPago();",
"public function form()\n {\n return $this->belongsTo(Form::class, 'form_id');\n }",
"public function show($id)\n {\n $documentMeta = $this->documentMetaRepository->findWithoutFail($id);\n\n if (empty($documentMeta)) {\n Flash::error(__('messages.not-found'));\n\n return redirect(route('admin.documentMetas.index'));\n }\n\n return view('backend.document_metas.show', compact('documentMeta'));\n }",
"public function getForm(Request $request, $id) {\r\n $validator = Validator::make(\r\n ['id' => $id],\r\n ['id' => 'required|string|min:36|exists:form,id']\r\n );\r\n\r\n if ($validator->fails()) {\r\n return response()->json([\r\n 'msg' => 'Validation failed',\r\n 'err' => $validator->errors()\r\n ], $validator->statusCode());\r\n }\r\n\r\n $formModel = Form::with('sections', 'nameTranslation', 'versions', 'sections.questionGroups', 'sections.nameTranslation', 'sections.formSections.repeatPromptTranslation')->find($id);\r\n\r\n return response()->json([\r\n 'form' => $formModel\r\n ], Response::HTTP_OK);\r\n }",
"public function getForm()\n {\n RETURN $this->strategy->getForm();\n }",
"public function getForm()\n {\n if (!isset($this->form)) {\n try {\n $this->form = SimpleForms::$plugin->forms->getFormById($this->formId);\n } catch (\\Exception $e) {\n // Do nothing\n }\n }\n\n return $this->form;\n }",
"function dgu_search_info_content_type_edit_form($form, &$form_state) {\n return $form;\n}",
"public function getInfor( $id_form )\n {\n return Form::find( $id_form );\n }",
"public function get_forms( array $where = array() )\n {\n if( 'form' != $this->_object->get_type() ) return FALSE;\n\n return $this->_object->find( NULL, $where );\n }"
] |
[
"0.60720235",
"0.5449104",
"0.51294845",
"0.5112246",
"0.5109938",
"0.5045402",
"0.50421304",
"0.5026036",
"0.4964001",
"0.49393034",
"0.4927252",
"0.4914297",
"0.4903871",
"0.48985013",
"0.48961535",
"0.4877468",
"0.4870231",
"0.4852134",
"0.48276985",
"0.48126465",
"0.480946",
"0.47829792",
"0.47591323",
"0.4746167",
"0.47435445",
"0.47364125",
"0.47145227",
"0.47101945",
"0.4696406",
"0.4695124"
] |
0.5695702
|
1
|
Operation findMetaformWithHttpInfo Finds single Metaform
|
public function findMetaformWithHttpInfo($realmId, $metaformId)
{
$returnType = '\Metatavu\Metaform\Api\Model\Metaform';
$request = $this->findMetaformRequest($realmId, $metaformId);
try {
try {
$response = $this->client->send($request);
} catch (RequestException $e) {
$umaResponse = $this->umaRetry($request, $e);
if ($umaResponse) {
$response = $umaResponse;
} else {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null
);
}
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Metatavu\Metaform\Api\Model\Metaform',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Metatavu\Metaform\Api\Model\BadRequest',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 403:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Metatavu\Metaform\Api\Model\Forbidden',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Metatavu\Metaform\Api\Model\NotFound',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 500:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Metatavu\Metaform\Api\Model\InternalServerError',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function getMeta(){\n\t\t$AccessToken = Auth::token();\n\t\t$baseUrl = url . '/api/v1/' . customerAlias . '/' . databaseAlias;\n\t\t$endpoint = '/meta';\n\t\t$request = $baseUrl . $endpoint;\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(\n\t\t CURLOPT_HTTPGET => true,\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t\t'Authorization: Bearer ' . $AccessToken),\n\t\t CURLOPT_URL => $request,\n\t\t\tCURLOPT_RETURNTRANSFER => 1\n\t\t ));\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $response;\n\t}",
"protected function findMetaformRequest($realmId, $metaformId)\n {\n // verify the required parameter 'realmId' is set\n if ($realmId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $realmId when calling findMetaform'\n );\n }\n // verify the required parameter 'metaformId' is set\n if ($metaformId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $metaformId when calling findMetaform'\n );\n }\n\n $resourcePath = '/realms/{realmId}/metaforms/{metaformId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($realmId !== null) {\n $resourcePath = str_replace(\n '{' . 'realmId' . '}',\n ObjectSerializer::toPathValue($realmId),\n $resourcePath\n );\n }\n // path params\n if ($metaformId !== null) {\n $resourcePath = str_replace(\n '{' . 'metaformId' . '}',\n ObjectSerializer::toPathValue($metaformId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=utf-8'],\n ['application/json;charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function findMetaform($realmId, $metaformId)\n {\n list($response) = $this->findMetaformWithHttpInfo($realmId, $metaformId);\n return $response;\n }",
"public function findMetaformAsyncWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->findMetaformRequest($realmId, $metaformId);\n\n return $this->client\n ->sendAsync($request)\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 listMetaformsWithHttpInfo($realmId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform[]';\n $request = $this->listMetaformsRequest($realmId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Metaform[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function v1PropertyTemplatesFormsGetWithHttpInfo($accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesFormsGetRequest($accept_language);\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\\TemplateMetadataResponse[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ProblemDetails',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function read_meta( &$object );",
"public function getMeta();",
"public function getMeta();",
"protected function listProductMetaDataTypesRequest()\n {\n $resourcePath = '/product-meta-data-types';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\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 }",
"public function metaDetailAction() {\n\n //ONLY LOGGED IN USER CAN ADD OVERVIEW\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET LISTING ID AND OBJECT\n $listing_id = $this->_getParam('listing_id');\n\n \n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n Engine_Api::_()->core()->setSubject($sitereview); \n //GET LISTING TYPE ID\n $listingtype_id = $sitereview->listingtype_id;\n\n if(!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_helper->content\n ->setContentName(\"sitereview_dashboard_metadetails_listtype_$listingtype_id\")\n //->setNoRender()\n ->setEnabled();\n \n }\n \n Engine_Api::_()->sitereview()->setListingTypeInRegistry($listingtype_id);\n $listingType = Zend_Registry::get('listingtypeArray' . $listingtype_id);\n\n if (empty($listingType->metakeyword)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!$sitereview->authorization()->isAllowed($viewer, 'edit_listtype_' . $listingtype_id)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'sitereview_listing', \"metakeyword_listtype_$listingtype_id\")) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //SELECTED TAB\n $this->view->TabActive = \"metadetails\";\n\n //SET FORM\n $this->view->form = $form = new Sitereview_Form_Metainfo();\n\n $tableOtherinfo = Engine_Api::_()->getDbTable('otherinfo', 'sitereview');\n\n //POPULATE FORM\n $value['keywords'] = $tableOtherinfo->getColumnValue($listing_id, 'keywords');\n\n $form->populate($value);\n\n //CHECK FORM VALIDATION\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET FORM VALUES\n $values = $form->getValues();\n $tableOtherinfo->update(array('keywords' => $values['keywords']), array('listing_id = ?' => $listing_id));\n\n //SHOW SUCCESS MESSAGE\n $form->addNotice(Zend_Registry::get('Zend_Translate')->_('Your changes have been saved successfully.'));\n }\n }",
"function get_metadata($meta_type, $object_id, $meta_key = '', $single = \\false)\n {\n }",
"function getCmsMetaData ()\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['cms_manager_url']}/resources/cms/{$this->api['cms_manager_id']}\",array(),'json');\n return $this->createResponse($result,'get My CMS Information');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }",
"public /* Metadata */ function getResourceMetadata($uri) {\n try {\n $client = new Client();\n\n $request = $client->get($this->getServiceUrl($uri),array(\n \"User-Agent\" => \"Marmotta Client Library (PHP)\",\n \"Accept\" => \"application/rdf+json; rel=meta\"\n ));\n // set authentication if given in configuration\n if(!empty($this->config->getUsername())) {\n $request->setAuth($this->config->getUsername(),$this->config->getPassword());\n }\n $response = $request->send();\n\n return RdfJson::decode_metadata($uri,$response->getBody(true));\n } catch(BadResponseException $ex) {\n if($ex->getResponse()->getStatusCode() == 404) {\n throw new NotFoundException(\"could not retrieve resource metadata for resource $uri; it does not exist\");\n } else if($ex->getResponse()->getStatusCode() == 406) {\n throw new ContentFormatException(\"server does not offer metadata type application/json for resource $uri\");\n } else {\n throw new MarmottaClientException(\"could not retrieve resource metadata for resource $uri; \".$ex->getResponse()->getReasonPhrase());\n }\n }\n }",
"function getMetaData($dataType){\n\t\t$AccessToken = Auth::token();\n\t\t$baseUrl = url . '/api/v1/' . customerAlias . '/' . databaseAlias;\n\t\t$endpoint = '/meta/';\n\t\t$request = $baseUrl . $endpoint . $dataType;\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(\n\t\t CURLOPT_HTTPGET => true,\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t\t'Authorization: Bearer ' . $AccessToken),\n\t\t CURLOPT_URL => $request,\n\t\t\tCURLOPT_RETURNTRANSFER => 1\n\t\t ));\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $response;\n\t}",
"protected function getSlidesApiInfoRequest()\n {\n\n $resourcePath = '/slides/info';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['application/json'],\n ['application/json']);\n\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'GET');\n }",
"public function deleteMetaformWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '';\n $request = $this->deleteMetaformRequest($realmId, $metaformId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\NotFound',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getMeta($meta)\n {\n if (!isset($this->metas[$meta])) {\n return;\n }\n\n return $this->metas[$meta];\n }",
"public function actionMeta() {\n\t\ttry {\n\t\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.structure.controllers');\n\t\t\t$notice = false;\n\t\t\tif(isset($_POST[Html::modelName('sweelix\\yii1\\admin\\core\\models\\Meta')]) === true) {\n\t\t\t\tforeach($_POST[Html::modelName('sweelix\\yii1\\admin\\core\\models\\Meta')] as $swfMeta) {\n\t\t\t\t\t$formMeta = new FormMeta('content');\n\t\t\t\t\t$formMeta->attributes = $swfMeta;\n\t\t\t\t\t$formMeta->contentId = $this->currentContent->contentId;\n\t\t\t\t\tif($formMeta->validate() === true) {\n\t\t\t\t\t\tif(\\CPropertyValue::ensureBoolean($formMeta->metaModeOverride) === true) {\n\t\t\t\t\t\t\t$contentMeta = ContentMeta::model()->findByPk(array('contentId'=>$formMeta->contentId, 'metaId'=>$formMeta->metaId));\n\t\t\t\t\t\t\tif($contentMeta === null) {\n\t\t\t\t\t\t\t\t$contentMeta = new ContentMeta();\n\t\t\t\t\t\t\t\t$contentMeta->contentId = $formMeta->contentId;\n\t\t\t\t\t\t\t\t$contentMeta->metaId = $formMeta->metaId;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$contentMeta->contentMetaValue = $formMeta->metaValue;\n\t\t\t\t\t\t\t$contentMeta->save();\n\t\t\t\t\t\t\tunset($contentMeta);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tContentMeta::model()->deleteByPk(array(\n\t\t\t\t\t\t\t\t'contentId'=>$this->currentContent->contentId,\n\t\t\t\t\t\t\t\t'metaId'=>$formMeta->metaId\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\t$notice = true;\n\t\t\t}\n\t\t\t$realMetas = Meta::model()->findAll(array('order'=>'metaId ASC'));\n\t\t\t$metas = array();\n\t\t\tforeach($realMetas as $realMeta) {\n\t\t\t\t$contentMeta = ContentMeta::model()->findByAttributes(array(\n\t\t\t\t\t'contentId'=>$this->currentContent->contentId,\n\t\t\t\t\t'metaId'=>$realMeta->metaId\n\t\t\t\t));\n\t\t\t\t$formMeta = new FormMeta('content');\n\t\t\t\t$formMeta->attributes = $realMeta->attributes;\n\t\t\t\t$formMeta->contentId = $this->currentContent->contentId;\n\t\t\t\tif($contentMeta !== null) {\n\t\t\t\t\t$formMeta->metaValue = $contentMeta->contentMetaValue;\n\t\t\t\t\t$formMeta->metaModeOverride = true;\n\t\t\t\t} else {\n\t\t\t\t\t$formMeta->metaModeOverride = false;\n\t\t\t\t}\n\t\t\t\t$metas[] = $formMeta;\n\t\t\t}\n\t\t\t$contentCriteriaBuilder = new CriteriaBuilder('content');\n\t\t\t$contentCriteriaBuilder->filterBy('contentId', $this->currentContent->contentId);\n\n\t\t\t$this->setCurrentNode($this->currentContent->node);\n\t\t\tif(\\Yii::app()->request->isAjaxRequest === true) {\n\t\t\t\t$this->renderPartial('_meta', array(\n\t\t\t\t\t\t'content' => $this->currentContent,\n\t\t\t\t\t\t'metas'=>$metas,\n\t\t\t\t\t\t'contentsDataProvider' => $contentCriteriaBuilder->getActiveDataProvider(array('pagination' => false)),\n\t\t\t\t\t\t'notice' => $notice,\n\t\t\t\t));\n\t\t\t} else {\n\t\t\t\t$this->render('meta', array(\n\t\t\t\t\t'breadcrumb' => $this->buildBreadcrumb($this->currentContent->contentId),\n\t\t\t\t\t'mainMenu' => $this->buildMainMenu(2, 3),\n\t\t\t\t\t'metas'=>$metas,\n\t\t\t\t\t'content' => $this->currentContent,\n\t\t\t\t\t'node' => $this->currentNode,\n\t\t\t\t\t'contentsDataProvider' => $contentCriteriaBuilder->getActiveDataProvider(array('pagination' => false)),\n\t\t\t\t\t'notice' => $notice,\n\t\t\t\t));\n\t\t\t}\n\t\t} catch(\\Exception $e) {\n\t\t\t\\Yii::log('Error in '.__METHOD__.'():'.$e->getMessage(), \\CLogger::LEVEL_ERROR, 'sweelix.yii1.admin.structure.controllers');\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function getMeta() {\n return $this->meta;\n }",
"public function getMeta($model)\n {\n }",
"public static function apiQuery($params)\n\t\t{\n\t\t\t$class = get_called_class();\n\t\t\t$metaSelectReflect = new ReflectionMethod($class, 'MetaSelect');\n\t\t\tif($metaSelectReflect->class != $class)\n\t\t\t\tthrow new SERIA_Exception('The \"'.$class.'::MetaSelect\"-method has not been overridden. You must apply security restrictions before this api can be made available. The method must return a where clause or NULL if you wish to make everything available to everybody.');\n\t\t\ttry {\n\t\t\t\t$metaFieldsReflect = new ReflectionMethod($class, 'MetaFields');\n\t\t\t} catch (ReflectionException $e) {\n\t\t\t\tthrow new SERIA_Exception('The \"'.$class.'::MetaFields\"-method has not been declared. You must apply security restrictions before this api can be made available. The method must return an array containing the field names the user is allowed to read or NULL if all fields should be available.');\n\t\t\t}\n\t\t\tif($metaFieldsReflect->class != $class)\n\t\t\t\tthrow new SERIA_Exception('The \"'.$class.'::MetaFields\"-method has not been declared. You must apply security restrictions before this api can be made available. The method must return an array containing the field names the user is allowed to read or NULL if all fields should be available.');\n\n\t\t\t$fields = call_user_func(array($class, 'MetaFields'), $options);\n\n\t\t\t$query = SERIA_Meta::all($class);\n\n\t\t\tif (isset($params['order'])) {\n\t\t\t\tif (substr($params['order'], 0, 1) == '-') {\n\t\t\t\t\tif (in_array(substr($params['order'], 1), $fields))\n\t\t\t\t\t\t$query->order(substr($params['order'], 1).' DESC');\n\t\t\t\t} else {\n\t\t\t\t\tif (in_array($params['order'], $fields))\n\t\t\t\t\t\t$query->order($params['order'].' ASC');\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($params['length'])) {\n\t\t\t\tif (isset($params['start']))\n\t\t\t\t\t$query->limit(intval($params['start']), intval($params['length']));\n\t\t\t\telse\n\t\t\t\t\t$query->limit(intval($params['length']));\n\t\t\t}\n\n\t\t\tforeach ($params as $name => $value) {\n\t\t\t\tif (in_array($name, $fields))\n\t\t\t\t\t$query->where($name.' = :'.$name, array($name => $value));\n\t\t\t}\n\t\t\t$res = array();\n\t\t\tforeach ($query as $obj) {\n\t\t\t\t$arr = array();\n\t\t\t\tforeach ($fields as $field) {\n\t\t\t\t\t$value = $obj->get($field);\n\t\t\t\t\tif ($value instanceof SERIA_MetaObject)\n\t\t\t\t\t\t$value = SERIA_Meta::getReference($value);\n\t\t\t\t\t$arr[$field] = $value;\n\t\t\t\t}\n\t\t\t\t$res[] = $arr;\n\t\t\t}\n\t\t\treturn $res;\n\t\t}",
"protected function listMetaformsRequest($realmId)\n {\n // verify the required parameter 'realmId' is set\n if ($realmId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $realmId when calling listMetaforms'\n );\n }\n\n $resourcePath = '/realms/{realmId}/metaforms';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($realmId !== null) {\n $resourcePath = str_replace(\n '{' . 'realmId' . '}',\n ObjectSerializer::toPathValue($realmId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=utf-8'],\n ['application/json;charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function v1PropertyTemplatesClaimsClaimTemplateIdFormsGetWithHttpInfo($claim_template_id, $accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesClaimsClaimTemplateIdFormsGetRequest($claim_template_id, $accept_language);\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\\TemplateMetadataResponse[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ProblemDetails',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getMeta(){\n // $this->meta();\n }",
"public function v1PropertyTemplatesFormsGetAsyncWithHttpInfo($accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesFormsGetRequest($accept_language);\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 getMeta(TransformerData $data): MetaObject\n {\n $metaObj = $this->specification->getMetaObject();\n $metaObj->{'api-version'} = $data->getApiVersion();\n $metaObj->copyright = 'Max Nagaychenko (http://blog.nagaychenko.com)';\n\n if (!empty($data->getDataCount())) {\n $metaObj->{'entity-count'} = $data->getDataCount();\n }\n\n return $metaObj;\n }",
"public function show($platform)\n {\n try {\n if (!request()->isJson())\n return $this->response->unauthorized();\n\n if (!is_numeric($platform))\n return $this->response->badRequest();\n\n $platformModel = Platform::find($platform);\n\n if (!isset($platformModel))\n return $this->response->noContent();\n\n return $this->response->success($platformModel->format());\n } catch (\\Exception $exception) {\n\n return $this->response->exception($exception->getMessage());\n }\n }",
"public function findMetaformAsync($realmId, $metaformId)\n {\n return $this->findMetaformAsyncWithHttpInfo($realmId, $metaformId)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getMeta()\n {\n return $this->meta;\n }"
] |
[
"0.5213043",
"0.5116603",
"0.4906756",
"0.47334158",
"0.46535373",
"0.45640326",
"0.45114645",
"0.44546387",
"0.44546387",
"0.44198924",
"0.43789428",
"0.4371257",
"0.43390134",
"0.4335587",
"0.43227077",
"0.42969733",
"0.428869",
"0.42830044",
"0.427298",
"0.4271842",
"0.4262471",
"0.42607412",
"0.42578834",
"0.4255298",
"0.4244947",
"0.42448595",
"0.4215051",
"0.4200177",
"0.41874424",
"0.41837496"
] |
0.5971972
|
0
|
Operation findMetaformAsync Finds single Metaform
|
public function findMetaformAsync($realmId, $metaformId)
{
return $this->findMetaformAsyncWithHttpInfo($realmId, $metaformId)
->then(
function ($response) {
return $response[0];
}
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function findForm(){\n\n\t\t$results = $this->wpdb->get_results($this->wpdb->prepare(\"\n\t\t\tSELECT\n\t\t\t\t`form`.`id` \t\t\tas 'id',\n\t\t\t\t`form`.`label` \t\t\tas 'label',\n\t\t\t\t`form`.`confirm_submit` as 'confirm_submit',\n\t\t\t\t`form`.`date_available` as 'date_available',\n\t\t\t\t`form`.`date_expire` \tas 'date_expire'\n\t\t\tFROM `mark_reg_forms` as `form`\n\t\t\tWHERE\n\t\t\t\t`form`.`id` = %d\n\t\t\t\tAND `form`.`enabled` = 1\n\t\t\", $this->form_id));\n\n\t\tif(count($results)):\n\t\t\t$this->form_confirm_submit\t= $results[0]->confirm_submit;\n\t\t\t$this->form_label \t\t\t= $results[0]->label;\n\t\t\t$this->form_date_available\t= $results[0]->date_available;\n\t\t\t$this->form_date_expire\t\t= $results[0]->date_expire;\n\t\t\t$this->form_name\t\t\t= 'mark_reg_form_'.$this->form_id;\n\t\telse:\n\t\t\t$this->log(\"FORM NOT FOUND FOR ID: $this->form_id\");\n\t\tendif;\n\t}",
"protected function findMetaformRequest($realmId, $metaformId)\n {\n // verify the required parameter 'realmId' is set\n if ($realmId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $realmId when calling findMetaform'\n );\n }\n // verify the required parameter 'metaformId' is set\n if ($metaformId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $metaformId when calling findMetaform'\n );\n }\n\n $resourcePath = '/realms/{realmId}/metaforms/{metaformId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($realmId !== null) {\n $resourcePath = str_replace(\n '{' . 'realmId' . '}',\n ObjectSerializer::toPathValue($realmId),\n $resourcePath\n );\n }\n // path params\n if ($metaformId !== null) {\n $resourcePath = str_replace(\n '{' . 'metaformId' . '}',\n ObjectSerializer::toPathValue($metaformId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=utf-8'],\n ['application/json;charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function findMetaform($realmId, $metaformId)\n {\n list($response) = $this->findMetaformWithHttpInfo($realmId, $metaformId);\n return $response;\n }",
"public function findMetaformAsyncWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->findMetaformRequest($realmId, $metaformId);\n\n return $this->client\n ->sendAsync($request)\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 show($id)\n {\n $documentMeta = $this->documentMetaRepository->findWithoutFail($id);\n\n if (empty($documentMeta)) {\n Flash::error(__('messages.not-found'));\n\n return redirect(route('admin.documentMetas.index'));\n }\n\n return view('backend.document_metas.show', compact('documentMeta'));\n }",
"public function findForm($index, $options = array())\n {\n return $this->renderForm($index, $options, 'find');\n }",
"public function getForm(Request $request, $id) {\r\n $validator = Validator::make(\r\n ['id' => $id],\r\n ['id' => 'required|string|min:36|exists:form,id']\r\n );\r\n\r\n if ($validator->fails()) {\r\n return response()->json([\r\n 'msg' => 'Validation failed',\r\n 'err' => $validator->errors()\r\n ], $validator->statusCode());\r\n }\r\n\r\n $formModel = Form::with('sections', 'nameTranslation', 'versions', 'sections.questionGroups', 'sections.nameTranslation', 'sections.formSections.repeatPromptTranslation')->find($id);\r\n\r\n return response()->json([\r\n 'form' => $formModel\r\n ], Response::HTTP_OK);\r\n }",
"abstract public function getForm($formId);",
"public function showmetadata($string){\n\n $artistalike = DB::table('artistas')->where('nomeartista','LIKE', '%' . $string . '%')->first();\n\n if(!$artistalike){\n return response()->json([\n 'message' => 'Nenhum resultado para: ' . $string\n ], 404);\n }\n\n $data = $artistalike->id;\n \n $metadata = DB::table('artistas')\n ->select(\n 'nomeartista',\n 'desc_artista',\n 'filepath'\n )->where('nomeartista', 'LIKE', '%' . $string . '%')\n ->get();\n\n $metaalbum = DB::table('artistas')\n ->join('album', 'album.artistaID', '=', 'artistas.id')->where('artistas.id', '=', $data)\n ->select(\n 'album.titulo_album',\n 'album.desc_album',\n 'album.filepath_avatar'\n )\n ->get();\n \n $metamusica = DB::table('artistas')\n ->join('musica', 'musica.artistaID', '=', 'artistas.id')->where('artistas.id', '=', $data)\n ->select(\n 'musica.id',\n 'musica.nomemusica',\n 'musica.filepath',\n 'musica.created_at'\n )\n ->get();\n \n if(!$metadata){\n return response()->json([\n 'message' => 'Nenhum resultado para: ' . $string\n ], 404);\n }\n\n return [\n 'find' => [\n 'artist' => [\n 'artista' => $metadata,\n 'data' => [\n 'album'=>$metaalbum,\n 'musicas'=>$metamusica\n ]\n\n ]\n ]\n ];\n }",
"public function getById($form_guid)\n {\n $endpoint = \"https://api.hubapi.com/forms/v2/forms/{$form_guid}\";\n\n return $this->client->request('get', $endpoint);\n }",
"public function getMeta($model)\n {\n }",
"public function find()\n {\n parent::validateRoles(['superadmin']);\n $model_app = new Model_App();\n $conditions = json_decode(file_get_contents(\"php://input\"));\n\n $result = $model_app->find($conditions);\n\n $this->response->sendMessage(iterator_to_array($result))\n ->setCode(200);\n }",
"public function show()\n {\n return $this->get();\n }",
"public function findMetaformWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->findMetaformRequest($realmId, $metaformId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Metaform',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\NotFound',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function findFieldsForms($par) {\n\n $em = $this->getEntityManager();\n $entity = $em->getRepository('AppBundle:MedicalForms')->findOneBy($par);\n \n $user = null;\n if ($this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n }else{\n return array();\n }\n\n $entities = $em->getRepository('AppBundle:MedicalFormsFieldsets')->findBy(array(\"medicalForm\" => $entity->getId()), array(\"position\" => \"ASC\"));\n $entitiesAll = array();\n $entityset = (object) array(\"fieldset\" => '', \"fields\" => '');\n $classColor = array(\"azulOscuro blancoColor\", \"celeste\", \"rojo\", \"gris\", \"lila\", \"celeste\", \"rojoFuerte\", \"azulNormal\");\n $itc = 0;\n foreach ($entities as $entityFs) :\n $classC = ($entityFs->getType() == \"page\") ? $classColor[$itc] : \"\";\n $entityset = (object) array(\"fieldset\" => '', \"fields\" => '', \"classColor\" => $classC);\n $itc = ($entityFs->getType() == \"page\") ? (($itc === count($classColor) - 1) ? 0 : $itc + 1) : $itc;\n $entityset->fieldset = $entityFs;\n $rsm = new ResultSetMappingBuilder($em);\n $rsm->addRootEntityFromClassMetadata('AppBundle\\Entity\\MedicalFormsFields', 'f');\n if ($user !== NULL):\n $query = $em->createNativeQuery(\"SELECT F3.*,(CASE WHEN oi IS NULL THEN F3.orderid ELSE oi END) as oi ,(CASE F3.id WHEN F2.id THEN 1 ELSE 2 END) AS og, FV.value_data as value_temp, FV.key_enc as key_enc FROM medical_forms_fields F3 LEFT JOIN( SELECT F1.subgroup, F1.orderid as oi, F1.id FROM medical_forms_fields F1 WHERE F1.field='group' order by F1.orderid ) F2 ON F2.subgroup=F3.subgroup LEFT JOIN _mffd_\" . $entity->getFormName() . \" FV ON FV.medical_forms_field_name=F3.name AND FV.fos_user_id=:idu WHERE F3.medical_forms_fieldset_id=:id ORDER BY oi ASC, og ASC, orderid ASC \", $rsm);\n $query->setParameter('idu', $user->getId());\n else:\n $query = $em->createNativeQuery(\"SELECT F3.*,(CASE WHEN oi IS NULL THEN F3.orderid ELSE oi END) as oi ,(CASE F3.id WHEN F2.id THEN 1 ELSE 2 END) AS og FROM medical_forms_fields F3 LEFT JOIN( SELECT F1.subgroup, F1.orderid as oi, F1.id FROM medical_forms_fields F1 WHERE F1.field='group' order by F1.orderid) F2 ON F2.subgroup=F3.subgroup WHERE F3.medical_forms_fieldset_id=:id ORDER BY oi ASC, og ASC, orderid ASC \", $rsm);\n endif;\n $query->setParameter('id', $entityFs->getId());\n $entitiesFl = $query->getResult();\n $entityset->fields = $entitiesFl;\n array_push($entitiesAll, $entityset);\n endforeach;\n return $entitiesAll;\n }",
"public function form()\n {\n return $this->belongsTo(Form::class, 'form_id');\n }",
"public function getOwnershipFormsListAction(array $options = []): Model;",
"public function show(Request $request, object $model): bool;",
"public function form()\n {\n return $this->hasOne('App\\Form')->whereNull('deleted_at');\n }",
"public function getForm($object = null) : \\Dms\\Core\\Form\\IForm;",
"public function get($form_id) {\n if ($response = $this->podio->request('/form/'.$form_id)) {\n return json_decode($response->getBody(), TRUE);\n }\n }",
"public function actionMeta() {\n\t\ttry {\n\t\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.structure.controllers');\n\t\t\t$notice = false;\n\t\t\tif(isset($_POST[Html::modelName('sweelix\\yii1\\admin\\core\\models\\Meta')]) === true) {\n\t\t\t\tforeach($_POST[Html::modelName('sweelix\\yii1\\admin\\core\\models\\Meta')] as $swfMeta) {\n\t\t\t\t\t$formMeta = new FormMeta('content');\n\t\t\t\t\t$formMeta->attributes = $swfMeta;\n\t\t\t\t\t$formMeta->contentId = $this->currentContent->contentId;\n\t\t\t\t\tif($formMeta->validate() === true) {\n\t\t\t\t\t\tif(\\CPropertyValue::ensureBoolean($formMeta->metaModeOverride) === true) {\n\t\t\t\t\t\t\t$contentMeta = ContentMeta::model()->findByPk(array('contentId'=>$formMeta->contentId, 'metaId'=>$formMeta->metaId));\n\t\t\t\t\t\t\tif($contentMeta === null) {\n\t\t\t\t\t\t\t\t$contentMeta = new ContentMeta();\n\t\t\t\t\t\t\t\t$contentMeta->contentId = $formMeta->contentId;\n\t\t\t\t\t\t\t\t$contentMeta->metaId = $formMeta->metaId;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$contentMeta->contentMetaValue = $formMeta->metaValue;\n\t\t\t\t\t\t\t$contentMeta->save();\n\t\t\t\t\t\t\tunset($contentMeta);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tContentMeta::model()->deleteByPk(array(\n\t\t\t\t\t\t\t\t'contentId'=>$this->currentContent->contentId,\n\t\t\t\t\t\t\t\t'metaId'=>$formMeta->metaId\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\t$notice = true;\n\t\t\t}\n\t\t\t$realMetas = Meta::model()->findAll(array('order'=>'metaId ASC'));\n\t\t\t$metas = array();\n\t\t\tforeach($realMetas as $realMeta) {\n\t\t\t\t$contentMeta = ContentMeta::model()->findByAttributes(array(\n\t\t\t\t\t'contentId'=>$this->currentContent->contentId,\n\t\t\t\t\t'metaId'=>$realMeta->metaId\n\t\t\t\t));\n\t\t\t\t$formMeta = new FormMeta('content');\n\t\t\t\t$formMeta->attributes = $realMeta->attributes;\n\t\t\t\t$formMeta->contentId = $this->currentContent->contentId;\n\t\t\t\tif($contentMeta !== null) {\n\t\t\t\t\t$formMeta->metaValue = $contentMeta->contentMetaValue;\n\t\t\t\t\t$formMeta->metaModeOverride = true;\n\t\t\t\t} else {\n\t\t\t\t\t$formMeta->metaModeOverride = false;\n\t\t\t\t}\n\t\t\t\t$metas[] = $formMeta;\n\t\t\t}\n\t\t\t$contentCriteriaBuilder = new CriteriaBuilder('content');\n\t\t\t$contentCriteriaBuilder->filterBy('contentId', $this->currentContent->contentId);\n\n\t\t\t$this->setCurrentNode($this->currentContent->node);\n\t\t\tif(\\Yii::app()->request->isAjaxRequest === true) {\n\t\t\t\t$this->renderPartial('_meta', array(\n\t\t\t\t\t\t'content' => $this->currentContent,\n\t\t\t\t\t\t'metas'=>$metas,\n\t\t\t\t\t\t'contentsDataProvider' => $contentCriteriaBuilder->getActiveDataProvider(array('pagination' => false)),\n\t\t\t\t\t\t'notice' => $notice,\n\t\t\t\t));\n\t\t\t} else {\n\t\t\t\t$this->render('meta', array(\n\t\t\t\t\t'breadcrumb' => $this->buildBreadcrumb($this->currentContent->contentId),\n\t\t\t\t\t'mainMenu' => $this->buildMainMenu(2, 3),\n\t\t\t\t\t'metas'=>$metas,\n\t\t\t\t\t'content' => $this->currentContent,\n\t\t\t\t\t'node' => $this->currentNode,\n\t\t\t\t\t'contentsDataProvider' => $contentCriteriaBuilder->getActiveDataProvider(array('pagination' => false)),\n\t\t\t\t\t'notice' => $notice,\n\t\t\t\t));\n\t\t\t}\n\t\t} catch(\\Exception $e) {\n\t\t\t\\Yii::log('Error in '.__METHOD__.'():'.$e->getMessage(), \\CLogger::LEVEL_ERROR, 'sweelix.yii1.admin.structure.controllers');\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function fetchByFormId($formId);",
"public function show(SeoMetaTag $seoMetaTag)\n {\n //\n }",
"private function findRecord()\n {\n /** If the request is a read record request, we need to do this so eager loading occurs. */\n if ($this->jsonApiRequest->isReadResource()) {\n return $this->store->readRecord(\n $this->jsonApiRequest->getResourceType(),\n $this->jsonApiRequest->getResourceId(),\n $this->jsonApiRequest->getParameters()\n );\n }\n\n return $this->store->find($this->jsonApiRequest->getResourceIdentifier());\n }",
"public function getFormByHandle($formHandle)\n {\n return craft()->formBuilder2_form->getFormByHandle($formHandle);\n }",
"public function show($cari) {\n $meja = Meja::find($cari);\n\n if(!is_null($meja)) {\n return response([\n 'message' => 'Retrive Meja Success',\n 'data' => $meja\n ], 200);\n }\n\n return response([\n 'message' => 'Meja Not Found',\n 'data' => null\n ], 404);\n }",
"public static function find(...$arguments)\n {\n return (new static)->show(...$arguments);\n }",
"function getMeta(){\n\t\t$AccessToken = Auth::token();\n\t\t$baseUrl = url . '/api/v1/' . customerAlias . '/' . databaseAlias;\n\t\t$endpoint = '/meta';\n\t\t$request = $baseUrl . $endpoint;\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(\n\t\t CURLOPT_HTTPGET => true,\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t\t'Authorization: Bearer ' . $AccessToken),\n\t\t CURLOPT_URL => $request,\n\t\t\tCURLOPT_RETURNTRANSFER => 1\n\t\t ));\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $response;\n\t}",
"public function getMetaByKey($key)\n {\n return $this->metas()->where('key', $key)->first();\n }"
] |
[
"0.52684",
"0.4904229",
"0.4782164",
"0.47389537",
"0.45981035",
"0.4541773",
"0.44765487",
"0.4475946",
"0.44213727",
"0.4412171",
"0.440001",
"0.4390057",
"0.43517548",
"0.4335584",
"0.43261096",
"0.4322154",
"0.43105662",
"0.42964998",
"0.42881402",
"0.42848894",
"0.42834684",
"0.42618817",
"0.426047",
"0.42535633",
"0.4248347",
"0.42443207",
"0.42431173",
"0.4222446",
"0.42181844",
"0.4211938"
] |
0.56778675
|
0
|
Operation findMetaformAsyncWithHttpInfo Finds single Metaform
|
public function findMetaformAsyncWithHttpInfo($realmId, $metaformId)
{
$returnType = '\Metatavu\Metaform\Api\Model\Metaform';
$request = $this->findMetaformRequest($realmId, $metaformId);
return $this->client
->sendAsync($request)
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function findMetaformWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->findMetaformRequest($realmId, $metaformId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Metaform',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\NotFound',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function findMetaformAsync($realmId, $metaformId)\n {\n return $this->findMetaformAsyncWithHttpInfo($realmId, $metaformId)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function findMetaformRequest($realmId, $metaformId)\n {\n // verify the required parameter 'realmId' is set\n if ($realmId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $realmId when calling findMetaform'\n );\n }\n // verify the required parameter 'metaformId' is set\n if ($metaformId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $metaformId when calling findMetaform'\n );\n }\n\n $resourcePath = '/realms/{realmId}/metaforms/{metaformId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($realmId !== null) {\n $resourcePath = str_replace(\n '{' . 'realmId' . '}',\n ObjectSerializer::toPathValue($realmId),\n $resourcePath\n );\n }\n // path params\n if ($metaformId !== null) {\n $resourcePath = str_replace(\n '{' . 'metaformId' . '}',\n ObjectSerializer::toPathValue($metaformId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=utf-8'],\n ['application/json;charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function getMeta(){\n\t\t$AccessToken = Auth::token();\n\t\t$baseUrl = url . '/api/v1/' . customerAlias . '/' . databaseAlias;\n\t\t$endpoint = '/meta';\n\t\t$request = $baseUrl . $endpoint;\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(\n\t\t CURLOPT_HTTPGET => true,\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t\t'Authorization: Bearer ' . $AccessToken),\n\t\t CURLOPT_URL => $request,\n\t\t\tCURLOPT_RETURNTRANSFER => 1\n\t\t ));\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $response;\n\t}",
"public function v1PropertyTemplatesFormsGetAsyncWithHttpInfo($accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesFormsGetRequest($accept_language);\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 v1PropertyTemplatesClaimsClaimTemplateIdFormsGetAsyncWithHttpInfo($claim_template_id, $accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesClaimsClaimTemplateIdFormsGetRequest($claim_template_id, $accept_language);\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 recognizeFindSymbolAsyncWithHttpInfo($input_image, $target_image)\n {\n $returnType = '\\Swagger\\Client\\Model\\FindSymbolResult';\n $request = $this->recognizeFindSymbolRequest($input_image, $target_image);\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 findMetaform($realmId, $metaformId)\n {\n list($response) = $this->findMetaformWithHttpInfo($realmId, $metaformId);\n return $response;\n }",
"public function listMetaformsAsyncWithHttpInfo($realmId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform[]';\n $request = $this->listMetaformsRequest($realmId);\n\n return $this->client\n ->sendAsync($request)\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 restStorageFrontendFileMetadataGetAsyncWithHttpInfo($key)\n {\n $returnType = 'object[]';\n $request = $this->restStorageFrontendFileMetadataGetRequest($key);\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 queryForSlugAsyncWithHttpInfo($slug, $fields = null)\n {\n $returnType = '\\Looker\\Model\\Query';\n $request = $this->queryForSlugRequest($slug, $fields);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showmetadata($string){\n\n $artistalike = DB::table('artistas')->where('nomeartista','LIKE', '%' . $string . '%')->first();\n\n if(!$artistalike){\n return response()->json([\n 'message' => 'Nenhum resultado para: ' . $string\n ], 404);\n }\n\n $data = $artistalike->id;\n \n $metadata = DB::table('artistas')\n ->select(\n 'nomeartista',\n 'desc_artista',\n 'filepath'\n )->where('nomeartista', 'LIKE', '%' . $string . '%')\n ->get();\n\n $metaalbum = DB::table('artistas')\n ->join('album', 'album.artistaID', '=', 'artistas.id')->where('artistas.id', '=', $data)\n ->select(\n 'album.titulo_album',\n 'album.desc_album',\n 'album.filepath_avatar'\n )\n ->get();\n \n $metamusica = DB::table('artistas')\n ->join('musica', 'musica.artistaID', '=', 'artistas.id')->where('artistas.id', '=', $data)\n ->select(\n 'musica.id',\n 'musica.nomemusica',\n 'musica.filepath',\n 'musica.created_at'\n )\n ->get();\n \n if(!$metadata){\n return response()->json([\n 'message' => 'Nenhum resultado para: ' . $string\n ], 404);\n }\n\n return [\n 'find' => [\n 'artist' => [\n 'artista' => $metadata,\n 'data' => [\n 'album'=>$metaalbum,\n 'musicas'=>$metamusica\n ]\n\n ]\n ]\n ];\n }",
"public function listMetaformsWithHttpInfo($realmId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform[]';\n $request = $this->listMetaformsRequest($realmId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Metaform[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getMfaSettingsAsyncWithHttpInfo()\n {\n $returnType = '\\Reepay\\Model\\AccountMfaSettings';\n $request = $this->getMfaSettingsRequest();\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 getByIdAsyncWithHttpInfo($object_type)\n {\n $returnType = '\\HubSpot\\Client\\Crm\\Schemas\\Model\\ObjectSchema';\n $request = $this->getByIdRequest($object_type);\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 return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function getCustomProfileFieldsAsyncWithHttpInfo()\n {\n $returnType = 'JsonSuccessBase';\n $request = $this->getCustomProfileFieldsRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"protected function listMetaformsRequest($realmId)\n {\n // verify the required parameter 'realmId' is set\n if ($realmId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $realmId when calling listMetaforms'\n );\n }\n\n $resourcePath = '/realms/{realmId}/metaforms';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($realmId !== null) {\n $resourcePath = str_replace(\n '{' . 'realmId' . '}',\n ObjectSerializer::toPathValue($realmId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=utf-8'],\n ['application/json;charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function show($cari) {\n $meja = Meja::find($cari);\n\n if(!is_null($meja)) {\n return response([\n 'message' => 'Retrive Meja Success',\n 'data' => $meja\n ], 200);\n }\n\n return response([\n 'message' => 'Meja Not Found',\n 'data' => null\n ], 404);\n }",
"public function getDeviceCameraQualityAndRetentionAsyncWithHttpInfo($serial)\n {\n $returnType = 'object';\n $request = $this->getDeviceCameraQualityAndRetentionRequest($serial);\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 show($platform)\n {\n try {\n if (!request()->isJson())\n return $this->response->unauthorized();\n\n if (!is_numeric($platform))\n return $this->response->badRequest();\n\n $platformModel = Platform::find($platform);\n\n if (!isset($platformModel))\n return $this->response->noContent();\n\n return $this->response->success($platformModel->format());\n } catch (\\Exception $exception) {\n\n return $this->response->exception($exception->getMessage());\n }\n }",
"public function restStorageFrontendFileMetadataGetAsync($key)\n {\n return $this->restStorageFrontendFileMetadataGetAsyncWithHttpInfo($key)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function show($id)\n {\n $documentMeta = $this->documentMetaRepository->findWithoutFail($id);\n\n if (empty($documentMeta)) {\n Flash::error(__('messages.not-found'));\n\n return redirect(route('admin.documentMetas.index'));\n }\n\n return view('backend.document_metas.show', compact('documentMeta'));\n }",
"public function getDeviceCameraSenseAsyncWithHttpInfo($serial)\n {\n $returnType = 'object';\n $request = $this->getDeviceCameraSenseRequest($serial);\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 getDeviceCameraVideoSettingsAsyncWithHttpInfo($serial)\n {\n $returnType = 'object';\n $request = $this->getDeviceCameraVideoSettingsRequest($serial);\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 show($id)\n\t{\n\t\t//\n\t\t$http_status = 200;\n\t\t$data = array();\n\n\t\ttry{\n\t\t\t$recurso = IndicadorFASSAMeta::indicadorMetaDetalle()->with('metasTrimestre')->find($id);\n\t\t\tif($recurso){\n\t\t\t\t$mes_actual = intval(Util::obtenerMesActual());\n\n\t\t\t\t$recurso->load(array('registroAvance'=>function($query)use($mes_actual){\n\t\t\t\t\treturn $query->where('mes','<=',$mes_actual);\n\t\t\t\t},'comentario'));\n\n\t\t\t\t$recurso['mes_actual'] = $mes_actual;\n\t\t\t\t$data['data'] = $recurso;\n\t\t\t}else{\n\t\t\t\t$http_status = 404;\n\t\t\t\t$data = array(\"data\"=>\"No se ha podido encontrar el recurso solicitado.\",'code'=>'S01');\n\t\t\t}\n\t\t}catch(\\Exception $e){\n\t\t\t$http_status = 500;\n\t\t\t$data = array(\"data\"=>'Error al obtener los datos','code'=>'S03','ex'=>$e->getMessage());\n\t\t}\n\t\treturn Response::json($data,$http_status);\n\t}",
"public function info(): \\iota\\schemas\\response\\info {\n return $this->fetch([\n 'route' => \"info\",\n 'return' => \\iota\\schemas\\response\\Info::class,\n ]);\n }",
"public function getMeta($model)\n {\n }",
"protected function listProductMetaDataTypesRequest()\n {\n $resourcePath = '/product-meta-data-types';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\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 }",
"public function getForm(Request $request, $id) {\r\n $validator = Validator::make(\r\n ['id' => $id],\r\n ['id' => 'required|string|min:36|exists:form,id']\r\n );\r\n\r\n if ($validator->fails()) {\r\n return response()->json([\r\n 'msg' => 'Validation failed',\r\n 'err' => $validator->errors()\r\n ], $validator->statusCode());\r\n }\r\n\r\n $formModel = Form::with('sections', 'nameTranslation', 'versions', 'sections.questionGroups', 'sections.nameTranslation', 'sections.formSections.repeatPromptTranslation')->find($id);\r\n\r\n return response()->json([\r\n 'form' => $formModel\r\n ], Response::HTTP_OK);\r\n }",
"public function accountLocationGetAdHocSchemaAsyncWithHttpInfo()\n {\n $returnType = '\\Hut6\\CranaplusAcumaticaSdk\\Model\\AccountLocationModel';\n $request = $this->accountLocationGetAdHocSchemaRequest();\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 }"
] |
[
"0.54191184",
"0.514083",
"0.48361027",
"0.48174673",
"0.47267294",
"0.45695242",
"0.4363318",
"0.4334652",
"0.43134096",
"0.43119237",
"0.42671713",
"0.42151132",
"0.41365254",
"0.41231087",
"0.40395606",
"0.40381074",
"0.40362874",
"0.40190437",
"0.40155318",
"0.40111968",
"0.3996386",
"0.3989157",
"0.397849",
"0.39756042",
"0.397116",
"0.3963673",
"0.39607048",
"0.39435613",
"0.3927734",
"0.39153343"
] |
0.5628614
|
0
|
Create request for operation 'findMetaform'
|
protected function findMetaformRequest($realmId, $metaformId)
{
// verify the required parameter 'realmId' is set
if ($realmId === null) {
throw new \InvalidArgumentException(
'Missing the required parameter $realmId when calling findMetaform'
);
}
// verify the required parameter 'metaformId' is set
if ($metaformId === null) {
throw new \InvalidArgumentException(
'Missing the required parameter $metaformId when calling findMetaform'
);
}
$resourcePath = '/realms/{realmId}/metaforms/{metaformId}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($realmId !== null) {
$resourcePath = str_replace(
'{' . 'realmId' . '}',
ObjectSerializer::toPathValue($realmId),
$resourcePath
);
}
// path params
if ($metaformId !== null) {
$resourcePath = str_replace(
'{' . 'metaformId' . '}',
ObjectSerializer::toPathValue($metaformId),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers= $this->headerSelector->selectHeadersForMultipart(
['application/json;charset=utf-8']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json;charset=utf-8'],
['application/json;charset=utf-8']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
} 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('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $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(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"abstract function getForm();",
"public function getForm();",
"public function getFormRequestInstance();",
"public function formParams() {\n\t\tswitch($this->method()) {\n\t\tcase 'GET':\n\t\tcase 'DELETE':\n\t\tcase 'HEAD':\n\t\tcase 'OPTIONS':\n\t\tcase 'TRACE':\n\t\t\t$query_str = $this->queryString();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// TODO Validate Content-Type\n\t\t\t$query_str = $this->getBody();\n\t\t}\n\t\tparse_str($query_str, $result);\n\t\treturn $result;\n\t}",
"abstract protected function getForm();",
"public function sendMetadataForm($data, $form)\n {\n // Specify array for the params to send to the API. Can't be associative and keyed by the xmlname\n // as the Dublin core specification allows for multiple of the same field.\n $apiParams = array();\n\n // Loop through the defined fields grabbing the POSTed data for it, or if a placeholder\n // then just adding it and the specified value to the apiParams.\n foreach($this->Fields()->sort('SortOrder', 'asc') as $field) {\n // Like when the fields are looped through to create the form, str_replace the label to create the fieldname.\n $fieldName = str_replace(' ', '_', $field->Label);\n\n // If the field type is not a placeholder then get the data POSTed for it.\n if ($field->FieldType != 'PLACEHOLDER') {\n if (isset($data[$fieldName])) {\n // Check if the field is a dropdown and the 'other' option has been checked for it\n // if so then if the value selected is 'other' we need to grab the value out of the _other\n // field for it and pop that in the API params instead of the value selected in the dropdown.\n if ($field->DropdownOtherOption && $data[$fieldName] == 'other') {\n if (isset($data[\"${fieldName}_other\"])) {\n $apiParams[] = array('xmlname' => $field->DublinCoreFieldType()->XmlName, 'value' => trim($data[\"${fieldName}_other\"]));\n } else {\n $apiParams[] = array('xmlname' => $field->DublinCoreFieldType()->XmlName, 'value' => trim($data[$fieldName]));\n }\n } else {\n // Check if the field is a Keywords field. If so we need to append the string \"Keywords: \"\n // along with the keywords the admin specified to those entered by the user.\n if ($field->FieldType == 'KEYWORDS') {\n $keywordsString = 'Keywords: ';\n\n // If the admin entered some keywords (which is optional) add with one comma afterwards.\n if (trim($field->KeywordsValue)) {\n $keywordsString .= rtrim(trim($field->KeywordsValue), ',') . ', ';\n }\n\n // If the user entered some keywords then also add these on.\n if (trim($data[$fieldName])) {\n $keywordsString .= trim($data[$fieldName]);\n }\n\n // Finally set the keywords for the parameter to send to the catalogue.\n $apiParams[] = array('xmlname' => $field->DublinCoreFieldType()->XmlName, 'value' => $keywordsString);\n } else {\n // Else if regular field then just add its value to the params keyed by the XMLName.\n $apiParams[] = array('xmlname' => $field->DublinCoreFieldType()->XmlName, 'value' => trim($data[$fieldName]));\n }\n }\n }\n } else {\n // If it is placeholder then add it along with the admin defined placeholder value to the API params.\n $apiParams[] = array('xmlname' => $field->DublinCoreFieldType()->XmlName, 'value' => $field->PlaceholderValue);\n }\n }\n\n // Create an object of the MetadataPushAPI type sending the needed info to the constructor and then call the\n // execute command passing the apiParams. We need to try/catch it as it will throw and exception if there is\n // an issue or return the identifer of the newly created record if successful.\n $api = new MetadataPushApi($this->CataloguePushUrl, $this->CatalogueUsername, $this->CataloguePassword);\n $apiError = false;\n $apiErrorMessage = \"\";\n $newRecordId = \"\";\n\n try {\n $newRecordId = $api->execute($apiParams);\n }\n\n catch (Exception $exception) {\n $apiError = true;\n $apiErrorMessage = $exception->getMessage();\n }\n\n // If the push was not successful, then we need to retain the user's input on the form i.e. re-display it with all fields re-populated.\n if ($apiError) {\n // Remember the user's data, this will cause the form to re-populate.\n Session::set(\"FormData.{$form->getName()}.data\", $data);\n\n // Get the failure error message defined in the CMS and replace the speical {ERROR} variable with\n // the error message from the Catalogue API or HTML error code message.\n $errorMessage = nl2br(str_replace('{ERROR}', $apiErrorMessage, $this->PushFailureMessage));\n\n // Populate the error message to display on the form when it is re-loaded.\n $form->sessionMessage($errorMessage, 'bad', false);\n\n // Return the user back to the form page they just posted.\n return $this->redirectBack();\n } else {\n // No error, build link to view the new record which is displayed on the page and also included in the email.\n $newRecordLink = $this->CatalogueViewUrl . $newRecordId;\n\n // See if the AdditionalMessage checkbox is ticked, if so then get the value of the email user address\n // and User email message fields as this needs to be included in the email to the curator.\n $additionalMessageEmail = null;\n $additionalMessageText = null;\n\n if (!empty($data['AdditionalMessage'])) {\n $additionalMessageEmail = $data['AdditionalMessageEmail'];\n $additionalMessageText = $data['AdditionalMessageText'];\n }\n\n // Email the curators.\n foreach($this->Curators() as $curator) {\n $this->EmailCurator($curator->Name, $curator->Email, $this->CuratorEmailSubject, $this->CuratorEmailBody, $newRecordLink, $additionalMessageEmail, $additionalMessageText);\n }\n\n // Ensure that any form data in the session is cleared.\n Session::clear(\"FormData.{$form->getName()}.data\");\n\n // Get the success message replacing the link placeholder with a link to the newly created record.\n $successMessage = nl2br(str_replace('{LINK}', \"<a href='\" . $newRecordLink . \"' target='_blank'>\" . $newRecordLink . \"</a>\", $this->PushSuccessMessage));\n\n // Set the message in the session to this.\n $form->sessionMessage($successMessage, 'good', false);\n\n // Also add the link to the newly created record to an array in the session so we can display these on the form.\n // The links should be page specific which is why it ID is included.\n $createdRecords = Session::get('PostcardRecordsCreated_' . $this->ID);\n\n // If there are no records already in the current session then call function to check for the hidden fields on\n // the form which provide the information required to email a project coordinator, and if they exist sent an email.\n if (count($createdRecords) == 0) {\n $this->EmailCoordinator($data);\n }\n\n // Add the new reocrd to the created records array and then set back in the session.\n $createdRecords[] = $newRecordLink;\n Session::set('PostcardRecordsCreated_' . $this->ID, $createdRecords);\n\n // Return the user back to the form. The redirect back will take the user back to the form\n // with the original URL parameters which means the fields with parameters on the URL will be\n // populated again like they want.\n return $this->redirectBack();\n }\n }",
"public function createRequest();",
"public function createRequest();",
"function finishForm(& $agent) \n {\n $form = str_replace('{value}', $agent->query, $this->_inputTemplate);\n $form = str_replace('{name}', $this->_http_parameters['query'], $form);\n $form = str_replace('{namegroup}', $this->_http_parameters['group'], $form).'<br>';\n $form .= \"\\n\\tResults per page: \".$this->_getSelect(\n $this->_http_parameters['pagesize'],\n array('10' => '10', '20' => '20', '50' => '50')).'<br>';\n $form .= \"\\n\\tMatch: \".$this->_getSelect(\n $this->_http_parameters['mode'],\n array('All' => 'all', 'Any' => 'any', 'Boolean' => 'bool')).'<br>';\n $form .= \"\\n\\tSearch for: \".$this->_getSelect(\n $this->_http_parameters['wordmatch'],\n array(\n 'Whole word' => 'wrd',\n 'Beginning' => 'beg',\n 'Ending' => 'end',\n 'Substring' => 'sub'\n )).'<br>';\n $form .= \"\\n\\tSearch through: \".$this->_getSelect(\n $this->_http_parameters['type'],\n array(\n 'All types' => '',\n 'text/html' => 'text/html',\n 'text/plain' => 'text/plain'\n )).'<br>';\n $form .= \"\\n\\tSort by: \".$this->_getSelect(\n $this->_http_parameters['sortorder'],\n array('Relevancy' => 'RPD', 'Last Modified Date' => 'DRP')).'<br>';\n $form .= \"\\n\\tSearch in: \".$this->_getSelect(\n $this->_http_parameters['weightfactor'],\n array(\n 'all sections' => '2221',\n 'Description' => '2000',\n 'Keywords' => '0200',\n 'Title' => '0020',\n 'Body' => '0001'\n )).'<br>';\n \n $this->_form = str_replace('{content}', $form, $this->_formTemplate); \n $this->_html = $this->_form.\"\\n<hr>\".$this->_html;\n }",
"abstract protected function getFormTypeParams();",
"abstract public function getForm() : void;",
"abstract protected function getRequiredRequestParameters();",
"public function get_fields_for_response($request)\n {\n }",
"abstract protected function getFormTypeQuery();",
"public function getCustomProfileFieldsRequest()\n {\n\n $resourcePath = '/realm/profile_fields';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public static function getForm();",
"public function retrieveForms()\n {\n return $this->start()->uri(\"/api/form\")\n ->get()\n ->go();\n }",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"public function getRequest();",
"public function toApi(): FormResource;",
"public function getSearchForm() {\n $response = array();\n $this->_searchForm = Engine_Api::_()->getDbTable('searchformsetting', 'seaocore');\n $widgetSettings = $this->_getBrowseMembersWidgetSettings('sitemember.search-sitemember');\n $widgetSettings = !empty($widgetSettings) ? $widgetSettings : array(\"whatWhereWithinmile\" => 0, \"advancedSearch\" => 0, \"locationDetection\" => 0);\n\n // Set default value of \"whatWhereWithinmile\"\n $response['whatWhereWithinmile'] = 0;\n if (isset($widgetSettings['whatWhereWithinmile']))\n $response['whatWhereWithinmile'] = (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemember')) ? 1 : 0;\n\n // Form Elements: Profile Types\n $this->_profileFieldsArray = $getProfileTypes = $this->_getProfileTypes();\n if (!empty($getProfileTypes)) {\n $response['form'][] = array(\n 'type' => 'Select',\n 'name' => 'profile_type',\n 'label' => $this->_translate('What'),\n 'multiOptions' => $getProfileTypes,\n );\n }\n\n // Form Elements: Search\n $row = $this->_searchForm->getFieldsOptions('sitemember', 'search');\n if (!empty($row) && !empty($row->display)) {\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'search',\n 'label' => empty($widgetSettings['whatWhereWithinmile']) ? $this->_translate('Name / Keyword') : $this->_translate('Who')\n );\n }\n\n // Form Elements: Location\n $row = $this->_searchForm->getFieldsOptions('sitemember', 'location');\n if (Engine_Api::_()->getApi('settings', 'core')->getSetting('sitemember.location.enable', 1) && !empty($row) && !empty($row->display)) {\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'location',\n 'label' => empty($widgetSettings['whatWhereWithinmile']) ? $this->_translate('Location') : $this->_translate('Where')\n );\n\n // Form Elements: Proximate\n $row = $this->_searchForm->getFieldsOptions('sitemember', 'proximity');\n if (!empty($row) && !empty($row->display)) {\n $response['form'][] = $this->_getProximate();\n }\n }\n\n// $response['form'][] = array(\n// 'type' => 'Hidden',\n// 'name' => 'advanced_search',\n// 'label' => $this->_translate('Advanced Search'),\n// 'value' => $response['whatWhereWithinmile']\n// );\n // Form Elements: Show\n $row = $this->_searchForm->getFieldsOptions('sitemember', 'show');\n if (!empty($row) && !empty($row->display)) {\n $showMultiOptions = array();\n $showMultiOptions[\"1\"] = 'All Members';\n $showMultiOptions[\"2\"] = 'Only My Friends';\n $showMultiOptions[\"4\"] = \"Members I Like\";\n $showMultiOptions[\"5\"] = \"Only Featured\";\n $showMultiOptions[\"6\"] = \"Only Sponsored\";\n $showMultiOptions[\"7\"] = \"Both Featured & Sponsored\";\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('siteverify'))\n $showMultiOptions[\"8\"] = \"Members I've Verified\";\n\n $networkShow = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitemember.network.show', 0);\n if (empty($networkShow)) {\n $viewer_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n $networkMembershipTable = Engine_Api::_()->getDbtable('membership', 'network');\n $viewerNetwork = $networkMembershipTable->fetchRow(array('user_id = ?' => $viewer_id));\n if (!empty($viewerNetwork))\n $showMultiOptions[\"3\"] = 'Only My Networks';\n }\n\n $response['form'][] = array(\n 'type' => 'Select',\n 'name' => 'show',\n 'label' => $this->_translate('Show'),\n 'multiOptions' => $showMultiOptions,\n );\n }\n\n // Form Elements: Networks\n $networkshow = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitemember.network.show', 0);\n if (empty($networkshow)) {\n $row = $this->_searchForm->getFieldsOptions('sitemember', 'network_id');\n if (!empty($row) && !empty($row->display)) {\n $networks = Engine_Api::_()->getDbTable('networks', 'network');\n $networksname = $networks->info('name');\n $select = $networks->select()->from($networksname);\n $result = $networks->fetchAll($select);\n if (count($result) != 0) {\n foreach ($result as $results) {\n $networkTitle[$results->network_id] = $results->title;\n }\n\n $response['form'][] = array(\n 'type' => 'Select',\n 'name' => 'network_id',\n 'label' => $this->_translate('Networks'),\n 'multiOptions' => $networkTitle,\n );\n }\n }\n }\n\n // Form Elements: Order By\n $row = $this->_searchForm->getFieldsOptions('sitemember', 'orderby');\n if (!empty($row) && !empty($row->display)) {\n $multiOPtionsOrderBy = array(\n '' => '',\n 'creation_date' => 'Most Recent',\n 'view_count' => 'Most Viewed',\n 'like_count' => 'Most Liked',\n 'member_count' => 'Most Popular',\n 'title' => \"Alphabetical (A-Z)\",\n 'title_reverse' => 'Alphabetical (Z-A)'\n );\n\n if (Engine_Api::_()->getApi('settings', 'core')->getSetting('sitemember.location.enable', 1))\n $multiOPtionsOrderBy['distance'] = \"Distance\";\n\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('siteverify'))\n $multiOPtionsOrderBy['verify_count'] = 'Most Verified';\n\n $response['form'][] = array(\n 'type' => 'Select',\n 'name' => 'orderby',\n 'label' => $this->_translate('Browse By'),\n 'multiOptions' => $multiOPtionsOrderBy,\n );\n }\n\n // Form Elements: Street\n $rowStreet = Engine_Api::_()->getDbTable('searchformsetting', 'seaocore')->getFieldsOptions('sitemember', 'street');\n if (!empty($rowStreet) && !empty($rowStreet->display)) {\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'sitemember_street',\n 'label' => $this->_translate('Street')\n );\n }\n\n // Form Elements: City\n $rowCity = $this->_searchForm->getFieldsOptions('sitemember', 'city');\n if (!empty($rowCity) && !empty($rowCity->display)) {\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'sitemember_city',\n 'label' => $this->_translate('City')\n );\n }\n\n // Form Elements: State\n $rowState = $this->_searchForm->getFieldsOptions('sitemember', 'state');\n if (!empty($rowState) && !empty($rowState->display)) {\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'sitemember_state',\n 'label' => $this->_translate('State')\n );\n }\n\n // Form Elements: Country\n $rowCountry = $this->_searchForm->getFieldsOptions('sitemember', 'country');\n if (!empty($rowCountry) && !empty($rowCountry->display)) {\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'sitemember_country',\n 'label' => $this->_translate('Country')\n );\n }\n\n // Form Elements: Is Online\n $row = $this->_searchForm->getFieldsOptions('sitemember', 'is_online');\n if (!empty($row) && !empty($row->display)) {\n $response['form'][] = array(\n 'type' => 'Checkbox',\n 'name' => 'is_online',\n 'label' => $this->_translate('Only Online Members')\n );\n }\n\n // Form Elements: Has Photo\n $row = $this->_searchForm->getFieldsOptions('sitemember', 'has_photo');\n if (!empty($row) && !empty($row->display)) {\n $response['form'][] = array(\n 'type' => 'Checkbox',\n 'name' => 'has_photo',\n 'label' => $this->_translate('Only Members With Photos')\n );\n }\n\n $response['form'][] = array(\n 'type' => 'Submit',\n 'name' => 'done',\n 'label' => $this->_translate('Search')\n );\n\n $response['fields'] = $this->_getProfileFields(array(), true);\n return $response;\n }",
"public function getForm(object $parameters, object $data, object $headers): object\n {\n $this->checkParameters(['uuid'], $parameters);\n\n // Get form from DB\n $data->form = Form::whereUuid($parameters->uuid)->with('template', 'state')->first();\n\n return $data;\n }",
"public function getFormInObject()\n {\n $sExKey = null;\n\n if ($this->_iIdEntity > 0 && $this->_sSynchronizeEntity !== null && count($_POST) < 1) {\n\n $sModelName = str_replace('Entity', 'Model', $this->_sSynchronizeEntity);\n $oModel = new $sModelName;\n\n $oEntity = new $this->_sSynchronizeEntity;\n $sPrimaryKey = LibEntity::getPrimaryKeyNameWithoutMapping($oEntity);\n $sMethodName = 'findOneBy'.$sPrimaryKey;\n $oCompleteEntity = call_user_func_array(array(&$oModel, $sMethodName), array($this->_iIdEntity));\n\n if (is_object($oCompleteEntity)) {\n\n foreach ($this->_aElement as $sKey => $sValue) {\n\n\t\t\t\t\tif ($sValue instanceof \\Venus\\lib\\Form\\Input && $sValue->getType() == 'submit') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n if ($sValue instanceof \\Venus\\lib\\Form\\Radio) {\n\n $sExKey = $sKey;\n $sKey = substr($sKey, 0, -6);\n }\n\n if ($sValue instanceof Form) {\n\n ;\n } else {\n\n $sMethodNameInEntity = 'get_'.$sKey;\n\t\t\t\t\t\tif (method_exists($oCompleteEntity, $sMethodNameInEntity)) {\n\t\t\t\t\t\t\t$mValue = $oCompleteEntity->$sMethodNameInEntity();\n\t\t\t\t\t\t}\n\n if ($sValue instanceof \\Venus\\lib\\Form\\Radio && method_exists($this->_aElement[$sExKey], 'setValueChecked')) {\n\n $this->_aElement[$sExKey]->setValueChecked($mValue);\n } else if (isset($mValue) && method_exists($this->_aElement[$sKey], 'setValue')) {\n\n $this->_aElement[$sKey]->setValue($mValue);\n }\n }\n }\n }\n }\n\n $oForm = new \\StdClass();\n $oForm->start = '<form name=\"form'.$this->_iFormNumber.'\" method=\"post\" enctype=\"multipart/form-data\"><input type=\"hidden\" value=\"1\" name=\"validform'.$this->_iFormNumber.'\">';\n $oForm->form = array();\n\n foreach ($this->_aElement as $sKey => $sValue) {\n\n if ($sValue instanceof Container) {\n\n $oForm->form[$sKey] = $sValue;\n } else {\n\n $oForm->form[$sKey] = $sValue->fetch();\n }\n }\n\n $oForm->end = '</form>';\n\n return $oForm;\n }",
"public abstract function formRequest($responseObject, $pack, $instanceNumber, $memberDetail=null);"
] |
[
"0.551111",
"0.5395909",
"0.5349085",
"0.5336188",
"0.5300843",
"0.52629983",
"0.524762",
"0.524762",
"0.5225418",
"0.5169984",
"0.5143016",
"0.5133814",
"0.5120568",
"0.5106406",
"0.50556815",
"0.50493896",
"0.5038962",
"0.5028992",
"0.5028992",
"0.5028992",
"0.5028992",
"0.5028992",
"0.5028992",
"0.5028992",
"0.5028992",
"0.5006494",
"0.5005892",
"0.50005996",
"0.4980244",
"0.49475977"
] |
0.5407247
|
1
|
Operation listMetaformsWithHttpInfo Lists Metaforms
|
public function listMetaformsWithHttpInfo($realmId)
{
$returnType = '\Metatavu\Metaform\Api\Model\Metaform[]';
$request = $this->listMetaformsRequest($realmId);
try {
try {
$response = $this->client->send($request);
} catch (RequestException $e) {
$umaResponse = $this->umaRetry($request, $e);
if ($umaResponse) {
$response = $umaResponse;
} else {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null
);
}
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Metatavu\Metaform\Api\Model\Metaform[]',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Metatavu\Metaform\Api\Model\BadRequest',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 403:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Metatavu\Metaform\Api\Model\Forbidden',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 500:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Metatavu\Metaform\Api\Model\InternalServerError',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function v1PropertyTemplatesFormsGetWithHttpInfo($accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesFormsGetRequest($accept_language);\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\\TemplateMetadataResponse[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ProblemDetails',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function listMetaformsAsyncWithHttpInfo($realmId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform[]';\n $request = $this->listMetaformsRequest($realmId);\n\n return $this->client\n ->sendAsync($request)\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 }",
"function list_meta($meta)\n {\n }",
"public function findMetaformWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->findMetaformRequest($realmId, $metaformId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Metaform',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\NotFound',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function listMetaforms($realmId)\n {\n list($response) = $this->listMetaformsWithHttpInfo($realmId);\n return $response;\n }",
"public static function getFormsList() {\n\n return RGFormsModel::get_forms(null, \"title\");\n }",
"function all_awm_meta_libraries()\n {\n $metaBoxes = $options = array();\n $metas = new AWM_Meta();\n $metaBoxes['metas'] = $metas->meta_boxes();\n $metaBoxes['term'] = $metas->term_meta_boxes();\n $metaBoxes['options'] = $metas->options_boxes();\n $metaBoxes['user'] = $metas->user_boxes();\n if (!empty($metaBoxes)) {\n foreach ($metaBoxes as $key => $data) {\n $afterfix = __('Post type metabox', 'extend-wp');\n switch ($key) {\n case 'user':\n $afterfix = __('User metabox', 'extend-wp');\n break;\n case 'term':\n $afterfix = __('Taxonomy metabox', 'extend-wp');\n break;\n case 'options':\n $afterfix = __('Option metabox', 'extend-wp');\n break;\n }\n foreach ($data as $meta_key => $meta_data) {\n $name = $meta_data['title'] . ' - ' . $afterfix;;\n $options[$meta_key] = array('label' => $name);\n }\n }\n }\n return $options;\n }",
"public function v1PropertyTemplatesFormsGetAsyncWithHttpInfo($accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesFormsGetRequest($accept_language);\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 add_meta_boxes() {\n\t\tglobal $current_screen;\n\n\t\t$page_main = $this->_admin_pages[ 'vfb-pro' ];\n\n\t\tif ( $current_screen->id == $page_main && isset( $_REQUEST['form'] ) ) {\n\t\t\tadd_meta_box( 'vfb_form_switcher', __( 'Quick Switch', 'visual-form-builder-pro' ), array( &$this, 'meta_box_switch_form' ), $page_main, 'side', 'high' );\n\t\t\tadd_meta_box( 'vfb_form_items_meta_box', __( 'Form Items', 'visual-form-builder-pro' ), array( &$this, 'meta_box_form_items' ), $page_main, 'side', 'high' );\n\t\t\tadd_meta_box( 'vfb_form_media_button_tip', __( 'Display Forms', 'visual-form-builder-pro' ), array( &$this, 'meta_box_display_forms' ), $page_main, 'side', 'low' );\n\t\t}\n\t}",
"protected function listMetaformsRequest($realmId)\n {\n // verify the required parameter 'realmId' is set\n if ($realmId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $realmId when calling listMetaforms'\n );\n }\n\n $resourcePath = '/realms/{realmId}/metaforms';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($realmId !== null) {\n $resourcePath = str_replace(\n '{' . 'realmId' . '}',\n ObjectSerializer::toPathValue($realmId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=utf-8'],\n ['application/json;charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listForms();",
"public function actionMeta() {\n\t\ttry {\n\t\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.structure.controllers');\n\t\t\t$notice = false;\n\t\t\tif(isset($_POST[Html::modelName('sweelix\\yii1\\admin\\core\\models\\Meta')]) === true) {\n\t\t\t\tforeach($_POST[Html::modelName('sweelix\\yii1\\admin\\core\\models\\Meta')] as $swfMeta) {\n\t\t\t\t\t$formMeta = new FormMeta('content');\n\t\t\t\t\t$formMeta->attributes = $swfMeta;\n\t\t\t\t\t$formMeta->contentId = $this->currentContent->contentId;\n\t\t\t\t\tif($formMeta->validate() === true) {\n\t\t\t\t\t\tif(\\CPropertyValue::ensureBoolean($formMeta->metaModeOverride) === true) {\n\t\t\t\t\t\t\t$contentMeta = ContentMeta::model()->findByPk(array('contentId'=>$formMeta->contentId, 'metaId'=>$formMeta->metaId));\n\t\t\t\t\t\t\tif($contentMeta === null) {\n\t\t\t\t\t\t\t\t$contentMeta = new ContentMeta();\n\t\t\t\t\t\t\t\t$contentMeta->contentId = $formMeta->contentId;\n\t\t\t\t\t\t\t\t$contentMeta->metaId = $formMeta->metaId;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$contentMeta->contentMetaValue = $formMeta->metaValue;\n\t\t\t\t\t\t\t$contentMeta->save();\n\t\t\t\t\t\t\tunset($contentMeta);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tContentMeta::model()->deleteByPk(array(\n\t\t\t\t\t\t\t\t'contentId'=>$this->currentContent->contentId,\n\t\t\t\t\t\t\t\t'metaId'=>$formMeta->metaId\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\t$notice = true;\n\t\t\t}\n\t\t\t$realMetas = Meta::model()->findAll(array('order'=>'metaId ASC'));\n\t\t\t$metas = array();\n\t\t\tforeach($realMetas as $realMeta) {\n\t\t\t\t$contentMeta = ContentMeta::model()->findByAttributes(array(\n\t\t\t\t\t'contentId'=>$this->currentContent->contentId,\n\t\t\t\t\t'metaId'=>$realMeta->metaId\n\t\t\t\t));\n\t\t\t\t$formMeta = new FormMeta('content');\n\t\t\t\t$formMeta->attributes = $realMeta->attributes;\n\t\t\t\t$formMeta->contentId = $this->currentContent->contentId;\n\t\t\t\tif($contentMeta !== null) {\n\t\t\t\t\t$formMeta->metaValue = $contentMeta->contentMetaValue;\n\t\t\t\t\t$formMeta->metaModeOverride = true;\n\t\t\t\t} else {\n\t\t\t\t\t$formMeta->metaModeOverride = false;\n\t\t\t\t}\n\t\t\t\t$metas[] = $formMeta;\n\t\t\t}\n\t\t\t$contentCriteriaBuilder = new CriteriaBuilder('content');\n\t\t\t$contentCriteriaBuilder->filterBy('contentId', $this->currentContent->contentId);\n\n\t\t\t$this->setCurrentNode($this->currentContent->node);\n\t\t\tif(\\Yii::app()->request->isAjaxRequest === true) {\n\t\t\t\t$this->renderPartial('_meta', array(\n\t\t\t\t\t\t'content' => $this->currentContent,\n\t\t\t\t\t\t'metas'=>$metas,\n\t\t\t\t\t\t'contentsDataProvider' => $contentCriteriaBuilder->getActiveDataProvider(array('pagination' => false)),\n\t\t\t\t\t\t'notice' => $notice,\n\t\t\t\t));\n\t\t\t} else {\n\t\t\t\t$this->render('meta', array(\n\t\t\t\t\t'breadcrumb' => $this->buildBreadcrumb($this->currentContent->contentId),\n\t\t\t\t\t'mainMenu' => $this->buildMainMenu(2, 3),\n\t\t\t\t\t'metas'=>$metas,\n\t\t\t\t\t'content' => $this->currentContent,\n\t\t\t\t\t'node' => $this->currentNode,\n\t\t\t\t\t'contentsDataProvider' => $contentCriteriaBuilder->getActiveDataProvider(array('pagination' => false)),\n\t\t\t\t\t'notice' => $notice,\n\t\t\t\t));\n\t\t\t}\n\t\t} catch(\\Exception $e) {\n\t\t\t\\Yii::log('Error in '.__METHOD__.'():'.$e->getMessage(), \\CLogger::LEVEL_ERROR, 'sweelix.yii1.admin.structure.controllers');\n\t\t\tthrow $e;\n\t\t}\n\t}",
"function GetMetaInfo(){\r\n\r\n\treturn !empty($_POST['app_meta'])? json_decode($_POST['app_meta'],true):array();\r\n}",
"public function add_meta_boxes() {\n global $current_screen;\n\n $page_main = $this->_admin_pages['swpm'];\n\n if ($current_screen->id == $page_main && isset($_REQUEST['form'])) {\n add_meta_box('swpm_form_items_meta_box', __('Form Items', 'swpm-form-builder'), array(&$this, 'meta_box_form_items'), $page_main, 'side', 'high');\n }\n }",
"protected function forms()\r\n {\r\n $metaFileInfo = $this->getFormObj()->GetMetaFileInfo();\r\n $modulePath = $metaFileInfo['modules_path'];\r\n $modulePath = substr($modulePath,0,strlen($modulePath)-1);\r\n global $g_MetaFiles;\r\n php_grep(\"<EasyForm\", $modulePath);\r\n \r\n for ($i=0; $i<count($g_MetaFiles); $i++)\r\n {\r\n $g_MetaFiles[$i] = str_replace('/','.',str_replace(array($modulePath.'/','.xml'),'', $g_MetaFiles[$i]));\r\n $list[$i]['val'] = $g_MetaFiles[$i];\r\n $list[$i]['txt'] = $g_MetaFiles[$i];\r\n }\r\n\r\n return $list; \r\n }",
"protected function getFormList()\n {\n $formList = [];\n foreach ($this->availableAuthenticators as $key => $className) {\n /** @var BootstrapMFAAuthenticator $class */\n $class = Injector::inst()->get($className);\n $formList[] = $class->getMFAForm($this, static::VERIFICATION_METHOD);\n }\n\n return $formList;\n }",
"protected function getMetas(): array\n {\n return $this->metas;\n }",
"protected function listProductMetaDataTypesRequest()\n {\n $resourcePath = '/product-meta-data-types';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\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 }",
"public static function registerMetaBoxes() {}",
"public function getMetaboxes()\n\t{\n\t\treturn $this->_metaboxes;\n\t}",
"public function v1PropertyTemplatesClaimsClaimTemplateIdFormsGetWithHttpInfo($claim_template_id, $accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesClaimsClaimTemplateIdFormsGetRequest($claim_template_id, $accept_language);\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\\TemplateMetadataResponse[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ProblemDetails',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function v1PropertyTemplatesClaimsGetWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesClaimsGetRequest();\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\\TemplateMetadataResponse[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ProblemDetails',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"function awm_basic_meta_structure($fields)\n {\n $metas = array();\n\n foreach ($fields as $field) {\n $meta_key = awm_clean_string($field['key']);\n $metas[$meta_key] = $field;\n $metas[$meta_key]['label'] = __($field['label'], 'extend-wp');\n\n $metas[$meta_key]['class'] = !empty($field['class']) ? explode(',', $field['class']) : array();\n $attributes = array();\n if (isset($field['attributes'])) {\n foreach ($field['attributes'] as $attribute) {\n if (!empty($attribute['label']) && !empty($attribute['value'])) {\n $attributes[$attribute['label']] = $attribute['value'];\n }\n }\n }\n $metas[$meta_key]['attributes'] = $attributes;\n switch ($field['case']) {\n case 'select':\n case 'radio':\n $metas[$meta_key]['options'] = array();\n if (!empty($field['options'])) {\n foreach ($field['options'] as $option) {\n $metas[$meta_key]['options'][$option['option']] = array('label' => __($option['label'], 'extend-wp'));\n }\n }\n break;\n }\n }\n\n return $metas;\n }",
"public function apb_add_meta_boxes() {\r\n\t}",
"public function getMeta(): array\n {\n return [];\n }",
"public function registerMetaBoxes()\n\t {\n\t \t$dataMetas = self::getDataMetas();\n\n\t \tif ( !empty($dataMetas) ) {\n\t \t\tforeach ($dataMetas as $key => $meta) {\n\t \t\t\t/* CHECK IF HAS PAGES */\n\t \t\t\tif ( isset($meta[\"_pages\"]) && !empty($meta[\"_pages\"][0]) ) {\n\t \t\t\t\tself::createMetasPages($meta);\n\t \t\t\t}\n\n\t \t\t\t/* POSTS TYPES REGISTER METAS */\n\t \t\t\tif ( isset($meta[\"_posts_types\"]) && !empty($meta[\"_posts_types\"][0]) ) {\n\t \t\t\t\tself::createMetasPostTypes($meta);\n\t \t\t\t}\n\n\t \t\t\t/* CHECK IF ALL POSTS IS true */\n\t \t\t\tif ( isset($meta[\"_all_posts\"]) && $meta['_all_posts'] == 'yes' ) {\n\t \t\t\t\tself::createMetasPosts($meta);\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\n\t }",
"function getMeta(){\n\t\t$AccessToken = Auth::token();\n\t\t$baseUrl = url . '/api/v1/' . customerAlias . '/' . databaseAlias;\n\t\t$endpoint = '/meta';\n\t\t$request = $baseUrl . $endpoint;\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(\n\t\t CURLOPT_HTTPGET => true,\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t\t'Authorization: Bearer ' . $AccessToken),\n\t\t CURLOPT_URL => $request,\n\t\t\tCURLOPT_RETURNTRANSFER => 1\n\t\t ));\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $response;\n\t}",
"function get_meta_objs() {\n return $this->meta_objs;\n }",
"public function getMeta(): array;",
"public function v1PropertyTemplatesClaimsClaimTemplateIdFormsGetAsyncWithHttpInfo($claim_template_id, $accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesClaimsClaimTemplateIdFormsGetRequest($claim_template_id, $accept_language);\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 }"
] |
[
"0.5238683",
"0.5232897",
"0.51853645",
"0.516035",
"0.5020101",
"0.49759573",
"0.49641126",
"0.4889973",
"0.48821706",
"0.48731506",
"0.48414937",
"0.4817264",
"0.47930762",
"0.4717237",
"0.47140902",
"0.47070557",
"0.47042072",
"0.46868706",
"0.46780822",
"0.46423754",
"0.46392542",
"0.46345338",
"0.46170852",
"0.46076766",
"0.4562984",
"0.45615318",
"0.45392415",
"0.45299387",
"0.4520282",
"0.45002675"
] |
0.63675046
|
0
|
Operation listMetaformsAsync Lists Metaforms
|
public function listMetaformsAsync($realmId)
{
return $this->listMetaformsAsyncWithHttpInfo($realmId)
->then(
function ($response) {
return $response[0];
}
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function getFormsList() {\n\n return RGFormsModel::get_forms(null, \"title\");\n }",
"public function listForms();",
"public function listMetaformsAsyncWithHttpInfo($realmId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform[]';\n $request = $this->listMetaformsRequest($realmId);\n\n return $this->client\n ->sendAsync($request)\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 }",
"function list_meta($meta)\n {\n }",
"protected function getFormList()\n {\n $formList = [];\n foreach ($this->availableAuthenticators as $key => $className) {\n /** @var BootstrapMFAAuthenticator $class */\n $class = Injector::inst()->get($className);\n $formList[] = $class->getMFAForm($this, static::VERIFICATION_METHOD);\n }\n\n return $formList;\n }",
"public function listforms()\n {\n\t\t\n }",
"public function all()\n {\n $endpoint = 'https://api.hubapi.com/forms/v2/forms';\n\n return $this->client->request('get', $endpoint);\n }",
"public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }",
"public function getFormsList()\n {\n $forms = cms_forms::all();\n $pages = cms_pages::lists('title', 'id');\n\n\n $asset_folder = Config::get('cms.asset_folder');\n\n\n $pages[0] = 'no page';\n return view(\"cms::formsList\", ['forms' => $forms,\n 'pages' => $pages,\n 'asset_folder' => $asset_folder\n ]\n );\n }",
"public function actionMeta() {\n\t\ttry {\n\t\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.structure.controllers');\n\t\t\t$notice = false;\n\t\t\tif(isset($_POST[Html::modelName('sweelix\\yii1\\admin\\core\\models\\Meta')]) === true) {\n\t\t\t\tforeach($_POST[Html::modelName('sweelix\\yii1\\admin\\core\\models\\Meta')] as $swfMeta) {\n\t\t\t\t\t$formMeta = new FormMeta('content');\n\t\t\t\t\t$formMeta->attributes = $swfMeta;\n\t\t\t\t\t$formMeta->contentId = $this->currentContent->contentId;\n\t\t\t\t\tif($formMeta->validate() === true) {\n\t\t\t\t\t\tif(\\CPropertyValue::ensureBoolean($formMeta->metaModeOverride) === true) {\n\t\t\t\t\t\t\t$contentMeta = ContentMeta::model()->findByPk(array('contentId'=>$formMeta->contentId, 'metaId'=>$formMeta->metaId));\n\t\t\t\t\t\t\tif($contentMeta === null) {\n\t\t\t\t\t\t\t\t$contentMeta = new ContentMeta();\n\t\t\t\t\t\t\t\t$contentMeta->contentId = $formMeta->contentId;\n\t\t\t\t\t\t\t\t$contentMeta->metaId = $formMeta->metaId;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$contentMeta->contentMetaValue = $formMeta->metaValue;\n\t\t\t\t\t\t\t$contentMeta->save();\n\t\t\t\t\t\t\tunset($contentMeta);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tContentMeta::model()->deleteByPk(array(\n\t\t\t\t\t\t\t\t'contentId'=>$this->currentContent->contentId,\n\t\t\t\t\t\t\t\t'metaId'=>$formMeta->metaId\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\t$notice = true;\n\t\t\t}\n\t\t\t$realMetas = Meta::model()->findAll(array('order'=>'metaId ASC'));\n\t\t\t$metas = array();\n\t\t\tforeach($realMetas as $realMeta) {\n\t\t\t\t$contentMeta = ContentMeta::model()->findByAttributes(array(\n\t\t\t\t\t'contentId'=>$this->currentContent->contentId,\n\t\t\t\t\t'metaId'=>$realMeta->metaId\n\t\t\t\t));\n\t\t\t\t$formMeta = new FormMeta('content');\n\t\t\t\t$formMeta->attributes = $realMeta->attributes;\n\t\t\t\t$formMeta->contentId = $this->currentContent->contentId;\n\t\t\t\tif($contentMeta !== null) {\n\t\t\t\t\t$formMeta->metaValue = $contentMeta->contentMetaValue;\n\t\t\t\t\t$formMeta->metaModeOverride = true;\n\t\t\t\t} else {\n\t\t\t\t\t$formMeta->metaModeOverride = false;\n\t\t\t\t}\n\t\t\t\t$metas[] = $formMeta;\n\t\t\t}\n\t\t\t$contentCriteriaBuilder = new CriteriaBuilder('content');\n\t\t\t$contentCriteriaBuilder->filterBy('contentId', $this->currentContent->contentId);\n\n\t\t\t$this->setCurrentNode($this->currentContent->node);\n\t\t\tif(\\Yii::app()->request->isAjaxRequest === true) {\n\t\t\t\t$this->renderPartial('_meta', array(\n\t\t\t\t\t\t'content' => $this->currentContent,\n\t\t\t\t\t\t'metas'=>$metas,\n\t\t\t\t\t\t'contentsDataProvider' => $contentCriteriaBuilder->getActiveDataProvider(array('pagination' => false)),\n\t\t\t\t\t\t'notice' => $notice,\n\t\t\t\t));\n\t\t\t} else {\n\t\t\t\t$this->render('meta', array(\n\t\t\t\t\t'breadcrumb' => $this->buildBreadcrumb($this->currentContent->contentId),\n\t\t\t\t\t'mainMenu' => $this->buildMainMenu(2, 3),\n\t\t\t\t\t'metas'=>$metas,\n\t\t\t\t\t'content' => $this->currentContent,\n\t\t\t\t\t'node' => $this->currentNode,\n\t\t\t\t\t'contentsDataProvider' => $contentCriteriaBuilder->getActiveDataProvider(array('pagination' => false)),\n\t\t\t\t\t'notice' => $notice,\n\t\t\t\t));\n\t\t\t}\n\t\t} catch(\\Exception $e) {\n\t\t\t\\Yii::log('Error in '.__METHOD__.'():'.$e->getMessage(), \\CLogger::LEVEL_ERROR, 'sweelix.yii1.admin.structure.controllers');\n\t\t\tthrow $e;\n\t\t}\n\t}",
"function GetAll()\n {\n $this->abrir_conexion();\n $sql = \"SELECT * FROM metas order by meta_id\";\n $resultado = mysqli_query($this->db, $sql);\n\n while ($row = mysqli_fetch_assoc($resultado)) {\n $datos[] = $row;\n }\n\n return $datos;\n $this->cerrar_conexion();\n }",
"public function getOwnershipFormsListAction(array $options = []): Model;",
"public function retrieveForms()\n {\n return $this->start()->uri(\"/api/form\")\n ->get()\n ->go();\n }",
"private function getMClist()\n {\n return DB::table('absence')->join('teacher', 'absence.short_name', '=', 'teacher.short_name')\n ->get();\n// return Teacher::whereIn('short_name',Absence::where('date','=',new DateTime('today'))->lists('short_name'))->has('absence')->get();\n }",
"public function test_list_all_medicao() {\n $response = $this->get(url('/api/medicao'))\n ->assertStatus(200);\n }",
"public function listMagazines()\n {\n return View::make('maglist')\n ->with('title', 'Magazines List')\n ->with('magazines', Magazine::all());\n }",
"public function listMetaforms($realmId)\n {\n list($response) = $this->listMetaformsWithHttpInfo($realmId);\n return $response;\n }",
"public function showMeta()\n {\n $query = $this->pdo->prepare(\"SHOW META\");\n $query->execute();\n return $query->fetchAll();\n }",
"protected function listMetaformsRequest($realmId)\n {\n // verify the required parameter 'realmId' is set\n if ($realmId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $realmId when calling listMetaforms'\n );\n }\n\n $resourcePath = '/realms/{realmId}/metaforms';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($realmId !== null) {\n $resourcePath = str_replace(\n '{' . 'realmId' . '}',\n ObjectSerializer::toPathValue($realmId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=utf-8'],\n ['application/json;charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listMetaformsWithHttpInfo($realmId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform[]';\n $request = $this->listMetaformsRequest($realmId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Metaform[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function getMetas(): array\n {\n return $this->metas;\n }",
"public function index()\n\t{\n\t\t$marcas = $this->marca->all();\n\t\treturn $marcas;\n\t}",
"public function index()\n {\n return $this->collection(Matakuliah::all(), new MatakuliahTransformer);\n }",
"function fetchAllForms () {\n global $wpdb;\n $table_name = $wpdb->prefix . \"dx_forms_meta_data\";\n $dbResults = $wpdb->get_results( \"SELECT * FROM $table_name\" );\n\n echo \"<h1>All forms</h1>\";\n\n // loop through all forms\n foreach ($dbResults as $row) {\n ?>\n <div>Last updated on: <?= date(\"F j, Y. g:i A\",strtotime($row->timestamp)) ?></div>\n <div><?= $row->form_name ?></div>\n <h3>Form submissions</h3>\n <?php\n // get field mappings (ID to name) from DB row\n $field_mappings = json_decode($row->field_mappings, true);\n \n $this->fetchFormSubmissions($row->form_id, $field_mappings);\n }\n\n echo \"<hr>\";\n }",
"public function index()\n {\n $fcms = Fcm::all();\n return $fcms;\n }",
"public function getAllMeta()\n {\n return $this->meta;\n }",
"public function index()\n {\n //\n $medioPlataformas = MedioPlataforma::all();\n\n return response()->json([\n 'ready' => true,\n 'medioPlataformas' => $medioPlataformas,\n ]);\n }",
"public function index()\n {\n $marcas = Modelo::with(['marca'])->orderBy('descripcion', 'asc')->get();\n return $marcas;\n }",
"public function list() {\n $machines = Machines::all();\n \n return response()->json($machines);\n\n // return response()->json([\n // 'status' => 'OK',\n // 'machines' => $machines\n // ]);\n }",
"public function getMeta(): array\n {\n return [];\n }"
] |
[
"0.55793387",
"0.54376966",
"0.5373553",
"0.52942395",
"0.5289935",
"0.52198046",
"0.5214367",
"0.51754355",
"0.5139133",
"0.5075648",
"0.5058309",
"0.50436187",
"0.50112826",
"0.5010094",
"0.50082326",
"0.5003207",
"0.49785706",
"0.49359843",
"0.49321097",
"0.49111757",
"0.4906485",
"0.49039254",
"0.48601055",
"0.48579493",
"0.48556584",
"0.48465154",
"0.48314393",
"0.48293084",
"0.4811984",
"0.47858158"
] |
0.57380086
|
0
|
Operation listMetaformsAsyncWithHttpInfo Lists Metaforms
|
public function listMetaformsAsyncWithHttpInfo($realmId)
{
$returnType = '\Metatavu\Metaform\Api\Model\Metaform[]';
$request = $this->listMetaformsRequest($realmId);
return $this->client
->sendAsync($request)
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function listMetaformsWithHttpInfo($realmId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform[]';\n $request = $this->listMetaformsRequest($realmId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Metaform[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function v1PropertyTemplatesFormsGetAsyncWithHttpInfo($accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesFormsGetRequest($accept_language);\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 listMetaformsAsync($realmId)\n {\n return $this->listMetaformsAsyncWithHttpInfo($realmId)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getApplicationListAsyncWithHttpInfo()\n {\n $returnType = '\\RusticiSoftware\\Cloud\\V2\\Model\\ApplicationListSchema';\n $request = $this->getApplicationListRequest();\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 v1PropertyTemplatesClaimsClaimTemplateIdFormsGetAsyncWithHttpInfo($claim_template_id, $accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesClaimsClaimTemplateIdFormsGetRequest($claim_template_id, $accept_language);\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 restSystemCloudMetricsGetAsyncWithHttpInfo()\n {\n $returnType = '\\OpenAPI\\Client\\Model\\CloudMetricsList';\n $request = $this->restSystemCloudMetricsGetRequest();\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 v1PropertyTemplatesClaimsGetAsyncWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesClaimsGetRequest();\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 getCustomProfileFieldsAsyncWithHttpInfo()\n {\n $returnType = 'JsonSuccessBase';\n $request = $this->getCustomProfileFieldsRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function getTermsAsyncWithHttpInfo()\n {\n $returnType = '\\Reepay\\Model\\Terms';\n $request = $this->getTermsRequest();\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 findMetaformWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->findMetaformRequest($realmId, $metaformId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Metaform',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\NotFound',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function listMetaformsRequest($realmId)\n {\n // verify the required parameter 'realmId' is set\n if ($realmId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $realmId when calling listMetaforms'\n );\n }\n\n $resourcePath = '/realms/{realmId}/metaforms';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($realmId !== null) {\n $resourcePath = str_replace(\n '{' . 'realmId' . '}',\n ObjectSerializer::toPathValue($realmId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=utf-8'],\n ['application/json;charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function findMetaformAsyncWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->findMetaformRequest($realmId, $metaformId);\n\n return $this->client\n ->sendAsync($request)\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 keywordListsGetAsyncWithHttpInfo($limit, $offset)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\KeywordLists';\n $request = $this->keywordListsGetRequest($limit, $offset);\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 }",
"function list_meta($meta)\n {\n }",
"function all_awm_meta_libraries()\n {\n $metaBoxes = $options = array();\n $metas = new AWM_Meta();\n $metaBoxes['metas'] = $metas->meta_boxes();\n $metaBoxes['term'] = $metas->term_meta_boxes();\n $metaBoxes['options'] = $metas->options_boxes();\n $metaBoxes['user'] = $metas->user_boxes();\n if (!empty($metaBoxes)) {\n foreach ($metaBoxes as $key => $data) {\n $afterfix = __('Post type metabox', 'extend-wp');\n switch ($key) {\n case 'user':\n $afterfix = __('User metabox', 'extend-wp');\n break;\n case 'term':\n $afterfix = __('Taxonomy metabox', 'extend-wp');\n break;\n case 'options':\n $afterfix = __('Option metabox', 'extend-wp');\n break;\n }\n foreach ($data as $meta_key => $meta_data) {\n $name = $meta_data['title'] . ' - ' . $afterfix;;\n $options[$meta_key] = array('label' => $name);\n }\n }\n }\n return $options;\n }",
"public function v1PropertyTemplatesPerilsGetAsyncWithHttpInfo($accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesPerilsGetRequest($accept_language);\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 listMetaforms($realmId)\n {\n list($response) = $this->listMetaformsWithHttpInfo($realmId);\n return $response;\n }",
"public function brandsGetAsyncWithHttpInfo()\n {\n $returnType = '\\Fozzy\\WinVPS\\Api\\Models\\BrandsListResponse';\n $request = $this->brandsGetRequest();\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 $result = ObjectSerializer::deserialize($content, $returnType, []);\n\n if (is_object($result) && property_exists($result, 'getData')) {\n $result = $result->getData();\n }\n\n return [\n $result,\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 $request,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function v1PropertyTemplatesFormsGetWithHttpInfo($accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesFormsGetRequest($accept_language);\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\\TemplateMetadataResponse[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\ProblemDetails',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function add_meta_boxes() {\n\t\tglobal $current_screen;\n\n\t\t$page_main = $this->_admin_pages[ 'vfb-pro' ];\n\n\t\tif ( $current_screen->id == $page_main && isset( $_REQUEST['form'] ) ) {\n\t\t\tadd_meta_box( 'vfb_form_switcher', __( 'Quick Switch', 'visual-form-builder-pro' ), array( &$this, 'meta_box_switch_form' ), $page_main, 'side', 'high' );\n\t\t\tadd_meta_box( 'vfb_form_items_meta_box', __( 'Form Items', 'visual-form-builder-pro' ), array( &$this, 'meta_box_form_items' ), $page_main, 'side', 'high' );\n\t\t\tadd_meta_box( 'vfb_form_media_button_tip', __( 'Display Forms', 'visual-form-builder-pro' ), array( &$this, 'meta_box_display_forms' ), $page_main, 'side', 'low' );\n\t\t}\n\t}",
"protected function getFormList()\n {\n $formList = [];\n foreach ($this->availableAuthenticators as $key => $className) {\n /** @var BootstrapMFAAuthenticator $class */\n $class = Injector::inst()->get($className);\n $formList[] = $class->getMFAForm($this, static::VERIFICATION_METHOD);\n }\n\n return $formList;\n }",
"public function getOutboundCallabletimesetsAsyncWithHttpInfo($pageSize = '25', $pageNumber = '1', $filterType = 'Prefix', $name = null, $sortBy = null, $sortOrder = 'ascending')\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\CallableTimeSetEntityListing';\n $request = $this->getOutboundCallabletimesetsRequest($pageSize, $pageNumber, $filterType, $name, $sortBy, $sortOrder);\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 getStoreThemesAsyncWithHttpInfo($accept, $content_type)\n {\n $returnType = '\\BigCommerce\\Themes\\Model\\ThemesCollectionResponse';\n $request = $this->getStoreThemesRequest($accept, $content_type);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public static function registerMetaBoxes() {}",
"public static function getFormsList() {\n\n return RGFormsModel::get_forms(null, \"title\");\n }",
"public function getUniverseGroupsAsyncWithHttpInfo($datasource = 'tranquility', $page = '1', $userAgent = null, $xUserAgent = null)\n {\n $returnType = 'int[]';\n $request = $this->getUniverseGroupsRequest($datasource, $page, $userAgent, $xUserAgent);\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 getApplicationsAsyncWithHttpInfo($since = null, $until = null, $datetime_filter = 'updated', $filter = null, $filter_by = 'app_id', $order_by = 'updated_asc', $more = null, $include_course_count = 'false', $include_registration_count = 'false', $include_total_count = 'false')\n {\n $returnType = '\\RusticiSoftware\\Cloud\\V2\\Model\\ApplicationInfoListSchema';\n $request = $this->getApplicationsRequest($since, $until, $datetime_filter, $filter, $filter_by, $order_by, $more, $include_course_count, $include_registration_count, $include_total_count);\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 postOutboundCallabletimesetsAsyncWithHttpInfo($body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\CallableTimeSet';\n $request = $this->postOutboundCallabletimesetsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listAllAsync(array $customHeaders = [])\n {\n if ($this->_client->getApiVersion() == null) {\n Validate::notNullOrEmpty($this->_client->getApiVersion(), '$this->_client->getApiVersion()');\n }\n if ($this->_client->getSubscriptionId() == null) {\n Validate::notNullOrEmpty($this->_client->getSubscriptionId(), '$this->_client->getSubscriptionId()');\n }\n\n $path = '/subscriptions/{subscriptionId}/providers/Microsoft.Features/features';\n $statusCodes = [200];\n $method = 'GET';\n\n $path = strtr($path, ['{subscriptionId}' => $this->_client->getSubscriptionId()]);\n $queryParams = ['api-version' => $this->_client->getApiVersion()];\n $headers = $customHeaders;\n if ($this->_client->getAcceptLanguage() != null) {\n $headers['accept-language'] = $this->_client->getAcceptLanguage();\n }\n if ($this->_client->getGenerateClientRequestId()) {\n $headers[Resources::X_MS_REQUEST_ID] = Utilities::getGuid();\n }\n\n $body = '';\n\n $response = HttpClient::send(\n $method,\n $headers,\n $queryParams,\n [],\n $this->_client->getUrl($path),\n $statusCodes,\n $body,\n $this->_client->getFilters()\n );\n\n return $response;\n }",
"public function listRateLimitersAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\RateLimiterResponse[]';\n $request = $this->listRateLimitersRequest($options);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }"
] |
[
"0.5860923",
"0.5415656",
"0.52918696",
"0.51831865",
"0.510636",
"0.4995776",
"0.49918875",
"0.48456746",
"0.46620634",
"0.46322536",
"0.462976",
"0.4609176",
"0.45249236",
"0.45102322",
"0.44839054",
"0.4476878",
"0.44655865",
"0.44499195",
"0.44478714",
"0.44451112",
"0.43946362",
"0.4375334",
"0.43734428",
"0.43639135",
"0.43622684",
"0.43460763",
"0.43398264",
"0.43312415",
"0.43295044",
"0.4322414"
] |
0.61778486
|
0
|
Operation updateMetaformWithHttpInfo Updates Metaform
|
public function updateMetaformWithHttpInfo($realmId, $metaformId, $payload)
{
$returnType = '\Metatavu\Metaform\Api\Model\Metaform';
$request = $this->updateMetaformRequest($realmId, $metaformId, $payload);
try {
try {
$response = $this->client->send($request);
} catch (RequestException $e) {
$umaResponse = $this->umaRetry($request, $e);
if ($umaResponse) {
$response = $umaResponse;
} else {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null
);
}
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Metatavu\Metaform\Api\Model\Metaform',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 400:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Metatavu\Metaform\Api\Model\BadRequest',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 403:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Metatavu\Metaform\Api\Model\Forbidden',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 404:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Metatavu\Metaform\Api\Model\NotFound',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 500:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\Metatavu\Metaform\Api\Model\InternalServerError',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testUpdatePetWithFormWithHttpInfo()\n {\n // initialize the API client\n $config = (new Configuration())->setHost('http://petstore.swagger.io/v2');\n $api_client = new ApiClient($config);\n $pet_id = 10001; // ID of pet that needs to be fetched\n $pet_api = new Api\\PetApi($api_client);\n // update Pet (form)\n list($update_response, $status_code, $http_headers) = $pet_api->updatePetWithFormWithHttpInfo(\n $pet_id,\n 'update pet with form with http info'\n );\n // return nothing (void)\n $this->assertNull($update_response);\n $this->assertSame($status_code, 200);\n $this->assertSame($http_headers['Content-Type'], 'application/json');\n $response = $pet_api->getPetById($pet_id);\n $this->assertSame($response->getId(), $pet_id);\n $this->assertSame($response->getName(), 'update pet with form with http info');\n }",
"public function update($info, $meta)\r\n {\r\n\r\n }",
"public function deleteMetaformWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '';\n $request = $this->deleteMetaformRequest($realmId, $metaformId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\NotFound',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function findMetaformWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->findMetaformRequest($realmId, $metaformId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Metaform',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\NotFound',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function updatemetaAction(Request $request)\n {\n $config = $this->getConfiguration();\n\n $factoryService = $this->get('pumukitschema.factory');\n $personService = $this->get('pumukitschema.person');\n $groupService = $this->get('pumukitschema.group');\n\n $personalScopeRoleCode = $personService->getPersonalScopeRoleCode();\n $allGroups = $groupService->findAll();\n\n $roles = $personService->getRoles();\n if (null === $roles) {\n throw new \\Exception('Not found any role.');\n }\n\n $sessionId = $this->get('session')->get('admin/series/id', null);\n $series = $factoryService->findSeriesById($request->get('seriesId'), $sessionId);\n\n if (null === $series) {\n throw new \\Exception('Series with id '.$request->get('seriesId').' or with session id '.$sessionId.' not found.');\n }\n $this->get('session')->set('admin/series/id', $series->getId());\n\n $parentTags = $factoryService->getParentTags();\n $mmtemplate = $factoryService->getMultimediaObjectPrototype($series);\n\n $translator = $this->get('translator');\n $locale = $request->getLocale();\n $formMeta = $this->createForm(new MultimediaObjectTemplateMetaType($translator, $locale), $mmtemplate);\n\n $pubDecisionsTags = $factoryService->getTagsByCod('PUBDECISIONS', true);\n\n $method = $request->getMethod();\n if (in_array($method, array('POST', 'PUT', 'PATCH')) &&\n $formMeta->submit($request, !$request->isMethod('PATCH'))->isValid()) {\n $this->domainManager->update($mmtemplate);\n\n if ($config->isApiRequest()) {\n return $this->handleView($this->view($formMeta));\n }\n\n return new JsonResponse(array('mmtemplate' => 'updatemeta'));\n }\n\n if ($config->isApiRequest()) {\n return $this->handleView($this->view($formMeta));\n }\n\n return $this->render('PumukitNewAdminBundle:MultimediaObjectTemplate:edit.html.twig',\n array(\n 'mm' => $resource,\n 'form_meta' => $formMeta->createView(),\n 'series' => $series,\n 'roles' => $roles,\n 'personal_scope_role' => $personalScopeRole,\n 'personal_scope_role_code' => $personalScopeRoleCode,\n 'pub_decisions' => $pubDecisionsTags,\n 'parent_tags' => $parentTags,\n 'groups' => $allGroups,\n )\n );\n }",
"public function update_meta( &$object, $meta ) {\n\t\t}",
"public function testUpdateMetadata1UsingPUT()\n {\n }",
"public function testUpdateMetadata2UsingPUT()\n {\n }",
"function acf_update_metadata($post_id = 0, $name = '', $value = '', $hidden = \\false)\n{\n}",
"public function updateMetaformAsyncWithHttpInfo($realmId, $metaformId, $payload)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->updateMetaformRequest($realmId, $metaformId, $payload);\n\n return $this->client\n ->sendAsync($request)\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 }",
"function update_meta($meta_id, $meta_key, $meta_value)\n {\n }",
"public function setMeta($var)\n {\n GPBUtil::checkMessage($var, \\Temporal\\Api\\Update\\V1\\Meta::class);\n $this->meta = $var;\n\n return $this;\n }",
"protected function updateMetaformRequest($realmId, $metaformId, $payload)\n {\n // verify the required parameter 'realmId' is set\n if ($realmId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $realmId when calling updateMetaform'\n );\n }\n // verify the required parameter 'metaformId' is set\n if ($metaformId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $metaformId when calling updateMetaform'\n );\n }\n // verify the required parameter 'payload' is set\n if ($payload === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $payload when calling updateMetaform'\n );\n }\n\n $resourcePath = '/realms/{realmId}/metaforms/{metaformId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($realmId !== null) {\n $resourcePath = str_replace(\n '{' . 'realmId' . '}',\n ObjectSerializer::toPathValue($realmId),\n $resourcePath\n );\n }\n // path params\n if ($metaformId !== null) {\n $resourcePath = str_replace(\n '{' . 'metaformId' . '}',\n ObjectSerializer::toPathValue($metaformId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($payload)) {\n $_tempBody = $payload;\n }\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=utf-8'],\n ['application/json;charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listMetaformsWithHttpInfo($realmId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform[]';\n $request = $this->listMetaformsRequest($realmId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Metaform[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function testUpdateMetadata3UsingPUT()\n {\n }",
"function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_value = '')\n {\n }",
"public function createMetaformWithHttpInfo($realmId, $payload)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->createMetaformRequest($realmId, $payload);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Metaform',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\NotFound',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function updateLocationBillingTypeCustomFieldsWithHttpInfo($body)\n {\n \n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $body when calling updateLocationBillingTypeCustomFields');\n }\n \n // parse inputs\n $resourcePath = \"/beta/locationBillingType/customFields\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n \n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('API-Key');\n if (strlen($apiKey) !== 0) {\n $headerParams['API-Key'] = $apiKey;\n }\n \n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'PUT',\n $queryParams, $httpBody,\n $headerParams\n );\n \n return array(null, $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n }\n \n throw $e;\n }\n }",
"public function update_meta(Request $request)\n {\n $type = $request->input('type');\n $ret['msg'] = 'info';\n $ret['message'] = __('messages.nothing');\n $auth_id = auth()->id();\n $is_saved = false;\n\n $type_key = 'default'; $is_page_meta = false;\n if($type == 'tnx_page_meta' || $type == 'kyc_page_meta' || $type == 'user_page_meta') {\n $type_key = str_replace('_page_meta', '', $type);\n $is_page_meta = true;\n }\n\n if ($is_page_meta==true) {\n $meta_name = $this->meta_key_val($request->meta, 'key');\n $meta_val = $this->meta_key_val($request->meta, 'value');\n $ret['msg'] = 'error';\n $ret['message'] = __('messages.update.failed', ['what' => 'Options']);\n\n if($meta_name=='perpage') {\n $meta_by_name = $type_key.'_per_page';\n $result = GlobalMeta::save_meta($meta_by_name, $meta_val, $auth_id);\n $is_saved = true;\n } elseif($meta_name=='ordered') {\n $meta_by_name = $type_key.'_ordered';\n $result = GlobalMeta::save_meta($meta_by_name, $meta_val, $auth_id);\n $is_saved = true;\n } elseif($meta_name=='orderby') {\n $meta_by_name = $type_key.'_order_by';\n $result = GlobalMeta::save_meta($meta_by_name, $meta_val, $auth_id);\n $is_saved = true;\n } else {\n $meta_by_name = $type_key.'_'.$meta_name;\n $result = GlobalMeta::save_meta($meta_by_name, $meta_val, $auth_id);\n $is_saved = true;\n }\n if($is_saved) {\n $ret['msg'] = 'success';\n $ret['message'] = __('messages.update.success', ['what' => 'Options']);\n }\n }\n\n if ($request->ajax()) {\n return response()->json($ret);\n }\n return back()->with([$ret['msg'] => $ret['message']]);\n }",
"public function updateArticleMeta(Request $request, Response $response, $args)\n\t{\n\t\t$this->params \t= $request->getParams();\n\t\t$this->uri \t\t= $request->getUri();\n\n\t\t$tab \t\t\t= isset($this->params['tab']) ? $this->params['tab'] : false;\n\t\t$metaData\t\t= isset($this->params['data']) ? $this->params['data'] : false ;\n\t\t$objectName\t\t= 'meta';\n\t\t$errors \t\t= false;\n\n\t\tif(!$tab or !$metaData)\n\t\t{\n\t\t\treturn $response->withJson($this->errors, 404);\n\t\t}\n\n\t\t# load metadefinitions\n\t\t$metaDefinitions = $this->aggregateMetaDefinitions();\n\n\t\t# create validation object\n\t\t$validate \t\t= $this->getValidator();\n\n\t\t# take the user input data and iterate over all fields and values\n\t\tforeach($metaData as $fieldName => $fieldValue)\n\t\t{\n\t\t\t# get the corresponding field definition from original plugin settings */\n\t\t\t$fieldDefinition = isset($metaDefinitions[$tab]['fields'][$fieldName]) ? $metaDefinitions[$tab]['fields'][$fieldName] : false;\n\n\t\t\tif(!$fieldDefinition)\n\t\t\t{\n\t\t\t\t$errors[$tab][$fieldName] = 'This field is not defined';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t# validate user input for this field\n\t\t\t\t$result = $validate->objectField($fieldName, $fieldValue, $objectName, $fieldDefinition);\n\n\t\t\t\tif($result !== true)\n\t\t\t\t{\n\t\t\t\t\t$errors[$tab][$fieldName] = $result[$fieldName][0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t# return validation errors\n\t\tif($errors){ return $response->withJson(array('errors' => $errors),422); }\n\n\t\t# set structure\n\t\tif(!$this->setStructure($draft = true)){ return $response->withJson($this->errors, 404); }\n\n\t\t# set item \n\t\tif(!$this->setItem()){ return $response->withJson($this->errors, 404); }\n\t\t\n\t\t$writeYaml = new writeYaml();\n\n\t\t# get existing metadata for page\n\t\t$meta = $writeYaml->getYaml($this->settings['contentFolder'], $this->item->pathWithoutType . '.yaml');\n\n\t\t# add the new/edited metadata\n\t\t$meta[$tab] = $metaData;\n\n\t\t# store the metadata\n\t\t$writeYaml->updateYaml($this->settings['contentFolder'], $this->item->pathWithoutType . '.yaml', $meta);\n\n\t\t# return with the new metadata\n\t\treturn $response->withJson(array('metadata' => $metaData, 'errors' => false));\n\t}",
"public function setMetaInfo($meta) {\n $this->meta = $meta;\n }",
"function wck_update_meta(){\r\n\t\tcheck_ajax_referer( \"wck-update-entry\" );\r\n\t\tif( !empty( $_POST['meta'] ) )\r\n\t\t\t$meta = sanitize_text_field( $_POST['meta'] );\r\n\t\telse \r\n\t\t\t$meta = '';\r\n\t\tif( !empty( $_POST['id'] ) )\r\n\t\t\t$id = absint($_POST['id']);\r\n\t\telse \r\n\t\t\t$id = '';\r\n\t\tif( isset( $_POST['element_id'] ) )\r\n\t\t\t$element_id = absint( $_POST['element_id'] );\r\n\t\telse \r\n\t\t\t$element_id = 0;\r\n\t\tif( !empty( $_POST['values'] ) && is_array( $_POST['values']) )\r\n\t\t\t$values = array_map( 'wppb_sanitize_value', $_POST['values'] );\r\n\t\telse\r\n\t\t\t$values = array();\r\n\t\t\r\n\t\t// Security checks\r\n\t\tif( true !== ( $error = self::wck_verify_user_capabilities( $this->args['context'], $meta, $id ) ) ) {\r\n\t\t\theader( 'Content-type: application/json' );\r\n\t\t\tdie( json_encode( $error ) );\r\n\t\t}\r\n\t\t\r\n\t\t$values = apply_filters( \"wck_update_meta_filter_values_{$meta}\", $values, $element_id );\r\n\t\t\r\n\t\t/* check required fields */\r\n\t\t$errors = self::wck_test_required( $this->args['meta_array'], $meta, $values, $id );\r\n\t\tif( $errors != '' ){\r\n\t\t\theader( 'Content-type: application/json' );\r\n\t\t\tdie( json_encode( $errors ) );\r\n\t\t}\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\t$results = get_post_meta($id, $meta, true);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\t$results = get_option( apply_filters( 'wck_option_meta' , $meta, $values, $element_id ) );\r\n\t\t\r\n\t\t$results[$element_id] = $values;\r\n\r\n\t\t/* make sure this does not output anything so it won't break the json response below\r\n\t\twill keep it do_action for compatibility reasons\r\n\t\t */\r\n\t\tob_start();\r\n\t\t\tdo_action( 'wck_before_update_meta', $meta, $id, $values, $element_id );\r\n\t\t$wck_before_update_meta = ob_get_clean(); //don't output it\r\n\t\t\r\n\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\tupdate_post_meta($id, $meta, $results);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\tupdate_option( apply_filters( 'wck_option_meta' , $meta, $results, $element_id ), wp_unslash( $results ) );\r\n\t\t\r\n\t\t/* if unserialize_fields is true update the coresponding post metas for every element of the form */\r\n\t\tif( $this->args['unserialize_fields'] && $this->args['context'] == 'post_meta' ){\r\n\t\t\t\r\n\t\t\t$meta_suffix = $element_id + 1;\t\r\n\t\t\tif( !empty( $values ) ){\r\n\t\t\t\tforeach( $values as $name => $value ){\r\n\t\t\t\t\tupdate_post_meta($id, $meta.'_'.$name.'_'.$meta_suffix, $value);\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$entry_content = $this->wck_refresh_entry( $meta, $id, $element_id );\t\t\r\n\r\n\t\theader( 'Content-type: application/json' );\r\n\t\tdie( json_encode( array( 'entry_content' => $entry_content ) ) );\r\n\t}",
"public function updateForm($formId, $request)\n {\n return $this->start()->uri(\"/api/form\")\n ->urlSegment($formId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }",
"public function update(array $metadata, array $options = [])\n {\n $options = $this->applyEtagHeader(\n $this->identity\n + $metadata\n + $options\n );\n\n if (!isset($options['etag']) && !isset($options['retries'])) {\n $options['retries'] = 0;\n }\n\n return $this->info = $this->connection->patchModel($options);\n }",
"public function updateMetaform($realmId, $metaformId, $payload)\n {\n list($response) = $this->updateMetaformWithHttpInfo($realmId, $metaformId, $payload);\n return $response;\n }",
"public function updateFulfillmentProcessCustomFieldsWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateFulfillmentProcessCustomFieldsRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function updateMfaSettingsWithHttpInfo($body = null)\n {\n $returnType = '\\Reepay\\Model\\AccountMfaSettings';\n $request = $this->updateMfaSettingsRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!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 '\\Reepay\\Model\\AccountMfaSettings',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function updateVendorCustomFieldsWithHttpInfo($body)\n {\n \n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $body when calling updateVendorCustomFields');\n }\n \n // parse inputs\n $resourcePath = \"/beta/vendor/customFields\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n \n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('API-Key');\n if (strlen($apiKey) !== 0) {\n $headerParams['API-Key'] = $apiKey;\n }\n \n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'PUT',\n $queryParams, $httpBody,\n $headerParams\n );\n \n return array(null, $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n }\n \n throw $e;\n }\n }",
"public function uploadMeta()\n\t{\n global $mysql;\n\n Debug::log('<hr><h1>Beginning meta update</h1><hr>', LEVEL_MAIN);\n \n $startTime = new DateTime();\n\n\t\t$version = $this->getVersionNumberFromFolder($this->folderlocation);\n\n\t\tif ($this->getVersionExistsInDatabase($version, $this->versionId) == null)\n\t\t{\n Debug::log('New version detected', LEVEL_MINIMUM);\n\n // Todo: Migrate to stored procedure\n $mysql->insert('wot_versions', array('version' => $version, 'published' => time()));\n\n $this->versionId = $mysql->getLastUpdatedId();\n\t\t}\n \n $this->deserializeWoTMetaFiles();\n $this->copyTranslationFiles();\n $this->updateTranslations();\n \n $this->vehicles_path = 'versions/' . $this->version . '/';\n \n $this->ImportEquipment();\n $this->ImportTankInformation();\n\n\n Debug::log('<hr><h1>Completed meta upate</h1>', LEVEL_MAIN);\n Debug::log('Meta update took '.$startTime->diff(new DateTime())->format('%I minutes and %S seconds'), LEVEL_MAIN);\n \n\t}",
"public function updateMfaSettingsAsyncWithHttpInfo($body = null)\n {\n $returnType = '\\Reepay\\Model\\AccountMfaSettings';\n $request = $this->updateMfaSettingsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] |
[
"0.6174776",
"0.60431516",
"0.5516041",
"0.53753185",
"0.5320041",
"0.5317375",
"0.52006423",
"0.5186518",
"0.5177128",
"0.5110012",
"0.51086044",
"0.5063023",
"0.49696532",
"0.49576938",
"0.49106622",
"0.4855671",
"0.48509222",
"0.4806242",
"0.4792652",
"0.47362334",
"0.47187454",
"0.4715844",
"0.46970463",
"0.46821886",
"0.46666166",
"0.4654062",
"0.4625343",
"0.4624556",
"0.46195555",
"0.45516354"
] |
0.63324374
|
0
|
Operation updateMetaformAsync Updates Metaform
|
public function updateMetaformAsync($realmId, $metaformId, $payload)
{
return $this->updateMetaformAsyncWithHttpInfo($realmId, $metaformId, $payload)
->then(
function ($response) {
return $response[0];
}
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function update($form_guid, $form)\n {\n $endpoint = \"https://api.hubapi.com/forms/v2/forms/{$form_guid}\";\n\n $options['json'] = $form;\n\n return $this->client->request('post', $endpoint, $options);\n }",
"public function updateMetaformAsyncWithHttpInfo($realmId, $metaformId, $payload)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->updateMetaformRequest($realmId, $metaformId, $payload);\n\n return $this->client\n ->sendAsync($request)\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 }",
"function acf_update_metadata($post_id = 0, $name = '', $value = '', $hidden = \\false)\n{\n}",
"public function updatemetaAction(Request $request)\n {\n $config = $this->getConfiguration();\n\n $factoryService = $this->get('pumukitschema.factory');\n $personService = $this->get('pumukitschema.person');\n $groupService = $this->get('pumukitschema.group');\n\n $personalScopeRoleCode = $personService->getPersonalScopeRoleCode();\n $allGroups = $groupService->findAll();\n\n $roles = $personService->getRoles();\n if (null === $roles) {\n throw new \\Exception('Not found any role.');\n }\n\n $sessionId = $this->get('session')->get('admin/series/id', null);\n $series = $factoryService->findSeriesById($request->get('seriesId'), $sessionId);\n\n if (null === $series) {\n throw new \\Exception('Series with id '.$request->get('seriesId').' or with session id '.$sessionId.' not found.');\n }\n $this->get('session')->set('admin/series/id', $series->getId());\n\n $parentTags = $factoryService->getParentTags();\n $mmtemplate = $factoryService->getMultimediaObjectPrototype($series);\n\n $translator = $this->get('translator');\n $locale = $request->getLocale();\n $formMeta = $this->createForm(new MultimediaObjectTemplateMetaType($translator, $locale), $mmtemplate);\n\n $pubDecisionsTags = $factoryService->getTagsByCod('PUBDECISIONS', true);\n\n $method = $request->getMethod();\n if (in_array($method, array('POST', 'PUT', 'PATCH')) &&\n $formMeta->submit($request, !$request->isMethod('PATCH'))->isValid()) {\n $this->domainManager->update($mmtemplate);\n\n if ($config->isApiRequest()) {\n return $this->handleView($this->view($formMeta));\n }\n\n return new JsonResponse(array('mmtemplate' => 'updatemeta'));\n }\n\n if ($config->isApiRequest()) {\n return $this->handleView($this->view($formMeta));\n }\n\n return $this->render('PumukitNewAdminBundle:MultimediaObjectTemplate:edit.html.twig',\n array(\n 'mm' => $resource,\n 'form_meta' => $formMeta->createView(),\n 'series' => $series,\n 'roles' => $roles,\n 'personal_scope_role' => $personalScopeRole,\n 'personal_scope_role_code' => $personalScopeRoleCode,\n 'pub_decisions' => $pubDecisionsTags,\n 'parent_tags' => $parentTags,\n 'groups' => $allGroups,\n )\n );\n }",
"public function updateForm($formId, $request)\n {\n return $this->start()->uri(\"/api/form\")\n ->urlSegment($formId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }",
"public function update($info, $meta)\r\n {\r\n\r\n }",
"public function update(Request $request, form $form)\n {\n //\n }",
"public function update(Request $request, Form $form)\n {\n //\n }",
"public function update(Request $request, Form $form)\n {\n //\n }",
"public function update($mambot);",
"public function updateMetaformWithHttpInfo($realmId, $metaformId, $payload)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->updateMetaformRequest($realmId, $metaformId, $payload);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Metaform',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\NotFound',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"abstract function performUpdate(Form $arg0);",
"function update_meta($meta_id, $meta_key, $meta_value)\n {\n }",
"public function update(Request $request, SeoMetaTag $seoMetaTag)\n {\n //\n $request->validate([\n 'name' => ['required'],\n 'template' => ['required'],\n 'sort' => ['required', 'numeric'],\n 'editable' => ['boolean'],\n 'group_id' => ['required', 'exists:seo_tag_groups,id'],\n ]);\n\n return response()->json($seoMetaTag->update($request->except(['_token', 'id', 'group_name', 'group'])));\n }",
"public function update($maeMedico);",
"public function update(Request $request, Form $form)\n {\n $form->slug = null;\n $form->update($request->except('groups'));\n\n $form->groups()->detach();\n // Groups attach\n if ($request->has('groups')) {\n $form->groups()->attach($request->input('groups'));\n }\n\n return redirect()->route('admin.form.setting', ['form' => $form->id])->with('success', 'Form settings updated');\n }",
"protected function updateMetaformRequest($realmId, $metaformId, $payload)\n {\n // verify the required parameter 'realmId' is set\n if ($realmId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $realmId when calling updateMetaform'\n );\n }\n // verify the required parameter 'metaformId' is set\n if ($metaformId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $metaformId when calling updateMetaform'\n );\n }\n // verify the required parameter 'payload' is set\n if ($payload === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $payload when calling updateMetaform'\n );\n }\n\n $resourcePath = '/realms/{realmId}/metaforms/{metaformId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($realmId !== null) {\n $resourcePath = str_replace(\n '{' . 'realmId' . '}',\n ObjectSerializer::toPathValue($realmId),\n $resourcePath\n );\n }\n // path params\n if ($metaformId !== null) {\n $resourcePath = str_replace(\n '{' . 'metaformId' . '}',\n ObjectSerializer::toPathValue($metaformId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($payload)) {\n $_tempBody = $payload;\n }\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=utf-8'],\n ['application/json;charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function update_meta( &$object, $meta ) {\n\t\t}",
"public function testUpdateSingleForm(): void\n {\n $form = factory(Form::class)->create();\n\n $data = [\n 'name' => $this->faker->title,\n 'description' => $this->faker->paragraph\n ];\n\n $this->put(route('form.update', $form->id), $data)\n ->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'data' => $data,\n 'message' => __('messages.updated_record', ['model' => Form::$name]),\n ]);\n }",
"public function update(Request $request, FormModel $formModel)\n {\n //\n }",
"function update() {\n\t\tglobal $tpl, $lng;\n\n\t\t$form = $this->initForm(TRUE);\n\t\tif ($form->checkInput()) {\n\t\t\tif ($this->updateElement($this->getPropertiesFromPost($form))) {\n\t\t\t\tilUtil::sendSuccess($lng->txt('msg_obj_modified'), TRUE);\n\t\t\t\t$this->returnToParent();\n\t\t\t}\n\t\t}\n\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHtml());\n\t}",
"function wck_update_meta(){\r\n\t\tcheck_ajax_referer( \"wck-update-entry\" );\r\n\t\tif( !empty( $_POST['meta'] ) )\r\n\t\t\t$meta = sanitize_text_field( $_POST['meta'] );\r\n\t\telse \r\n\t\t\t$meta = '';\r\n\t\tif( !empty( $_POST['id'] ) )\r\n\t\t\t$id = absint($_POST['id']);\r\n\t\telse \r\n\t\t\t$id = '';\r\n\t\tif( isset( $_POST['element_id'] ) )\r\n\t\t\t$element_id = absint( $_POST['element_id'] );\r\n\t\telse \r\n\t\t\t$element_id = 0;\r\n\t\tif( !empty( $_POST['values'] ) && is_array( $_POST['values']) )\r\n\t\t\t$values = array_map( 'wppb_sanitize_value', $_POST['values'] );\r\n\t\telse\r\n\t\t\t$values = array();\r\n\t\t\r\n\t\t// Security checks\r\n\t\tif( true !== ( $error = self::wck_verify_user_capabilities( $this->args['context'], $meta, $id ) ) ) {\r\n\t\t\theader( 'Content-type: application/json' );\r\n\t\t\tdie( json_encode( $error ) );\r\n\t\t}\r\n\t\t\r\n\t\t$values = apply_filters( \"wck_update_meta_filter_values_{$meta}\", $values, $element_id );\r\n\t\t\r\n\t\t/* check required fields */\r\n\t\t$errors = self::wck_test_required( $this->args['meta_array'], $meta, $values, $id );\r\n\t\tif( $errors != '' ){\r\n\t\t\theader( 'Content-type: application/json' );\r\n\t\t\tdie( json_encode( $errors ) );\r\n\t\t}\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\t$results = get_post_meta($id, $meta, true);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\t$results = get_option( apply_filters( 'wck_option_meta' , $meta, $values, $element_id ) );\r\n\t\t\r\n\t\t$results[$element_id] = $values;\r\n\r\n\t\t/* make sure this does not output anything so it won't break the json response below\r\n\t\twill keep it do_action for compatibility reasons\r\n\t\t */\r\n\t\tob_start();\r\n\t\t\tdo_action( 'wck_before_update_meta', $meta, $id, $values, $element_id );\r\n\t\t$wck_before_update_meta = ob_get_clean(); //don't output it\r\n\t\t\r\n\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\tupdate_post_meta($id, $meta, $results);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\tupdate_option( apply_filters( 'wck_option_meta' , $meta, $results, $element_id ), wp_unslash( $results ) );\r\n\t\t\r\n\t\t/* if unserialize_fields is true update the coresponding post metas for every element of the form */\r\n\t\tif( $this->args['unserialize_fields'] && $this->args['context'] == 'post_meta' ){\r\n\t\t\t\r\n\t\t\t$meta_suffix = $element_id + 1;\t\r\n\t\t\tif( !empty( $values ) ){\r\n\t\t\t\tforeach( $values as $name => $value ){\r\n\t\t\t\t\tupdate_post_meta($id, $meta.'_'.$name.'_'.$meta_suffix, $value);\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$entry_content = $this->wck_refresh_entry( $meta, $id, $element_id );\t\t\r\n\r\n\t\theader( 'Content-type: application/json' );\r\n\t\tdie( json_encode( array( 'entry_content' => $entry_content ) ) );\r\n\t}",
"protected function updateFormModelData($params, $responseBody, $data)\n\t{\n\t\t$w = new FabrikWorker;\n\t\t$dataMap = $params->get('put_include_list', '');\n\t\t$include = $w->parseMessageForPlaceholder($dataMap, $responseBody, true);\n\t\tif (FabrikWorker::isJSON($include))\n\t\t{\n\t\t\t$include = json_decode($include);\n\n\t\t\t$keys = $include->put_key;\n\t\t\t$values = $include->put_value;\n\t\t\t$defaults = $include->put_value;\n\t\t\tfor ($i = 0; $i < count($keys); $i++)\n\t\t\t{\n\t\t\t\t$key = $keys[$i];\n\t\t\t\t$default = $defaults[$i];\n\t\t\t\t$localKey = FabrikString::safeColNameToArrayKey($values[$i]);\n\t\t\t\t$remoteData = FArrayHelper::getNestedValue($data, $key, $default, true);\n\t\t\t\tif (!is_null($remoteData))\n\t\t\t\t{\n\t\t\t\t\t$this->formModel->_data[$localKey] = $remoteData;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}",
"public function updateMetaform($realmId, $metaformId, $payload)\n {\n list($response) = $this->updateMetaformWithHttpInfo($realmId, $metaformId, $payload);\n return $response;\n }",
"public function update(Request $request, MJasa $mJasa)\n {\n //\n }",
"public function update($id, UpdateDocumentMetaRequest $request)\n {\n $documentMeta = $this->documentMetaRepository->findWithoutFail($id);\n\n if (empty($documentMeta)) {\n Flash::error(__('messages.not-found'));\n\n return redirect(route('admin.documentMetas.index'));\n }\n\n if ($request->category_doc_meta_id == 0) {\n Flash::error(__('messages.document_metas_no_category'));\n return back()->withInput();\n }\n\n $this->documentMetaRepository->update($request->all(), $id);\n\n Flash::success(__('messages.updated'));\n\n return redirect(route('admin.documentMetas.index'));\n }",
"public function update(Request $request, Form $form)\n {\n $request->validate([\n 'name' => 'required|unique:forms,name,' . $form->id . '|max:50',\n ]);\n\n $form->update([\n 'name' => $request->name\n ]);\n\n $old_route = session('old_route') ? session('old_route') : route('admin.forms.index');\n\n session()->forget('old_route');\n\n return redirect($old_route)->with('success', \"'$request->name' Updated Successfully\");\n }",
"function wck_show_update_form(){\r\n\t\tcheck_ajax_referer( \"wck-edit-entry\" );\t\t\r\n\t\t$meta = sanitize_text_field( $_POST['meta'] );\r\n\t\t$id = absint($_POST['id']);\r\n\t\t$element_id = absint( $_POST['element_id'] );\r\n\r\n do_action( \"wck_before_adding_form_{$meta}\", $id, $element_id );\r\n\r\n\t\techo self::mb_update_form($this->args['meta_array'], $meta, $id, $element_id);\r\n\t\t\r\n\t\tdo_action( \"wck_after_adding_form\", $meta, $id, $element_id );\r\n do_action( \"wck_after_adding_form_{$meta}\", $id, $element_id );\r\n\r\n\t\texit;\r\n\t}",
"public function update(Request $request, enquiryForm $enquiryForm)\n {\n //\n }",
"public function update_meta(Request $request)\n {\n $type = $request->input('type');\n $ret['msg'] = 'info';\n $ret['message'] = __('messages.nothing');\n $auth_id = auth()->id();\n $is_saved = false;\n\n $type_key = 'default'; $is_page_meta = false;\n if($type == 'tnx_page_meta' || $type == 'kyc_page_meta' || $type == 'user_page_meta') {\n $type_key = str_replace('_page_meta', '', $type);\n $is_page_meta = true;\n }\n\n if ($is_page_meta==true) {\n $meta_name = $this->meta_key_val($request->meta, 'key');\n $meta_val = $this->meta_key_val($request->meta, 'value');\n $ret['msg'] = 'error';\n $ret['message'] = __('messages.update.failed', ['what' => 'Options']);\n\n if($meta_name=='perpage') {\n $meta_by_name = $type_key.'_per_page';\n $result = GlobalMeta::save_meta($meta_by_name, $meta_val, $auth_id);\n $is_saved = true;\n } elseif($meta_name=='ordered') {\n $meta_by_name = $type_key.'_ordered';\n $result = GlobalMeta::save_meta($meta_by_name, $meta_val, $auth_id);\n $is_saved = true;\n } elseif($meta_name=='orderby') {\n $meta_by_name = $type_key.'_order_by';\n $result = GlobalMeta::save_meta($meta_by_name, $meta_val, $auth_id);\n $is_saved = true;\n } else {\n $meta_by_name = $type_key.'_'.$meta_name;\n $result = GlobalMeta::save_meta($meta_by_name, $meta_val, $auth_id);\n $is_saved = true;\n }\n if($is_saved) {\n $ret['msg'] = 'success';\n $ret['message'] = __('messages.update.success', ['what' => 'Options']);\n }\n }\n\n if ($request->ajax()) {\n return response()->json($ret);\n }\n return back()->with([$ret['msg'] => $ret['message']]);\n }"
] |
[
"0.5436299",
"0.5428015",
"0.5275205",
"0.52689993",
"0.5194214",
"0.5186538",
"0.51547575",
"0.51500493",
"0.51500493",
"0.51402766",
"0.5135611",
"0.5111159",
"0.5092139",
"0.5083803",
"0.5059282",
"0.50563115",
"0.5043162",
"0.49983844",
"0.49928907",
"0.49373618",
"0.4920311",
"0.49027988",
"0.48764616",
"0.48752767",
"0.4869934",
"0.4838512",
"0.48351145",
"0.48342252",
"0.48264918",
"0.48260856"
] |
0.5603168
|
0
|
Operation updateMetaformAsyncWithHttpInfo Updates Metaform
|
public function updateMetaformAsyncWithHttpInfo($realmId, $metaformId, $payload)
{
$returnType = '\Metatavu\Metaform\Api\Model\Metaform';
$request = $this->updateMetaformRequest($realmId, $metaformId, $payload);
return $this->client
->sendAsync($request)
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = $responseBody->getContents();
if ($returnType !== 'string') {
$content = json_decode($content);
}
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function updateMetaformWithHttpInfo($realmId, $metaformId, $payload)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->updateMetaformRequest($realmId, $metaformId, $payload);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Metaform',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\NotFound',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function updateFulfillmentProcessCustomFieldsAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateFulfillmentProcessCustomFieldsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateMfaSettingsAsyncWithHttpInfo($body = null)\n {\n $returnType = '\\Reepay\\Model\\AccountMfaSettings';\n $request = $this->updateMfaSettingsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function testUpdatePetWithFormWithHttpInfo()\n {\n // initialize the API client\n $config = (new Configuration())->setHost('http://petstore.swagger.io/v2');\n $api_client = new ApiClient($config);\n $pet_id = 10001; // ID of pet that needs to be fetched\n $pet_api = new Api\\PetApi($api_client);\n // update Pet (form)\n list($update_response, $status_code, $http_headers) = $pet_api->updatePetWithFormWithHttpInfo(\n $pet_id,\n 'update pet with form with http info'\n );\n // return nothing (void)\n $this->assertNull($update_response);\n $this->assertSame($status_code, 200);\n $this->assertSame($http_headers['Content-Type'], 'application/json');\n $response = $pet_api->getPetById($pet_id);\n $this->assertSame($response->getId(), $pet_id);\n $this->assertSame($response->getName(), 'update pet with form with http info');\n }",
"public function update($info, $meta)\r\n {\r\n\r\n }",
"public function updateVendorComplianceSurveyCustomFieldsAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateVendorComplianceSurveyCustomFieldsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function findMetaformAsyncWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->findMetaformRequest($realmId, $metaformId);\n\n return $this->client\n ->sendAsync($request)\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 listMetaformsAsyncWithHttpInfo($realmId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform[]';\n $request = $this->listMetaformsRequest($realmId);\n\n return $this->client\n ->sendAsync($request)\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 updateMeasurementAsyncWithHttpInfo($body)\n {\n $returnType = '\\CureDAO\\Client\\Models\\CommonResponse';\n $request = $this->updateMeasurementRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function deleteMetaformAsyncWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '';\n $request = $this->deleteMetaformRequest($realmId, $metaformId);\n\n return $this->client\n ->sendAsync($request)\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateTermsAsyncWithHttpInfo($body = null)\n {\n $returnType = '\\Reepay\\Model\\Terms';\n $request = $this->updateTermsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updatemetaAction(Request $request)\n {\n $config = $this->getConfiguration();\n\n $factoryService = $this->get('pumukitschema.factory');\n $personService = $this->get('pumukitschema.person');\n $groupService = $this->get('pumukitschema.group');\n\n $personalScopeRoleCode = $personService->getPersonalScopeRoleCode();\n $allGroups = $groupService->findAll();\n\n $roles = $personService->getRoles();\n if (null === $roles) {\n throw new \\Exception('Not found any role.');\n }\n\n $sessionId = $this->get('session')->get('admin/series/id', null);\n $series = $factoryService->findSeriesById($request->get('seriesId'), $sessionId);\n\n if (null === $series) {\n throw new \\Exception('Series with id '.$request->get('seriesId').' or with session id '.$sessionId.' not found.');\n }\n $this->get('session')->set('admin/series/id', $series->getId());\n\n $parentTags = $factoryService->getParentTags();\n $mmtemplate = $factoryService->getMultimediaObjectPrototype($series);\n\n $translator = $this->get('translator');\n $locale = $request->getLocale();\n $formMeta = $this->createForm(new MultimediaObjectTemplateMetaType($translator, $locale), $mmtemplate);\n\n $pubDecisionsTags = $factoryService->getTagsByCod('PUBDECISIONS', true);\n\n $method = $request->getMethod();\n if (in_array($method, array('POST', 'PUT', 'PATCH')) &&\n $formMeta->submit($request, !$request->isMethod('PATCH'))->isValid()) {\n $this->domainManager->update($mmtemplate);\n\n if ($config->isApiRequest()) {\n return $this->handleView($this->view($formMeta));\n }\n\n return new JsonResponse(array('mmtemplate' => 'updatemeta'));\n }\n\n if ($config->isApiRequest()) {\n return $this->handleView($this->view($formMeta));\n }\n\n return $this->render('PumukitNewAdminBundle:MultimediaObjectTemplate:edit.html.twig',\n array(\n 'mm' => $resource,\n 'form_meta' => $formMeta->createView(),\n 'series' => $series,\n 'roles' => $roles,\n 'personal_scope_role' => $personalScopeRole,\n 'personal_scope_role_code' => $personalScopeRoleCode,\n 'pub_decisions' => $pubDecisionsTags,\n 'parent_tags' => $parentTags,\n 'groups' => $allGroups,\n )\n );\n }",
"public function fontProcessorUpdateAsyncWithHttpInfo($id, $tenant_id = null, $name = null, $path = null, $custom_fields = null, $file = null)\n {\n $returnType = '\\Aurigma\\AssetProcessor\\Model\\FontDto';\n $request = $this->fontProcessorUpdateRequest($id, $tenant_id, $name, $path, $custom_fields, $file);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function updateMetaformAsync($realmId, $metaformId, $payload)\n {\n return $this->updateMetaformAsyncWithHttpInfo($realmId, $metaformId, $payload)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function deleteMetaformWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '';\n $request = $this->deleteMetaformRequest($realmId, $metaformId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\NotFound',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function findMetaformWithHttpInfo($realmId, $metaformId)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->findMetaformRequest($realmId, $metaformId);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n $umaResponse = $this->umaRetry($request, $e);\n if ($umaResponse) {\n $response = $umaResponse; \n } else {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Metaform',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\BadRequest',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\Forbidden',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\NotFound',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Metatavu\\Metaform\\Api\\Model\\InternalServerError',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function createMetaformAsyncWithHttpInfo($realmId, $payload)\n {\n $returnType = '\\Metatavu\\Metaform\\Api\\Model\\Metaform';\n $request = $this->createMetaformRequest($realmId, $payload);\n\n return $this->client\n ->sendAsync($request)\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function updateMetaformRequest($realmId, $metaformId, $payload)\n {\n // verify the required parameter 'realmId' is set\n if ($realmId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $realmId when calling updateMetaform'\n );\n }\n // verify the required parameter 'metaformId' is set\n if ($metaformId === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $metaformId when calling updateMetaform'\n );\n }\n // verify the required parameter 'payload' is set\n if ($payload === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $payload when calling updateMetaform'\n );\n }\n\n $resourcePath = '/realms/{realmId}/metaforms/{metaformId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($realmId !== null) {\n $resourcePath = str_replace(\n '{' . 'realmId' . '}',\n ObjectSerializer::toPathValue($realmId),\n $resourcePath\n );\n }\n // path params\n if ($metaformId !== null) {\n $resourcePath = str_replace(\n '{' . 'metaformId' . '}',\n ObjectSerializer::toPathValue($metaformId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($payload)) {\n $_tempBody = $payload;\n }\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=utf-8'],\n ['application/json;charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function restStorageFrontendFileMetadataPostAsyncWithHttpInfo($key, $metadata)\n {\n $returnType = 'object[]';\n $request = $this->restStorageFrontendFileMetadataPostRequest($key, $metadata);\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 putIdentityprovidersAdfsAsyncWithHttpInfo($body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\OAuthProvider';\n $request = $this->putIdentityprovidersAdfsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"function acf_update_metadata($post_id = 0, $name = '', $value = '', $hidden = \\false)\n{\n}",
"public function updateFulfillmentProcessCustomFieldsAsync($body)\n {\n return $this->updateFulfillmentProcessCustomFieldsAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putVerimatrixStreamMapsConfigAsyncWithHttpInfo($server_name, $vhost_name, $app_name, $body)\n {\n $returnType = '';\n $request = $this->putVerimatrixStreamMapsConfigRequest($server_name, $vhost_name, $app_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putTranscoderStreamNameGroupAppConfigAsyncWithHttpInfo($server_name, $vhost_name, $template_name, $group_name, $app_name, $body)\n {\n $returnType = '';\n $request = $this->putTranscoderStreamNameGroupAppConfigRequest($server_name, $vhost_name, $template_name, $group_name, $app_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function patchOutboundSettingsAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->patchOutboundSettingsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateDiscountSettingsAsyncWithHttpInfo($body = null)\n {\n $returnType = '\\Reepay\\Model\\DiscountSettings';\n $request = $this->updateDiscountSettingsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function v1PropertyTemplatesFormsGetAsyncWithHttpInfo($accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesFormsGetRequest($accept_language);\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 quoteDraftsV2PutAsyncWithHttpInfo($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id)\n {\n $returnType = 'object';\n $request = $this->quoteDraftsV2PutRequest($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $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 update(array $metadata, array $options = [])\n {\n $options = $this->applyEtagHeader(\n $this->identity\n + $metadata\n + $options\n );\n\n if (!isset($options['etag']) && !isset($options['retries'])) {\n $options['retries'] = 0;\n }\n\n return $this->info = $this->connection->patchModel($options);\n }",
"public function putDRMConfigAsyncWithHttpInfo($server_name, $vhost_name, $app_name, $body)\n {\n $returnType = '';\n $request = $this->putDRMConfigRequest($server_name, $vhost_name, $app_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] |
[
"0.5938246",
"0.5724528",
"0.5686862",
"0.5605833",
"0.55348045",
"0.5283282",
"0.5247352",
"0.50929767",
"0.5075119",
"0.50434655",
"0.50429386",
"0.50269926",
"0.50127304",
"0.5006061",
"0.49937135",
"0.4981048",
"0.49608964",
"0.48671126",
"0.4864397",
"0.486415",
"0.4845308",
"0.4837093",
"0.48320708",
"0.4801703",
"0.47934538",
"0.47760454",
"0.47677684",
"0.476744",
"0.47640923",
"0.47517204"
] |
0.61619323
|
0
|
/ This is a fake cron ... it only updates this count when an elapsed time has passed
|
function update_tweet_count_cron($link_id, $interval = 900 /* defaults to 15 minutes */)
{
global $prli_link_meta;
static $already_updated_tweet_count;
if( !isset($already_updated_tweet_count) or
empty($already_updated_tweet_count) or
!$already_updated_tweet_count )
{
$last_update = $prli_link_meta->get_link_meta($link_id,'pretty-link-tweet-last-update',true);
$now = time();
if($last_update)
{
$time_lapse = $now - $last_update;
if($time_lapse >= $interval)
{
$this->update_link_tweets($link_id);
$prli_link_meta->update_link_meta($link_id,'pretty-link-tweet-last-update',$now);
$already_updated_tweet_count = true;
}
}
else
{
$this->update_link_tweets($link_id);
$prli_link_meta->update_link_meta($link_id,'pretty-link-tweet-last-update',$now);
$already_updated_tweet_count = true;
}
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function increment() {\n $this->db->query('UPDATE '.TABLE_PREFIX.'tickers SET last_run = '.time().' WHERE id = '.$this->id);\n }",
"public static function record_still_alive() {\n\t\n\t\tglobal $updraftplus;\n\t\n\t\t// Update the record of maximum detected runtime on each run\n\t\t$time_passed = $updraftplus->jobdata_get('run_times');\n\t\tif (!is_array($time_passed)) $time_passed = array();\n\n\t\t$time_this_run = microtime(true)-$updraftplus->opened_log_time;\n\t\t$time_passed[$updraftplus->current_resumption] = $time_this_run;\n\t\t$updraftplus->jobdata_set('run_times', $time_passed);\n\n\t\t$resume_interval = $updraftplus->jobdata_get('resume_interval');\n\t\tif ($time_this_run + 30 > $resume_interval) {\n\t\t\t$new_interval = ceil($time_this_run + 30);\n\t\t\tset_site_transient('updraft_initial_resume_interval', (int) $new_interval, 8*86400);\n\t\t\t$updraftplus->log(\"The time we have been running (\".round($time_this_run, 1).\") is approaching the resumption interval ($resume_interval) - increasing resumption interval to $new_interval\");\n\t\t\t$updraftplus->jobdata_set('resume_interval', $new_interval);\n\t\t}\n\n\t}",
"private function _updateCronStats()\n\t{\n\t $this->load->model('tasks');\n\t $this->tasks->updateCronStats();\n\t}",
"function wp_schedule_update_user_counts()\n {\n }",
"private static function time_exec()\n {\n $current = self::time();\n self::$time_exec = $current-self::$time_start;\n }",
"public function passedTicks() {\r\n\t\t$seconds = 300;\r\n\r\n\t\t$lastUpdate = (int)($this->lastUpdate() / $seconds);\r\n\t\t$now = (int)(TIME / $seconds);\r\n\r\n\t\treturn ($now - $lastUpdate);\r\n\t}",
"private function cronMinute()\n {\n $timedRecords = $this->app['storage.event_processor.timed'];\n if ($timedRecords->isDuePublish()) {\n $this->notify('Publishing timed records');\n $timedRecords->publishTimedRecords();\n }\n if ($timedRecords->isDueHold()) {\n $this->notify('De-publishing timed records');\n $timedRecords->holdExpiredRecords();\n }\n }",
"protected function tick() \n\t{\n\t\t// Override this for any process that should happen periodically.Will happen at least once\n\t\t// per second, but possibly more often.\n\t}",
"public function longRunning(): int {\n return self::$db->scalar(\"\n SELECT count(*)\n FROM information_schema.processlist\n WHERE COMMAND NOT IN ('Sleep')\n AND TIME > 1200;\n \");\n }",
"public static function getTimeToRun();",
"public function run()\n {\n //$this->getBars();\n $this->getTicks();\n $this->ticksBar();\n\n $this->age =\n strtotime($this->current_time) -\n strtotime($this->last_refreshed_at);\n }",
"public function needs_run() {\n $today = time();\n $lastrun = $this->info[\"last_run\"];\n $interval = (int)$this->freq * 86400;\n\n return($today > ($lastrun + $interval));\n }",
"public function getRunInterval()\n\t{\n\t\treturn 1;\n\t}",
"static function doCron() {\n\t\t$lc = new DateTime(Preferences::value(\"lastCron\"));\n\t\t$now = new DateTime();\n\t\t\n\t\t$diff = $now->diff($lc, true);\n\t\tif($diff->i >= 1) return true;\n\t\treturn false;\n\t}",
"protected function tick() {\n // per second, but possibly more often.\n }",
"function CountCachedExecs($db, $secs2cache, $sql, $inputarray) {\r\n\tglobal $CACHED; $CACHED++; /** @see variables.php */\r\n}",
"public function uptime() : int;",
"public function cron()\n\t{\n\t\t$objNews = $this->Database->prepare(\"SELECT * FROM tl_news WHERE newsalert=? AND na_sent=? AND date<=?\")\n\t\t\t\t\t\t\t\t ->execute(1, '', time());\n\t\t\t\t\t\t\t\t \n\t\tif ($objNews->numRows)\n\t\t{\n\t\t\twhile( $objNews->next() )\n\t\t\t{\n\t\t\t\t$this->send($objNews->id, true);\n\t\t\t}\n\t\t}\n\t}",
"public function calculateTime()\n {\n echo 'it takes 1h to get there.',\"\\n\";\n\n self::$traitStaticMember = 'changes conflict member\\'s initial value';\n }",
"function count_new_messages() {\n $last_visit = UserConfigOptions::getValue('status_update_last_visited', $this->logged_user);\n echo StatusUpdates::countNewMessagesForUser($this->logged_user, $last_visit);\n die();\n }",
"public function updateCount() {\n $sql = \"UPDATE goCount SET count = count + 1 WHERE 1\";\n\n if (self::$conn->query($sql) === FALSE) {\n echo \"Error updating count record: \" . self::$conn->error;\n }\n }",
"private function _upTime() \n {\n return microtime(true) - $this->_startTime;\n }",
"public function wp_cron_scheduled_check()\n {\n }",
"private function tick() {\r\n\t\treturn ceil( time() / 43200 );\r\n\t}",
"function simulateCron() {\n\t\tglobal $publishthis;\n\n\t\t// Return here is we want to pause polling.\n\t\tif ( $publishthis->get_option ( 'pause_polling' ) ) {\n\t\t\tif ( ! get_option ( 'publishthis_paused_on' ) ) {\n\t\t\t\tupdate_option ( 'publishthis_paused_on', time() );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tignore_user_abort( true );\n\n\t\t//modifying the logic here a bit and going with options, instead of\n\t\t//transients, because those were sometimes disappearing from\n\t\t//the wp cache. don't want to disrupt the clients site\n\n\t\t//basic algorithm\n\t\t/*\n 1 - see if we are doing the cron all ready, if so, don't do anything\n 2 - if not doing cron, get the last timestamp of when we did this cron\n -- we only want to check every XX minutes\n 3 - if no time is set yet, we do the check\n 4 - if the time is set, and we have not yet passed our XX minutes, we do not do anything\n 5 - if we are doing the check, update that we are doing the cron\n 6 - do the cron action\n 7 - once completed, set\n - the timestamp we completed at, for future checks\n - remove the doing cron value\n */\n\t\t$doingSimulatedCron = get_option ( 'pt_simulated_cron' );\n\n\t\t//create lock flag if not exists and set it to 0 (false)\n\t\tif ( false === $doingSimulatedCron ) {\n\t\t\tupdate_option( \"pt_simulated_cron\", 0 );\n\t\t}\n\t\t$doingSimulatedCron = intval($doingSimulatedCron);\n\t\t//cron is not running\n\t\tif ( 0 === $doingSimulatedCron ) {\n\t\t\t//check the time\n\t\t\t$secondsExpiration = 60 * 2; //roughly 2 minutes. should be based on publishing action set poll times, but that would be too much to query;\n\n\t\t\t$timestamp = get_option ( 'pt_simulated_cron_ts' );\n\n\t\t\t$currentTimestamp = ( time() ) * 1000;\n\n\t\t\tif ( !$timestamp ) {\n\t\t\t\t//this has never been set before, so, we can just assume we need to do the cron\n\t\t\t\t$timestamp = $currentTimestamp;\n\t\t\t\t\n\t\t\t\t//set the timestamp the first time\n\t\t\t\tupdate_option( \"pt_simulated_cron_ts\", $timestamp );\n\t\t\t}\n\t\t\t//see if we need to do the cron\n\t\t\t$diffTimestamp = $currentTimestamp - $timestamp;\n\t\t\t\n\t\t\t$diffTimeSeconds = ( $diffTimestamp / 1000 );\n\t\n\t\t\tif ( $diffTimeSeconds >= $secondsExpiration ) {\n\t\t\t\t//ok, we need to do the cron action\n\t\t\t\tupdate_option( \"pt_simulated_cron\", 1 );\n\n\t\t\t\ttry {\n\t\t\t\t\t//if we are here, that means we need to do the cron action\n\t\t\t\t\t//get only active Publishing Actions\n\t\t\t\t\t$actions = $publishthis->publish->get_publishing_actions();\n\n\t\t\t\t\t$publishthis->log->addWithLevel ( array(\n\t\t\t\t\t\t\t'message' => 'Checking on simulated cron events',\n\t\t\t\t\t\t\t'status' => 'info',\n\t\t\t\t\t\t\t'details' => \"Found \" . count( $actions ) . \" publishing events to check\" ), \"2\" );\n\t\t\t\t\t\n\t\t\t\t\t// do import\n\t\t\t\t\t$publishthis->publish->run_import();\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t//set simulate cron options on failure\n\t\t\t\t\t//leaving duplicated lines, because php4 doesn't have finally block\n\t\t\t\t\tupdate_option( \"pt_simulated_cron_ts\", $currentTimestamp );\n\t\t\t\t\tupdate_option( \"pt_simulated_cron\", 0 );\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//now that we are done, set the old timestamp\n\t\t\t\tupdate_option( \"pt_simulated_cron_ts\", $currentTimestamp );\n\t\t\t\tupdate_option( \"pt_simulated_cron\", 0 );\n\t\t\t}\t\n\t\t}\t\t\n\t}",
"static function cron() {\n\t\tself::starter();\n\t\tself::ender();\n\t}",
"function cron() {\n\t\t//look at the clock.\n\t\t$now = strtotime('now');\n\t\t\n\t\t//check for the hack\n\t\tif(Configure::read('debug') != 0 && isset($this->params['named']['time_machine'])){\n\t\t\t$now = strtotime($this->params['named']['time_machine']);\n\t\t}\n\t\t\n\t\t$this->Project->upgradeProjects($now);\n\t}",
"function custom_rules_is_cron_running(){\n\t$cron_expires = db_query(\"SELECT `expire` FROM {semaphore} WHERE `name` = 'cron' LIMIT 1\")->fetchField();\n\n\tif ( $cron_expires && $cron_expires > microtime(TRUE) ) {\n\t\treturn TRUE;\n\t}\n\n\treturn FALSE;\n}",
"public static function cronIsRunning(){\n\t\t$utc_str = gmdate(\"M d Y H:i:s\", time());\n\t\t$utc = strtotime($utc_str);\n\t\treturn \\GO::config()->get_setting('cron_last_run') > $utc-300;\n\t}",
"function schedule_expiry() {\n\t\tif ( ! wp_next_scheduled( 'github_embed_cron' ) ) {\n\t\t\t$frequency = apply_filters( 'github_embed_cache_frequency', 'daily' );\n\t\t\twp_schedule_event( time(), $frequency, 'github_embed_cron' );\n\t\t}\n\t}"
] |
[
"0.6593629",
"0.6372517",
"0.63425803",
"0.6053337",
"0.6049604",
"0.6025023",
"0.60223305",
"0.5972799",
"0.5960949",
"0.5909001",
"0.58800054",
"0.5843977",
"0.58196115",
"0.5793225",
"0.57897323",
"0.56674397",
"0.5663892",
"0.56312984",
"0.5615135",
"0.5613355",
"0.5604448",
"0.5600291",
"0.55871564",
"0.5585269",
"0.55731124",
"0.5564253",
"0.55613095",
"0.5529121",
"0.55174553",
"0.551589"
] |
0.6487818
|
1
|
Count all players in the users table
|
public function countTotalPlayers()
{
$sql = "SELECT count(*) FROM `users`";
$result = $this->pdo->prepare($sql);
$result->execute();
// store the number of rows in a variable
$number_of_rows = $result->fetchColumn();
return $number_of_rows;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getCountPlayers(): int;",
"function countUsers(){\n\t\n\t}",
"public function countAll() : int\n {\n $result = $this->em->createQueryBuilder()->select('count(u.username)')\n ->from(User::class, 'u')\n ->getQuery()->getSingleScalarResult();\n\n return intval($result);\n }",
"public function numUsers(){\n $query = \"SELECT count(*) FROM final_usuario\";\n return $this->con->action($query);\n }",
"public function countUsers() {\n require('database.php');\n if ($result = $mysqli->query('SELECT Count(Distinct id) as count\n FROM users')) {\n while ($row = $result->fetch_assoc()) {\n echo $row['count'];\n }\n }\n }",
"public function findByCountRankedPlayers()\n\t{\n\t\t$query = $this->getEntityManager()->createQuery(\"SELECT count(u) FROM App:User u WHERE\n\t\t\tu.archived = false\n\t\t\tAND u.pseudo != 'world-center'\n\t\t\");\n\n\t\treturn $query->getOneOrNullResult()[1];\n\t}",
"public function getUsersCount()\n {\n return count($this->userRepo->findAll());\n }",
"public function countUsers()\n\t{\n \treturn $this\n \t->createQueryBuilder('u')\n \t->select('COUNT(u)')\n \t->getQuery()->getSingleScalarResult();\n\t}",
"public function getNumberOfUsers()\n {\n $query = \"SELECT * FROM `users`\";\n $db = new DB();\n $result = $db->prepare($query);\n $result->execute();\n $data = $result->rowCount();\n return $data;\n }",
"public function amountPlayersRecords(){\n $sql = \"SELECT COUNT(*) as contagem FROM jogador\";\n $result = $this->connection->dataBase->Execute($sql);\n $record = $result->FetchNextObject();\n return $record->CONTAGEM;\n\t}",
"function countUsers(){\n return $this->db->count_all('user');\n \t}",
"function get_all_users_count()\n {\n $this->db->from('users');\n return $this->db->count_all_results();\n }",
"function get_all_users_count()\n {\n $this->db->from('users');\n return $this->db->count_all_results();\n }",
"public function countAllUser(){\n\n return $this->db->count_all( 'user' );\n }",
"public function countAll(){\n\t // query to select all user records\n\t $query = \"SELECT id FROM \" . $this->table_name . \"\";\n\t // prepare query statement\n\t $stmt = $this->conn->prepare($query);\n\t // execute query\n\t $stmt->execute();\n\t // get number of rows\n\t $num = $stmt->rowCount();\n\t // return row count\n\t return $num;\n\t}",
"function getUsersCount() {\n $company_id = $this->getId(); \n \treturn Users::count(\"company_id LIKE $company_id\");\n }",
"public function user_count() {\r\n\t\tif (is_array($this->users))\r\n\t\t\treturn sizeof($this->users);\r\n\t\t$this->users = [];\r\n\t\treturn 0;\r\n\t}",
"public function countAll() : int\n {\n $sql = \"SELECT COUNT(*) AS num FROM users\";\n\n $stmt = $this->conn->prepare($sql);\n\n try {\n $stmt->execute();\n\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n throw new InvalidArgumentException($e->getMessage(), 500);\n }\n\n return intval($result['num']);\n }",
"public function getCountUsers(){\n $connect = ConnectionManager::get('default');\n $fila = $connect->execute(\"select count(*) from Usuarios;\")->fetchAll();\n return $fila[0];\n }",
"public function countMembers()\n {\n return $this->users->count();\n }",
"public function getUsersCount()\n {\n return $this->count(self::_USERS);\n }",
"public function count()\n {\n return $this->db->count_all('us_user');\n }",
"public function getCountUser()\n {\n return $this->users_model->countAll();\n }",
"public static function user_count() {\n $ret = 0;\n $database = new \\ZGZagua\\common\\database();\n\n $sql = \"SELECT count(id) contador FROM users WHERE 1\";\n\n $resultado = $database->query( $sql );\n\n if ( $row = mysqli_fetch_array( $resultado ) ) {\n $ret = $row[ 'contador' ];\n }\n\n return max( $ret, 100 );\n }",
"public function getUsersCount()\n {\n return $this->manager->createQuery('SELECT COUNT(u) FROM App\\Entity\\User u')->getSingleScalarResult();\n }",
"function countMembers() {\n\t\t$result = $this->MySQL->query(\"SELECT * FROM \".$this->MySQL->get_tablePrefix().\"members WHERE \".$this->strTableKey.\" = '\".$this->intTableKeyValue.\"'\");\n\t\t$num_rows = $result->num_rows;\n\t\t\n\t\t\n\t\treturn $num_rows;\n\t}",
"public function userCount()\n {\n return User::count();\n }",
"public function countAll(){\n \n // query to select all user records\n $query = \"SELECT Mabh FROM \" . $this->table_name . \"\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n // get number of rows\n $num = $stmt->rowCount();\n \n // return row count\n return $num;\n}",
"public function countAll(){\r\n\r\n\t // query to select all user records\r\n\t $query = \"SELECT fag_uid FROM \" . $this->table_name . \"\";\r\n\r\n\t // prepare query statement\r\n\t $stmt = $this->conn->prepare($query);\r\n\r\n\t // execute query\r\n\t $stmt->execute();\r\n\r\n\t // get number of rows\r\n\t $num = $stmt->rowCount();\r\n\r\n\t // return row count\r\n\t return $num;\r\n\t}",
"public function count()\n {\n return $this->onlineUsers->count();\n }"
] |
[
"0.7470783",
"0.71570593",
"0.7076483",
"0.7029009",
"0.6973847",
"0.6901268",
"0.68177783",
"0.6783146",
"0.6761919",
"0.6759528",
"0.66989195",
"0.6680426",
"0.6680426",
"0.6678694",
"0.6665485",
"0.6631754",
"0.6629896",
"0.65914035",
"0.6572604",
"0.6571653",
"0.6567479",
"0.6557667",
"0.6528237",
"0.6493287",
"0.64875245",
"0.647583",
"0.6435013",
"0.6432593",
"0.63853604",
"0.6366454"
] |
0.7767385
|
0
|
Specifies scenario test guy is working on.
|
public function describe(string $scenario): TestGuy;
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function test()\n {\n $this->executeScenario();\n }",
"public function setTestMode()\n {\n $this->isTestMode = true;\n }",
"public function turn_on()\n {\n $this->testing = TRUE;\n }",
"public function setSuite()\n {\n $this->_suite = true;\n }",
"public function getScenario() {\n\t // TODO: Implement getScenario() method.\n }",
"public function getScenario(): TestScenario;",
"public function getScenario()\n {\n return $this->scenario;\n }",
"function playScenario($scenario_id=null, $player_id=null){\r\n \r\n// Configure::write('debug',2);\r\n \r\n $this->__requireLogin();\r\n \r\n $this->set('msgClass', 'error'); // on Success 'error' is overwritten by 'message'\r\n $this->set('rc', 0); // will be overwritten if error occurrs\r\n $debugInfo = array(\r\n 'message' => 'The scenario has been set up!<br />Remember to cancel it if you do not complete it!', // eventually overwritten if error occurs. \r\n 'legend'=>'function playScenario($scenario_id='.$scenario_id.', $player_id='.$player_id.')',\r\n 'command'=>'Everything went fine.',\r\n 'rc'=>''\r\n );\r\n $this->set('debugInfo', $debugInfo);\r\n if (!$scenario_id || !$player_id){\r\n $debugInfo['message'] = 'Scenario and player not specified.';\r\n $this->set('debugInfo', $debugInfo);\r\n $this->render();\r\n exit;\r\n }\r\n \r\n // TODO: START TRANSACTION HERE!\r\n $this->set('debugInfo', $debugInfo);\r\n $scenario = $this->Scenario->read(null, $scenario_id);\r\n $this->set('scenario', $scenario);\r\n \r\n// 1. can the scenario be set up at all?\r\n $preliminaryChecks = $this->_checkSetupPossibility($scenario_id, $player_id);\r\n if (!empty($preliminaryChecks['error'])){\r\n $debugInfo['message'] = $preliminaryChecks['error'];\r\n $this->set('debugInfo', $debugInfo);\r\n $this->render();\r\n exit;\r\n }\r\n $systemaccount_id = (isset($preliminaryChecks['Systemaccount']['id']))? $preliminaryChecks['Systemaccount']['id'] : null;\r\n // The scenario can be set up for the player, so make an entry in \"scenariosetups\"\r\n $new = $this->Scenariosetup->create();\r\n $new['Scenariosetup']['scenario_id'] = $scenario_id;\r\n $new['Scenariosetup']['player_id'] = $player_id;\r\n if (!$this->Scenariosetup->save($new)){\r\n $debugInfo['message'] = 'Could not create Scenariosetup.';\r\n $this->set('debugInfo', $debugInfo);\r\n $this->render();\r\n exit;\r\n }\r\n $new['Scenariosetup']['id'] = $this->Scenariosetup->getLastInsertId();\r\n \r\n// 2. select random Values for all scripts parameters and lock them in DB!\r\n // 2nd param is the id of the new scenariosetup:\r\n $values = $this->_selectParametervalues($scenario_id, $new['Scenariosetup']['id'], $scenario['Scenario']['use_player']);\r\n $values['values']['$'.CAKEUSER] = $preliminaryChecks['Systemaccount']['user'];\r\n $values['values']['$'.CAKEPASS] = $preliminaryChecks['Systemaccount']['passwd'];\r\n if (isset($values['error']) && strlen($values['error']) > 0){\r\n $success = $this->_rollback($new['Scenariosetup']['id']); // delete the whole setup and everything belonging to it!\r\n if (is_array($success)){\r\n $debugInfo = $success;\r\n $debugInfo['message'] = $values['error'].'<br />'.$debugInfo['message'];\r\n }\r\n $this->set('debugInfo', $debugInfo);\r\n $this->render();\r\n exit;\r\n }\r\n \r\n// 2.a) prepare parameter resource files for the view:\r\n $resources = array(); //\r\n $resources['Parameter'] = (isset($values['paramResources']))? $values['paramResources'] : array();\r\n unset($values['paramResources']);\r\n \r\n// 3. if necessary do the environment setup(s) on hosts:\r\n if ($preliminaryChecks['envSetupNeeded']){\r\n \r\n// 3.a) get EnvSetup shellscripts filled with the real values we selected in step 2:\r\n $scripts = $this->_prepareScripts($scenario_id, ENVIRONMENT_SETUP_SCRIPT, $values['values']);\r\n// if (!empty($scripts)){ debug($scripts);}\r\n \r\n $setupError = $this->_executeScripts($player_id, $scripts, ENVIRONMENT_SETUP_SCRIPT);\r\n if ($setupError){\r\n $rollback = $this->_rollback($new['Scenariosetup']['id'], $systemaccount_id);\r\n if ($rollback == true){\r\n $debugInfo['message'] = 'Sorry, the scenario environment could not be set up.';\r\n } else if (is_array($rollback)){\r\n $debugInfo['message'] = 'Fatal error: EnvSetup rollback unsuccessful. Check DB consistency!<br />'.$debugInfo['message'];\r\n }\r\n $this->set('debugInfo', $debugInfo);\r\n $this->render();\r\n exit;\r\n }\r\n// if ($setupError){ debug($setupError);exit;}\r\n\r\n } // end of if (envSetupNeeded)...\r\n \r\n\r\n// 4. Player setup and port forwarding to the machines which have a player setup:\r\n // first check if a systemaccount is used and if so - lock it:\r\n if ($preliminaryChecks['Systemaccount']['id']){ // lock systemaccount by setting player_id:\r\n $this->Systemaccount->id = $preliminaryChecks['Systemaccount']['id'];\r\n if (!$this->Systemaccount->saveField('player_id', $player_id)){\r\n $debugInfo['message'] = 'Could not lock Systemaccount';\r\n $this->set('debugInfo', $debugInfo);\r\n $this->render();\r\n exit;\r\n }\r\n }\r\n// 4.a) do the player setup by executing the player setup scripts:\r\n $scripts = $this->_prepareScripts($scenario_id, PLAYER_SETUP_SCRIPT, $values['values']);\r\n $setupError = $this->_executeScripts($player_id, $scripts, PLAYER_SETUP_SCRIPT);\r\n if ($setupError){\r\n $rollback = $this->_rollback($new['Scenariosetup']['id'], $systemaccount_id);\r\n if ($rollback){\r\n $debugInfo['message'] = 'Sorry, there was an error during the player setup.';\r\n } else {\r\n $debugInfo['message'] = 'Fatal error: PlayerSetup rollback unsuccessful. Check DB consistency!';\r\n }\r\n $this->set('debugInfo', $debugInfo);\r\n $this->render();\r\n exit;\r\n }\r\n \r\n// 4.b) make entries in used_hosts and do port forwarding if necessary:\r\n foreach($scripts as $current){\r\n foreach($current['hosts'] as $id=>$ip){\r\n // if no entry for this host exists in UsedHosts, do port forwarding:\r\n if ($this->UsedHost->findCount(array('host_id'=>$id))==0){\r\n $host = $this->Host->find(array('id'=>$id));\r\n if (empty($host)){\r\n $debugInfo['message'] = 'Error during port forwarding preparation: could not determine interface!';\r\n $debugInfo['legend'] = 'port forwarding preparation';\r\n $debugInfo['rc'] = 'no host for id '.$id.' found';\r\n $this->set('debugInfo', $debugInfo);\r\n $this->render();\r\n exit;\r\n }\r\n $interfaces = $this->getInterfaces();\r\n $interface = ($host['Host']['area']==1 || $host['Host']['area']==2)? $interfaces['player'] : $interfaces['management'];\r\n $portForwardError = $this->_portForwarding($id, $ip, true, $interface);\r\n if ($portForwardError){\r\n $this->set('debugInfo', $portForwardError);\r\n $this->render();\r\n exit;\r\n }\r\n }\r\n // in any case, make a new entry in used_hosts for this scenariosetup:\r\n $newEntry = array(\r\n 'id' => null,\r\n 'host_id' => $id,\r\n 'scenariosetup_id' => $new['Scenariosetup']['id']\r\n );\r\n $this->UsedHost->create();\r\n $this->UsedHost->save($newEntry);\r\n }\r\n }\r\n \r\n \r\n// 5. do the DRONE setup scripts!\r\n $scripts = $this->_prepareScripts($scenario_id, DRONE_SETUP_SCRIPT, $values['values']);\r\n $droneSetupError = $this->_executeScripts($player_id, $scripts, DRONE_SETUP_SCRIPT, $values['values']['$CAKEUSER']);\r\n if ($droneSetupError){\r\n $this->set('debugInfo', $droneSetupError);\r\n $this->render();\r\n exit;\r\n }\r\n\r\n \r\n \r\n// 6. get all resource files for the scenario\r\n if ($systemaccount_id){\r\n $resources['Systemaccount'] = $this->Resource->find('list', array(\r\n 'conditions'=>'Resource.scenario_id='.$scenario_id.' AND Resource.systemaccount_id='.$systemaccount_id,\r\n )\r\n );\r\n } else {\r\n $resources['Systemaccount'] = array();\r\n }\r\n $resources['General'] = $this->Resource->find('list', array(\r\n 'conditions'=>'Resource.scenario_id='.$scenario_id.\r\n ' AND Resource.systemaccount_id=0 AND Resource.sequence_no=-1'\r\n )\r\n );\r\n \r\n // TODO: END TRANSACTION HERE!\r\n $this->set('resources', $resources);\r\n $this->set('msgClass', 'message');\r\n $this->set('debugInfo', $debugInfo); \r\n $this->set('usedHosts', $this->_getUsedHostPorts($new['Scenariosetup']['id']));\r\n $this->render();\r\n }",
"public function testCreateScenario()\n {\n $client = static::createClient();\n }",
"public function setGoal()\n {\n }",
"public function checkScenario()\n {\n return in_array($this->getOwner()->scenario, $this->scenarios);\n }",
"protected function setTestingMode()\n {\n if (defined('IS_INNER_TESTING')) {\n return;\n }\n\n if (ENVIRONMENT == ENVIRONMENT_DEV\n &&\n (\n !empty($_REQUEST[self::GET_PARAM_NAME_TESTING_MODE])\n || $this->checkIfCliIsTested()\n )\n ) {\n $this->isInnerTesting = true;\n }\n /** Indicates if the current run is an inner test. */\n define('IS_INNER_TESTING', $this->isInnerTesting);\n }",
"public function scenarios() {\n $scenarios = parent::scenarios();\n \n $scenarios['updateLogo'] = ['employer_logo'];\n\n return $scenarios;\n }",
"public function setScenario($var)\n {\n GPBUtil::checkString($var, True);\n $this->scenario = $var;\n\n return $this;\n }",
"public function test_squad_server_admin_force_team_change()\n {\n $this->assertTrue($this->btwServer->adminForceTeamChange('Test'));\n }",
"public function isTesting() {}",
"public function testJobEnable()\n {\n\n }",
"protected function is_being_tested()\n {\n return $this->testing;\n }",
"public function testWebinarStatus()\n {\n }",
"private function addTestUser(): void\n {\n $this->terminus(sprintf('site:team:add %s %s', $this->getSiteName(), $this->getUserEmail()));\n }",
"public function getScenario()\n\t{\n\t\treturn $this->_se;\n\t}",
"abstract function is_trial_utilized();",
"public function scenarios() \r\n {\r\n $register = USE_RECAPTCHA ? ['first_name', 'last_name', 'username', 'password', 'confirm_password', 'email', 'status', 'verifyCode'] : ['first_name', 'last_name', 'username', 'password', 'confirm_password', 'email', 'status'];\r\n return [\r\n 'login'=>['email', 'password'],\r\n 'register'=>$register,\r\n 'changePassword'=>['old_password', 'password', 'confirm_password'],\r\n 'editProfile'=>['first_name', 'last_name','username', 'email'],\r\n \r\n \r\n #########Scenario for admin\r\n 'addUser'=>['first_name', 'last_name', 'username', 'password', 'confirm_password', 'email', 'status', 'by_admin'],\r\n 'editUser'=>['first_name', 'last_name', 'username', 'email', 'status'],\r\n 'statusChange'=>['status'],\r\n 'changeUserPassword'=>['password', 'confirm_password'],\r\n 'emailVerification'=>['email_verified'],\r\n \r\n #######Password reset\r\n 'resetPassword'=>['email'],\r\n 'resetPass'=>['password'],\r\n ];\r\n \r\n }",
"function _checkSetupPossibility($scenario_id, $player_id){ \r\n \r\n // this array is filled by the checks below!\r\n // it is returned to the calling function playScenario which evaluates what to do next! \r\n $returnData = array(\r\n 'Systemaccount' => array(\r\n 'user'=>null,\r\n 'passwd'=>null,\r\n 'id'=>false\r\n ),\r\n 'envSetupNeeded' => false,\r\n 'error' => null,\r\n 'scripts'=>array() //this will be filled with scenario data\r\n );\r\n \r\n // each player can only setup and play one scenario at a time!\r\n $other = $this->Scenariosetup->find('Scenariosetup.player_id='.$player_id, false);\r\n if(!empty($other)){\r\n $this->redirect('/game/evaluateScenario/'.$other['Scenario']['id'].'/'.$player_id);\r\n exit;\r\n }\r\n \r\n $scenario = $this->Scenario->read(null, $scenario_id);\r\n $player = $this->Player->read(null, $player_id);\r\n \r\n // check scenario/player data ---------------------------------------\r\n if (empty($scenario) || empty($player)){\r\n $returnData['error'] = 'scenario/player not found.';\r\n return $returnData;\r\n }\r\n \r\n // check if player is active ---------------------------------------\r\n if ($player['Player']['active']!=1){\r\n $returnData['error'] = 'Not allowed, Player is disabled!';\r\n return $returnData;\r\n }\r\n \r\n // check if player meets the required skills ---------------------------\r\n if (!$this->_playerHasRequiredSkills($scenario['Skill'], $player['Skill'])){\r\n $returnData['error'] = 'You do not have enough skills!';\r\n return $returnData;\r\n }\r\n \r\n // do the most important scenario checks here: (IF-Monster) ===============================================\r\n $singleScenario = $this->_isSingleScenarioRunning();\r\n if (!empty($singleScenario)){ // a single scenario is running:\r\n if ($singleScenario['id'] == $scenario_id){ // running same as requested? -----------\r\n if ($singleScenario['is_multiplayer_scenario']==1){\r\n // OKAY up to here, continue below this IF-Monster\r\n } else { // the running single scenario is not multiplayer: ------------------------------------------\r\n $returnData['error'] = 'Not allowed!<br />Someone else is doing this scenario already.';\r\n }\r\n } else { // running single scenario is not the same as requested: ---------------------------------\r\n $returnData['error'] = 'Not allowed!<br />A different single scenario is running.';\r\n }\r\n \r\n } else { // =================== NO single scenario is running: ======================================\r\n \r\n if ($scenario['Scenario']['is_multiplayer_scenario']){ // requested scenario is multi-player:\r\n $running = $this->Scenariosetup->find('scenario_id='.$scenario_id);\r\n if (!empty($running)){ // same multiplayer scenario is already running: --------------------\r\n // envSetupNeeded = false; //this is default already!\r\n } else { // the same multiplayer scenario is NOT running: -------------------------------------\r\n $returnData['envSetupNeeded'] = true; // IMPORTANT!\r\n $availableResources = $this->_getAvailableResources($scenario_id);\r\n if (!$availableResources){\r\n $returnData['error'] = 'Not allowed!<br />The resources are not available.';\r\n }\r\n }\r\n // OKAY!\r\n \r\n } else { // requested scenario is a single player scenario: ----------------------------------------\r\n \r\n $running = $this->Scenariosetup->find('scenario_id='.$scenario_id);\r\n if (empty($running)){ // single player is possible, because scenario is not running: ------------\r\n $returnData['envSetupNeeded'] = true; // IMPORTANT!\r\n $availableResources = $this->_getAvailableResources($scenario_id);\r\n if (!$availableResources){\r\n $returnData['error'] = 'All resources are in use, scenario setup impossible.';\r\n }\r\n // OKAY!\r\n } else { // single player is not possible somebody else has set it up already -----\r\n $returnData['error'] = 'Scenario setup not possible.<br />Somebody else plays this scenario already.';\r\n } \r\n }\r\n } // end of IF-Monster: ======================================================\r\n \r\n \r\n // When you get HERE, all checks have been successful until now.\r\n // now check for precompiled/player Systemaccount:\r\n if ($scenario['Scenario']['use_player']==0){ // the requested scenario uses system accounts: -------\r\n $possibleAccounts = $this->_getAvailableSystemaccounts($scenario_id);\r\n if (!empty($possibleAccounts)){ // player max is not reached (not all systemaccounts are in use):-------\r\n $rand = rand(0,(sizeof($possibleAccounts)-1)); // get a random id between 0 and size-1\r\n $returnData['Systemaccount'] = $possibleAccounts[$rand];\r\n // OKAY\r\n } else { // all Systemaccounts are in use! ---------------------------------------\r\n $returnData['error'] = 'Not allowed!<br />Someone else is playing this scenario already.';\r\n }\r\n } else {// the player user/password is used for scenario: --------------------------\r\n $returnData['Systemaccount']['user'] = $player['Player']['nick'];\r\n $returnData['Systemaccount']['passwd'] = $this->Session->read('Player.passwd_clear');\r\n }\r\n \r\n $returnData['Script'] = $scenario['Script'];\r\n return $returnData;\r\n }",
"public function _before(\\AcceptanceTester $I)\n {\n }",
"public function testSetStatus()\n {\n $this->todo('stub');\n }",
"public function testFight()\n {\n }",
"public function testListPastWebinarQA()\n {\n }",
"public function testStatusOption()\n {\n $user = factory(User::class)->create();\n $lease = factory(Lease::class)->create();\n }",
"public function testWebinarRegistrantStatus()\n {\n }"
] |
[
"0.5941834",
"0.5457332",
"0.5431214",
"0.5408679",
"0.535267",
"0.53487056",
"0.5283273",
"0.52655196",
"0.5260529",
"0.5198053",
"0.51976514",
"0.5191191",
"0.5169772",
"0.51673883",
"0.5140476",
"0.5132985",
"0.5129821",
"0.5117028",
"0.50895035",
"0.5073737",
"0.50681156",
"0.50596535",
"0.50482017",
"0.5034056",
"0.5030457",
"0.5027307",
"0.50255257",
"0.50214493",
"0.49849215",
"0.49512178"
] |
0.56381
|
1
|
Specifies name of a variable test guy would check.
|
public function lookAt(string $variableName): TestGuy;
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function tlogVariable($name, $variable);",
"public function setName($x) {\n $this->name = $x;\n }",
"public function setName($x) { $this->name = $x; }",
"abstract public function assertJavascriptVariable($variableName, $expectedValue);",
"public function testGetName()\n {\n static::assertEquals('cookie', $this->fixture->getName());\n }",
"public function testMissingParameterAddCheckName() {\n $check = $this->default_check;\n $check['name'] = null;\n $this->pingdom->addCheck($check);\n }",
"public function testMethodSetName()\n {\n $scorebox = new Scorebox();\n\n $scorebox->setName(\"One\");\n\n $name = $scorebox->getName();\n\n $expName = \"One\";\n\n $this->assertEquals($name, $expName);\n }",
"protected function _validVariableName($name)\n {\n // @TODO: Update this list with more\n $named = array('pageName','channel','server','campaign','products','TnT','events','pageType','purchaseID', 'transactionID','state','zip','currencyCode','pageType');\n $count = array('hier', 'eVar', 'prop');\n \n // Check for named\n if(in_array($name, $named))\n return true;\n \n // Check against numbered vars\n foreach($count as $var)\n if(strpos($name, $var) === 0)\n return true;\n \n // No matches :(\n return false;\n }",
"public function setVar($name = '', $var = FALSE)\n {\n if(intval($name) === 0)\n $this->args[$name] = $var;\n else\n _d('Class name: '.__CLASS__.' line: '.__LINE__.' function: '.__FUNCTION__.'() You must set correct param\\'s name.',1);\n }",
"public function testGetName(): void\n {\n $this->assertSame('travis', $this->context->getName());\n }",
"function defineVar(string $name, $value, string $scope=\"global\") {\r\n\r\n }",
"public function defaultVariables_test($tester) {\n\t\t$this->setupTests();\n\t\t$this->process();\n\n\t\t$tester->assertNotBlank($this->name);\n\t\t$tester->assertTrue(!$this->hasChanged);\n\t}",
"function set_name($name) {\n $this->name = $name;\n }",
"public function addVariable($name, $value);",
"public function getNameBasic()\n {\n $generator = All::create();\n $name = $generator->getName();\n $this->assertRegexp('/.+/', $name);\n }",
"private function set_name($v)\n\t{\n\t\tUtil::validateArgCount(func_num_args(), 1);\n\t\tUtil::validateType($v, \"string\");\n\t\t$this->m_name = $v;\n\t\t$this->n_name = true;\n\t\treturn $this->m_name;\n\t}",
"private function set_name($v)\n\t{\n\t\tUtil::validateArgCount(func_num_args(), 1);\n\t\tUtil::validateType($v, \"string\");\n\t\t$this->m_name = $v;\n\t\t$this->n_name = true;\n\t\treturn $this->m_name;\n\t}",
"function setName($value) {\n $this->name = $value;\n }",
"public function setName($var)\n {\n GPBUtil::checkString($var, True);\n $this->name = $var;\n }",
"public function setName($var)\n {\n GPBUtil::checkString($var, True);\n $this->name = $var;\n }",
"public function setName($var)\n {\n GPBUtil::checkString($var, True);\n $this->name = $var;\n }",
"public function setName($var)\n {\n GPBUtil::checkString($var, True);\n $this->name = $var;\n }",
"public function setName($var)\n {\n GPBUtil::checkString($var, True);\n $this->name = $var;\n }",
"public function setName($value)\r\n {\r\n $this->name = $value;\r\n }",
"public function setName($value)\r\n {\r\n $this->name = $value;\r\n }",
"public function setName($var)\n {\n GPBUtil::checkString($var, False);\n $this->name = $var;\n }",
"function testNameGetter(){\n\t\t#mdx:nameGetter\n\t\t$field = new MyField('address');\n\t\t#/mdx echo $field->name()\n\t\t$this->assertEquals('address',$field->name());\n\t}",
"function setName($value) {\n $this->name = $value;\n }",
"public function setName($_name)\n {\n if (is_string($_name)) {\n \t$this->_name = $_name;\n }\n }",
"private function setName($name) {\n if (is_string($name)) {\n $this->name = $name;\n }\n }"
] |
[
"0.60927755",
"0.59896594",
"0.591214",
"0.58867306",
"0.58608913",
"0.5746237",
"0.57208526",
"0.56905633",
"0.5681144",
"0.5664391",
"0.5657555",
"0.55731237",
"0.5535762",
"0.55182946",
"0.55151856",
"0.55034715",
"0.55034715",
"0.54974157",
"0.54900676",
"0.54900676",
"0.54900676",
"0.54900676",
"0.54900676",
"0.5484382",
"0.5484382",
"0.546837",
"0.5456292",
"0.54431814",
"0.54368347",
"0.54359657"
] |
0.6183142
|
0
|
Sets the chain for the task
|
public function setChain($chain) {
$this->chain = $chain;
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function set_chain(Event $chain)\n {\n $this->_chain = $chain;\n }",
"public function chain() {\n\t\t\treturn $this->chain;\n\t\t}",
"public function getChain() {\n return $this->chain;\n }",
"public function chain($tasks) \n {\n return new Chain($tasks);\n }",
"public function startChain(){\n\t\treturn $this;\n\t}",
"public function startChain(){\n\t\treturn $this;\n\t}",
"public function chain(PipeChainInterface $chain): PipeChainInterface;",
"public function get_chain()\n {\n return $this->_chain;\n }",
"public function __construct(\\Iterator $chain) {\n $this->chain = $chain;\n }",
"public function startChain() {\n\t\treturn $this;\n\t}",
"public function chain()\n {\n $response = SubstrateBase::APIHandler('system_'.__FUNCTION__);\n $this->_chain = $response['result'];\n return response()->json($this->_chain);\n }",
"public function setCallChainId($val)\n {\n $this->_propDict[\"callChainId\"] = $val;\n return $this;\n }",
"public function executeChain(IJoinPoint $joinpoint);",
"public function __construct(AbstractChainedCommandHandler $headOfChain)\n {\n $this->headOfChain = $headOfChain;\n }",
"public function testChain()\n\t{\n\t\t$request = $this->createMock(\\Psr\\Http\\Message\\ServerRequestInterface::class);\n\n\t\t$response = $this->createMock(\\Psr\\Http\\Message\\ResponseInterface::class);\n\t\t$response->method('getReasonPhrase')->willReturn('ping');\n\n\t\t$middlewareAdaptor = $this->createMock(MiddlewareAdaptorInterface::class);\n\t\t$middlewareAdaptor->method('setResolver');\n\t\t$middlewareAdaptor->method('executePipeline')\n\t\t->with(\n\t\t\t$this->equalTo('pipelineFoo'),\n\t\t\t$this->equalTo($request),\n\t\t\t$this->equalTo(null)\n\t\t)\n\t\t->willReturn($response);\n\n\t\t$resolveAdaptor = $this->createMock(\\Weave\\Resolve\\ResolveAdaptorInterface::class);\n\t\t$dispatchAdaptor = $this->createMock(\\Weave\\Dispatch\\DispatchAdaptorInterface::class);\n\n\t\t$requestFactory = $this->createMock(\\Weave\\Http\\RequestFactoryInterface::class);\n\t\t$responseFactory = $this->createMock(\\Weave\\Http\\ResponseFactoryInterface::class);\n\t\t$emitter = $this->createMock(\\Weave\\Http\\ResponseEmitterInterface::class);\n\n\t\t$middleware = new Middleware(\n\t\t\t$middlewareAdaptor,\n\t\t\tfn () => 'pipelineFoo',\n\t\t\t$resolveAdaptor,\n\t\t\t$dispatchAdaptor,\n\t\t\t$requestFactory,\n\t\t\t$responseFactory,\n\t\t\t$emitter\n\t\t);\n\n\t\t$result = $middleware->chain('pipelineFoo', $request);\n\n\t\t$this->assertEquals('ping', $result->getReasonPhrase());\n\t}",
"protected function & returnToChain () {\n // Easier, than writing return (this) every time;\n return $this;\n }",
"public static function withChain($chain)\n {\n return new PendingChain(static::class, $chain);\n }",
"public function setTask($value) {\nif (empty($value))\n throw new Exception('A Name cannot be empty');\nif (strlen($value) > 30)\n throw new Exception('A task cannot be longer than 30 characters');\n$this->task = $value;\nreturn $this;\n}",
"public function setAppChain(AppChain $appChain)\n {\n $this->appChain = $appChain;\n }",
"final public function setPrev(Chainable $chainable) {\n $this->prev = $chainable;\n }",
"public function findChained()\n {\n $this->chain = $this->createQueryBuilder('bl')\n ->select('bl, b, ta')\n ->leftJoin('bl.banknote', 'b')\n ->leftJoin('bl.transaction', 'ta')\n ;\n\n return $this;\n }",
"protected function setTo() {}",
"public function task($task)\n\t{\n\t\t$this->task = $task;\n\n\t\treturn $this;\n\t}",
"public function appendTaskSettings(){\n $taskSettingsSerializer=new CloudDriverTaskSettingsSerializer($this->pmml,$this->miner->type);\n $taskSettingsSerializer->task=$this->task;\n $this->pmml=$taskSettingsSerializer->settingsFromJson($this->task->taskSettingsJson);\n }",
"public function execute($filterChain)\n {\n if ($this->isFirstCall())\n {\n $q = Doctrine::getTable('P1ngSettings')->\n createQuery('s')->\n where('s.deleted_at IS NULL');\n $result = $q->fetchArray();\n\n foreach($result as $item)\n {\n sfConfig::set('p1ng_'.sfInflector::underscore($item['namespace'].'_'.$item['name']), $item['value']);\n }\n }\n\n $filterChain->execute();\n }",
"function execute(&$context,&$chain){}",
"public function setWrappedTask(sfTask $task)\n {\n $this->wrappedTask = $task;\n }",
"public function set_task($task)\n {\n $task = asciiwords($task);\n\n if ($this->user && $this->user->ID)\n $task = !$task ? 'mail' : $task;\n else\n $task = 'login';\n\n $this->task = $task;\n $this->comm_path = $this->url(array('task' => $this->task));\n\n if ($this->output)\n $this->output->set_env('task', $this->task);\n }",
"function iptables_chain_add($chain) {\n\t\t//define the global variables\n\t\tglobal $firewall_path, $firewall_name;\n\n\t\t//if the chain exists return true\n\t\tif (iptables_chain_exists($chain)) {\n\t\t\techo \"IPtables \".$chain.\" chain already exists\\n\";\n\t\t\treturn true;\n\t\t}\n\n\t\t//log info to the console\n\t\techo \"Add iptables \".$chain.\" chain\\n\";\n\n\t\t//add the chain\n\t\tsystem($firewall_path.'/./iptables --new '.$chain);\n\t\tsystem($firewall_path.'/./iptables -I INPUT -j '.$chain);\n\n\t\t//check if the chain exists\n\t\tif (iptables_chain_exists($chain)) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\tsleep(1);\n\t\t\tiptables_chain_add($chain);\n\t\t}\n\t}",
"public function setTask($task)\n {\n $taskCode = filter_var($task, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);\n if (strpos($taskCode, '-') !== false) {\n $taskCode = str_replace('-', '', $taskCode);\n }\n $taskCode = $this->project . $taskCode;\n $this->task = $taskCode;\n }"
] |
[
"0.6503596",
"0.5784868",
"0.5734278",
"0.5658802",
"0.5639664",
"0.5639664",
"0.56358916",
"0.5532191",
"0.54464877",
"0.5445263",
"0.52836263",
"0.5212807",
"0.5212401",
"0.50718635",
"0.5041686",
"0.50297964",
"0.5023095",
"0.50082195",
"0.4983455",
"0.48973045",
"0.48564154",
"0.47307426",
"0.47005048",
"0.47000024",
"0.46980828",
"0.4696995",
"0.46948186",
"0.46579468",
"0.46083477",
"0.46027407"
] |
0.66851497
|
0
|
Gets the chain for the task
|
public function getChain() {
return $this->chain;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function get_chain()\n {\n return $this->_chain;\n }",
"public function chain() {\n\t\t\treturn $this->chain;\n\t\t}",
"public function chain($tasks) \n {\n return new Chain($tasks);\n }",
"public function chain()\n {\n $response = SubstrateBase::APIHandler('system_'.__FUNCTION__);\n $this->_chain = $response['result'];\n return response()->json($this->_chain);\n }",
"function getTask() ;",
"public function getTask();",
"public function getTask();",
"public function getTask() {}",
"public function getTask() {}",
"public function getTask() {}",
"public function startChain(){\n\t\treturn $this;\n\t}",
"public function startChain(){\n\t\treturn $this;\n\t}",
"public function getTask() {\n return $this->call->getTask();\n }",
"public function getChainCollection();",
"public function startChain() {\n\t\treturn $this;\n\t}",
"public function getTask()\n {\n return $this->task;\n }",
"public function getTask()\n {\n return $this->task;\n }",
"function getTask() {\n\t\treturn $this->_task;\n\t}",
"public function chain(PipeChainInterface $chain): PipeChainInterface;",
"public function getTask(): string\n {\n return $this->task;\n }",
"public function getTaskPath()\r\n { \r\n return 'bebras-tasks/'.$this->route;\r\n }",
"public function get()\n {\n return $this->tasks;\n }",
"protected function & returnToChain () {\n // Easier, than writing return (this) every time;\n return $this;\n }",
"public function getTasks()\n {\n return $this->hasMany(Task::className(), ['contractor_id' => 'id']);\n }",
"protected function getChainTableName()\n {\n return $this->getGatewayCollection()\n ->getGateway('pt_rule_chain')\n ->getMetaData()\n ->getName();\n \n }",
"public function getWorkflow();",
"public function getCallChainId()\n {\n if (array_key_exists(\"callChainId\", $this->_propDict)) {\n return $this->_propDict[\"callChainId\"];\n } else {\n return null;\n }\n }",
"public function getPropertyConditionChain()\n {\n return $this->conditionChain;\n }",
"public function getTask(array $task);",
"public function getTransferJob()\n {\n return $this->transfer_job;\n }"
] |
[
"0.72851616",
"0.71652704",
"0.6131776",
"0.60779554",
"0.59972864",
"0.5897607",
"0.5897607",
"0.5863068",
"0.5863068",
"0.5861416",
"0.5784574",
"0.5784574",
"0.57444346",
"0.5614221",
"0.555363",
"0.5541112",
"0.5541112",
"0.54808325",
"0.5436687",
"0.53471863",
"0.53451663",
"0.5212043",
"0.5207767",
"0.5166063",
"0.5154145",
"0.5130642",
"0.5119868",
"0.50993854",
"0.5072513",
"0.50525355"
] |
0.73174363
|
0
|
Returns the maximum level of containers.
|
public function computeMaxLevel($level = 0)
{
$this->GetContainer();
$maxLevel = $level;
$containerChildList = $this->GetChildContainerList();
if (count($containerChildList) > 0) {
$level++;
foreach ($containerChildList as $cName => $childContainer) {
$retval = $childContainer->computeMaxLevel($level);
$maxLevel = max(array($retval, $maxLevel));
}
}
return $maxLevel;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getDepthMaximum(): PositiveInteger;",
"public function getMaxNesting()\n {\n return $this->maxNesting;\n }",
"public function getMaximumDepth()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$query = 'SELECT MAX(depth) depth FROM '.$this->table_tree;\n\t\t$res = $ilDB->query($query);\t\t\n\t\t\n\t\t$row = $ilDB->fetchAssoc($res);\n\t\treturn $row['depth'];\n\t}",
"public function getMaxComponentDepth() {}",
"public static function getMaxGraphicStateNestingLevel() {}",
"public function getMaxDepth(): ?int;",
"public function getMaxDepth(): ?int;",
"public static function maxLevel()\n\t{\n\t\tif (!auth()->check()) return 0;\n\t\t$member = \\PanicHDMember::find(auth()->user()->id);\n\t\tif ($member->isAdmin()){\n\t\t\treturn 3;\n\t\t}elseif($member->isAgent()){\n\t\t\treturn 2;\n\t\t}else\n\t\t\treturn 1;\n\t}",
"public function maxDepth()\n {\n if ($this->maxDepth === null) {\n return static::DEFAULT_MAX_DEPTH;\n }\n\n return $this->maxDepth;\n }",
"public function getMaxStackElements() {}",
"private function getActualLevel(): int\n {\n return (int)array_key_last($this->levels);\n }",
"protected function _getMax()\n {\n $max = 0;\n if (!empty($this->_tagsArray)) {\n $p_size = 0;\n foreach ($this->_tagsArray as $cKey => $cVal) {\n $c_size = $cVal['size'];\n if ($c_size > $p_size) {\n $max = $c_size;\n $p_size = $c_size;\n }\n }\n }\n return $max;\n }",
"public function getMaximum()\n {\n return $this->maximum;\n }",
"function get_max_depth($cat_id)\n{\n\tglobal $db;\n\tif ($cat_id < 0) $cat_id = 0;\n\t$local_depth = 0;\n\t$sql = \"select * from \" . CATEGORIES_TABLE . \" where cat_main = $cat_id\";\n\tif( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query categorie parm', '', __LINE__, __FILE__, $sql);\n\twhile ( $row = $db->sql_fetchrow($result) )\n\t{\n\t\t$branch_depth = get_max_depth( $row['cat_id'] );\n\t\tif ( $cat_id > 0 ) $branch_depth++;\n\t\tif ( $branch_depth > $local_depth ) $local_depth = $branch_depth;\n\t}\n\treturn $local_depth;\n}",
"public function getMaxNbChilds()\n {\n return $this->getOption('max', 0);\n }",
"public function getMaximum()\n {\n return $this->max;\n }",
"function max() { return $this->max; }",
"public function get_last_level()\n {\n return $this->levels()->order_by(\"dungeon_level\", \"desc\")->first();\n }",
"protected function max_value() {\n $max = 0;\n foreach ($this->data_collections as $data_collection) {\n foreach ($data_collection->get_items() as $item) {\n if ($max < $item->get_value()) {\n $max = $item->get_value();\n }\n }\n }\n return $max;\n }",
"public function getMax()\n {\n return $this->_maxValue;\n }",
"public function getLevel()\n {\n return sizeof($this->getParentsID());\n }",
"public function getHighestHardcoreLevel()\n {\n return $this->getData(__FUNCTION__, 0);\n }",
"public function getMax() {\n return $this->max;\n }",
"public function getMaximum() {\r\n return $this->maximumvalue;\r\n }",
"public function getLargest()\n {\n return $this->getVersionAlgorithm()->largestDim()->byImage($this)->first();\n }",
"public function max() {\n return count($this->flats);\n }",
"function wpsl_get_max_zoom_levels() {\n\n $max_zoom_levels = array();\n $zoom_level = array(\n 'min' => 10,\n 'max' => 21\n );\n\n $i = $zoom_level['min'];\n\n while ( $i <= $zoom_level['max'] ) {\n $max_zoom_levels[$i] = $i;\n $i++;\n }\n\n return $max_zoom_levels;\n}",
"function getLastlevel() {\n return $this->lastlevel;\n }",
"public function maxRangeSets(): int\n {\n return $this->maximumRangeSets;\n }",
"public function getMaxValue();"
] |
[
"0.7198032",
"0.7151124",
"0.699007",
"0.69733405",
"0.6883715",
"0.6867958",
"0.6867958",
"0.68655103",
"0.6685317",
"0.6674382",
"0.6532583",
"0.64575744",
"0.6439754",
"0.6391976",
"0.63853997",
"0.6373736",
"0.63664",
"0.6342863",
"0.63155377",
"0.62109643",
"0.6207189",
"0.61440766",
"0.61352175",
"0.6127839",
"0.611874",
"0.6113822",
"0.6099555",
"0.6091428",
"0.60770535",
"0.60729903"
] |
0.7196478
|
1
|
Get the format's id.
|
public function getId() : FormatId
{
return $this->id;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFormatId() : FormatId\n\t{\n\t\treturn $this->formatId;\n\t}",
"public function id($format = 'N')\n {\n return $this->getVar('imgset_id', $format);\n }",
"public function getID()\n {\n return $this->formattedData['id'];\n }",
"public function imgset_id($format = '')\n {\n return $this->getVar('imgset_id', $format);\n }",
"public function imgset_refid($format = '')\n {\n return $this->getVar('imgset_refid', $format);\n }",
"protected function GetId() {\n\n $Id= $this->GetOption('Id');\n if (!$Id) {\n $Id= $this->GetName(); // let id be same as name\n $Id= str_replace(array('[',']'),'_', $Id); // id cannot contain '[' and ']'\n $Id= trim($Id, '_'); // id cannot start with '_'\n }\n return $Id;\n }",
"function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}",
"public function getId()\n {\n return substr($this->_id, 0, 12);\n }",
"public function getId()\n {\n return (substr($this->_id, 0, 12));\n }",
"public static function getID()\n {\n return self::getInstance()->_getID();\n }",
"public function getId()\n {\n return isset($this->id) ? $this->id : '';\n }",
"public function getId()\n {\n return isset($this->id) ? $this->id : '';\n }",
"public function pId()\n {\n static $id = null;\n\n if (!is_null($id)) {\n return $id;\n }\n\n $id = $this->property('id');\n\n if (strpos($id, 'http') === 0) {\n $path = explode('/', parse_url($id, PHP_URL_PATH));\n\n if ($path[1] == 'gallery') {\n $id = $path[2];\n }\n elseif ($path[1] == 'a') {\n $id = 'a/'.$path[2];\n }\n else {\n $id = $path[1];\n }\n }\n\n return $id;\n }",
"public function getId()\n {\n return $this->file->get('id');\n }",
"public function get_id();",
"public function get_id();",
"public function getId(){\n if(!$this->id){\n return $this->getShippingOptionId().'_'.md5($this->getShippingServiceName());\n }\n return $this->id;\n }",
"public function getIdentifier()\n {\n return $this->id;\n }",
"public function get_id() {\n\t\treturn self::ID;\n\t}",
"public function get_id() {\n\t\treturn self::ID;\n\t}",
"public function getFormat(): int;",
"public function getID() {\n \n return $this->id;\n }",
"public function getID();",
"public function getID();",
"public function getID();",
"public function getIdentifier() {\n\t\tif (empty($this->_id) && $this->_hasCategory) {\n\t\t\t$this->_id = $this->_getCategory()->getId();\n\t\t}\n\t\treturn $this->_id;\n\t}",
"public static function getID() {\r\n return 1;\r\n }",
"function get_idstring() {\n return $this->id;\n }",
"public function getId()\n {\n return $this->identifier;\n }",
"public function getId(): string\n {\n return $this->id;\n }"
] |
[
"0.846736",
"0.7381673",
"0.73241794",
"0.71253",
"0.6908983",
"0.688962",
"0.6798856",
"0.6750246",
"0.672604",
"0.66546667",
"0.6608332",
"0.6608332",
"0.6589153",
"0.658753",
"0.6586679",
"0.6586679",
"0.6576638",
"0.654186",
"0.64991105",
"0.64991105",
"0.64688575",
"0.6452708",
"0.6452632",
"0.6452632",
"0.6452632",
"0.6448914",
"0.6444561",
"0.64383245",
"0.6436638",
"0.64334536"
] |
0.87433904
|
0
|
Get the format's field size.
|
public function getFieldSize() : int
{
return $this->fieldSize;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFormatSize() {}",
"function _get_field_size() \n {\n if (isset($this->attribs['size'])) {\n return $this->attribs['size'];\n }\n elseif ($this->attribs['maxlength'] > $this->max_size) {\n return $this->max_size;\n }\n else {\n return $this->attribs['maxlength'];\n }\n }",
"public function getFieldLength()\n {\n return $this->FieldLength;\n }",
"function getSize() {\n\t\treturn $this->data_array['filesize'];\n\t}",
"public function getSize()\n {\n return $this->item['size'];\n }",
"public function getExtensionLength()\n {\n return $this->_fields['ExtensionLength']['FieldValue'];\n }",
"public function getSize()\n {\n return $this->_Size;\n }",
"public function getBulletSizeField()\n {\n return $this->bulletSizeField;\n }",
"public function getSize() {\n return $this->_size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize() {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->fileStructure->size;\n }",
"public function getSize()\n\t{\n\t\treturn $this->size;\n\t}",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->size;\n }",
"public function getSize()\n {\n return $this->length;\n }",
"public function getSize() {\n\n return $this->size;\n }",
"public function getSize() {\n\n return $this->size;\n\t}",
"public function getSize() {\r\n return $this->iSize;\r\n }",
"public function getSize() {\r\n\t\treturn $this->app->filesystem->formatFilesize($this->get('size', 0));\r\n\t}",
"public function getSize()\n {\n $size = (int) $this->resolveProperty('size');\n\n if ($size < 0) {\n throw new ConfigurationException('Field size should not be less 0');\n }\n\n return $size;\n }",
"function getSize()\r\n\t{\r\n\t\treturn $this->size;\r\n\t}"
] |
[
"0.8430468",
"0.78774667",
"0.75984144",
"0.7120926",
"0.7011472",
"0.6995463",
"0.6951911",
"0.6915207",
"0.6913422",
"0.6908509",
"0.6908509",
"0.6908509",
"0.6908509",
"0.6908509",
"0.6908509",
"0.6908509",
"0.6908509",
"0.68897176",
"0.68783164",
"0.6877252",
"0.68643475",
"0.68643475",
"0.6856958",
"0.68567324",
"0.68524355",
"0.68472713",
"0.68426347",
"0.6836295",
"0.68320876",
"0.68201107"
] |
0.8206506
|
1
|
Get the format's Smogon dex identifier.
|
public function getSmogonDexIdentifier() : string
{
return $this->smogonDexIdentifier;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFormatId() : FormatId\n\t{\n\t\treturn $this->formatId;\n\t}",
"public function getId() : FormatId\n\t{\n\t\treturn $this->id;\n\t}",
"public function getFormatName();",
"public function getFormat(): int;",
"public function id($format = 'N')\n {\n return $this->getVar('imgset_id', $format);\n }",
"public static function getFormat(): string;",
"public function imgset_refid($format = '')\n {\n return $this->getVar('imgset_refid', $format);\n }",
"public function getEdiType(): string\n {\n return $this->identifierCode;\n }",
"function get_segment_id() : string {\n\tif ( defined( 'ALTIS_SEGMENT_ID' ) ) {\n\t\treturn ALTIS_SEGMENT_ID;\n\t}\n\treturn SEGMENT_ID;\n}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"abstract public function getFormat(): int;",
"public function getFormat() {}",
"public function getFormat() {}",
"public function getFormat() {}",
"public function getIdentifier(): string;",
"public function getIdentifier(): string;",
"public function getIdentifier(): string\n {\n return $this->identifier;\n }",
"public function getIdentifier(): string\n {\n return $this->identifier;\n }",
"public function getIdentifier(): string\n {\n return $this->identifier;\n }",
"public function imgset_id($format = '')\n {\n return $this->getVar('imgset_id', $format);\n }",
"public function get_identifier() {\n return $this->identifier;\n }",
"public function getHeaderPlatformGID()\r\n\t{\r\n\t\treturn $this->headers[SONIC_HEADER__PLATFORM_GID];\r\n\t}",
"public function getIdentifier();"
] |
[
"0.644611",
"0.61967593",
"0.58986276",
"0.5820077",
"0.5729863",
"0.57200944",
"0.56906164",
"0.56569505",
"0.561363",
"0.5612573",
"0.5612573",
"0.561227",
"0.5611996",
"0.5611996",
"0.5611996",
"0.5611996",
"0.5611996",
"0.5595931",
"0.55783284",
"0.55783284",
"0.55783284",
"0.55440795",
"0.55440795",
"0.5525882",
"0.5525882",
"0.5525882",
"0.55237734",
"0.5520348",
"0.5504641",
"0.5495167"
] |
0.76524717
|
0
|
Set current effect counter in player data
|
public function select(CustomPlayer $player) {
$player->particleEffectExtra["i"] = 0;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function updateCounter(array $data): void\n {\n }",
"public function setEffect( $effect ) {\n $this->effect = $effect;\n }",
"public function setCounter( Streamwide_Engine_Counter $counter )\n {\n $this->_counter = $counter;\n }",
"protected function updateFlashCounters()\n {\n $counters = $this->get(SessionBlockInterface::FLASH_KEY, []);\n if (is_array($counters)) {\n foreach ($counters as $key => $count) {\n if ($count > 0) {\n unset($counters[$key]);\n $this->remove($key);\n } elseif ($count === 0) {\n $counters[$key]++;\n }\n }\n $this->set(SessionBlockInterface::FLASH_KEY, $counters);\n }\n }",
"function stDogmaEffect() {\n $current_effect_type = self::getGameStateValue('current_effect_type');\n $current_effect_number = self::getGameStateValue('current_effect_number');\n $card_id = self::getGameStateValue('dogma_card_id');\n $card = self::getCardInfo($card_id);\n $qualified_effect = self::qualifyEffect($current_effect_type, $current_effect_number, $card);\n \n // Search for the first player who will undergo/share the effects, if any\n $first_player = self::getFirstPlayerUnderEffect($current_effect_type);\n if ($first_player === null) {\n // There is no player affected by the effect\n self::notifyGeneralInfo(\"<span class='minor_information'>\" . clienttranslate('Nobody is affected by the ${qualified_effect} of the card.') . \"</span>\", array(\n 'i18n' => array('qualified_effect'),\n 'qualified_effect' => $qualified_effect\n ));\n \n // End of the effect\n self::trace('dogmaEffect->interDogmaEffect');\n $this->gamestate->nextState('interDogmaEffect');\n return;\n }\n \n self::setGameStateValue('current_player_under_dogma_effect', $first_player);\n $this->gamestate->changeActivePlayer($first_player);\n \n // Begin the loop with this player\n self::trace('dogmaEffect->playerInvolvedTurn');\n $this->gamestate->nextState('playerInvolvedTurn');\n }",
"public function pvc_counter_mechanism() {\n add_filter( 'the_content', [ $this, 'pvc_set_post_view' ] );\n add_filter( 'the_content', [ $this, 'pvc_get_post_view' ] );\n }",
"function markExecutingPlayer($player_id) {\n self::DbQuery(self::format(\"\n UPDATE\n player\n SET\n effects_had_impact = TRUE\n WHERE\n player_id = {player_id}\n \", \n array('player_id' => $player_id)\n ));\n }",
"public function updatePositiveCount() {\n\n\t}",
"public function increaseVolume()\n {\n $this->volume += 1;\n }",
"public function effect1()\n {\n }",
"public function incrIdPlayer($increment) {\n $this->setIdPlayer($this->getIdPlayer() + $increment);\n }",
"function startUpdate()\r\n {\r\n $this->_updatecounter++;\r\n }",
"public function setCurrentPlayer($player){\r\n $this->currentPlayer = $player;\r\n }",
"public function inc(): void {}",
"public function incResponseCount()\n {\n $incResponse = (int) $this->attribute( 'response_count' );\n $incResponse++;\n $this->setAttribute( 'response_count', $incResponse );\n $this->store();\n }",
"function resetFlagsForMonument() {\n self::DbQuery(\"\n UPDATE\n player\n SET\n number_of_tucked_cards = 0,\n number_of_scored_cards = 0\n \");\n }",
"function setCount( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Count = $value;\n setType( $this->Count, \"integer\" );\n }",
"function incrementFlagForMonument($player_id, $column_name) { // The player tucked or scored a card. Update database accordingly\n self::DbQuery(self::format(\"\n UPDATE\n player\n SET\n {column_name} = {column_name} + 1\n WHERE\n player_id = {player_id}\n \",\n array('player_id' => $player_id, 'column_name' => $column_name)\n ));\n }",
"function updateScore(Player $player, int $points)\n{\n $score = $player->getScore();\n $player->setScore($score + $points);\n}",
"public function getEffect() {\n return $this->effect;\n }",
"protected function _initCounter()\n {\n $this->_counter->reset();\n $tries = $this->_options[self::OPT_TRIES];\n $this->_counter->setOptions( array( Streamwide_Engine_Counter::OPT_TRIES => $tries ) );\n }",
"function updatecounter() \n{\n\t//session_start();\n\t//Determine if seesion exists\n\tif (!isset($_SESSION['counter'])) \n\t{\n\t\t//create the session\n\t\t$_SESSION['counter']=\"set\";\n\t\tinclude(\"dbconnect.php\");\n\t\t$str1=\"update options set value1=value1+1 where name='counter'\";\n\t\t//echo($str1);\n\t\t$result=mysql_query($str1) or die(mysql_error());\n\t\t//mysql_free_result($result);\n\t\t//IPtracking();\n\t}\n\t\t\n}",
"public function setBuffFromItems()\n {\n\n if (isset($_SESSION[\"inventory\"]) && sizeof($_SESSION[\"inventory\"]) > 0) {\n\n $atk_total_items = 0;\n $health_total_items = 0;\n $mana_total_items = 0;\n\n foreach ($_SESSION['inventory'] as $item) {\n if ($item->getStatAtk()) {\n $atk_total_items += $item->getStatAtk();\n }\n if ($item->getStatHealth()) {\n $health_total_items += $item->getStatHealth();\n }\n if ($item->getStatMana()) {\n $mana_total_items += $item->getStatMana();\n }\n }\n\n $_SESSION[\"character\"]->setAtk($_SESSION[\"character\"]->getBaseAtk() + $atk_total_items);\n $_SESSION[\"character\"]->setHp($_SESSION[\"character\"]->getBaseHp() + $health_total_items);\n $_SESSION[\"character\"]->setMana($_SESSION[\"character\"]->getBaseMana() + $mana_total_items);\n\n $_SESSION[\"character\"]->setBuffActivated(true);\n }\n }",
"public function increaseEffectDuration($Battleeffect, $sameHero = true) {\n $existingEffectIndex = $this->battleeffects->indexOf($Battleeffect, $sameHero);\n if($existingEffectIndex > -1) {\n $existingEffect = $this->battleeffects->itemAt($existingEffectIndex);\n $existingEffect->turns += $Battleeffect->turns;\n } else {\n // nothing or throw exception?\n }\n }",
"function _setCounter()\n {\n\t\t$counter = $this->get( 'session.counter', 0 );\n\t\t++$counter;\n\n\t\t$this->set( 'session.counter', $counter );\n \treturn true;\n }",
"function stInterDogmaEffect() { $current_effect_type = self::getGameStateValue('current_effect_type');\n \n // Indicate the potential new (non-demand) dogma to come\n if ($current_effect_type == 0) { // I demand dogma : there is only one for this version of this game\n $current_effect_number = 1; // Switch on the first non-demand dogma, if exists\n }\n else {\n $current_effect_number = self::getGameStateValue('current_effect_number') + 1; // Next non-demand dogma, if exists\n }\n \n $card_id = self::getGameStateValue('dogma_card_id');\n $card = self::getCardInfo($card_id);\n \n // Check whether this new dogma exists actually or not\n if ($current_effect_number > 3 || $card['non_demand_effect_'.$current_effect_number] === null) {\n // No card has more than 3 non-demand dogma => there is no more effect\n // or the next non-demand-dogma effect is not defined\n \n $sharing_bonus = self::getGameStateValue('sharing_bonus');\n $launcher_id = self::getGameStateValue('active_player');\n \n // Stats\n $i_demand_effects = false;\n $executing_players = self::getExecutingPlayers();\n foreach($executing_players as $player_id => $stronger_or_equal) {\n if ($player_id == $launcher_id) {\n continue;\n }\n if ($stronger_or_equal) { // This player had effectively shared some dogma effects of the card\n self::incStat(1, 'sharing_effects_number', $player_id);\n }\n else { // The card had an I demand effect, and at least one player executed it with effects\n self::incStat(1, 'i_demand_effects_number', $player_id);\n $i_demand_effects = true;\n }\n\n }\n if ($i_demand_effects) {\n self::incStat(1, 'dogma_actions_number_with_i_demand', $launcher_id);\n }\n if ($sharing_bonus == 1) {\n self::incStat(1, 'dogma_actions_number_with_sharing', $launcher_id);\n }\n \n // Award the sharing bonus if needed\n if ($sharing_bonus == 1) {\n self::notifyGeneralInfo('<span class=\"minor_information\">${text}</span>', array('i18n'=>array('text'), 'text'=>clienttranslate('Sharing bonus.')));\n $player_who_launched_the_dogma = self::getGameStateValue('active_player');\n try {\n self::executeDraw($player_who_launched_the_dogma); // Draw a card with age consistent with player board\n }\n catch (EndOfGame $e) {\n // End of the game: the exception has reached the highest level of code\n self::trace('EOG bubbled from self::stInterDogmaEffect');\n self::trace('interDogmaEffect->justBeforeGameEnd');\n $this->gamestate->nextState('justBeforeGameEnd');\n return;\n }\n }\n \n // The active player may have changed during the dogma. Reset it on the player whose turn was\n $this->gamestate->changeActivePlayer($launcher_id);\n \n // Reset player table\n self::resetPlayerTable();\n \n // [R] Disable the flags used when in dogma \n self::setGameStateValue('dogma_card_id', -1);\n self::setGameStateValue('current_effect_type', -1);\n self::setGameStateValue('current_effect_number', -1);\n self::setGameStateValue('sharing_bonus', -1);\n self::setGameStateValue('current_player_under_dogma_effect', -1);\n self::setGameStateValue('step', -1);\n self::setGameStateValue('step_max', -1);\n self::setGameStateValue('special_type_of_choice', -1);\n self::setGameStateValue('choice', -1);\n self::setGameStateValue('splay_direction', -1);\n self::setGameStateValue('n_min', -1);\n self::setGameStateValue('n_max', -1);\n self::setGameStateValue('solid_constraint', -1);\n self::setGameStateValue('owner_from', -1);\n self::setGameStateValue('location_from', -1);\n self::setGameStateValue('owner_to', -1);\n self::setGameStateValue('location_to', -1);\n self::setGameStateValue('bottom_to', -1);\n self::setGameStateValue('age_min', -1);\n self::setGameStateValue('age_max', -1);\n self::setGameStateValue('color_array', -1);\n self::setGameStateValue('with_icon', -1);\n self::setGameStateValue('without_icon', -1);\n self::setGameStateValue('not_id', -1);\n self::setGameStateValue('can_pass', -1);\n self::setGameStateValue('n', -1);\n self::setGameStateValue('id_last_selected', -1);\n self::setGameStateValue('age_last_selected', -1);\n self::setGameStateValue('color_last_selected', -1);\n self::setGameStateValue('score_keyword', -1);\n self::setGameStateValue('auxiliary_value', -1);\n for($i=1; $i<=9; $i++) {\n self::setGameStateInitialValue('nested_id_'.$i, -1);\n self::setGameStateInitialValue('nested_current_effect_number_'.$i, -1);\n }\n \n // End of this player action\n self::trace('interDogmaEffect->interPlayerTurn');\n $this->gamestate->nextState('interPlayerTurn');\n return;\n }\n \n // There is another (non-demand) effect to perform\n self::setGameStateValue('current_effect_type', 1);\n self::setGameStateValue('current_effect_number', $current_effect_number);\n \n // Jump to this effect\n self::trace('interDogmaEffect->dogmaEffect');\n $this->gamestate->nextState('dogmaEffect');\n }",
"public function modify() {\n\t\t$cart = D('ShoppingCart');\n\t\t// call a method in shopping cart model\n\t\t// decide by return value to give different hint\n\t\tif ($cart->modifyCount($this->_session('uid'), $_POST['good_id'], $_POST['good_count'], $_POST['add'])) {\n\t\t\t$this->success('Modification succeeded!');\n\t\t} else {\n\t\t\t$this->error('Modification failed!');\n\t\t}\n\t}",
"public function establish_follow_count() {\n\t\tif ( false == SWFW_Cache::is_cache_fresh() ) {\n\t\t\t$this->do_api_request();\n\t\t\t$this->parse_api_response();\n\t\t\t$this->save_follow_count();\n\n\t\t}\n\n\t\t$key = \"{$this->key}_follow_count\";\n\t\t$follow_count = SWFW_Utility::get_option( $key );\n\t\t$this->follow_count = SWP_Utility::kilomega( $follow_count );\n\t}",
"public function setControllerCooldown(Player $player) : void{\n\t\t$task = new ControllerCooldown($this);\t\n\t\t$handler = $this->getScheduler()->scheduleRepeatingTask($task, 1);\n\t\t$task->setHandler($handler);\n\t\t$this->cooldown[$task->getTaskId()] = $player;\n\t}",
"private function incrementFavoriteCount()\n {\n $counter = $this->favoriteCounter()->first();\n\n if ($counter) {\n $counter->count++;\n $counter->save();\n } else {\n $counter = new FavoriteCounter;\n $counter->count = 1;\n $this->favoriteCounter()->save($counter);\n }\n }"
] |
[
"0.5447777",
"0.5323069",
"0.5166309",
"0.5115582",
"0.50420237",
"0.5006997",
"0.50014335",
"0.49816447",
"0.49334466",
"0.4918838",
"0.49162382",
"0.4888362",
"0.4878574",
"0.48492476",
"0.4844867",
"0.48291376",
"0.47946236",
"0.47855547",
"0.47306868",
"0.47176653",
"0.47172984",
"0.47032434",
"0.4694989",
"0.46838465",
"0.46835592",
"0.4680854",
"0.46793956",
"0.46723047",
"0.46646854",
"0.46550736"
] |
0.56862295
|
0
|
Get a descriptive name for this task (shown to admins).
|
public function get_name() {
return \enrol_oes_string::display('sync_taskname');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function get_task_name()\n\t{\n\t\treturn $this->task_name;\n\t}",
"public function get_task_name()\n\t{\n\t\treturn $this->task_name;\n\t}",
"public function getTaskName() : string\n {\n return $this->taskName;\n }",
"public function getTaskName() : string {\n return $this->taskName;\n }",
"public function getNameTask()\n {\n return $this->name_task;\n }",
"public function get_name() {\n // Shown in admin screens.\n return get_string('recompletiontask', 'local_recompletion');\n }",
"public function getTaskName()\n {\n return $this->taskName;\n }",
"protected function getTaskName()\n {\n return str_replace(' ', '', lcfirst(ucwords(str_replace('-', ' ', $this->executableName))));\n }",
"protected function _getTaskName()\n {\n $name = explode(':', $this->getName());\n\n return $name[1];\n }",
"public function getTaskTitle() {}",
"public function getDepandTaskName()\n {\n return $this->get(self::DEPAND_TASK_NAME);\n }",
"public function getTaskUserName()\n\t{\n\t\treturn $this->getUser()->getFullName();\n\t}",
"public function getName()\n {\n return 'task_create_short';\n }",
"public function get_name() {\n return get_string('taskrefreshsystemtokens', 'admin');\n }",
"private function _getTitle()\r\n\t{\r\n\t\tglobal $action, $whmcs;\r\n\t\t\r\n\t\t$task = ( array_key_exists( 'task', $whmcs->input ) && ! empty( $whmcs->input['task'] ) ? '.' . $whmcs->input['task'] : null );\r\n\t\t\r\n\t\treturn '<h1>' . t( 'themer.admin.module.title', t( 'themer.admin.module.title.' . $action . $task ) ) . '</h1>';\r\n\t}",
"public function get_name() {\n return get_string('deleteexistingdeleteduserstask', 'tool_dataprivacy');\n }",
"public function get_name() {\n return get_string('scheduledtasks', 'local_scheduledtasks');\n }",
"public function getTaskCreatorName()\n\t{\n\t\treturn $this->first_name.' '.$this->last_name;\n\t}",
"public function getDescription() : string {\n return $this->taskDesc;\n }",
"public function get_name() {\n\t\treturn esc_html__( $this->title, 'dashwp' );\n\t}",
"public function getName() : string\n\t{\n\t\treturn $this->getContext()->getI18n()->dt( 'controller/jobs', 'Send email to vendor' );\n\t}",
"public function getTask(): string\n {\n return $this->task;\n }",
"public static function displayName(): string\n {\n return Craft::t('sched-api-integration', 'SchedApiIntegrationUtility');\n }",
"private function _getTitle()\r\n\t{\r\n\t\t$input\t= dunloader( 'input', true );\r\n\t\t$action\t= $input->getVar( 'action', 'themes' );\r\n\t\t$task\t= $input->getVar( 'task', null );\r\n\t\t\r\n\t\treturn '<h1>' . t( 'themer.admin.module.title', t( 'themer.admin.module.title.' . $action . ( $task ? '.' . $task : '' ) ) ) . '</h1>';\r\n\t}",
"public function getName(): string\n {\n return $this->title;\n }",
"protected function getName()\n {\n return $this->getRequest()->args('name') ?: $this->profile->code . '_' . $this->tpl['name'];\n }",
"function getDisplayName() {\n return lang('Module Name Display Name');\n }",
"public function getName(): string {\n\t\treturn $this->l10nFactory->get('notifications')->t('Admin notifications');\n\t}",
"public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }",
"public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }"
] |
[
"0.8249345",
"0.8249345",
"0.8241932",
"0.82180387",
"0.81940645",
"0.8153734",
"0.8105926",
"0.79118145",
"0.7903746",
"0.75865936",
"0.7561378",
"0.7529209",
"0.74503607",
"0.7356569",
"0.7314809",
"0.72717917",
"0.7208717",
"0.71992356",
"0.7166518",
"0.7154664",
"0.713355",
"0.7103374",
"0.70311743",
"0.7029233",
"0.7025948",
"0.7002596",
"0.6968473",
"0.696685",
"0.6959782",
"0.6959782"
] |
0.8317246
|
0
|
Parse the post content and return all attachment ids used in blocks.
|
function get_attachments_used_in_content( string $content ): array {
$blocks = parse_blocks( $content );
$attachment_ids = [];
foreach ( $blocks as $block ) {
// Fetch the attachement id/s from block fields.
switch ( $block['blockName'] ) {
case 'planet4-blocks/enform':
$attachment_ids[] = $block['attrs']['background'] ?? '';
break;
case 'core/image':
case 'planet4-blocks/happypoint':
$attachment_ids[] = $block['attrs']['id'] ?? '';
break;
case 'planet4-blocks/media-video':
$attachment_ids[] = $block['attrs']['video_poster_img'] ?? '';
break;
case 'planet4-blocks/gallery':
if ( isset( $block['attrs']['multiple_image'] ) ) {
$multiple_images = explode( ',', $block['attrs']['multiple_image'] );
$attachment_ids = array_merge( $attachment_ids, $multiple_images );
}
break;
case 'planet4-blocks/carousel-header':
if ( isset( $block['attrs']['slides'] ) ) {
foreach ( $block['attrs']['slides'] as $slide ) {
$attachment_ids[] = $slide['image'];
}
}
break;
case 'planet4-blocks/split-two-columns':
$attachment_ids[] = $block['attrs']['issue_image'] ?? '';
$attachment_ids[] = $block['attrs']['tag_image'] ?? '';
break;
case 'planet4-blocks/columns':
if ( isset( $block['attrs']['columns'] ) ) {
foreach ( $block['attrs']['columns'] as $column ) {
$attachment_ids[] = $column['attachment'] ?? '';
}
}
break;
case 'planet4-blocks/social-media-cards':
if ( isset( $block['attrs']['cards'] ) ) {
foreach ( $block['attrs']['cards'] as $card ) {
$attachment_ids[] = $card['image_id'];
}
}
break;
case 'planet4-blocks/take-action-boxout':
$attachment_ids[] = $block['attrs']['background_image'] ?? '';
break;
}
}
return $attachment_ids;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function extractPostIds()\n {\n $postIds = [];\n $documentType = $this->getConfig()->getDocumentType();\n\n if ($this->searchResult !== null && isset($this->searchResult['records'][$documentType])) {\n foreach ($this->searchResult['records'][$documentType] as $hit) {\n $postIds[] = (int) $hit['external_id'];\n }\n }\n\n if (empty($postIds)) {\n $postIds = [0];\n }\n\n return $postIds;\n }",
"function block_core_navigation_get_post_ids($inner_blocks)\n {\n }",
"function block_core_navigation_from_block_get_post_ids($block)\n {\n }",
"function get_blocks( $content, $post_id = 0 ) {\n\t$output = [];\n\t$blocks = parse_blocks( $content );\n\n\tforeach ( $blocks as $block ) {\n\t\t$block_data = handle_do_block( $block, $post_id );\n\t\tif ( $block_data ) {\n\t\t\t$output[] = $block_data;\n\t\t}\n\t}\n\n\treturn $output;\n}",
"function post_ids() {\n\n\t\t$media_location = $this->media_location();\n\n\t\tif ( ! $media_location )\n\t\t\treturn array();\n\n\t\t$media_files = $media_location->media_files();\n\n\t\tif ( ! count( $media_files ) )\n\t\t\treturn array();\n\n\t\t// fetch releases\n\t\t$episode_ids = array_map( function ( $v ) { return $v->episode_id; }, $media_files );\n\t\t$episodes = Episode::find_all_by_where( \"id IN (\" . implode( ',', $episode_ids ) . \")\" );\n\n\t\treturn array_map( function ( $v ) { return $v->post_id; }, $episodes );\n\t}",
"protected function parse_content(){\n $m = array(); // we will keep here\n list( $t, $text ) = explode( \"<div class='post entry-content '>\", $this->page );\n list( $text, $t ) = explode( '</div>', $text );\n return $text;\n }",
"private function parseTags($postBody)\n {\n preg_match_all(\"/#(\\\\w+)/\", $postBody, $tagnames);\n\n $tagIds = [];\n\n if (!empty($tagnames[1])) {\n foreach ($tagnames[1] as $tagname) {\n if (Tag::whereName($tagname)->get()->isEmpty()) {\n $tag = new Tag();\n $tag->name = $tagname;\n $tag->save();\n $tagIds[] = $tag->id;\n } else {\n $tag = Tag::whereName($tagname)->first();\n $tagIds[] = $tag->id;\n }\n $postBody = preg_replace(\"/(#\\\\w+)/\", '<a href=\"/tags/' . $tag->id . '\">${1}</a>', $postBody);\n }\n }\n\n return [$postBody, $tagIds];\n }",
"function wpex_portfolio_post_blocks() {\n\n\t// Get layout blocks\n\t$blocks = wpex_get_mod( 'portfolio_post_composer' );\n\n\t// If blocks are 100% empty return defaults\n\t$blocks = $blocks ? $blocks : 'content,share,related';\n\n\t// Convert blocks to array so we can loop through them\n\tif ( ! is_array( $blocks ) ) {\n\t\t$blocks = explode( ',', $blocks );\n\t}\n\n\t// Apply filters to entry layout blocks\n\t$blocks = apply_filters( 'wpex_portfolio_single_blocks', $blocks );\n\n\t// Return blocks\n\treturn $blocks;\n\n}",
"public static function get_block_fields($id,$post_type = 'post'){\n\n\t\t$fields = array();\n\n\t\tif($post_type == 'page'){\n\t\t\t$args = array(\n\t\t\t\t'page_id' => $id\n\t\t\t);\n\t\t} else {\n\t\t\t$args = array(\n\t\t\t\t'p' => $id\n\t\t\t);\n\t\t\tif($post_type != 'post'){\n\t\t\t\t$args['post_type'] = array( $post_type);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$query = new \\WP_Query( $args );\n\t\t$post = $query->posts[0];\n\n\t\n\t\t$blocks = gutenberg_parse_blocks($post->post_content);\n\n\n\t\tforeach($blocks as $key => $block){\n\t\t\t$block_fields = array();\n\t\t\t\n\t\t\tif(sizeof($block['attrs'])>0){\n\t\t\t\t$block_fields = self::get_block_acf_fields($block['attrs']['data']);\n\n\t\t\t\n\t\t\t\t$fields[] = array(\n\t\t\t\t\t'fields' => $block_fields,\n\t\t\t\t\t'block' => $block,\n\t\t\t\t\t'name' => $block['blockName']\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $fields;\n\t}",
"function get_campaign_attachments( $post_ids ) {\n\n\tglobal $wpdb;\n\n\t// phpcs:disable\n\t$sql = 'SELECT ID, guid, post_parent FROM %1$s WHERE post_type = \\'attachment\\'';\n\t$prepared_sql = $wpdb->prepare(\n\t\t$sql,\n\t\t[\n\t\t\t$wpdb->posts,\n\t\t] );\n\t$attachments = $wpdb->get_results( $prepared_sql, OBJECT_K );\n\t// phpcs:enable\n\n\tif ( empty( $attachments ) ) {\n\t\treturn $post_ids;\n\t}\n\n\t$attachment_ids = [];\n\n\t/**\n\t * Post thumbnails\n\t */\n\tif ( $post_ids ) {\n\t\t$placeholders = implode( ',', array_fill( 0, count( $post_ids ), '%d' ) );\n\t\t$sql = 'SELECT meta_value FROM %1$s WHERE ( meta_key = \\'_thumbnail_id\\' or meta_key = \\'background_image_id\\' ) AND post_id IN(' . $placeholders . ')';\n\t\t$values = [];\n\t\t$values[0] = $wpdb->postmeta;\n\t\t$values = array_merge( $values, $post_ids );\n\t\t$prepared_sql = $wpdb->prepare( $sql, $values ); // WPCS: unprepared SQL OK.\n\t\t$results = $wpdb->get_results( $prepared_sql ); // WPCS: unprepared SQL OK.\n\t\t$attachment_ids = [];\n\t\tforeach ( (array) $results as $result ) {\n\t\t\t$attachment_ids[] = $result->meta_value;\n\t\t}\n\t}\n\n\t/**\n\t * Uploaded to (post_parent)\n\t */\n\tforeach ( $attachments as $id => $att ) {\n\t\tif ( in_array( $att->post_parent, $post_ids, true ) ) {\n\t\t\t$attachment_ids[] = $id;\n\t\t}\n\t}\n\n\t$placeholders = implode( ',', array_fill( 0, count( $post_ids ), '%d' ) );\n\n\t$sql = 'SELECT post_content \n\t\t\tFROM %1$s \n\t\t\tWHERE ID IN(' . $placeholders . ') \n\t\t\t\tAND post_content REGEXP \\'((wp-image-|wp-att-)[0-9][0-9]*)|\\\\\\[gallery |shortcake\\_|href=|src=\\'';\n\n\t$values = [];\n\t$values[0] = $wpdb->posts;\n\t$values = array_merge( $values, $post_ids );\n\t$prepared_sql = $wpdb->prepare( $sql, $values ); // WPCS: unprepared SQL OK.\n\t$results = $wpdb->get_results( $prepared_sql ); // WPCS: unprepared SQL OK.\n\n\tforeach ( (array) $results as $text ) {\n\t\t$text = $text->post_content;\n\n\t\t// Filter attachment ids from caption.\n\t\tpreg_match_all( '#(wp-image-|wp-att-|attachment\\_)(\\d+)#', $text, $matches, PREG_SET_ORDER );\n\t\tforeach ( $matches as $match ) {\n\t\t\t$attachment_ids[] = $match[2];\n\t\t}\n\n\t\t// Filter attachment ids from shortcake code(shortcake_gallery, shortcake_happy_point, shortcake_media_video).\n\t\tpreg_match_all( '#\\[shortcake\\_[a-zA-Z0-9\\_\\\"\\'\\-\\s\\:\\/\\/\\=\\.\\?\\&]*\\s(multiple_image|background|video_poster_img)[=][\\\"|\\']([\\d\\s\\,]*)[\\\"|\\']#', $text, $matches, PREG_SET_ORDER );\n\t\tforeach ( $matches as $match ) {\n\t\t\tif ( 'multiple_image' === $match[1] ) {\n\t\t\t\t$multiple_images = explode( ',', $match[2] );\n\t\t\t\t$attachment_ids = array_merge( $attachment_ids, $multiple_images );\n\t\t\t} else {\n\t\t\t\t$attachment_ids[] = $match[2];\n\t\t\t}\n\t\t}\n\n\t\t// Filter attachment ids from shortcake code(shortcake_carousel_header, shortcake_split_two_columns, shortcake_columns).\n\t\tpreg_match_all( '#\\s(image_[0-9]*|attachment_[0-9]*|issue_image|tag_image)[=][\\\"|\\']([\\d\\s\\,]*)[\\\"|\\']#', $text, $matches, PREG_SET_ORDER );\n\t\tforeach ( $matches as $match ) {\n\t\t\t$attachment_ids[] = $match[2];\n\t\t}\n\n\t\t// Filter attachment ids from [gallery] shortcode.\n\t\tpreg_match_all( '#\\[gallery\\s+[ids=\\\"\\']+([\\d\\s,]*)[\\\"\\'].#', $text, $matches, PREG_SET_ORDER );\n\t\tforeach ( $matches as $match ) {\n\t\t\tforeach ( explode( ',', $match[1] ) as $id ) {\n\t\t\t\t$attachment_ids[] = (int) $id;\n\t\t\t}\n\t\t}\n\t}\n\n\t$attachment_ids = array_unique( $attachment_ids );\n\tsort( $attachment_ids );\n\n\t// The post ids are reorderd as sort all attachment ids first and then append the post id to array.(Added for simplification of import process).\n\t$attachment_ids = array_diff( $attachment_ids, $post_ids );\n\t$post_ids = array_merge( $attachment_ids, $post_ids );\n\n\treturn $post_ids;\n}",
"public function get_content_item_ids() {\n\t\t$items = $this->get_content_items();\n\t\tif ( empty( $items ) ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Map the IDs.\n\t\treturn array_map(\n\t\t\tfunction( $item ) {\n\t\t\t\treturn $item->get_data( 'post_id' );\n\t\t\t},\n\t\t\t$items\n\t\t);\n\t}",
"protected function parse_galleries( $content, $post_id = 0 ) {\n\n\t\t$attachments = array();\n\t\t$galleries = $this->get_content_galleries( $content );\n\n\t\tforeach ( $galleries as $gallery ) {\n\n\t\t\t$id = $post_id;\n\n\t\t\tif ( ! empty( $gallery['id'] ) ) {\n\t\t\t\t$id = intval( $gallery['id'] );\n\t\t\t}\n\n\t\t\t// Forked from core gallery_shortcode() to have exact same logic. R.\n\t\t\tif ( ! empty( $gallery['ids'] ) ) {\n\t\t\t\t$gallery['include'] = $gallery['ids'];\n\t\t\t}\n\n\t\t\t$gallery_attachments = $this->get_gallery_attachments( $id, $gallery );\n\n\n\t\t\t$attachments = array_merge( $attachments, $gallery_attachments );\n\t\t}\n\n\t\tif ( PHP_VERSION_ID >= 50209 ) {\n\t\t\t// phpcs:ignore PHPCompatibility.PHP.NewFunctionParameters.array_unique_sort_flagsFound -- Wrapped in version check.\n\t\t\treturn array_unique( $attachments, SORT_REGULAR );\n\t\t}\n\n\t\treturn $attachments;\n\t}",
"public function getPostGalleryMasonryData($attachments)\n {\n $data = [];\n $data['images'] = $this->getAttachmentsData($attachments, '150w');\n\n return $data;\n }",
"public static function getContentIDs($postID)\n {\n $timePassesList = TimePass::getTimePassesListByPostID($postID);\n $timePasses = TimePass::getTokenizedTimePassIDs($timePassesList);\n $subscriptionsList = Subscription::getSubscriptionsListByPostID($postID);\n $subscriptions = Subscription::getTokenizedIDs($subscriptionsList);\n\n return array_merge(array_merge(array($postID), $timePasses, $subscriptions));\n }",
"function wp_get_post_content_block_attributes()\n {\n }",
"private function get_unattached_ids() {\n\t\tglobal $wpdb;\n\t\treturn $wpdb->get_col(\"SELECT `ID` FROM {$wpdb->posts} WHERE `post_type` = 'attachment' AND `post_status` = 'inherit' AND `post_parent` = '0'\");\n\t}",
"protected static function handle_posts($content) {\n\t\t\n\t\tpreg_match('/{\\- BEGIN POST(S)? \\-}.*?{\\- END POST(S)? \\-}/s', $content, $post_loop_block);\n\n\t\t// $posts or $post? \n\t\t$is_s = isset($post_loop_block[1]) && strtoupper( trim($post_loop_block[2]) ) === 'S';\n\n\t\tif( !empty($post_loop_block[0]) ) {\n\t\t\t\n\t\t\t// excerpt, slug, and description are those indexes which don't require additional processing.\n\t\t\t$_content = preg_replace('/{\\- (excerpt|slug|description) \\-}/', '<?php echo $post[\\'$1\\']; ?>', $post_loop_block[0]);\n\n\t\t\tif( BlogPad::has_setting('auto_link', true) ) {\n\n\t\t\t\t$_content = str_replace('{- title -}', \"<a href=\\\"<?php echo Link_Parser::generate_link('post', array('slug' => \\$post['slug']));?>\\\"><?php echo \\$post['title'];?></a>\", $_content);\n\n\t\t\t\t$_content = str_replace('{- author -}', \"<a href=\\\"<?php echo Link_Parser::generate_link('profile', array('slug' => \\$post['author']));?>\\\"><?php echo \\$post['author'];?></a>\", $_content);\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\t$_content = str_replace('{- title -}', \"<?php echo \\$post['title'];?>\", $_content);\n\n\t\t\t\t$_content = str_replace('{- author -}', \"<?php echo \\$post['author'];?>\", $_content);\n\t\t\t}\n\n\t\t\t$_content = str_replace('{- post -}', \"<?php echo Parsedown::instance()->parse(\\$post['post']);?>\", $_content);\n\n\t\t\t$_content = str_replace('{- BEGIN POST'.( ($is_s) ? 'S': '').' -}', '<?php if( !empty($post'.( ($is_s) ? 's': '').') ): '.( ($is_s) ? 'foreach($posts as $post):' : '').' ?>', $_content);\n\n\t\t\t$_content = str_replace('{- END POST'.( ($is_s) ? 'S': '').' -}', '<?php '.( ($is_s) ? 'endforeach; else: ': 'else: ').\"echo BlogPad::get_setting('no_post_message', 'Nothing to see here!'); endif; ?>\", $_content);\n\n\n\t\t\t// Now parse date and categories calls\n\t\t\t$_content = BP_Parser::handle_dates($_content);\n\t\t\t$_content = BP_Parser::handle_categories($_content);\n\n\t\t\t$content = str_replace($post_loop_block[0], $_content, $content);\n\t\t}\n\n\t\treturn $content;\n\t}",
"function lc_grab_ids_from_gallery()\n{\n global $post;\n\n if ($post instanceof WP_Post === false) {\n return array();\n }\n\n $pattern = get_shortcode_regex();\n $ids = array();\n\n if (preg_match_all('/' . $pattern . '/s', $post->post_content, $matches)) { //finds the \"gallery\" shortcode and puts the image ids in an associative array at $matches[3]\n\n $count = count($matches[3]); //in case there is more than one gallery in the post.\n for ($i = 0; $i < $count; $i++) {\n $atts = shortcode_parse_atts($matches[3][$i]);\n if (isset($atts['ids'])) {\n $ids = array_merge($ids, explode(',', $atts['ids']));\n }\n }\n }\n return $ids;\n}",
"function readPostData($rawPostContent, $postFileName){\n $headerContent = substr($rawPostContent, 0, \n strpos($rawPostContent, LOGMD_POST_HEADER_DELIM));\n // no header content found\n if (!$headerContent) return false;\n \n //// parse header\n $data = array();\n // split into lines\n $lines = explode(PHP_EOL, $headerContent);\n foreach ($lines as $line){\n if (!strpos($line, ':')) continue;\n // separate prop key and value\n $data[trim(substr($line, 0, strpos($line, ':')))] \n = trim(substr($line, strpos($line, ':') + 1));\n }\n\n // save post link id\n $data['LINK'] = preg_replace('/\\.md$/i', '', $postFileName);\n $data['FILE'] = $postFileName;\n \n // uppercase meta prop keys\n $data = array_change_key_case($data, CASE_UPPER);\n \n // if TIME is missing, try to get last modification time of md file\n if (!isset($data['TIME'])){\n $data['TIME'] = date(\"Y-m-d H:i\", filemtime(LOGMD_POSTS_DIR_PATH . $postFileName));\n }\n\n // extract actual post md content\n $data['POST'] = substr($rawPostContent,\n strpos($rawPostContent, LOGMD_POST_HEADER_DELIM) + strlen(LOGMD_POST_HEADER_DELIM));\n \n //return post data\n return $data;\n }",
"protected function postMedia($post) {\n $images = [];\n $videos = [];\n if (!empty($post['edge_sidecar_to_children']['edges'])) {\n foreach ($post['edge_sidecar_to_children']['edges'] as $edge) {\n $node = $edge['node'];\n if ($node['__typename'] === 'GraphVideo') {\n $videos[] = $node['video_url'];\n }\n elseif ($node['__typename'] === 'GraphImage') {\n $images[] = $node['display_url'];\n }\n }\n }\n elseif (!empty($post['images']['standard_resolution'])) {\n $images = [$post['images']['standard_resolution']['url']];\n }\n elseif (!empty($post['display_src'])) {\n $images = [$post['display_src']];\n }\n elseif (!empty($post['display_url'])) {\n $images = [$post['display_url']];\n }\n return [$images, $videos];\n }",
"private function WP_Post_attachments($graph, $post) {\r\n $args = array( 'post_type' => 'attachment', 'numberposts' => null, 'post_status' => 'inherit', 'post_parent' => $post->ID );\r\n $attachments = get_posts($args);\r\n\r\n if ($attachments) {\r\n foreach ($attachments as $attachment) {\r\n $post_resource = $graph->resource($post->guid);\r\n $post_resource->add('sioc:attachment', $graph->resource($attachment->guid));\r\n\r\n $attachment_resource = $graph->resource($attachment->guid);\r\n $attachment_resource->set('rdfs:seeAlso', $graph->resource($this->return_seeAlso_resource(get_attachment_link($attachment->ID))));\r\n }\r\n }\r\n return $graph;\r\n }",
"function extract_embedded_images_from_post_content() {\n // be consistent with media_images.\n // http://stackoverflow.com/a/20861974/6763239\n $embedded_images = array();\n\n $img_nodes = $this->dom->getElementsByTagName('img');\n\n foreach ( $img_nodes as $img_node ) {\n $embedded_images[] = new EmbeddedImage($img_node, $this);\n }\n\n return $embedded_images;\n }",
"private function parse(array $block): array\n {\n $raw = get_field('data');\n $className = trim(array_key_exists('className', $block) ? $block['className'] : '');\n\n unset($raw['']);\n\n $data = array(\n 'block' => (object) [\n 'id' => $block['id'],\n 'classList' => !empty($className) ? explode(' ', $className) : [],\n 'className' => $className,\n 'anchor' => !empty($block['anchor']) ? $block['anchor'] : $block['id']\n ],\n 'raw' => !empty($block['data']) ? (object) $block['data'] : (object) [],\n 'data' => !empty($raw) ? (object) $raw : (object) [],\n 'template' => 'blocks::' . $this->getId()\n );\n\n return $this->filter($data, $block);\n }",
"function get_post_attachments($post_id) {\n $args = array(\n 'post_type' => 'attachment',\n 'numberposts' => -1,\n 'post_status' => null,\n 'post_parent' => $post_id\n );\n\n return get_posts($args);\n }",
"function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, $user_id = 0)\n{\n global $bb_cfg;\n\n // Generate Array, if it's not an array\n if ($post_id_array === 0 && $attach_id_array === 0 && $page === 0) {\n return;\n }\n\n if ($post_id_array === 0 && $attach_id_array !== 0) {\n $post_id_array = array();\n\n if (!is_array($attach_id_array)) {\n if (strstr($attach_id_array, ', ')) {\n $attach_id_array = explode(', ', $attach_id_array);\n } elseif (strstr($attach_id_array, ',')) {\n $attach_id_array = explode(',', $attach_id_array);\n } else {\n $attach_id = intval($attach_id_array);\n $attach_id_array = array();\n $attach_id_array[] = $attach_id;\n }\n }\n\n // Get the post_ids to fill the array\n $p_id = 'post_id';\n\n $sql = \"SELECT $p_id\n\t\t\tFROM \" . BB_ATTACHMENTS . '\n\t\t\t\tWHERE attach_id IN (' . implode(', ', $attach_id_array) . \")\n\t\t\tGROUP BY $p_id\";\n\n if (!($result = DB()->sql_query($sql))) {\n bb_die('Could not select ids');\n }\n\n $num_post_list = DB()->num_rows($result);\n\n if ($num_post_list == 0) {\n DB()->sql_freeresult($result);\n return;\n }\n\n while ($row = DB()->sql_fetchrow($result)) {\n $post_id_array[] = intval($row[$p_id]);\n }\n DB()->sql_freeresult($result);\n }\n\n if (!is_array($post_id_array)) {\n if (trim($post_id_array) == '') {\n return;\n }\n\n if (strstr($post_id_array, ', ')) {\n $post_id_array = explode(', ', $post_id_array);\n } elseif (strstr($post_id_array, ',')) {\n $post_id_array = explode(',', $post_id_array);\n } else {\n $post_id = intval($post_id_array);\n\n $post_id_array = array();\n $post_id_array[] = $post_id;\n }\n }\n\n if (!sizeof($post_id_array)) {\n return;\n }\n\n // First of all, determine the post id and attach_id\n if ($attach_id_array === 0) {\n $attach_id_array = array();\n\n // Get the attach_ids to fill the array\n $whereclause = 'WHERE post_id IN (' . implode(', ', $post_id_array) . ')';\n\n $sql = 'SELECT attach_id\n\t\t\tFROM ' . BB_ATTACHMENTS . \" $whereclause\n\t\t\tGROUP BY attach_id\";\n\n if (!($result = DB()->sql_query($sql))) {\n bb_die('Could not select attachment id #1');\n }\n\n $num_attach_list = DB()->num_rows($result);\n\n if ($num_attach_list == 0) {\n DB()->sql_freeresult($result);\n return;\n }\n\n while ($row = DB()->sql_fetchrow($result)) {\n $attach_id_array[] = (int)$row['attach_id'];\n }\n DB()->sql_freeresult($result);\n }\n\n if (!is_array($attach_id_array)) {\n if (strstr($attach_id_array, ', ')) {\n $attach_id_array = explode(', ', $attach_id_array);\n } elseif (strstr($attach_id_array, ',')) {\n $attach_id_array = explode(',', $attach_id_array);\n } else {\n $attach_id = intval($attach_id_array);\n\n $attach_id_array = array();\n $attach_id_array[] = $attach_id;\n }\n }\n\n if (!sizeof($attach_id_array)) {\n return;\n }\n\n $sql_id = 'post_id';\n\n if (sizeof($post_id_array) && sizeof($attach_id_array)) {\n $sql = 'DELETE FROM ' . BB_ATTACHMENTS . '\n\t\t\tWHERE attach_id IN (' . implode(', ', $attach_id_array) . \")\n\t\t\t\tAND $sql_id IN (\" . implode(', ', $post_id_array) . ')';\n\n if (!(DB()->sql_query($sql))) {\n bb_die($lang['ERROR_DELETED_ATTACHMENTS']);\n }\n\n //bt\n if ($sql_id == 'post_id') {\n $sql = \"SELECT topic_id FROM \" . BB_BT_TORRENTS . \" WHERE attach_id IN(\" . implode(',', $attach_id_array) . \")\";\n\n if (!$result = DB()->sql_query($sql)) {\n bb_die($lang['ERROR_DELETED_ATTACHMENTS']);\n }\n\n $torrents_sql = array();\n\n while ($row = DB()->sql_fetchrow($result)) {\n $torrents_sql[] = $row['topic_id'];\n }\n\n if ($torrents_sql = implode(',', $torrents_sql)) {\n // Remove peers from tracker\n $sql = \"DELETE FROM \" . BB_BT_TRACKER . \"\n\t\t\t\t\tWHERE topic_id IN($torrents_sql)\";\n\n if (!DB()->sql_query($sql)) {\n bb_die('Could not delete peers');\n }\n }\n // Delete torrents\n $sql = \"DELETE FROM \" . BB_BT_TORRENTS . \"\n\t\t\t\tWHERE attach_id IN(\" . implode(',', $attach_id_array) . \")\";\n\n if (!DB()->sql_query($sql)) {\n bb_die($lang['ERROR_DELETED_ATTACHMENTS']);\n }\n }\n //bt end\n\n for ($i = 0; $i < sizeof($attach_id_array); $i++) {\n $sql = 'SELECT attach_id\n\t\t\t\tFROM ' . BB_ATTACHMENTS . '\n\t\t\t\t\t\tWHERE attach_id = ' . (int)$attach_id_array[$i];\n\n if (!($result = DB()->sql_query($sql))) {\n bb_die('Could not select Attachment id #2');\n }\n\n $num_rows = DB()->num_rows($result);\n DB()->sql_freeresult($result);\n\n if ($num_rows == 0) {\n $sql = 'SELECT attach_id, physical_filename, thumbnail\n\t\t\t\t\t\tFROM ' . BB_ATTACHMENTS_DESC . '\n\t\t\t\t\t\t\tWHERE attach_id = ' . (int)$attach_id_array[$i];\n\n if (!($result = DB()->sql_query($sql))) {\n bb_die('Could not query attach description table');\n }\n $num_rows = DB()->num_rows($result);\n\n if ($num_rows != 0) {\n $num_attach = $num_rows;\n $attachments = DB()->sql_fetchrowset($result);\n DB()->sql_freeresult($result);\n\n // delete attachments\n for ($j = 0; $j < $num_attach; $j++) {\n unlink_attach($attachments[$j]['physical_filename']);\n\n if (intval($attachments[$j]['thumbnail']) == 1) {\n unlink_attach($attachments[$j]['physical_filename'], MODE_THUMBNAIL);\n }\n\n $sql = 'DELETE FROM ' . BB_ATTACHMENTS_DESC . ' WHERE attach_id = ' . (int)$attachments[$j]['attach_id'];\n\n if (!(DB()->sql_query($sql))) {\n bb_die($lang['ERROR_DELETED_ATTACHMENTS']);\n }\n }\n } else {\n DB()->sql_freeresult($result);\n }\n }\n }\n }\n\n // Now Sync the Topic/PM\n if (sizeof($post_id_array)) {\n $sql = 'SELECT topic_id\n\t\t\tFROM ' . BB_POSTS . '\n\t\t\tWHERE post_id IN (' . implode(', ', $post_id_array) . ')\n\t\t\tGROUP BY topic_id';\n\n if (!($result = DB()->sql_query($sql))) {\n bb_die('Could not select topic id');\n }\n\n while ($row = DB()->sql_fetchrow($result)) {\n attachment_sync_topic($row['topic_id']);\n }\n DB()->sql_freeresult($result);\n }\n}",
"function readPostContent($postData){\n $renderedPath = LOGMD_RENDERED . $postData['FILE'] . '.html';\n if (file_exists($renderedPath)){\n $postData['POST'] = file_get_contents($renderedPath);\n } else {\n //// post not rendered, yet. render now...\n // load parsedown\n require_once 'lib/Parsedown.php';\n \n // process links and paths in post md content\n $postData['POST'] = fixMarkdownLinks($postData['POST']);\n $postData['POST'] = fixMarkdownImagePaths($postData['POST']);\n \n // parse with Parsedown\n $Parsedown = new Parsedown();\n $Parsedown->setUrlsLinked(false);\n \n if (LOGMD_SAFE_MODE){\n $Parsedown->setSafeMode(true);\n $Parsedown->setMarkupEscaped(true);\n }\n $postData['POST'] = $Parsedown->text($postData['POST']);\n\n //...and save rendered HTML for next time\n file_put_contents($renderedPath, $postData['POST']);\n }\n return $postData['POST'];\n }",
"public function getPostIDs() {\n\t\treturn self::getAllPostIDs($this->threadID);\n\t}",
"function vcex_get_post_gallery_ids( $post_id = '' ) {\n\n\t/**\n\t * Filters the post gallery image ids before trying to fetch them.\n\t *\n\t * @param array $ids\n\t */\n\t$filter_val = apply_filters( 'vcex_pre_get_post_gallery_ids', null );\n\n\tif ( $filter_val ) {\n\t\treturn $filter_val;\n\t}\n\n\tif ( function_exists( 'wpex_get_gallery_ids' ) ) {\n\t\treturn wpex_get_gallery_ids( $post_id );\n\t}\n\n\t$attachment_ids = '';\n\n\tif ( ! $post_id ) {\n\t\t$post_id = vcex_get_the_ID();\n\t}\n\n\tif ( class_exists( 'WC_product' ) && 'product' == get_post_type( $post_id ) ) {\n\t\t$product = new WC_product( $post_id );\n\t\tif ( $product && method_exists( $product, 'get_gallery_image_ids' ) ) {\n\t\t\t$attachment_ids = $product->get_gallery_image_ids();\n\t\t}\n\t}\n\n\t$attachment_ids = $attachment_ids ?: get_post_meta( $post_id, '_easy_image_gallery', true );\n\n\tif ( $attachment_ids ) {\n\t\tif ( is_string( $attachment_ids ) ) {\n\t\t\t$attachment_ids = explode( ',', $attachment_ids );\n\t\t}\n\t\t$attachment_ids = array_values( array_filter( $attachment_ids, 'wpex_sanitize_gallery_id' ) );\n\t\treturn apply_filters( 'wpex_get_post_gallery_ids', $attachment_ids );\n\t}\n}",
"public function getPostContent();",
"function parse_blocks($content)\n {\n }"
] |
[
"0.6134889",
"0.60722506",
"0.60234135",
"0.5847964",
"0.5700822",
"0.5577837",
"0.5426566",
"0.5388764",
"0.5340252",
"0.53097624",
"0.5271495",
"0.52678645",
"0.52018857",
"0.5195208",
"0.51815027",
"0.51744485",
"0.51709205",
"0.51666355",
"0.5165405",
"0.5149635",
"0.5145022",
"0.5139345",
"0.5127436",
"0.5121633",
"0.5095002",
"0.5086363",
"0.50521964",
"0.5051744",
"0.50382483",
"0.5017043"
] |
0.6844334
|
0
|
Returns all attachment ids from campaign post content.
|
function get_campaign_attachments( $post_ids ) {
global $wpdb;
if ( empty( $post_ids ) ) {
return [];
}
$sql = '
SELECT id
FROM %1$s
WHERE post_type = \'attachment\'
AND post_parent IN (' . generate_list_placeholders( $post_ids, 2 ) . ')';
$prepared_sql = $wpdb->prepare(
$sql, // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
array_merge( [ $wpdb->posts ], $post_ids )
);
$results = $wpdb->get_results( $prepared_sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
$attachment_ids = array_map(
function ( $result ) {
return $result->id;
},
$results
);
/**
* Post thumbnails
*/
$sql = '
SELECT meta_value
FROM %1$s
WHERE ( meta_key = \'_thumbnail_id\' OR meta_key = \'background_image_id\' )
AND post_id IN(' . generate_list_placeholders( $post_ids, 2 ) . ')';
$prepared_sql = $wpdb->prepare(
$sql, // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
array_merge( [ $wpdb->postmeta ], $post_ids )
);
$results = $wpdb->get_results( $prepared_sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
$attachment_ids = array_merge(
$attachment_ids,
array_map(
function ( $result ) {
return $result->meta_value;
},
$results
)
);
$sql = '
SELECT post_content
FROM %1$s
WHERE ID IN(' . generate_list_placeholders( $post_ids, 2 ) . ')
AND post_content REGEXP \'((wp-image-|wp-att-)[0-9][0-9]*)|gallery_block_style|wp\:planet4\-blocks|href=|src=\'';
$prepared_sql = $wpdb->prepare( $sql, array_merge( [ $wpdb->posts ], $post_ids ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
$results = $wpdb->get_results( $prepared_sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
foreach ( (array) $results as $text ) {
$text = $text->post_content;
$attachment_ids = array_merge( $attachment_ids, get_attachments_used_in_content( $text ) );
}
$attachment_ids = array_unique( $attachment_ids );
sort( $attachment_ids );
// The post ids are reordered as sort all attachment ids first and then append the post id to array.(Added for simplification of import process).
$attachment_ids = array_diff( $attachment_ids, $post_ids );
$post_ids = array_merge( $attachment_ids, $post_ids );
return $post_ids;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function get_campaign_attachments( $post_ids ) {\n\n\tglobal $wpdb;\n\n\t// phpcs:disable\n\t$sql = 'SELECT ID, guid, post_parent FROM %1$s WHERE post_type = \\'attachment\\'';\n\t$prepared_sql = $wpdb->prepare(\n\t\t$sql,\n\t\t[\n\t\t\t$wpdb->posts,\n\t\t] );\n\t$attachments = $wpdb->get_results( $prepared_sql, OBJECT_K );\n\t// phpcs:enable\n\n\tif ( empty( $attachments ) ) {\n\t\treturn $post_ids;\n\t}\n\n\t$attachment_ids = [];\n\n\t/**\n\t * Post thumbnails\n\t */\n\tif ( $post_ids ) {\n\t\t$placeholders = implode( ',', array_fill( 0, count( $post_ids ), '%d' ) );\n\t\t$sql = 'SELECT meta_value FROM %1$s WHERE ( meta_key = \\'_thumbnail_id\\' or meta_key = \\'background_image_id\\' ) AND post_id IN(' . $placeholders . ')';\n\t\t$values = [];\n\t\t$values[0] = $wpdb->postmeta;\n\t\t$values = array_merge( $values, $post_ids );\n\t\t$prepared_sql = $wpdb->prepare( $sql, $values ); // WPCS: unprepared SQL OK.\n\t\t$results = $wpdb->get_results( $prepared_sql ); // WPCS: unprepared SQL OK.\n\t\t$attachment_ids = [];\n\t\tforeach ( (array) $results as $result ) {\n\t\t\t$attachment_ids[] = $result->meta_value;\n\t\t}\n\t}\n\n\t/**\n\t * Uploaded to (post_parent)\n\t */\n\tforeach ( $attachments as $id => $att ) {\n\t\tif ( in_array( $att->post_parent, $post_ids, true ) ) {\n\t\t\t$attachment_ids[] = $id;\n\t\t}\n\t}\n\n\t$placeholders = implode( ',', array_fill( 0, count( $post_ids ), '%d' ) );\n\n\t$sql = 'SELECT post_content \n\t\t\tFROM %1$s \n\t\t\tWHERE ID IN(' . $placeholders . ') \n\t\t\t\tAND post_content REGEXP \\'((wp-image-|wp-att-)[0-9][0-9]*)|\\\\\\[gallery |shortcake\\_|href=|src=\\'';\n\n\t$values = [];\n\t$values[0] = $wpdb->posts;\n\t$values = array_merge( $values, $post_ids );\n\t$prepared_sql = $wpdb->prepare( $sql, $values ); // WPCS: unprepared SQL OK.\n\t$results = $wpdb->get_results( $prepared_sql ); // WPCS: unprepared SQL OK.\n\n\tforeach ( (array) $results as $text ) {\n\t\t$text = $text->post_content;\n\n\t\t// Filter attachment ids from caption.\n\t\tpreg_match_all( '#(wp-image-|wp-att-|attachment\\_)(\\d+)#', $text, $matches, PREG_SET_ORDER );\n\t\tforeach ( $matches as $match ) {\n\t\t\t$attachment_ids[] = $match[2];\n\t\t}\n\n\t\t// Filter attachment ids from shortcake code(shortcake_gallery, shortcake_happy_point, shortcake_media_video).\n\t\tpreg_match_all( '#\\[shortcake\\_[a-zA-Z0-9\\_\\\"\\'\\-\\s\\:\\/\\/\\=\\.\\?\\&]*\\s(multiple_image|background|video_poster_img)[=][\\\"|\\']([\\d\\s\\,]*)[\\\"|\\']#', $text, $matches, PREG_SET_ORDER );\n\t\tforeach ( $matches as $match ) {\n\t\t\tif ( 'multiple_image' === $match[1] ) {\n\t\t\t\t$multiple_images = explode( ',', $match[2] );\n\t\t\t\t$attachment_ids = array_merge( $attachment_ids, $multiple_images );\n\t\t\t} else {\n\t\t\t\t$attachment_ids[] = $match[2];\n\t\t\t}\n\t\t}\n\n\t\t// Filter attachment ids from shortcake code(shortcake_carousel_header, shortcake_split_two_columns, shortcake_columns).\n\t\tpreg_match_all( '#\\s(image_[0-9]*|attachment_[0-9]*|issue_image|tag_image)[=][\\\"|\\']([\\d\\s\\,]*)[\\\"|\\']#', $text, $matches, PREG_SET_ORDER );\n\t\tforeach ( $matches as $match ) {\n\t\t\t$attachment_ids[] = $match[2];\n\t\t}\n\n\t\t// Filter attachment ids from [gallery] shortcode.\n\t\tpreg_match_all( '#\\[gallery\\s+[ids=\\\"\\']+([\\d\\s,]*)[\\\"\\'].#', $text, $matches, PREG_SET_ORDER );\n\t\tforeach ( $matches as $match ) {\n\t\t\tforeach ( explode( ',', $match[1] ) as $id ) {\n\t\t\t\t$attachment_ids[] = (int) $id;\n\t\t\t}\n\t\t}\n\t}\n\n\t$attachment_ids = array_unique( $attachment_ids );\n\tsort( $attachment_ids );\n\n\t// The post ids are reorderd as sort all attachment ids first and then append the post id to array.(Added for simplification of import process).\n\t$attachment_ids = array_diff( $attachment_ids, $post_ids );\n\t$post_ids = array_merge( $attachment_ids, $post_ids );\n\n\treturn $post_ids;\n}",
"function get_post_attachments($post_id) {\n $args = array(\n 'post_type' => 'attachment',\n 'numberposts' => -1,\n 'post_status' => null,\n 'post_parent' => $post_id\n );\n\n return get_posts($args);\n }",
"private function extractPostIds()\n {\n $postIds = [];\n $documentType = $this->getConfig()->getDocumentType();\n\n if ($this->searchResult !== null && isset($this->searchResult['records'][$documentType])) {\n foreach ($this->searchResult['records'][$documentType] as $hit) {\n $postIds[] = (int) $hit['external_id'];\n }\n }\n\n if (empty($postIds)) {\n $postIds = [0];\n }\n\n return $postIds;\n }",
"public function get_content_item_ids() {\n\t\t$items = $this->get_content_items();\n\t\tif ( empty( $items ) ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Map the IDs.\n\t\treturn array_map(\n\t\t\tfunction( $item ) {\n\t\t\t\treturn $item->get_data( 'post_id' );\n\t\t\t},\n\t\t\t$items\n\t\t);\n\t}",
"function post_ids() {\n\n\t\t$media_location = $this->media_location();\n\n\t\tif ( ! $media_location )\n\t\t\treturn array();\n\n\t\t$media_files = $media_location->media_files();\n\n\t\tif ( ! count( $media_files ) )\n\t\t\treturn array();\n\n\t\t// fetch releases\n\t\t$episode_ids = array_map( function ( $v ) { return $v->episode_id; }, $media_files );\n\t\t$episodes = Episode::find_all_by_where( \"id IN (\" . implode( ',', $episode_ids ) . \")\" );\n\n\t\treturn array_map( function ( $v ) { return $v->post_id; }, $episodes );\n\t}",
"public function get_attached_content_object_ids($type = self :: ATTACHMENT_NORMAL)\n {\n if (!is_array($this->attachment_ids[$type]))\n {\n $conditions = array();\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(\n ContentObjectAttachment::class_name(),\n ContentObjectAttachment::PROPERTY_CONTENT_OBJECT_ID\n ),\n new StaticConditionVariable($this->get_id())\n );\n if ($type != self::ATTACHMENT_ALL)\n {\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(\n ContentObjectAttachment::class_name(),\n ContentObjectAttachment::PROPERTY_TYPE\n ),\n new StaticConditionVariable($type)\n );\n }\n $condition = new AndCondition($conditions);\n\n $parameters = new DataClassDistinctParameters(\n $condition,\n new DataClassProperties(\n array(\n new PropertyConditionVariable(\n ContentObjectAttachment::class,\n ContentObjectAttachment::PROPERTY_ATTACHMENT_ID\n )\n )\n )\n );\n $this->attachment_ids[$type] = DataManager::distinct(ContentObjectAttachment::class_name(), $parameters);\n }\n\n return $this->attachment_ids[$type];\n }",
"function get_attachments_used_in_content( string $content ): array {\n\t$blocks = parse_blocks( $content );\n\n\t$attachment_ids = [];\n\n\tforeach ( $blocks as $block ) {\n\t\t// Fetch the attachement id/s from block fields.\n\t\tswitch ( $block['blockName'] ) {\n\t\t\tcase 'planet4-blocks/enform':\n\t\t\t\t$attachment_ids[] = $block['attrs']['background'] ?? '';\n\t\t\t\tbreak;\n\n\t\t\tcase 'core/image':\n\t\t\tcase 'planet4-blocks/happypoint':\n\t\t\t\t$attachment_ids[] = $block['attrs']['id'] ?? '';\n\t\t\t\tbreak;\n\n\t\t\tcase 'planet4-blocks/media-video':\n\t\t\t\t$attachment_ids[] = $block['attrs']['video_poster_img'] ?? '';\n\t\t\t\tbreak;\n\n\t\t\tcase 'planet4-blocks/gallery':\n\t\t\t\tif ( isset( $block['attrs']['multiple_image'] ) ) {\n\t\t\t\t\t$multiple_images = explode( ',', $block['attrs']['multiple_image'] );\n\t\t\t\t\t$attachment_ids = array_merge( $attachment_ids, $multiple_images );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'planet4-blocks/carousel-header':\n\t\t\t\tif ( isset( $block['attrs']['slides'] ) ) {\n\t\t\t\t\tforeach ( $block['attrs']['slides'] as $slide ) {\n\t\t\t\t\t\t$attachment_ids[] = $slide['image'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'planet4-blocks/split-two-columns':\n\t\t\t\t$attachment_ids[] = $block['attrs']['issue_image'] ?? '';\n\t\t\t\t$attachment_ids[] = $block['attrs']['tag_image'] ?? '';\n\t\t\t\tbreak;\n\n\t\t\tcase 'planet4-blocks/columns':\n\t\t\t\tif ( isset( $block['attrs']['columns'] ) ) {\n\t\t\t\t\tforeach ( $block['attrs']['columns'] as $column ) {\n\t\t\t\t\t\t$attachment_ids[] = $column['attachment'] ?? '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'planet4-blocks/social-media-cards':\n\t\t\t\tif ( isset( $block['attrs']['cards'] ) ) {\n\t\t\t\t\tforeach ( $block['attrs']['cards'] as $card ) {\n\t\t\t\t\t\t$attachment_ids[] = $card['image_id'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'planet4-blocks/take-action-boxout':\n\t\t\t\t$attachment_ids[] = $block['attrs']['background_image'] ?? '';\n\t\t\t\tbreak;\n\n\t\t}\n\t}\n\n\treturn $attachment_ids;\n}",
"private function get_unattached_ids() {\n\t\tglobal $wpdb;\n\t\treturn $wpdb->get_col(\"SELECT `ID` FROM {$wpdb->posts} WHERE `post_type` = 'attachment' AND `post_status` = 'inherit' AND `post_parent` = '0'\");\n\t}",
"public function getAttachments();",
"public function getAttachments();",
"function get_current_post_attachments() {\n return get_post_attachments(get_queried_object_id());\n }",
"protected function _shortcode_get_attachments( $atts ) {\n\t\t$attachments = array();\n\n\t\tif ( ! empty( $atts['include'] ) ) :\n\t\t\t$_attachments = get_posts( array(\n\t\t\t\t'include' => $atts['include'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\n\t\t\tforeach ( $_attachments as $key => $val )\n\t\t\t\t$attachments[$val->ID] = $_attachments[$key];\n\n\t\telseif ( ! empty( $atts['exclude'] ) ) :\n\t\t\t$attachments = get_children( array(\n\t\t\t\t'post_parent' => $atts['id'],\n\t\t\t\t'exclude' => $atts['exclude'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\n\t\telse :\n\t\t\t$attachments = get_children( array(\n\t\t\t\t'post_parent' => $atts['id'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\t\tendif;\n\n\t\treturn $attachments;\n\t}",
"function w2pg_get_attachments($id = null, $post = null)\n{\n $post = get_post($post);\n\n if ($post === null) {\n return null;\n }\n\n $galleries_attachs = w2pg_get_galleries_attachments($post->ID);\n\n if ($id) {\n if (!isset($galleries_attachs[$id])) {\n return null;\n }\n\n return $galleries_attachs[$id];\n }\n\n return $galleries_attachs;\n}",
"public function getAttachments(): array;",
"public function getAttachments(): array\n {\n return $this->attachments;\n }",
"public function getAttachments(): array\n {\n return $this->attachments;\n }",
"public function getAttachmentsList() {\n return $this->_get(20);\n }",
"public function getPostGalleryAttachments($short_code_atts, $id)\n {\n $attachments = [];\n if (!empty($short_code_atts['include'])) {\n $_attachments = get_posts([\n 'include' => $short_code_atts['include'],\n 'post_status' => 'inherit',\n 'post_type' => 'attachment',\n 'post_mime_type' => 'image',\n 'order' => $short_code_atts['order'],\n 'orderby' => $short_code_atts['orderby']\n ]);\n\n foreach ($_attachments as $key => $val) {\n $attachments[$val->ID] = $_attachments[$key];\n }\n } elseif (!empty($short_code_atts['exclude'])) {\n $attachments = get_children([\n 'post_parent' => $id,\n 'exclude' => $short_code_atts['exclude'],\n 'post_status' => 'inherit',\n 'post_type' => 'attachment',\n 'post_mime_type' => 'image',\n 'order' => $short_code_atts['order'],\n 'orderby' => $short_code_atts['orderby']\n ]);\n } else {\n $attachments = get_children([\n 'post_parent' => $id,\n 'post_status' => 'inherit',\n 'post_type' => 'attachment',\n 'post_mime_type' => 'image',\n 'order' => $short_code_atts['order'],\n 'orderby' => $short_code_atts['orderby']\n ]);\n }\n\n return $attachments;\n }",
"public function getAttachmentsList() {\n return $this->_get(14);\n }",
"public function getAttachmentsList() {\n return $this->_get(10);\n }",
"public function attachments()\n {\n return $this->hasMany(Attachment::class, 'mail_id', 'id');\n }",
"public function getAttachments() {\n\t\treturn $this->attachments;\n\t}",
"public function getAttachments()\n {\n return $this->attachment;\n }",
"private function setAttachmentData()\n {\n $attachments = [];\n if($this->attachments){\n foreach($this->attachments as $attachment){\n $attachments[] = $attachment['file']->getRealPath();\n }\n }\n return $attachments;\n }",
"function vcex_get_post_gallery_ids( $post_id = '' ) {\n\n\t/**\n\t * Filters the post gallery image ids before trying to fetch them.\n\t *\n\t * @param array $ids\n\t */\n\t$filter_val = apply_filters( 'vcex_pre_get_post_gallery_ids', null );\n\n\tif ( $filter_val ) {\n\t\treturn $filter_val;\n\t}\n\n\tif ( function_exists( 'wpex_get_gallery_ids' ) ) {\n\t\treturn wpex_get_gallery_ids( $post_id );\n\t}\n\n\t$attachment_ids = '';\n\n\tif ( ! $post_id ) {\n\t\t$post_id = vcex_get_the_ID();\n\t}\n\n\tif ( class_exists( 'WC_product' ) && 'product' == get_post_type( $post_id ) ) {\n\t\t$product = new WC_product( $post_id );\n\t\tif ( $product && method_exists( $product, 'get_gallery_image_ids' ) ) {\n\t\t\t$attachment_ids = $product->get_gallery_image_ids();\n\t\t}\n\t}\n\n\t$attachment_ids = $attachment_ids ?: get_post_meta( $post_id, '_easy_image_gallery', true );\n\n\tif ( $attachment_ids ) {\n\t\tif ( is_string( $attachment_ids ) ) {\n\t\t\t$attachment_ids = explode( ',', $attachment_ids );\n\t\t}\n\t\t$attachment_ids = array_values( array_filter( $attachment_ids, 'wpex_sanitize_gallery_id' ) );\n\t\treturn apply_filters( 'wpex_get_post_gallery_ids', $attachment_ids );\n\t}\n}",
"protected function parse_galleries( $content, $post_id = 0 ) {\n\n\t\t$attachments = array();\n\t\t$galleries = $this->get_content_galleries( $content );\n\n\t\tforeach ( $galleries as $gallery ) {\n\n\t\t\t$id = $post_id;\n\n\t\t\tif ( ! empty( $gallery['id'] ) ) {\n\t\t\t\t$id = intval( $gallery['id'] );\n\t\t\t}\n\n\t\t\t// Forked from core gallery_shortcode() to have exact same logic. R.\n\t\t\tif ( ! empty( $gallery['ids'] ) ) {\n\t\t\t\t$gallery['include'] = $gallery['ids'];\n\t\t\t}\n\n\t\t\t$gallery_attachments = $this->get_gallery_attachments( $id, $gallery );\n\n\n\t\t\t$attachments = array_merge( $attachments, $gallery_attachments );\n\t\t}\n\n\t\tif ( PHP_VERSION_ID >= 50209 ) {\n\t\t\t// phpcs:ignore PHPCompatibility.PHP.NewFunctionParameters.array_unique_sort_flagsFound -- Wrapped in version check.\n\t\t\treturn array_unique( $attachments, SORT_REGULAR );\n\t\t}\n\n\t\treturn $attachments;\n\t}",
"public function getAttachments(): Collection\n {\n return $this->attachments;\n }",
"function extract_embedded_images_from_post_content() {\n // be consistent with media_images.\n // http://stackoverflow.com/a/20861974/6763239\n $embedded_images = array();\n\n $img_nodes = $this->dom->getElementsByTagName('img');\n\n foreach ( $img_nodes as $img_node ) {\n $embedded_images[] = new EmbeddedImage($img_node, $this);\n }\n\n return $embedded_images;\n }",
"public function getAttachments() : CompactTweetFieldsAttachments\n {\n return $this->attachments;\n }",
"private static function get_blog_ids() {\n\n\t\tglobal $wpdb;\n\n\t\t// get an array of blog ids\n\t\t$sql = \"SELECT blog_id FROM $wpdb->blogs\n\t\t\tWHERE archived = '0' AND spam = '0'\n\t\t\tAND deleted = '0'\";\n\n\t\treturn $wpdb->get_col( $sql );\n\n\t}"
] |
[
"0.7554445",
"0.6689919",
"0.6390449",
"0.62081563",
"0.61456585",
"0.6078144",
"0.603941",
"0.60375905",
"0.5978405",
"0.5978405",
"0.59721494",
"0.5916814",
"0.5877942",
"0.58172756",
"0.5813561",
"0.5813561",
"0.57794034",
"0.57610387",
"0.5757832",
"0.57562226",
"0.5733552",
"0.5725278",
"0.56811213",
"0.5673547",
"0.56699884",
"0.56571233",
"0.56422395",
"0.5624846",
"0.56111145",
"0.55850446"
] |
0.7345611
|
1
|
Get the Challenge which this Submission belongs to.
|
public function getChallenge()
{
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getChallenge()\n {\n return $this->challenge;\n }",
"public function getChallengeDesc()\n {\n return $this->challengeDesc;\n }",
"public function getChallengeType()\n {\n return $this->challengeType;\n }",
"function getChallengeName($challenge_id) {\n $challenges = challenges();\n return $challenges[$challenge_id]['name'];\n}",
"public function challengePlayground()\n {\n return $this->belongsTo(Playground::class, 'C_playground_id');\n }",
"public function single($id)\n {\n return new ChallengeResource(Challenge::findOrFail($id));\n }",
"public function getChallenge()\n {\n if (empty($this->_challenge))\n {\n $output = $this->postRequest(\n 'identification/securitytoken/challenge',\n [\n 'useEasyLogin' => false,\n 'generateEasyLoginId' => false,\n 'userId' => $this->_username,\n ]\n );\n\n if (!isset($output->links->next->uri))\n throw new Exception('Cannot fetch control number. Check if the username is correct.', 10);\n\n $this->_challenge = $output->challenge;\n $this->_useOneTimePassword = (bool)$output->useOneTimePassword;\n }\n\n return $this->_challenge;\n }",
"public function setChallenge($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\ConfidentialComputing\\V1\\Challenge::class);\n $this->challenge = $var;\n\n return $this;\n }",
"public function getChallenger()\n {\n return $this->get(self::_CHALLENGER);\n }",
"public function getChallenger()\n {\n return $this->get(self::_CHALLENGER);\n }",
"public function getChallenger()\n {\n return $this->get(self::_CHALLENGER);\n }",
"public function getContestId()\n {\n return $this->contest_id;\n }",
"public function submission()\n {\n return Submission::where('assignment_id', $this->attributes['id'])->where('user_id', Auth::user()->id)->first();\n }",
"public function ChallengeTo()\n {\n return $this->belongsTo(Hour::class, 'C_to', 'hour_id');\n }",
"public function getThreatSubmission()\n {\n if (array_key_exists(\"threatSubmission\", $this->_propDict)) {\n if (is_a($this->_propDict[\"threatSubmission\"], \"\\Beta\\Microsoft\\Graph\\SecurityNamespace\\Model\\ThreatSubmissionRoot\") || is_null($this->_propDict[\"threatSubmission\"])) {\n return $this->_propDict[\"threatSubmission\"];\n } else {\n $this->_propDict[\"threatSubmission\"] = new \\Beta\\Microsoft\\Graph\\SecurityNamespace\\Model\\ThreatSubmissionRoot($this->_propDict[\"threatSubmission\"]);\n return $this->_propDict[\"threatSubmission\"];\n }\n }\n return null;\n }",
"public function get_question() {\n\t\t\treturn $this->question;\n\t\t}",
"public static function checkuchallenge($user_id, $challenge_id)\n {\n\t\t$user_challenge = UserChallenge::find('one', array('conditions' => array('user_id=? AND challenge_id=?', $user_id, $challenge_id)));\n\n\t\treturn $user_challenge;\n }",
"public function getChallenges(): array\n {\n return $this->challenges;\n }",
"function getChallengeId($challenge_name) {\n $challenges = challenges();\n foreach ($challenges as $challenge_id => $data) {\n if (preg_match('/'.$data['name'].'/i',$challenge_name)) {\n return $challenge_id;\n }\n }\n return false;\n}",
"function findPromotionalChallengeId(){\n\t\t$this->PromotionalChallenge->recursive = -1;\n\t\t$promotional_challenge = $this->PromotionalChallenge->find('first', \n\t\t\tarray(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'PromotionalChallenge.title' => strtolower($this->data['Challenge']['title'])\n\t\t\t\t), \n\t\t\t\t'fields' => array(\n\t\t\t\t\t'PromotionalChallenge.id'\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t\n\t\t$untracked_challenge = !($this->data['Challenge']['promotional_challenge_id'] = $promotional_challenge['PromotionalChallenge']['id']);\n\t\t\n\t\tif($untracked_challenge){\n\t\t\treturn 15;\n\t\t} \n\t\t\n\t\treturn $promotional_challenge['PromotionalChallenge']['id'];\n\t}",
"public function challenge($challenge_id = null){\n\t\t//TODO: Important! I think that we have security issue here – teacher should not have ability to\n\t //edit challenges which are created by other users.\n\n\t //If parametes are sent as POST data, repack them as GET data\n $uri = Mapper_Helper::create_uri_segments();\n if ($uri !== null) {\n redirect('question/challenge/'.$challenge_id.'/' . $uri);\n }\n\n $this->mapperlib->set_default_base_page('question/challenge/'.$challenge_id);\n $this->mapperlib->set_breaking_segment(4);\n\n $data = new stdClass();\n $this->challenge_question_model->setChallenge_id($challenge_id);\n\n $data->challange_id = $challenge_id;\n\t $data->challenge = $this->challenge_model->getChallengeById($challenge_id);\n\n $challengeQuestions = $this->challenge_question_model->getList();\n $questionIds = array();\n foreach ($challengeQuestions as $cq) {\n /** @var $cq PropChallengeQuestion */\n $questionIds[] = $cq->getQuestionId();\n }\n\n /**\n * Nem's hack - this should be moved to question_model once\n */\n $questions = PropQuestionQuery::create()\n ->filterByQuestionId($questionIds)\n ->filterByIsDeleted(PropQuestionPeer::IS_DELETED_NO)\n ->find();\n\n $data->questions = array();\n\n foreach($questions as $k => $question){\n $data->questions[$k]['question_name'] = $question->getText();\n $question_id = $question->getQuestionId();\n $data->questions[$k]['question_id'] = $question_id;\n $data->questions[$k]['question_type'] = $this->challenge_questionlib->get_question_type($question_id);\n $data->questions[$k]['question_image'] = $this->challenge_questionlib->get_question_image_type($question_id);\n\n $question_data = $this->get_question_details($question_id);\n $data->questions[$k]['data'] = $question_data;\n }\n\n $data->content = $this->prepareView('x_challenge_question', 'home_challenge_question', $data);\n $this->load->view(config_item('teacher_template'), $data);\n }",
"public function getCohorte() {\n return $this->cohorte;\n }",
"public function getSubmission() {\n\t\t$submission = $this->getRequest()->param('ID');\n\t\t\n\t\tif ($submission) {\n\t\t\treturn SubmittedForm::get()->filter('uid', $submission)->First();\n\t\t}\n\n\t\treturn null;\n\t}",
"public function getQuestion() {\n return $this->question;\n }",
"public function getNamaChallenge();",
"public function getQuestion() {\n\t\t\treturn $this->question;\n\t\t}",
"public function getCompetition() :? Competition\n {\n return $this->competition;\n }",
"public function getQuestion()\n {\n return $this->hasOne(Question::className(), ['id' => 'question_id']);\n }",
"public function ChallengeFrom()\n {\n return $this->belongsTo(Hour::class, 'C_from', 'hour_id');\n }",
"public function getCommentSubmission() {\n\t\treturn ($this->commentSubmission);\n\t}"
] |
[
"0.74243546",
"0.6107202",
"0.6008314",
"0.5949735",
"0.58571637",
"0.5832968",
"0.5831718",
"0.5822467",
"0.564269",
"0.564269",
"0.56413037",
"0.55941695",
"0.5592151",
"0.55231386",
"0.5523069",
"0.55227077",
"0.55147254",
"0.54993063",
"0.5468062",
"0.54085577",
"0.540507",
"0.5388591",
"0.5384299",
"0.5333085",
"0.5304734",
"0.5291499",
"0.5261961",
"0.5240322",
"0.5214668",
"0.5208696"
] |
0.6586515
|
1
|
Quick and dirty testing for setting grades.
|
public function setGradeTest($grade)
{
array_push($this->grades, intval($grade));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function supports_mygrades() {\n return true;\n }",
"public function test_update_grade_item() {\n\n $testarray = $this->csv_load($this->oktext);\n $testobject = new phpunit_gradeimport_csv_load_data();\n\n // We're not using scales so no to this option.\n $verbosescales = 0;\n // Map and key are to retrieve the grade_item that we are updating.\n $map = array(1);\n $key = 0;\n // We return the new grade array for saving.\n $newgrades = $testobject->test_update_grade_item($this->courseid, $map, $key, $verbosescales, $testarray[0][6]);\n\n $expectedresult = array();\n $expectedresult[0] = new stdClass();\n $expectedresult[0]->itemid = 1;\n $expectedresult[0]->finalgrade = $testarray[0][6];\n\n $this->assertEquals($newgrades, $expectedresult);\n\n // Try sending a bad grade value (A letter instead of a float / int).\n $newgrades = $testobject->test_update_grade_item($this->courseid, $map, $key, $verbosescales, 'A');\n // The $newgrades variable should be null.\n $this->assertNull($newgrades);\n $expectederrormessage = get_string('badgrade', 'grades');\n // Check that the error message is what we expect.\n $gradebookerrors = $testobject->get_gradebookerrors();\n $this->assertEquals($expectederrormessage, $gradebookerrors[0]);\n }",
"public function setGrade($arr)\n\t{\n\t}",
"function ChangeGrades ($grades) {\n $hunt_division = mysql_result(@mysql_query(\"SELECT `hunt_division` FROM `hunts` WHERE `hunt_id` = '$this->hunt_id'\", $this->ka_db), 0, 'hunt_division');\n if (($this->Allowed('allhunts') == true) || (($this->Allowed('hunts') == true) && ($this->CheckDivision($hunt_division) == true))) {\n $grades_str = base64_encode(serialize($grades));\n if (@mysql_query (\"UPDATE `hunt_grades` SET `grades`='$grades_str' WHERE `hunt_id`='\".$this->hunt_id.\"' LIMIT 1\", $this->ka_db))\n return $this->IsGraded();\n else {\n $this->roster_error = \"Unsuccessful update query.\";\n return false;\n }\n } else {\n $this->roster_error = \"You do not have access to this function.\";\n return false;\n }\n }",
"public static function __gradeParser($score,$unit,$code=''){\r\n if($score >= 69){\r\n self::$_grades = 5;\r\n self::$_totalGrade[] = self::$_grades*$unit;\r\n self::__setUnitPF($score, $unit);\r\n }\r\n if($score > 59 && $score < 69){\r\n self::$_grades = 4;\r\n self::$_totalGrade[] = self::$_grades*$unit;\r\n self::__setUnitPF($score, $unit);\r\n }\r\n if($score > 49 && $score < 59){\r\n self::$_grades = 3;\r\n self::$_totalGrade[] = self::$_grades*$unit;\r\n self::__setUnitPF($score, $unit);\r\n }\r\n if($score > 44 && $score < 50){\r\n self::$_grades = 2;\r\n self::$_totalGrade[] = self::$_grades*$unit;\r\n self::__setUnitPF($score, $unit);\r\n }\r\n if($score > 39 && $score < 45){\r\n self::$_grades = 1;\r\n self::$_totalGrade[] = self::$_grades*$unit;\r\n self::__setUnitPF($score, $unit);\r\n }\r\n if($score >= 0 && $score < 40){\r\n self::$_grades = 0;\r\n self::$_totalGrade[] = self::$_grades*$unit;\r\n self::__setUnitPF($score, $unit);\r\n }\r\n self::__setRemarks($code, $score);\r\n return self::$_grades;\r\n }",
"public function save_grade() {\r\n\r\n\t\t\t//new method\r\n\t\t\t$sql = \"UPDATE grades SET student_id = ?, course_id = ?, degree = ?, examine_at = ? WHERE id = ?;\";\r\n\t\t\tDatabase::$db->prepare($sql)->execute([$this->student_id, $this->course_id, $this->degree, $this->examine_at, $this->id]);\r\n\t\t\t//old method\r\n\t\t\t/*$sql = \"UPDATE grades SET student_id = ? WHERE id = ?;\";\r\n\t\t\t$sql = \"UPDATE grades SET course_id = ? WHERE id = ?;\";\r\n\t\t\t$sql = \"UPDATE grades SET degree = ? WHERE id = ?;\";\r\n\t\t\t$sql = \"UPDATE grades SET examine_at = ? WHERE id = ?;\";\r\n\t\t\tDatabase::$db->prepare($sql)->execute([$this->student_id, $this->id]);\r\n\t\t\tDatabase::$db->prepare($sql)->execute([$this->course_id, $this->id]);\r\n\t\t\tDatabase::$db->prepare($sql)->execute([$this->degree, $this->id]);\r\n\t\t\tDatabase::$db->prepare($sql)->execute([$this->examine_at, $this->id]);*/\r\n\t\t}",
"public function get_grades() {\n return $this->grades;\n }",
"public function test_process_data() {\n global $DB, $CFG;\n\n $this->resetAfterTest(true);\n\n $course = $this->getDataGenerator()->create_course();\n\n // Create and enrol a student.\n $student = $this->getDataGenerator()->create_user(array('username' => 'Student Sam'));\n $role = $DB->get_record('role', array('shortname' => 'student'), '*', MUST_EXIST);\n $this->getDataGenerator()->enrol_user($student->id, $course->id, $role->id);\n\n // Test with limited grades.\n $CFG->unlimitedgrades = 0;\n\n $forummax = 80;\n $forum1 = $this->getDataGenerator()->create_module('forum', array('assessed' => 1, 'scale' => $forummax, 'course' => $course->id));\n // Switch the stdClass instance for a grade item instance.\n $forum1 = grade_item::fetch(array('itemtype' => 'mod', 'itemmodule' => 'forum', 'iteminstance' => $forum1->id, 'courseid' => $course->id));\n\n $report = $this->create_report($course);\n $testgrade = 60.00;\n\n $data = new stdClass();\n $data->id = $course->id;\n $data->report = 'grader';\n $data->timepageload = time();\n\n $data->grade = array();\n $data->grade[$student->id] = array();\n $data->grade[$student->id][$forum1->id] = $testgrade;\n\n $warnings = $report->process_data($data);\n $this->assertEquals(count($warnings), 0);\n\n $studentgrade = grade_grade::fetch(array('itemid' => $forum1->id, '' => $student->id));\n $this->assertEquals($studentgrade->finalgrade, $testgrade);\n\n // Grade above max. Should be pulled down to max.\n $toobig = 200.00;\n $data->grade[$student->id][$forum1->id] = $toobig;\n $data->timepageload = time();\n $warnings = $report->process_data($data);\n $this->assertEquals(count($warnings), 1);\n\n $studentgrade = grade_grade::fetch(array('itemid' => $forum1->id, '' => $student->id));\n $this->assertEquals($studentgrade->finalgrade, $forummax);\n\n // Grade below min. Should be pulled up to min.\n $toosmall = -10.00;\n $data->grade[$student->id][$forum1->id] = $toosmall;\n $data->timepageload = time();\n $warnings = $report->process_data($data);\n $this->assertEquals(count($warnings), 1);\n\n $studentgrade = grade_grade::fetch(array('itemid' => $forum1->id, '' => $student->id));\n $this->assertEquals($studentgrade->finalgrade, 0);\n\n // Test unlimited grades so we can give a student a grade about max.\n $CFG->unlimitedgrades = 1;\n\n $data->grade[$student->id][$forum1->id] = $toobig;\n $data->timepageload = time();\n $warnings = $report->process_data($data);\n $this->assertEquals(count($warnings), 0);\n\n $studentgrade = grade_grade::fetch(array('itemid' => $forum1->id, '' => $student->id));\n $this->assertEquals($studentgrade->finalgrade, $toobig);\n }",
"public function test_insert_grade_record() {\n global $DB, $USER;\n\n $user = $this->getDataGenerator()->create_user();\n $this->setAdminUser();\n\n $record = new stdClass();\n $record->itemid = 4;\n $record->newgradeitem = 25;\n $record->finalgrade = 62.00;\n $record->feedback = 'Some test feedback';\n\n $testobject = new phpunit_gradeimport_csv_load_data();\n $testobject->test_insert_grade_record($record, $user->id);\n\n $gradeimportvalues = $DB->get_records('grade_import_values');\n // Get the insert id.\n $key = key($gradeimportvalues);\n\n $testarray = array();\n $testarray[$key] = new stdClass();\n $testarray[$key]->id = $key;\n $testarray[$key]->itemid = $record->itemid;\n $testarray[$key]->newgradeitem = $record->newgradeitem;\n $testarray[$key]->userid = $user->id;\n $testarray[$key]->finalgrade = $record->finalgrade;\n $testarray[$key]->feedback = $record->feedback;\n $testarray[$key]->importcode = $testobject->get_importcode();\n $testarray[$key]->importer = $USER->id;\n $testarray[$key]->importonlyfeedback = 0;\n\n // Check that the record was inserted into the database.\n $this->assertEquals($gradeimportvalues, $testarray);\n }",
"public function test_prepare_import_grade_data() {\n global $DB;\n\n // Need to add one of the users into the system.\n $user = new stdClass();\n $user->firstname = 'Anne';\n $user->lastname = 'Able';\n $user->email = '[email protected]';\n // Insert user 1.\n $this->getDataGenerator()->create_user($user);\n $user = new stdClass();\n $user->firstname = 'Bobby';\n $user->lastname = 'Bunce';\n $user->email = '[email protected]';\n // Insert user 2.\n $this->getDataGenerator()->create_user($user);\n\n $this->csv_load($this->oktext);\n\n $importcode = 007;\n $verbosescales = 0;\n\n // Form data object.\n $formdata = new stdClass();\n $formdata->mapfrom = 5;\n $formdata->mapto = 'useremail';\n $formdata->mapping_0 = 0;\n $formdata->mapping_1 = 0;\n $formdata->mapping_2 = 0;\n $formdata->mapping_3 = 0;\n $formdata->mapping_4 = 0;\n $formdata->mapping_5 = 0;\n $formdata->mapping_6 = 'new';\n $formdata->mapping_7 = 'feedback_2';\n $formdata->mapping_8 = 0;\n $formdata->mapping_9 = 0;\n $formdata->map = 1;\n $formdata->id = 2;\n $formdata->iid = $this->iid;\n $formdata->importcode = $importcode;\n $formdata->forceimport = false;\n\n // Blam go time.\n $testobject = new phpunit_gradeimport_csv_load_data();\n $dataloaded = $testobject->prepare_import_grade_data($this->columns, $formdata, $this->csvimport, $this->courseid, '', '',\n $verbosescales);\n // If everything inserted properly then this should be true.\n $this->assertTrue($dataloaded);\n }",
"function _makeLetterGrade( $percent, $course_period_id = 0, $staff_id = 0, $ret = 'TITLE' )\n{\n\tglobal $_BETHEL;\n\n\t$course_period_id = $course_period_id ? $course_period_id : UserCoursePeriod();\n\n\tif ( ! $staff_id )\n\t{\n\t\tif ( User( 'PROFILE' ) === 'teacher' )\n\t\t{\n\t\t\t$staff_id = User( 'STAFF_ID' );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$staff_id = DBGetOne( \"SELECT TEACHER_ID\n\t\t\t\tFROM COURSE_PERIODS\n\t\t\t\tWHERE COURSE_PERIOD_ID='\" . $course_period_id . \"'\" );\n\t\t}\n\t}\n\n\t$gradebook_config = ProgramUserConfig( 'Gradebook', $staff_id );\n\n\t// Save courses in $_BETHEL['_makeLetterGrade']['courses'] global var.\n\tif ( ! isset( $_BETHEL['_makeLetterGrade']['courses'][ $course_period_id ] ) )\n\t{\n\t\t$_BETHEL['_makeLetterGrade']['courses'][ $course_period_id ] = DBGet( \"SELECT DOES_BREAKOFF,GRADE_SCALE_ID\n\t\t\tFROM COURSE_PERIODS\n\t\t\tWHERE COURSE_PERIOD_ID='\" . $course_period_id . \"'\" );\n\t}\n\n\t$does_breakoff = $_BETHEL['_makeLetterGrade']['courses'][ $course_period_id ][1]['DOES_BREAKOFF'];\n\n\t$grade_scale_id = $_BETHEL['_makeLetterGrade']['courses'][ $course_period_id ][1]['GRADE_SCALE_ID'];\n\n\t$percent *= 100;\n\n\t// If Teacher Grade Scale.\n\tif ( $does_breakoff === 'Y'\n\t\t&& is_array( $gradebook_config ) )\n\t{\n\t\tif ( $gradebook_config['ROUNDING'] === 'UP' )\n\t\t{\n\t\t\t$percent = ceil( $percent );\n\t\t}\n\t\telseif ( $gradebook_config['ROUNDING'] === 'DOWN' )\n\t\t{\n\t\t\t$percent = floor( $percent );\n\t\t}\n\t\telseif ( $gradebook_config['ROUNDING'] === 'NORMAL' )\n\t\t{\n\t\t\t$percent = round( $percent );\n\t\t}\n\t}\n\telse\n\t\t$percent = round( $percent, 2 ); // School default.\n\n\tif ( $ret === '%' )\n\t{\n\t\treturn $percent;\n\t}\n\n\t// Save grades in $_BETHEL['_makeLetterGrade']['grades'] global var.\n\tif ( ! isset( $_BETHEL['_makeLetterGrade']['grades'][ $grade_scale_id ] ) )\n\t{\n\t\t$_BETHEL['_makeLetterGrade']['grades'][ $grade_scale_id ] = DBGet( \"SELECT TITLE,ID,BREAK_OFF,COMMENT\n\t\t\tFROM REPORT_CARD_GRADES\n\t\t\tWHERE SYEAR='\" . UserSyear() . \"'\n\t\t\tAND SCHOOL_ID='\" . UserSchool() . \"'\n\t\t\tAND GRADE_SCALE_ID='\" . $grade_scale_id . \"'\n\t\t\tORDER BY BREAK_OFF IS NOT NULL DESC,BREAK_OFF DESC,SORT_ORDER\" );\n\t}\n\n\t// Fix error invalid input syntax for type numeric\n\t// If Teacher Grade Scale.\n\tif ( $does_breakoff === 'Y'\n\t\t&& is_array( $gradebook_config ) )\n\t{\n\t\tforeach ( (array) $_BETHEL['_makeLetterGrade']['grades'][ $grade_scale_id ] as $grade )\n\t\t{\n\t\t\tif ( is_numeric( $gradebook_config[ $course_period_id . '-' . $grade['ID'] ] )\n\t\t\t\t&& $percent >= $gradebook_config[ $course_period_id . '-' . $grade['ID'] ] )\n\t\t\t{\n\t\t\t\t// FJ use Report Card Grades comments.\n\t\t\t\t// return $ret=='ID' ? $grade['ID'] : $grade['TITLE'];\n\t\t\t\treturn $grade[ $ret ];\n\t\t\t}\n\t\t}\n\t}\n\n\tforeach ( (array) $_BETHEL['_makeLetterGrade']['grades'][ $grade_scale_id ] as $grade )\n\t{\n\t\tif ( $percent >= $grade['BREAK_OFF'] )\n\t\t{\n\t\t\t// FJ use Report Card Grades comments.\n\t\t\t// return $ret=='ID' ? $grade['ID'] : $grade['TITLE'];\n\t\t\treturn $grade[ $ret ];\n\t\t}\n\t}\n}",
"function dataform_update_grades($data=null, $userid=0, $nullifnone=true, $grades=null) {\n global $CFG, $DB;\n require_once(\"$CFG->libdir/gradelib.php\");\n\n if ($data != null) {\n if ($data->grade) {\n if ($grades or $grades = dataform_get_user_grades($data, $userid)) {\n dataform_grade_item_update($data, $grades);\n\n } else if ($userid and $nullifnone) {\n $grade = new object();\n $grade->userid = $userid;\n $grade->rawgrade = NULL;\n dataform_grade_item_update($data, $grade);\n\n } else {\n dataform_grade_item_update($data);\n }\n } else {\n dataform_grade_item_delete($data);\n }\n }\n}",
"function setGrade($grade) {\n $this->fulfillment['grade_result'] = $grade;\n return $this;\n }",
"function getGrade()\n {\n return $this->_Grade;\n }",
"public function getVarGrade();",
"function add_grade($grade) {\n $this->grades[] = $grade;\n }",
"public function get_grade() {\n return $this->grade;\n }",
"function getGrade() {\n return $this->fulfillment['grade_result'];\n }",
"protected /*void*/ function setGrade(/*int*/ $aid, /*int*/ $sid, /*int*/ $grade)\n\t{\n\t\tif(!$this->validateGrade($grade))\n\t\t\tthrow new GradeFormatException();\n\n\t\t$query = $this->db->prepare(\"\n\t\t\tREPLACE INTO `grades` (\n\t\t\t\t`assignmentid`,\n\t\t\t\t`studentid`,\n\t\t\t\t`grade`\n\t\t\t) VALUES (\n\t\t\t\t:aid,\n\t\t\t\t:sid,\n\t\t\t\t:grade\n\t\t\t);\n\t\t\")->execute(array(\n\t\t\t':aid' => $aid,\n\t\t\t':sid' => $sid,\n\t\t\t':grade' => $grade\n\t\t));\n\t}",
"private function fixGrades( Submission $submission ) {\n\t\tif( $submission->getStateID() == '' ) {\n\t\t\t$this->output->writeln( sprintf( '<fg=red>Submission ID: %d does not have a State ID. So grades were entered in wrong.</fg=red>' , $submission->getId() ) );\n\t\t\treturn;\n\t\t}\n\n\t\t$iNowGrades = $this->getContainer()->get('doctrine')->getRepository('IIABMagnetBundle:StudentGrade')->findGradesByStateID( $submission->getStateID() );\n\n\t\tif( count( $iNowGrades ) == 0 ) {\n\t\t\t$this->output->writeln( sprintf( '<fg=red>Submission ID: %d does not have any grades in iNow</fg=red>' , $submission->getId() ) );\n\t\t\treturn;\n\t\t}\n\n\t\t/** @var \\IIAB\\MagnetBundle\\Entity\\SubmissionGrade $grade */\n\t\tforeach( $submission->getGrades() as $grade ) {\n\n\t\t\t$submission->removeGrade( $grade );\n\n\t\t\t$this->getContainer()->get('doctrine')->getManager()->remove( $grade );\n\t\t}\n\n\t\t$this->output->writeln( sprintf( '<fg=green>Submission ID: %d removed old grades.</fg=green>' , $submission->getId() ) );\n\n\t\t/** @var \\IIAB\\MagnetBundle\\Entity\\StudentGrade $grade */\n\t\tforeach( $iNowGrades as $grade ) {\n\n\t\t\t$submissionGrade = new SubmissionGrade();\n\t\t\t$submissionGrade->setAcademicYear( $grade->getAcademicYear() );\n\t\t\t$submissionGrade->setAcademicTerm( $grade->getAcademicTerm() );\n\t\t\t$submissionGrade->setCourseTypeID( $grade->getCourseTypeID() );\n\t\t\t$submissionGrade->setCourseType( $grade->getCourseType() );\n\t\t\t$submissionGrade->setCourseName( $grade->getCourseName() );\n\t\t\t$submissionGrade->setSectionNumber( $grade->getSectionNumber() );\n\t\t\t$submissionGrade->setNumericGrade( $grade->getNumericGrade() );\n\n\t\t\t$submission->addGrade( $submissionGrade );\n\n\t\t\t$this->getContainer()->get('doctrine')->getManager()->persist( $submissionGrade );\n\n\t\t}\n\n\t\t$this->getContainer()->get('doctrine')->getManager()->flush();\n\t\t$this->output->writeln( sprintf( '<fg=green>Submission ID: %d grades were updated.</fg=green>' , $submission->getId() ) );\n\n\t}",
"function grade($user) {\n $nid = (int) $this->getInstanceId();\n\n $result = reset(quiz_get_score_data(array($nid), $user->uid));\n if ($result && ($result->percent_score >= $result->percent_pass)) {\n $this->getFulfillment()->setGrade($result->percent_score)->setComplete()->save();\n }\n else {\n $this->getFulfillment()->setGrade($result->percent_score)->save();\n }\n }",
"public function testMethodSetScore()\n {\n $scorebox = new Scorebox();\n\n $scorebox->setScore(1);\n\n $score = $scorebox->getScore();\n\n $expScore = 1;\n\n $this->assertEquals($score, $expScore);\n }",
"private function setGrade($final = 0)\r\n\t{\r\n\t\tif($final >= 80)\r\n\t\t\treturn 'A';\r\n\t\telseif ($final >= 70)\r\n\t\t\treturn 'B';\r\n\t\telseif ($final >= 60)\r\n\t\t\treturn 'C';\r\n\t\telseif ($final >= 40)\r\n\t\t\treturn 'D';\r\n\t\telse\r\n\t\t\treturn 'E';\r\n\t\t\r\n\t}",
"public function grade($user = NULL) { }",
"public function test_fetch_grade_items() {\n\n $gradeitemsarray = grade_item::fetch_all(array('courseid' => $this->courseid));\n $gradeitems = phpunit_gradeimport_csv_load_data::fetch_grade_items($this->courseid);\n\n // Make sure that each grade item is located in the gradeitemsarray.\n foreach ($gradeitems as $key => $gradeitem) {\n $this->assertArrayHasKey($key, $gradeitemsarray);\n }\n\n // Get the key for a specific grade item.\n $quizkey = null;\n foreach ($gradeitemsarray as $key => $value) {\n if ($value->itemname == \"Quiz grade item\") {\n $quizkey = $key;\n }\n }\n\n // Expected modified item name.\n $testitemname = get_string('modulename', $gradeitemsarray[$quizkey]->itemmodule) . ': ' .\n $gradeitemsarray[$quizkey]->itemname;\n // Check that an item that is a module, is concatenated properly.\n $this->assertEquals($testitemname, $gradeitems[$quizkey]);\n }",
"function bookking_grade_item_update($bookking, $grades=null) {\n global $CFG, $DB;\n require_once($CFG->libdir.'/gradelib.php');\n\n if (!isset($bookking->courseid)) {\n $bookking->courseid = $bookking->course;\n }\n $moduleid = $DB->get_field('modules', 'id', array('name' => 'bookking'));\n $cmid = $DB->get_field('course_modules', 'id', array('module' => $moduleid, 'instance' => $bookking->id));\n\n if ($bookking->scale == 0) {\n // Delete any grade item.\n bookking_grade_item_delete($bookking);\n return 0;\n } else {\n $params = array('itemname' => $bookking->name, 'idnumber' => $cmid);\n\n if ($bookking->scale > 0) {\n $params['gradetype'] = GRADE_TYPE_VALUE;\n $params['grademax'] = $bookking->scale;\n $params['grademin'] = 0;\n\n } else if ($bookking->scale < 0) {\n $params['gradetype'] = GRADE_TYPE_SCALE;\n $params['scaleid'] = -$bookking->scale;\n\n } else {\n $params['gradetype'] = GRADE_TYPE_TEXT; // Allow text comments only.\n }\n\n if ($grades === 'reset') {\n $params['reset'] = true;\n $grades = null;\n }\n\n return grade_update('mod/bookking', $bookking->courseid, 'mod', 'bookking', $bookking->id, 0, $grades, $params);\n }\n}",
"protected /*bool*/ function validateGrade(/*mixed*/ $grade)\n\t{\n\t\tif(is_string($grade)) {\n\t\t\tif(!ctype_digit($grade))\n\t\t\t\treturn false;\n\t\t\t$grade = intval($grade);\n\t\t}\n\n\t\tif(!is_integer($grade))\n\t\t\treturn false;\n\n\t\treturn isset(Grades::$values[$grade]);\n\t}",
"public function get_grade($acquired_mark) {\n\t\techo get_grade($acquired_mark);\n\t}",
"function languagelesson_save_grade($lessonid, $userid, $gradeval) {\n global $DB;\n\t// build the grade object\n\t$grade = new stdClass;\n\t$grade->lessonid = $lessonid;\n\t$grade->userid = $userid;\n\t$grade->grade = $gradeval;\n\n\t// And update the old grade record, if there is one; if not, insert the record.\n\tif ($oldgrade = $DB->get_record(\"languagelesson_grades\", array(\"lessonid\"=>$lessonid, \"userid\"=>$userid))) {\n\t\t// If the old grade was for a completed lesson attempt, update the completion time.\n\t\tif ($oldgrade->completed) { $grade->completed = time(); }\n\t\t$grade->id = $oldgrade->id;\n\t\tif (! $DB->update_record(\"languagelesson_grades\", $grade)) {\n\t\t\terror(\"Navigation: grade not updated\");\n\t\t}\n\t} else {\n\t\tif (! $DB->insert_record(\"languagelesson_grades\", $grade)) {\n\t\t\terror(\"Navigation: grade not inserted\");\n\t\t}\n\t}\n}",
"public function grade() \n {\n if (permission::permitted('grades')=='fail'){ return redirect()->route('denied'); }\n\n $data = table::grade()->get();\n return view('admin.fields.grade', compact('data'));\n }"
] |
[
"0.65037787",
"0.64960814",
"0.62365294",
"0.61997145",
"0.6183774",
"0.6165204",
"0.6148016",
"0.6141794",
"0.6090361",
"0.60559404",
"0.59892577",
"0.5920316",
"0.59165",
"0.5895564",
"0.5872203",
"0.586496",
"0.58520716",
"0.58312577",
"0.5775063",
"0.5760082",
"0.5728543",
"0.571263",
"0.5709203",
"0.5706758",
"0.570203",
"0.5670983",
"0.5661195",
"0.5639034",
"0.56289655",
"0.5608285"
] |
0.72267103
|
0
|
id_card_verified column should be used for sorting when name column is selected in Datatables.
|
public static function laratablesOrderIdCardVerified()
{
return 'id_card_verified';
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function laratablesAdditionalColumns()\n {\n return ['status', 'id_card_verified'];\n }",
"function payments_table_gateway_column_sortable( $columns ){\r\n //$columns['status'] = array('status', false);\r\n return $columns;\r\n}",
"function TS_VCSC_Testimonials_Sort_CustomColumns($columns) {\r\n\t\t$columns['ids'] = 'ids'; \r\n\t\treturn $columns;\r\n\t}",
"public function getSortColumn();",
"function columns_none_sort($name, $column, $sortedBy, $options)\n\t{\n return sprintf('<th>%s</th>', $name);\n\n\t}",
"protected function get_select_id_col_name() {\n return \"accession\";\n }",
"public function getPageIdColumnName() {}",
"function _1p21_dv_cust_col( $column, $post_id ) {\n\t\tglobal $post;\n\n\t\tswitch( $column ) {\n\n\t\t\t/* If displaying the 'duration' column. */\n\t\t\tcase 'id' :\n\t\t\techo '<b>'.$post->ID.'</b>';\n\t\t\tdefault :\n\t\t\t\tbreak;\n\t\t}\n\t}",
"protected function filterIdColumn()\n {\n return 'manufacturercode';\n }",
"public function sortableId()\n\t{\n\t \treturn ' <span class=\"auth-item-name\" style=\"display:none;\">'.$this->owner->id.'</span>';\n\t}",
"function columns_sortDiff($name, $column, $sortedBy, $options)\n\t{\n if ($options['orderBy'] != $column)\n $type = '';\n else\n $type = '-'. strtolower($options['sortedBy']);\n if((isset($options['searchFields']) && $options['searchFields'] != null) && (isset($options['search']) && $options['search'] != null))\n {\n \treturn sprintf('<th>\n\t\t \t\t\t\t\t%s\n\t\t\t\t\t\t \t<a href=\"?searchFields=%s&search=%s&orderBy=%s&sortedBy=%s&items_per_page=%s&in_trash=%s\"><i class=\"fa fa-sort%s\"></i></a>\n\t\t\t\t\t\t\t</th>', $name, $options['searchFields'], $options['search'], $column, $sortedBy, $options['items_per_page'], $options['in_trash'], $type);\n }\n else\n \treturn sprintf('<th>\n\t\t \t\t\t\t\t%s\n\t\t\t\t\t\t \t<a href=\"?orderBy=%s&sortedBy=%s&items_per_page=%s&in_trash=%s\"><i class=\"fa fa-sort%s\"></i></a>\n\t\t\t\t\t\t\t</th>', $name, $column, $sortedBy, $options['items_per_page'], $options['in_trash'], $type);\n\n\t}",
"function reOrderColumnHeaders() {\n\n }",
"protected function get_primary_column_name()\n {\n }",
"protected function get_primary_column_name()\n {\n }",
"protected function get_primary_column_name()\n {\n }",
"protected function get_sortable_columns()\n {\n }",
"protected function get_sortable_columns()\n {\n }",
"protected function get_sortable_columns()\n {\n }",
"public function ajaxList(Request $request){\n $primaryKey = 'id'; \n $columns = array(\n array( 'dt' => 0,\n 'formatter' => function( $d, $row ) {\n //return encrypt($row['id']);\n return $row['id'];\n }\n ),\n array(\n 'dbAlias' => 'customers',\n 'db' => 'reference',\n 'dt' => 1\n ),\n array(\n 'dbAlias' => 'customers',\n 'db' => 'first_name',\n 'dt' => 2\n ),\n array(\n 'dbAlias' => 'customers',\n 'db' => 'last_name',\n 'dt' => 3\n ),\n array(\n 'dbAlias' => 'customers',\n 'db' => 'account_number',\n 'dt' => 4\n ),\n array(\n 'dbAlias' => 'customers',\n 'db' => 'branch_code',\n 'dt' => 5\n ),\n array( 'db' => 'payment_date', 'dt' => 6 ),\n array( \n 'dt' => 7,\n 'formatter' => function($d,$row){\n $str = '<a href=\"#\" data-type=\"text\" data-pk=\"1\" data-name=\"recurring_amount\" class=\"editable editable-click editable-open\">'.$row['recurring_amount'].'</a>';\n return $str;\n } \n ),\n array( \n 'dt' => 8,\n 'formatter' => function($d,$row){\n $str = '<a href=\"#\" data-type=\"text\" data-pk=\"1\" data-name=\"once_off_amount\" class=\"editable editable-click editable-open\">'.$row['once_off_amount'].'</a>';\n return $str;\n } \n ),\n array(\n 'dbAlias' => 'customers',\n 'db' => 'service_type',\n 'dt' => 9\n ),\n array(\n \n 'dt' => 10,\n 'formatter' => function( $d, $row ) {\n return encrypt($row['id']);\n }\n ),\n );\n\n $firmId = auth()->user()->firm_id;\n \n $bindings=[$firmId,0];\n\n $whereConditions = \"customer_transaction.firm_id=? and customer_transaction.status=?\";\n $totalCount = DB::table('customer_transaction')\n ->selectRaw('count('.$primaryKey.') totCount')\n ->whereRaw($whereConditions, $bindings)\n ->get()\n ->toArray();\n\n $dtWhere=DatatableHelper::filter ( $request, $columns,$bindings);\n if($dtWhere!==\"\"){\n $whereConditions.=\" and \".$dtWhere;\n }\n $orderBy = DatatableHelper::order ( $request, $columns );\n $limit = DatatableHelper::limit ( $request, $columns );\n\n \n $data = DB::table('customer_transaction')\n ->selectRaw('customers.first_name,customers.last_name,customers.reference,customers.service_type,customers.account_number,customers.branch_code,customer_transaction.*')\n ->leftJoin('customers', function ($join) {\n $join->on('customers.id', '=', 'customer_transaction.customer_id');\n }) \n ->whereRaw($whereConditions, $bindings)\n ->orderByRaw($orderBy)\n ->offset(intval($request['start']))\n ->limit(intval($request['length']))\n ->get()\n ->toArray();\n\n $totalFilteredCount = DB::table('customer_transaction')\n ->selectRaw('count(customer_transaction.'.$primaryKey.') totCount, customer_transaction.'.$primaryKey)\n ->leftJoin('customers', function ($join) {\n $join->on('customers.id', '=', 'customer_transaction.customer_id');\n }) \n ->whereRaw($whereConditions, $bindings)\n ->get()\n ->toArray();\n \n \n echo json_encode(\n array(\n \"draw\" => isset ( $request['draw'] ) ?\n intval( $request['draw'] ) :\n 0,\n \"recordsTotal\"=> intval( $totalCount[0]->totCount ),\n \"recordsFiltered\" => intval( $totalFilteredCount[0]->totCount ),\n \"data\" => DatatableHelper::data_output( $columns, $data )\n )\n );\n die();\n }",
"public function sortField(): string\n {\n return $this->primaryKey;\n }",
"function units_sortable_columns( $columns ) {\n\n\t\t$columns['status'] = 'status';\n\n\t\treturn $columns;\n\t}",
"public function getSortedByColumnName()\n {\n return $this->tableSortedBy;\n }",
"function sl_shortlink_sortable_columns( $columns ) {\n\t$columns['hits'] = 'shortlink_hits';\n\treturn $columns;\n}",
"public function custom_shippify_order_column($columns){\n $columns['order-status'] = __( 'Shippify Order Status','woocommerce-shippify');\n return $columns;\n }",
"public function approvedronesTB(){\n // {\n // $query->select('id')\n // ->from('users')\n // ->whereRaw('drones.user_id = users.id')\n // ->where('approved', 1)->orWhere('roles_id', 4);\n // })\n // ->where('approved',0)->whereNotNull('model')->orderBy('id','desc')\n // ->get();\n\n $drones = DB::table('drones')\n ->join('users', 'drones.user_id', '=', 'users.id')\n ->join('perusahaan', 'perusahaan.id', '=', 'users.company')\n ->select('drones.id','drones.pic_of_drones','drones.model', 'users.nama','perusahaan.nama_perusahaan')\n ->where('drones.approved',0)->whereNotNull('drones.model')->whereNotNull('drones.pic_of_drones')->whereNotNull('drones.proof_of_ownership');\n //dd($drones);\n return Datatables::of($drones)\n ->addColumn('action', function ($datatb) {\n return\n '<a href=\"detail/drones/'.$datatb->id.'\" class=\"edit-modal btn btn-xs btn-info\"><i class=\"fa fa-edit\"></i> Details</a>';\n })\n ->addColumn('drones_image', function($datatb) {\n if ($datatb->pic_of_drones) {\n return '<a href=\"'.json_decode($datatb->pic_of_drones)->original.'\"><img src=\"'.json_decode($datatb->pic_of_drones)->resized.'\" alt=\"\" height=\"100px\"></a>';\n } else {\n return '';\n }\n })\n ->addIndexColumn()\n ->make(true);\n }",
"public function loadSortColumns()\n {\n add_filter( 'request', array( $this, 'sortColumns' ) );\n }",
"function feature_model_detail_list_table_visible_columns(String $table) {\n\n $model = $this->CI->grants->load_detail_model($table);\n\n $detail_list_table_visible_columns = [];\n \n if(method_exists($this->CI->$model,'detail_list_table_visible_columns') && \n is_array($this->CI->$model->detail_list_table_visible_columns())\n ){\n $detail_list_table_visible_columns = $this->CI->$model->detail_list_table_visible_columns();\n \n //Add the table id columns if does not exist in $columns\n if(is_array($detail_list_table_visible_columns) && \n !in_array($this->CI->grants->primary_key_field($table),$detail_list_table_visible_columns)){\n array_unshift($detail_list_table_visible_columns,$this->CI->grants->primary_key_field($table));\n }\n\n //Remove status and approval columns if the approveable item is not approveable\n if(!$this->CI->grants_model->approveable_item($table)) {\n $this->CI->grants->remove_mandatory_lookup_tables($detail_list_table_visible_columns,['status_name','approval_name']);\n }else{\n $this->CI->grants->add_mandatory_lookup_tables($detail_list_table_visible_columns,['status_name','approval_name']);\n }\n \n }\n \n return $detail_list_table_visible_columns;\n }",
"public function set_custom_columns_data( $column , $post_id )\n {\n $data = get_post_meta ( $post_id , '_mtk_testimonial_key' , true );\n\n /* Create the variables where we are going to sort the information */\n /* Author Name */\n $name = isset($data['name']) ? $data['name'] : '';\n /* Email */\n $email = isset($data['email']) ? $data['email'] : '';\n /* approved */\n $approved = ( isset($data['approved']) && ( $data['approved'] === 1 ) ) ? '<strong>YES</strong>' : 'NO';\n /* featured */\n $featured = ( isset($data['featured']) && ( $data['featured'] === 1 ) ) ? '<strong>YES</strong>' : 'NO';\n\n switch ( $column )\n {\n case 'name':\n echo '<strong>' . $name . '</strong><br /><a href=\"mailto:'. $email .'\">'. $email .'</a>';\n break;\n case 'approved':\n echo ($approved);\n break;\n case 'featured':\n echo ($featured);\n break;\n }\n }",
"public function get_sortable_columns()\r\n\t{\r\n\t\treturn [\r\n\t\t\t'name' => [ 'name', false ]\r\n\t\t];\r\n\t}",
"function dhali_sort_order_column( $columns ) {\n\n\t$columns['sort_order_column'] = __( 'Sort Order', 'dhali' );\n\treturn $columns;\n\n}"
] |
[
"0.5882058",
"0.5838682",
"0.58259183",
"0.5650482",
"0.5552866",
"0.5543188",
"0.54680985",
"0.532433",
"0.5267666",
"0.5254861",
"0.52284",
"0.52254254",
"0.5225326",
"0.52248526",
"0.52248526",
"0.51284754",
"0.512662",
"0.512662",
"0.51072484",
"0.50727755",
"0.50622827",
"0.50535506",
"0.50273323",
"0.50260514",
"0.50091696",
"0.4991341",
"0.49794197",
"0.49782792",
"0.49685338",
"0.4944445"
] |
0.6313637
|
0
|
Additional columns to be loaded for datatables.
|
public static function laratablesAdditionalColumns()
{
return ['status', 'id_card_verified'];
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function laratablesAdditionalColumns()\n\t\t{\n\t\t\treturn ['coa_name'];\n\t\t}",
"protected function loadColumns(){\n\t\t\t$this->columns = array_diff(\n\t\t\t\tarray_keys(get_class_vars($this->class)),\n\t\t\t\t$this->getIgnoreAttributes()\n\t\t\t);\n\t\t}",
"abstract public function loadColumns();",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"protected function initColumns()\n\t{\n\t\tif($this->columns===array())\n\t\t{\n\t\t\tif($this->dataProvider instanceof NActiveDataProvider)\n\t\t\t\t$this->columns=$this->dataProvider->model->attributeNames();\n\t\t\telse if($this->dataProvider instanceof IDataProvider)\n\t\t\t{\n\t\t\t\t// use the keys of the first row of data as the default columns\n\t\t\t\t$data=$this->dataProvider->getData();\n\t\t\t\tif(isset($data[0]) && is_array($data[0]))\n\t\t\t\t\t$this->columns=array_keys($data[0]);\n\t\t\t}\n\t\t}\n\t\t$id=$this->getId();\n\t\tforeach($this->columns as $i=>$column)\n\t\t{\n\t\t\tif ($column['name'] && (!isset($column['export']) || @$column['export']!=false)) {\n\t\t\t\tif(is_string($column))\n\t\t\t\t\t$column=$this->createDataColumn($column);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(!isset($column['class']))\n\t\t\t\t\t\t$column['class']='NDataColumn';\n\t\t\t\t\t$column=Yii::createComponent($column, $this);\n\t\t\t\t}\n\t\t\t\tif(!$column->visible)\n\t\t\t\t{\n\t\t\t\t\tunset($this->columns[$i]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif($column->id===null)\n\t\t\t\t\t$column->id=$id.'_c'.$i;\n\t\t\t\t$this->columns[$i]=$column;\n\t\t\t} else {\n\t\t\t\tunset($this->columns[$i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tforeach($this->columns as $column)\n\t\t\t\t$column->init();\n\t}",
"public function loadSortColumns()\n {\n add_filter( 'request', array( $this, 'sortColumns' ) );\n }",
"protected function load_col_info()\n {\n }",
"protected function initializeColumnMapping() {\n\t\t// add always available cols for filemetadata\n\t\tforeach ($this->metaColMapping as $damColName => $metaColName) {\n\t\t\t$this->columnMapping[$damColName] = $metaColName;\n\t\t}\n\n\t\t// add additional cols if ext:for filemetadata is installed\n\t\tif (ExtensionManagementUtility::isLoaded('filemetadata')) {\n\t\t\tforeach ($this->additionalMetaColMapping as $damColName => $metaColName) {\n\t\t\t\t$this->columnMapping[$damColName] = $metaColName;\n\t\t\t}\n\t\t}\n\t}",
"private function _setColumns()\n {\n $this->columns = new Pike_Grid_DataSource_Columns();\n\n foreach ($this->_query->getFields() as $field) {\n $this->columns->add($field, null, $field);\n }\n }",
"public function addColumns()\n {\n add_filter( 'manage_edit-' . $this->post_type . '_columns', array($this, 'editColumns') ) ; // Add or Remove a Column\n add_action( 'manage_' . $this->post_type . '_posts_custom_column', array($this, 'manageColumns') ); //Show and Modify Column Data\n add_filter( 'manage_edit-' . $this->post_type . '_sortable_columns', array($this, 'sortableColumns') ); // Flags sortable Columns\n add_action( 'load-edit.php', array($this, 'loadSortColumns') );\n }",
"function lookup_columns()\n {\n // Avoid doing multiple SHOW COLUMNS if we can help it\n $key = C_Photocrati_Transient_Manager::create_key('col_in_' . $this->get_table_name(), 'columns');\n $this->_table_columns = C_Photocrati_Transient_Manager::fetch($key, FALSE);\n if (!$this->_table_columns) {\n $this->object->update_columns_cache();\n }\n return $this->_table_columns;\n }",
"function get_columns() {\r\n return $columns= array(\r\n 'col_created_on'=>__('Date'),\r\n 'col_type'=>__('Type'),\r\n 'col_ip'=>__('IP'),\r\n 'col_os'=>__('Operating System'),\r\n 'col_browser'=>__('Browser'),\r\n 'col_location'=>__('Location'),\r\n 'col_actions'=>__('Actions')\r\n );\r\n }",
"protected function initColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n\n foreach ($this->columns as $i => $column) {\n if (is_string($column)) {\n $column = $this->createDataColumn($column);\n } else {\n $column = Yii::createObject(array_merge([\n 'class' => $this->dataColumnClass ?: DataColumn::className(),\n 'grid' => $this,\n ], $column));\n }\n if (!$column->visible) {\n unset($this->columns[$i]);\n $this->allColumns[$i] = $column;\n continue;\n }\n $this->columns[$i] = $column;\n $this->allColumns[$i] = $column;\n }\n }",
"protected function initColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n foreach ($this->columns as $i => $column) {\n if (is_string($column)) {\n $column = $this->createDataColumn($column);\n } else {\n $column = Yii::createObject(array_merge([\n 'class' => $this->dataColumnClass ?: DataColumn::className(),\n 'grid' => $this,\n ], $column));\n }\n if (!$column->visible) {\n unset($this->columns[$i]);\n continue;\n }\n $this->columns[$i] = $column;\n }\n }",
"function get_columns(){\n\t\treturn array('id' => 'ID', 'orderinfo' => 'Customer Information', 'company' => 'Company', 'transaction_id' => 'Paypal Transaction ID', 'email' => 'Email Address', 'expiration' => 'Access Expiration', 'accesstourlkey' => 'Order Access URLs', 'webinarpass' => 'Webinars Passkey', 'total' => 'Order Total');\n\t}",
"public function initialize_columns()\n {\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_LASTNAME));\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_FIRSTNAME));\n\n $showEmail = Configuration::getInstance()->get_setting(array('Chamilo\\Core\\User', 'show_email_addresses'));\n\n if($showEmail)\n {\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_EMAIL));\n }\n\n $this->add_column(new SortableStaticTableColumn('progress'));\n $this->add_column(new SortableStaticTableColumn('completed'));\n $this->add_column(new SortableStaticTableColumn('started'));\n\n if($this->getCurrentTreeNode()->supportsScore())\n {\n $this->add_column(new StaticTableColumn(self::COLUMN_LAST_SCORE));\n }\n }",
"private function load_columns_information() {\n $query = \"SELECT ordinal_position,\n column_name,\n data_type,\n is_nullable::boolean::integer\n FROM information_schema.columns\n WHERE table_schema = 'public'\n AND table_name = '{$this->get_table_name()}';\";\n $this->columns_information = DB::fetch_all($query);\n\n // Cria os campos da tabela no objeto corrente\n foreach($this->columns_information as $column) {\n $this->$column['column_name'] = null;\n $this->{'_' . $column['column_name']} = null;\n }\n }",
"protected function addColumns()\n {\n parent::addColumns();\n\n foreach ($this->config['fields'] as $key => $values) {\n\n switch ($values['type']) {\n case 'text':\n $this->table->addColumn($key, 'string', array('length' => 256, 'default' => ''));\n break;\n case 'textarea':\n case 'select':\n $this->table->addColumn($key, 'text', array('default' => ''));\n break;\n case 'checkbox':\n $this->table->addColumn($key, 'boolean', array('default' => 0));\n break;\n default:\n $this->table->addColumn($key, 'text', array('default' => ''));\n }\n\n }\n }",
"public static function getColumns()\n {\n return array('libraryId', 'signature', 'summary', 'status', 'userId');\n }",
"abstract public function tableColumns();",
"abstract public static function columnData();",
"public static function getColumns()\n {\n return array('title', 'bindingId', 'minYear', 'maxYear',\n 'preciseDate', 'placePublished', 'publisher', 'printVersion',\n 'firstPage', 'lastPage');\n }",
"private function initColumnArrays()\n {\n foreach ($this->columns as $key => $column) {\n $dql = $this->accessor->getValue($column, 'dql');\n $data = $this->accessor->getValue($column, 'data');\n\n $currentPart = $this->entityShortName;\n $currentAlias = $currentPart;\n $metadata = $this->metadata;\n\n if (true === $this->accessor->getValue($column, 'customDql')) {\n $columnAlias = str_replace('.', '_', $data);\n\n // Select\n $selectDql = preg_replace('/\\{([\\w]+)\\}/', '$1', $dql);\n $this->addSelectColumn(null, $selectDql.' '.$columnAlias);\n // Order on alias column name\n $this->addOrderColumn($column, null, $columnAlias);\n // Fix subqueries alias duplication\n $searchDql = preg_replace('/\\{([\\w]+)\\}/', '$1_search', $dql);\n $this->addSearchColumn($column, null, $searchDql);\n } elseif (true === $this->accessor->getValue($column, 'selectColumn')) {\n $parts = explode('.', $dql);\n\n while (count($parts) > 1) {\n $previousPart = $currentPart;\n $previousAlias = $currentAlias;\n\n $currentPart = array_shift($parts);\n $currentAlias = ($previousPart === $this->entityShortName ? '' : $previousPart.'_').$currentPart;\n\n if (!array_key_exists($previousAlias.'.'.$currentPart, $this->joins)) {\n $this->addJoin($previousAlias.'.'.$currentPart, $currentAlias, $this->accessor->getValue($column, 'joinType'));\n }\n\n $metadata = $this->setIdentifierFromAssociation($currentAlias, $currentPart, $metadata);\n }\n\n $this->addSelectColumn($currentAlias, $this->getIdentifier($metadata));\n $this->addSelectColumn($currentAlias, $parts[0]);\n $this->addSearchOrderColumn($column, $currentAlias, $parts[0]);\n } else {\n // Add Order-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'orderColumn') && true === $this->accessor->getValue($column, 'orderable')) {\n $orderColumn = $this->accessor->getValue($column, 'orderColumn');\n $orderParts = explode('.', $orderColumn);\n if (count($orderParts) < 2) {\n $orderColumn = $this->entityShortName.'.'.$orderColumn;\n }\n $this->orderColumns[] = $orderColumn;\n } else {\n $this->orderColumns[] = null;\n }\n\n // Add Search-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'searchColumn') && true === $this->accessor->getValue($column, 'searchable')) {\n $searchColumn = $this->accessor->getValue($column, 'searchColumn');\n $searchParts = explode('.', $searchColumn);\n if (count($searchParts) < 2) {\n $searchColumn = $this->entityShortName.'.'.$searchColumn;\n }\n $this->searchColumns[] = $searchColumn;\n } else {\n $this->searchColumns[] = null;\n }\n }\n }\n\n return $this;\n }",
"function get_columns( ) {\r\n\t\treturn self::mla_manage_columns_filter();\r\n\t}",
"public function getTableColumns()\n\t{\n\t}"
] |
[
"0.71819973",
"0.7153961",
"0.6938912",
"0.6901446",
"0.6901446",
"0.6901446",
"0.6901446",
"0.6899875",
"0.6899875",
"0.6826075",
"0.67785925",
"0.6743412",
"0.6719635",
"0.66889673",
"0.66668034",
"0.6617515",
"0.6600445",
"0.65730035",
"0.65610987",
"0.6545175",
"0.6536961",
"0.65221715",
"0.6504413",
"0.6492671",
"0.64913416",
"0.64854276",
"0.6458685",
"0.6442426",
"0.6438371",
"0.6434278"
] |
0.7305986
|
0
|
prepares optimize call to solr
|
private function prepareOptimize()
{
$cacheKey = 'NEXT_OPTIMIZE_ON_SOLR';
/** @var Carbon $nextOptimizeOnSolr */
$nextOptimizeOnSolr = $this->cache->get($cacheKey, Carbon::now());
// if cached value is too old, make it now
if ($nextOptimizeOnSolr->isPast()) {
$nextOptimizeOnSolr = Carbon::now();
}
// adding 2 minutes for next possible optimize
$nextOptimizeOnSolr->addMinutes(2);
// store until next optimize is possible
$this->cache->put($cacheKey, $nextOptimizeOnSolr, $nextOptimizeOnSolr);
$job = (new Optimize($cacheKey))
->delay($nextOptimizeOnSolr);
dispatch($job);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function _optimize() {}",
"public function optimize() {}",
"public function optimize();",
"public function optimize();",
"public function optimize()\n {\n $this->index->optimize();\n }",
"public function before_optimize() {\n\t\t$this->processed_trash_count = 0;\n\t\t$this->processed_akismet_count = 0;\n\t}",
"function solr_proxy_main() {\n $params = array();\n\tglobal $userdata;\n\n // The names of Solr parameters that may be specified multiple times.\n $multivalue_keys = array('bf', 'bq', 'facet.date', 'facet.date.other', 'facet.field', 'facet.query', 'fq', 'pf', 'qf');\n\n foreach ($_GET as $key => $value) {\n if (in_array($key, $multivalue_keys)) {\n $params[$key][] = $value;\n }\n elseif ($key == 'q') {\n $keys = $value;\n }\n else {\n $params[$key] = $value;\n }\n }\n\n $hour = (time() / (60 * 60)) % 24;\n $app = (($hour / 4) % 2) ? '/solr' : '/solralt';\n $transportInstance = new Apache_Solr_HttpTransport_Curl(array(CURLOPT_USERPWD => $userdata, CURLOPT_HTTPAUTH => CURLAUTH_ANY));\n $solr = new Apache_Solr_Service('localhost', 8080, $app, $transportInstance); \n\n var_dump($params);\n\n try {\n if(!isset($params['start'])) {\n $params['start'] = 0;\n }\n $response = $solr->search($keys, $params['start'], $params['rows'], $params);\n }\n catch (Exception $e) {\n die($e->__toString());\n }\n print $response->getRawResponse();\n}",
"public function optimizeIndex()\n {\n // either open or create the index\n $this->index = $this->openIndex(APPLICATION_PATH . '/data/search/jobs');\n $this->index->optimize();\n }",
"function opensky_islandora_solr_query_alter($qp) {\n // dsm('opensky_islandora_solr_query_alter');\n\n // if sort is not set for search pages, then set it to keyDate desc\n if (current_path() == ISLANDORA_SOLR_SEARCH_PATH && !isset($qp->solrParams['sort'])) {\n $qp->solrParams['sort'] = 'keyDate desc';\n }\n\n if (isset($qp->internalSolrParams['collection'])) {\n $collection = $qp->internalSolrParams['collection'];\n\n // create $fq_new by removing all RELS_EXT_isMemberOfCollection_uri_ms\n // clauses\n $fq_new = array();\n $pat = 'RELS_EXT_isMemberOfCollection_uri_ms';\n if (isset($qp->solrParams['fq'])) {\n $fq_old = $qp->solrParams['fq'];\n unset($qp->solrParams['fq']);\n foreach ($fq_old as $item) {\n if (substr($item, 0, strlen($pat)) !== $pat) {\n $fq_new[] = $item;\n }\n }\n }\n\n // construct a filter to search all searchable sub-collections (those\n // that have no sub-collections).\n $searchable_collections = opensky_get_searchable_subcollections($collection);\n\n $children_params = array();\n foreach ($searchable_collections as $searchable) {\n $children_params[] = 'RELS_EXT_isMemberOfCollection_uri_ms:\"info:fedora/'.$searchable.'\"';\n }\n\n $searchable_collection_clause = implode(' OR ', $children_params);\n\n $qp->solrParams['fq'] = array_merge($fq_new, array($searchable_collection_clause));\n // dsm($qp->solrParams);\n }\n}",
"function ctools_context_create_solrquery($empty, $data = NULL, $conf = FALSE) {\n $context = new ctools_context('solrquery');\n $context->plugin = 'solrquery';\n\n if ($empty) {\n return $context;\n }\n \n $keys = ''; \n \n if (!empty($data['keys'])) {\n $keys = $data['keys'];\n } \n \n $filters = '';\n \n if ($data['queryvalues'] && !empty($_REQUEST['filters'])) {\n $filters = $_REQUEST['filters'];\n }\n\n $solrsort = '';\n\n if ($data['queryvalues'] && !empty($_REQUEST['solrsort'])) {\n $solrsort = $_REQUEST['solrsort'];\n }\n \n $base_path = $_GET['q'];\n \n if (!empty($data['base_path'])) {\n $base_path = $data['base_path'];\n }\n\n $page = 0;\n\n if ($_GET['page']) {\n $page = $_GET['page'];\n }\n\n $params = array();\n\n $params += apachesolr_search_basic_params($current_query);\n\n if ($keys) {\n $params += apachesolr_search_highlighting_params($current_query);\n $params += apachesolr_search_spellcheck_params($current_query);\n }\n else {\n // No highlighting, use the teaser as a snippet.\n $params['fl'] .= ',teaser';\n }\n\n if (module_exists('upload')) {\n $params['fl'] .= ',is_upload_count';\n }\n \n $current_query = apachesolr_drupal_query($keys, $filters, $solrsort, $base_path);\n\n apachesolr_search_add_facet_params($params, $current_query);\n apachesolr_search_add_boost_params($params, $current_query, apachesolr_get_solr()); \n \n if ($data !== FALSE ) {\n $context->data = (object) array('query' => $current_query, 'params' => $params);\n $context->title = check_plain('Apache Solr query');\n return $context;\n }\n \n}",
"private function layeredSearch(): void\n {\n $this->setLimitAndOffset();\n $needles = $this->getNeedlesForPage();\n foreach ($this->layers as $Layer) {\n $Layer->quick_search = $this->config->quick_search;\n $Layer->resetNeedles();\n $Layer->searchAllNeedles($needles, $this->search_key);\n $needles = $Layer->getNeedles();\n }\n $this->saveNeedlesForPage($needles);\n }",
"public function execute()\n\t{\n\t\t$searchQuery = $this->searchPhrase ? '\"' . $this->searchPhrase . '\"' : '';\n\t\t$queryParams['attributesToRetrieve']\t= '*';\n\t\t$queryParams['maxValuesPerFacet']\t\t= '100';\n\t\t$queryParams['attributesToHighlight']\t= array();\n\t\t$queryParams['filters']\t\t\t\t\t= $this->filters;\n\t\t$queryParams['facetFilters']\t\t\t= $this->facetFilters;\n\t\t$queryParams['offset']\t\t\t\t\t= $this->start;\n\t\t$queryParams['length']\t\t\t\t\t= $this->limit;\n\n\t\t$queryParams['facets']\t\t\t\t\t= array($this->facetField);\n\n\t\t// We need to pass this query by setRawQueryParams for advsearch frontent.\n\t\t$queryParams['advancedSyntax']\t\t\t= 'true';\n\n\t\tif (count($this->rawQueryParams))\n\t\t{\n\t\t\t$queryParams = array_merge($queryParams, $this->rawQueryParams);\n\t\t}\n\n\t\t// This is something Juggad related to Osianama requirement.\n\t\tif (isset($queryParams['restrictSearchableAttributes']))\n\t\t{\n\t\t\t$searchQuery = $this->searchPhrase ? $this->searchPhrase : '';\n\t\t}\n\n\t\t$Data = $this->algoliaIndex->search($searchQuery, $queryParams);\n\n\t\tif (count($Data['hits']) > 0)\n\t\t{\n\t\t\t$this->total\t= $Data['nbHits'];\n\t\t\t$this->count\t= $Data['hitsPerPage'];\n\t\t\t$this->records\t= '';\n\n\t\t\tforeach ($Data['hits'] as $key => $row)\n\t\t\t{\n\t\t\t\tunset($row['_highlightResult']);\n\n\t\t\t\t$row['id']\t\t\t\t\t\t= $row['objectID'];\n\t\t\t\t$this->records['data'][$key]\t= (object) $row;\n\t\t\t}\n\n\t\t\tif ($this->facetField)\n\t\t\t{\n\t\t\t\t$this->records['facets'] = $Data['facets'];\n\t\t\t}\n\t\t}\n\t}",
"function processQuery($query,$include,$domain,$port,$core,$limit)\n{\n require_once($include);\n $results=\"\";\n $solr = new Apache_Solr_Service($domain, $port, $core);\n echo $solr;\n if (get_magic_quotes_gpc() == 1)\n {\n $query = stripslashes($query);\n\n }\n try\n {\n if($ranking == \"solr\")\n {\n $results = $solr->search($query, 0, $limit);\n echo $results;\n }\n else if($ranking == \"PageRank\")\n $results = $solr->search($query, 0, $limit, $additionalParameters);\n }\n \n catch (Exception $e)\n {\n die(\"<html><head><title>SEARCH EXCEPTION</title><body><pre>{$e->__toString()}</pre></body></html>\");\n }\n}",
"public function preProcess()\r\n\t{\t\t\r\n\t\tif(!Module::isInstalled('agilesearchbyzipcode'))return parent::preProcess();\r\n\t\tif(Tools::getValue('is_zipcode_search') != 1)return parent::preProcess();\r\n\r\n\t\t$this->productSort();\r\n\t\t$this->n = abs((int)(Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE'))));\r\n\t\t$this->p = abs((int)(Tools::getValue('p', 1)));\r\n \r\n $centerLat = Tools::getValue('asbz_centerLat');\r\n $centerLng = Tools::getValue('asbz_centerLng');\r\n $search_scope = Configuration::get('ASBZ_SEARCH_SCOPE');\r\n \r\n include_once(dirname(__FILE__) . \"/../../modules/agilesearchbyzipcode/ProdLocation.php\");\r\n $products = ProdLocation::searchProducts(self::$cookie->id_lang,$centerLat,$centerLng,$search_scope,Tools::getValue('orderby'),Tools::getValue('orderway'));\r\n\t\t$nbProducts = count($products);\r\n\t\t$this->pagination($nbProducts);\r\n\t\tself::$smarty->assign(array(\r\n\t\t'search_products' => $products,\r\n\t\t'nbProducts' => $nbProducts,\r\n\t\t'search_tag' => '',\r\n\t\t'search_query' => Tools::getValue('asbz_zipcode'),\r\n\t\t'ref' =>'',\r\n\t\t'search_zipcode' => Tools::getValue('asbz_zipcode'),\r\n\t\t'homeSize' => Image::getSize('home')));\r\n\t\tself::$smarty->assign('add_prod_display', Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'));\r\n\t}",
"function optimizeDatabase() {}",
"protected function start_bulk_operation() {\n\t\t// Disable term count updates for speed\n\t\twp_defer_term_counting( true );\n\t}",
"public function execute()\n\t{\n\t\t$queryUrl = $this->buildQueryUrl();\n\t\t$storeId = $this->getParam('storeid');\n\t\t$arguments = array(\n\t\t\t\t'json.nl' => 'map',\n\t\t\t\t'rows' => $this->rows,\n\t\t\t\t'start' => $this->start,\n\t\t\t\t'fl' => @implode(',', $this->fieldList),\n\t\t\t\t'qf' => $this->queryFields,\n\t\t\t\t'spellcheck' => 'true',\n\t\t\t\t'spellcheck.collate' => 'true',\n\t\t\t\t'facet' => 'true',\n\t\t\t\t'facet.mincount' => 1,\n\t\t\t\t'facet.limit' => $this->facetLimit,\n\t\t\t\t'timestamp' => time(),\n\t\t\t\t'mm' => $this->mm,\n\t\t\t\t'defType'=> 'edismax',\n\t\t\t\t'wt'=> 'json',\n\t\t);\n\n\t\t$resultSet = $this->doRequest($queryUrl, $arguments, 'array');\n\n\t\tif (isset($resultSet['response']['numFound']) && intval($resultSet['response']['numFound']) > 0)\n\t\t{\n\t\t\treturn $resultSet;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$queryText = $this->getQueryText();\n\t\t\tif (isset($resultSet['spellcheck']['suggestions']['collation']))\n\t\t\t{\n\t\t\t\t$queryText = strtolower($resultSet['spellcheck']['suggestions']['collation']);\n\t\t\t}\n\n\t\t\tif (!empty($queryText))\n\t\t\t{\n\t\t\t\t$this->queryText = $queryText;\n\t\t\t\t$queryUrl = $this->buildQueryUrl();\n\t\t\t\t$arguments['mm'] = '0%';\n\n\t\t\t\t$resultSet = $this->doRequest($queryUrl, $arguments, 'array');\n\t\t\t}\n\t\t}\n\t\treturn $resultSet;\n\t}",
"protected function start_bulk_operation() {\n\n\t\t// Disable term count updates for speed\n\t\twp_defer_term_counting( true );\n\t}",
"public function apply() {\n\t\t$prepLookup = clone $this->oLookup;\n\n\t\t$size = $this->oLookup->getSize();\n\n\t\t// Prepare preprocessor query\n\t\t$prepLookup->setSize( $size );\n\t\t$prepLookup->clearSourceField();\n\t\t$prepLookup->addSourceField( 'basename' );\n\t\t$prepLookup->addSourceField( 'namespace' );\n\t\t$prepLookup->addSourceField( 'prefixed_title' );\n\n\t\t$excludes = [];\n\n\t\t$this->getExcludesForCurrentPage( $prepLookup, $size, $excludes );\n\n\t\tif ( empty( $excludes ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add result _ids to exclude from the search\n\t\t$this->oLookup->addBoolMustNotTerms( '_id', $excludes );\n\t}",
"abstract public function installSolr();",
"public function apply_sitemap_optimisations() {\n\n\t\t\\add_filter(\n\t\t\t'wpseo_sitemap_entries_per_page',\n\t\t\tfunction( $per_page ) {\n\t\t\t\treturn self::SITEMAP_POSTS_PER_PAGE;\n\t\t\t}\n\t\t);\n\n\t}",
"private function generate_solr_cache()\r\n\t{\r\n\t\tfile_put_contents($this->solr_cache_file, $this->solr_stream);\r\n\t}",
"function __processDocument() {\n\t\t$document = new Apache_Solr_Document;\n\t\tif ($this->settings[$this->model->alias]['boost']) {\n\t\t\t$document->setBoost($this->settings[$this->model->alias]['boost']);\n\t\t}\n\t\tforeach ($this->model->data as $alias => $data) {\n\t\t\tif ($alias === $this->model->alias) {\n\t\t\t\t$document = $this->__processDocumentFieldArray($document, $data);\n\t\t\t} elseif (in_array($alias, $this->settings[$this->model->alias]['include'])) {\n\t\t\t\t$field = $alias . $this->__fieldTypeMappingTable['relations'];\n\t\t\t\t$document = $this->__processDocumentRelationalFieldArray($document, $field, $data);\n\t\t\t}\n\t\t}\n\t\t$document->setField($this->__fieldModelAlias, $this->model->alias);\n\t\t$document->setField('id', $this->__createDocId());\n\t\treturn $document;\n\t}",
"private function makeQueryNoSplit(){\n\t\t\n\t\t$this->searchQ['select'] = array('l.name','l.summary','l.sum_approach','l.sum_problems','l.address_line_1','l.address_line_2','l.town','l.county','l.postcode','l.country','l.phone','l.image','l.latitude','l.longitude','l.publish_address','l.publish_phone','l.approved','p.uri','p.urlname','e.level','y.listing_type');\n\t\t$this->searchQ['orderby'][] = 'l.level_id DESC';\n\t\t$this->searchQ['from'] = 'listing l, listing_level e, listing_type y, pages p'; //should always be the same...\n\t\t$this->searchQ['where'] = array('e.level_id = l.level_id','y.listing_type_id = l.listing_type_id','l.page_id = p.page_id','l.publish = 1');//,'p.publish = 1');\n\t\t\n\t\t// set up the initial search variables\t\t\n\t\t//! location\n\t\tif( strlen($this->vars['location']) ){\n\t\t\n\t\t\t$this->Geocode = new Geolocation( $this->vars['location']. ', UK' );\n\t\t\t$this->Geocode->lookup();\n\t\t\t// using the OS grid as makes calculation simpler than using lng/lat - can use simple pythag rather than calculus functions\n\t\t\t// we shorten the list of rows needing the calculation by the greater / less than in the where\n\t\t\t\n\t\t\t$calculation = ' SQRT(POW(( l.easting - ' . round($this->Geocode->getOSEast()) . '),2) + POW((l.northing - ' . round($this->Geocode->getOSNorth()) . '),2)) ';\n\t\t\t$this->searchQ['select'][] = $calculation . \" AS distance\";\n\t\t\t$this->searchQ['where'][] = \"northing < \" . round( $this->Geocode->getOSNorth() + $this->searchDistance ) ; \n\t\t\t$this->searchQ['where'][] = \"northing > \" . round( $this->Geocode->getOSNorth() - $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting < \" . round( $this->Geocode->getOSEast() + $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting > \" . round( $this->Geocode->getOSEast() - $this->searchDistance ) ;\n\t\t//\t$this->searchQ['where'][] = \"(\" . $calculation . \") <= \" . $this->searchDistance ;\n\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"distance <= \" . $this->searchDistance;\n\t\t\t$this->searchQ['orderby'][] = 'distance ASC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! freetext\n\t\tif( strlen($this->vars['term']) ){\n\t\t\t$this->searchQ['select'][] = \"MATCH(\" . $this->ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE) AS score\";\n\t\t\t//$this->searchQ['where'][] = \"MATCH(\" . $ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE)\";\n\t\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"score > 0\";\n\t\t\t$this->searchQ['orderby'][] = 'score DESC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t\n\t\t//! **** FILTERS ****\n\t\t//! profession\n\t\tif( isset($this->vars['profession']) && strlen($this->vars['profession']) ){\n\t\t\n\t\t\t//$this->searchQ['where'][] = \" l.listing_type_id IN (\" . implode(',', $this->vars['profession']) . \") \";\n\t\t\t$this->searchQ['where'][] = \" l.listing_type_id = \" . (int)$this->vars['profession'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! max price\n\t\tif( isset($this->vars['maxprice']) && is_numeric($this->vars['maxprice']) ){\n\t\t\n\t\t\t$this->searchQ['where'][] = \" l.hourly_rate <= \" . (int)$this->vars['maxprice'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! gender\n\t\tif( isset($this->vars['gender']) && in_array($this->vars['gender'] , array('M','F')) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_gender ltg';\n\t\t\t$this->searchQ['where'][] = \" ltg.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltg.gender = '\" . $this->vars['gender'] . \"' \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\n\t\t//! speciality\n\t\tif( isset($this->vars['speciality']) && is_numeric($this->vars['speciality']) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_age ltag';\n\t\t\t$this->searchQ['where'][] = \" ltag.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltag.age_id = \" . (int)$this->vars['speciality'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! ** build the query **\n\t\t$q = \"SELECT \" . (($this->numRows)?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $this->searchQ['select']). \"\n\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\tWHERE\n\t\t\t\t\t\" . implode(' AND ', $this->searchQ['where']) ;\n\t\t\t\t\t\n\t\tif( isset($this->searchQ['having']) && count($this->searchQ['having']) ){\n\t\t\t$q .= \" HAVING \" . implode(' AND ' , $this->searchQ['having']);\n\t\t}\n\t\t\n\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\n\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \"; \n\t\t\t\n\t\treturn $q;\n\t\t\n\t}",
"function opensky_islandora_solr_query($islandora_solr_query) {\n // dpm ('opensky_islandora_solr_query');\n // dpm ($islandora_solr_query);\n\n $islandora_solr_query->solrParams['fl'] = 'PID,mods*,fgs*,dc.*,dsmd_DC*,keyDate*,RELS_EXT*,*Display*,fedora_datastreams_ms';\n\n}",
"public function bulkOptimize() {\n\n\t\t// check if engine is selected\n\t\tif(!isset($this->configData['optBulkEngine'])) {\n\t\t\t$this->log->save('No engine selected (bulk).');\n\t\t\t$status = array(\n\t\t\t\t'error' => 'No engine selected.',\n\t\t\t\t'numImages' => 0\n\t\t\t);\n\t\t\theader('Content-Type: application/json');\n\t\t\techo json_encode($status);\n\t\t\texit(0);\n\t\t}\n\n\t\t$processOriginals = isset($this->configData['optBulkAction']) && in_array('optimize_originals', $this->configData['optBulkAction']);\n\t\t$processVariations = isset($this->configData['optBulkAction']) && in_array('optimize_variations', $this->configData['optBulkAction']);\n\n\t\t// get all fields of type FieldtypeImage or FieldtypeCroppableImage3\n\t\t$selector = 'type=FieldtypeImage';\n\t\tif(wire('modules')->isInstalled('FieldtypeCroppableImage3')) $selector .= '|FieldtypeCroppableImage3';\n\t\t$imageFields = wire('fields')->find($selector);\n\n\t\t// get total number of pages with images\n\t\t$numPagesWithImages = 0;\n\t\tforeach ($imageFields as $f) $numPagesWithImages += wire('pages')->count(\"$f>0, include=all\");\n\n\t\t$allImages = array();\n\t\t$limit = 1;\n\t\t$start = abs((int) wire('input')->get('start'));\n\t\tif($start >= $numPagesWithImages) $start = $numPagesWithImages;\n\n\t\t// get all images from pages that have image fields\n\t\tforeach ($imageFields as $f) {\n\t\t\tforeach (wire('pages')->find(\"$f>0, include=all, start=$start, limit=$limit\") as $p) {\n\t\t\t\t$images = $p->getUnformatted($f->name);\n\t\t\t\t$id = $p->id;\n\t\t\t\t$filesArray = false;\n\n\t\t\t\tforeach ($images as $i) {\n\t\t\t\t\tif($processOriginals) $allImages[] = \"$id,{$i->basename}\";\n\n\t\t\t\t\tif($processVariations) {\n\n\t\t\t\t\t\t// create array of files in pagefiles folder eg. /site/assest/files/1234/\n\t\t\t\t\t\tif($filesArray === false) {\n\t\t\t\t\t\t\t$filesArray = array_diff(@scandir($i->pagefiles->path), array('.', '..', $i->basename)); // array_diff removes ., .. and self\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// iterate over array of files and check if file is variation of current image\n\t\t\t\t\t\tforeach($filesArray as $file) {\n\t\t\t\t\t\t\tif($this->isVariation($i->basename, $file)) $allImages[] = \"$id,$file\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$totalImages = count($allImages);\n\t\t$a = array();\n\t\tif($start < $numPagesWithImages) {\n\t\t\t$a[\"counter\"] =\tsprintf($this->_('Processing page %1$d out of %2$d - {%3$d}%% complete'), // {} is placeholder, must be present\n\t\t\t\t\t\t\t\t\t\t\t$start+1, $numPagesWithImages, (int) ($start / $numPagesWithImages * 100));\n\t\t} else {\n\t\t\t$a[\"counter\"] =\tsprintf($this->_('All done - {100}%% complete'));\n\t\t}\n\t\t$a[\"numBatches\"] = $numPagesWithImages;\n\t\t$a[\"numImages\"] = $totalImages;\n\t\t$a[\"images\"] = $allImages;\n\t\theader('Content-Type: application/json');\n\t\techo json_encode($a);\n\t\texit(0);\n\n\t}",
"public function query() {\n if ($this->get_option('geocluster_enabled')) {\n if ($algorithm = geocluster_init_algorithm($this->config)) {\n $algorithm->pre_execute();\n }\n }\n }",
"function v_quick_search($surveyid=NULL,$limit=50,$offset=0)\n\t{\n\t\t//get a select query instance\n\t\t$query = $this->solr_client->createSelect();\n\n\t\t//set Edismax\n\t\t$edismax = $query->getEDisMax();\n\n\n\t\t$query->setFields(array(\n\t\t\t\t'vid',\n\t\t\t\t'labl',\n\t\t\t\t'name'\n\t\t\t));\n\n\t\t//set a query (all prices starting from 12)\n\t\t$query->setQuery(sprintf('doctype:2 AND labl:(%s) AND sid:(%s)',$this->study_keywords, $surveyid ) );\n\t\t$query->setStart(0)->setRows(100); //get 0-100 rows\n\n\t\tif($this->debug){\n\t\t\t$request = $this->solr_client->createRequest($query);\n\t\t\techo 'Request URI: ' . $request->getUri() . '<br/>';\n\t\t}\n\n\t\t//execute search\n\t\t$resultset = $this->solr_client->select($query);\n\n\t\t//get the total number of documents found by solr\n\t\t$this->search_found_rows=$resultset->getNumFound();\n\n\t\t//get search result as array\n\t\t$this->search_result=$resultset->getData();\n\t\treturn $this->search_result['response']['docs'];\n\t}",
"function mapreduceQuery()\n {\n\n }",
"function get_resource_SOLR($field,$desc)\n#############################\n# \n# returns the resource from the descritpor\n#\n{\n $solr_collection='zbw_stw';\n if (($SOLRCLIENT = init_SOLRCLIENT($solr_collection,'solr_index_skos_namespaces system error init SOLRCLIENT')))\n {\n // get a select query instance\n $query = $SOLRCLIENT->createSelect();\n //$query->setQuery((\"id%3A$desc\"));\n $query->createFilterQuery($field)->setQuery($desc);\n \n // set start and rows param (comparable to SQL limit) using fluent interface\n $query->setStart(0)->setRows(500); // one should be enough\n\n // set fields to fetch (this overrides the default setting 'all fields')\n // $query->setFields(array('id','name','price'));\n\n // sort the results by price ascending\n //$query->addSort('price', Solarium_Query_Select::SORT_ASC);\n\n // this executes the query and returns the result\n $resultset = $SOLRCLIENT->select($query);\n $noofresults=$resultset->getNumFound();\n if ($noofresults > 1) print \"Descriptor Query returns more than one element ($noofresults)\";\n //var_dump($resultset);\n // display the total number of documents found by solr\n $returndocument=array();\n // show documents using the resultset iterator\n foreach ($resultset as $document) \n {\n // the documents are also iterable, to get all fields\n foreach($document AS $field => $value)\n {\n // this converts multivalue fields to a comma-separated string\n if(is_array($value)) $value = implode(', ', $value);\n $returndocument[]=array($field,$value);\n }\n }\n \n }\n\treturn $returndocument;\n}"
] |
[
"0.68356603",
"0.6652448",
"0.66358936",
"0.66358936",
"0.6621075",
"0.6286711",
"0.6136164",
"0.5977733",
"0.5779549",
"0.5597144",
"0.54498565",
"0.5429893",
"0.5410246",
"0.54018885",
"0.53015584",
"0.53006524",
"0.5295529",
"0.52926785",
"0.5279336",
"0.52527595",
"0.5221575",
"0.51674837",
"0.51085484",
"0.5078058",
"0.50761914",
"0.5073027",
"0.5054238",
"0.50517684",
"0.5049612",
"0.50343376"
] |
0.695705
|
0
|
Get the value of idComment
|
public function getIdComment()
{
return $this->idComment;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getId()\n {\n return $this->_commentId;\n }",
"public function getCommentId() {\n\t\treturn ($this->commentId);\n\t}",
"public function getCommentId()\n {\n return $this->comment_id;\n }",
"public function getCommentID()\n {\n return $this->commentID;\n }",
"public function getCommentId()\n {\n return $this->_getValue('oepaypal_commentid');\n }",
"private function _GetCommentByPostedId()\n {\n global $DB;\n if($cid = Is_Valid_Number(GetVar('cid', 0, 'whole_number'),0,1,99999999))\n {\n $DB->result_type = MYSQL_ASSOC;\n $c_arr = $DB->query_first('SELECT * FROM {comments} WHERE commentid = %d LIMIT 1', $cid);\n return $c_arr;\n }\n return false;\n }",
"function get_comment_ID()\n {\n }",
"public function id(): int\n {\n return $this->comment->id;\n }",
"public function getCommentId(): Uuid {\n\t\treturn ($this->commentId);\n\t}",
"function getComment() {\n return DataObjectPool::get($this->getAdditionalProperty('comment_type'), $this->getAdditionalProperty('comment_id'));\n }",
"public function getIdCommentaire()\n {\n return $this->Id_commentaire;\n }",
"function getIdCommentaire() {\n return $this->idCommentaire;\n }",
"public function getComment()\n {\n $value = $this->get(self::comment);\n return $value === null ? (string)$value : $value;\n }",
"function get_single_comment($comment_id) {\n global $db;\n $query = 'SELECT * FROM comments \n WHERE comment_id = :comment_id';\n $statement = $db->prepare($query);\n $statement->bindValue(':comment_id', $comment_id);\n $statement->execute();\n $comment = $statement->fetch();\n $statement->closeCursor();\n return $comment;\n }",
"public function getComment()\n {\n $value = $this->get(self::COMMENT);\n return $value === null ? (string)$value : $value;\n }",
"public function getCommentPostId() {\n\t\treturn ($this->commentPostId);\n\t}",
"public function getID(): string {\n\t\treturn 'comments';\n\t}",
"function get_instance_comment($cId) \n {\n return $this->instance->get_instance_comment($cId);\n }",
"function get_comment() {\n\t\treturn $this->comment;\n\t}",
"public function get_comment()\n\t{\n\t\treturn $this->comment;\n\t}",
"function getCommentData($comid)\n{\n\t$sql = \"SELECT * FROM comments WHERE commentID =\".$comid;\n\t$result = mysql_query($sql);\n \t$comment = mysql_fetch_array($result);\n \treturn $comment;\n}",
"public function getComment($idComment)\n\t{\t\n\t\t$req=$this->_bdd->query('SELECT id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users AS idUser, id_post AS idPost, moderate FROM Comments WHERE id='.$idComment);\n\t\t//die(var_dump($idComment));\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$comment=new Comments($datas);\n\t\t}\n\t\treturn $comment;\n\t}",
"public function get_comment_id( $retval, $comment ) {\n\t\t$this->comment_id = $comment->comment_ID;\n\t\treturn $retval;\n\t}",
"function get_post_ID() {\n\t\treturn $this->get_data( 'comment_post_ID' );\n\t}",
"public function getComment()\r\n {\r\n return $this->comment;\r\n }",
"public function getComment();",
"public function getComment();",
"public function getComment();",
"public function getComment();",
"public function getComment();"
] |
[
"0.77629614",
"0.7647409",
"0.7621724",
"0.75461257",
"0.74374074",
"0.7299962",
"0.72960067",
"0.7252211",
"0.7140838",
"0.7090016",
"0.69937277",
"0.69281614",
"0.68813413",
"0.6874812",
"0.67452264",
"0.67139757",
"0.6666918",
"0.6629133",
"0.6615956",
"0.66136724",
"0.6597896",
"0.65571856",
"0.65361047",
"0.65246403",
"0.647799",
"0.64763635",
"0.64763635",
"0.64763635",
"0.64763635",
"0.64763635"
] |
0.78875077
|
1
|
Get the value of commentTitle
|
public function getCommentTitle()
{
return $this->commentTitle;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function title() { \n $title = $this->content()->get('title');\n if($title != '') {\n return $title;\n } else {\n $title->value = $this->uid();\n return $title;\n }\n }",
"public function getTitle()\n {\n if (!isset($this->_title)) {\n $this->_title = \"\";\n if (preg_match('/(?:\\/\\*\\*|^)[\\s\\*\\r\\f\\n]*(\\S.*?)[\\r\\f\\n]/', $this->getPageComment(), $match)) {\n $this->_title = trim($match[1]);\n }\n }\n return $this->_title;\n }",
"public function getTitle()\n {\n return $this->data['fields']['title'];\n }",
"public function getTitle()\n {\n return $this->getValue('title');\n }",
"public function getTitle()\n {\n return $this->getData('title');\n }",
"public function getTitle()\n {\n return $this->getValue();\n }",
"public function getTitle()\n {\n return $this->getData(self::TITLE);\n }",
"public function get_title () {\r\n\t\treturn $this->get_info()['title'];\r\n\t}",
"public function getTitle() {\n\t\t$field = $this->getTitleField();\n\t\treturn $field ? $field->getValue() : '';\n\t}",
"public function getTitle()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn '';\n\t\t\t\n\t\t\tif(!array_key_exists('title', $this->data))\n\t\t\t\treturn '';\n\t\t\t\n\t\t\treturn $this->data['title'];\n\t\t}",
"public function getTitle()\n {\n return $this->formattedData['title'];\n }",
"public function getTitle()\n {\n return $this['title'];\n }",
"public function getTitle()\n\t{\n\t\t$content = $this->getContent();\n\t\treturn $content->title;\n\t}",
"public function getTitle()\r\n {\r\n return $this->m_title;\r\n }",
"public function get_title()\n\t{\n\t\treturn $this->title;\n\t}",
"public function getTitle() {\r\n\t\treturn $this->title;\r\n\t}",
"public function getTitle() {\n\t\treturn $this->title;\t\n\t}",
"public function getTitle() {\r\n\t\treturn $this->_title;\r\n\t}",
"public function getTitle() {\n\t\treturn $this->title;\n\t}",
"public function getTitle() {\n\t\treturn $this->title;\n\t}",
"public function getTitle() {\n\t\treturn $this->title;\n\t}",
"public function getTitle() {\n\t\treturn $this->title;\n\t}",
"public function getTitle()\n {\n return $this->_getNodeAsText('title');\n }",
"public function getTitle(){\r\n\t\t\treturn $this->title;\r\n\t\t}",
"public function getTitle(){\n\t\t\treturn $this->title;\n\t\t}",
"public function getTitle() {\n\t\treturn $this->_title;\n\t}",
"public function getTitleText()\n {\n return $this->title->nodeValue;\n }",
"public function getTitle() {\r\n return $this->_title;\r\n }",
"public function getTitle(){\r\n\t\treturn $this->title;\r\n\t}",
"public function getTitle()\r\n {\r\n return $this->title;\r\n }"
] |
[
"0.7487197",
"0.7468829",
"0.74534893",
"0.74098784",
"0.72647816",
"0.7253575",
"0.72442836",
"0.72433007",
"0.7241647",
"0.7202421",
"0.71797794",
"0.71767336",
"0.7175112",
"0.7175071",
"0.7156923",
"0.7148174",
"0.7133329",
"0.7130334",
"0.71272916",
"0.71272916",
"0.71272916",
"0.71272916",
"0.71152484",
"0.71092516",
"0.71060437",
"0.7096302",
"0.7089446",
"0.70890564",
"0.708869",
"0.7087973"
] |
0.8281304
|
0
|
Get the value of commentContent
|
public function getCommentContent()
{
return $this->commentContent;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getCommentContent(): string {\n\t\treturn ($this->commentContent);\n\t}",
"function get_content() {\n\t\treturn $this->get_data( 'comment_content' );\n\t}",
"public function getCommentText() {\n\t\treturn $this->commentText;\n\t}",
"public function getCommentText()\n {\n return $this->commentText;\n }",
"public function getComment()\n {\n $value = $this->get(self::comment);\n return $value === null ? (string)$value : $value;\n }",
"public function getComment()\n {\n $value = $this->get(self::COMMENT);\n return $value === null ? (string)$value : $value;\n }",
"public function getCommentTxt()\n {\n return $this->commentTxt;\n }",
"public function getValue(){\n return $this->_content;\n }",
"function getComment() {\n return DataObjectPool::get($this->getAdditionalProperty('comment_type'), $this->getAdditionalProperty('comment_id'));\n }",
"public function comment() {\n\t\treturn $this->comment;\n\t}",
"function get_comment() {\n\t\treturn $this->comment;\n\t}",
"public function getComment()\r\n {\r\n return $this->comment;\r\n }",
"public function get_comment()\n\t{\n\t\treturn $this->comment;\n\t}",
"public function getComment()\n {\n return $this->comment;\n }",
"public function getComment()\n {\n return $this->comment;\n }",
"public function getComment()\n {\n return $this->comment;\n }",
"public function getComment()\n {\n return $this->comment;\n }",
"public function getComment()\n {\n return $this->comment;\n }",
"public function getComment()\n {\n return $this->comment;\n }",
"public function getComment()\n {\n return $this->comment;\n }",
"public function getComment();",
"public function getComment();",
"public function getComment();",
"public function getComment();",
"public function getComment();",
"public function getComment();",
"public function getComment() {\n return $this->comment;\n }",
"public function getComment()\n { \n return $this->comment;\n }",
"public function getComment()\n {\n return $this->_comment;\n }",
"public function getComment() {}"
] |
[
"0.83538353",
"0.8313828",
"0.74351543",
"0.7423645",
"0.7409425",
"0.73491067",
"0.72722405",
"0.72394246",
"0.7126029",
"0.7066186",
"0.70327747",
"0.69928706",
"0.69481915",
"0.69407284",
"0.69407284",
"0.69407284",
"0.69407284",
"0.69407284",
"0.69407284",
"0.69407284",
"0.69208324",
"0.69208324",
"0.69208324",
"0.69208324",
"0.69208324",
"0.69208324",
"0.69205624",
"0.6913611",
"0.68950546",
"0.6870824"
] |
0.8370874
|
0
|
Get the value of idRecipe
|
public function getIdRecipe()
{
return $this->idRecipe;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getIdRecipe() {\n return $this->id_recipe;\n }",
"function getRecipe($id)\r\n {\r\n //define query\r\n $query = \"SELECT * FROM recipe\r\n WHERE recipe_id = :id\";\r\n\r\n //prepare statement\r\n $statement = $this->_db->prepare($query);\r\n\r\n //bind parameter\r\n $statement->bindParam(':id', $id, PDO::PARAM_STR);\r\n\r\n //execute\r\n $statement->execute();\r\n\r\n //get result\r\n $result = $statement->fetch(PDO::FETCH_ASSOC);\r\n return $result;\r\n }",
"function getRecipeID($recipe){\n\t $id = mysql_fetch_assoc(@mysql_query(\"SELECT RecipeID FROM Recipes WHERE '$recipe' = RecipeName\"));\n\t $recipeid = $id['RecipeID'];\n\t\t if($recipeid == 0)\n\t\t print \"Recipe doesn't exist!\";\n\t\t else\n\t return $recipeid;\n\t}",
"public function getCookbookRecipeId(): Uuid {\n\t\treturn ($this->cookbookRecipeId);\n\t}",
"public function getRecipeById($id)\n {\n $stmt = (new Statement())->where(\n function (array $record) use ($id)\n {\n return $record['id'] == $id;\n }\n );\n return $stmt->process($this->reader)->fetchOne(0);\n }",
"public function getRecipe()\n {\n return $this->recipe;\n }",
"public function getRecipe()\n\t{\n\t\tif(!$this->_recipe){\n\t\t\t$this->_recipe = Website_Model_CbFactory::factory('Website_Model_Recipe',$this->recipeId);\n\t\t}\n\t\treturn $this->_recipe;\n\t}",
"public function fetchOneById( int $id)\n\t{\n return $this->db->fetchAssoc(\"SELECT * FROM recipe WHERE id=?\", [(int) $id]);\n\t}",
"public function getRecipe($recipe) {\n\n $query = $this->db\n ->from('recipes')\n ->where('slug', $recipe)\n ->get();\n\n return $result = $query->row();\n }",
"public function getRecipeName(){\r\n return $this->recipeName;\r\n }",
"public function getIdChef()\n {\n return $this->idChef;\n }",
"public function get($which)\n\t{\n\t\t// iterate over the data until we find the one we want\n\t\tforeach ($this->recipes as $record)\n\t\t\tif ($record['id'] == $which)\n\t\t\t\treturn $record;\n\t\treturn null;\n\t}",
"public function getId(){\n return $this->_data['id'];\n }",
"public function getId() {\n\t\treturn $this -> data['id'];\n\t}",
"public function getId()\n {\n return $this->getValue('id');\n }",
"public function getIdCook()\n {\n return $this->id_cook;\n }",
"public function getIdVit(){\n\t\treturn ($this->id);\n\t}",
"function getId() {\n\t\treturn $this->getData('id');\n\t}",
"function getId() {\n\t\treturn $this->getData('id');\n\t}",
"public function view_recipe($id){\n\t\t$query = $this->db->query(\"\n\t\t\tSELECT re.id re_id, re.name re_nm, re.price re_prc, re.instructions re_ins, re.cooking_time re_ct, re.servings re_se, re.image re_im, re.status re_st, re.created_date re_cd, re.updated_date re_ud, rg.name rg_nm, rg.id rid, co.name co_nm, co.id cid, ing.name in_nm, ring.ingredient_amount in_am\n\t\t\tFROM recipe_ingredients ring\n\t\t\tINNER JOIN ingredients ing ON ring.ingredient_id = ing.id\n\t\t\tRIGHT JOIN recipe re ON ring.recipe_id = re.id\n\t\t\tINNER JOIN country co ON re.country_id = co.id\n\t\t\tINNER JOIN region rg ON co.region_id = rg.id\n\t\t\tWHERE md5(re.id) = '$id'\n\t\t\");\n\t\tif ($query->num_rows() > 0){\n\t\t\treturn $query->result();\n\t\t}else{\n\t\t\treturn NULL;\n\t\t}\n\t}",
"public function getId() {\r\n\t\treturn $this->data['id'];\r\n\t}",
"function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}",
"public function recipe()\n\t{\n\t\treturn $this->hasOne(Recipe::class, 'craft_id', 'id');\n\t}",
"function getID() {\n\t\treturn $this->data_array['id'];\n\t}",
"function getId(){\n\t\t\treturn $this->$id;\n\t\t}",
"public function get($id) {\n //SQL\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"\";\n $dbname = \"a2Database\";\n\n // Create connection\n $conn = new mysqli($servername, $username, $password, $dbname);\n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n\n $sql = \"SELECT * FROM recipes WHERE code <=> \" . $id . \";\";\n $record = $conn->query($sql);\n $conn->close();\n //SQL//\n return $record;\n }",
"public function getId() {\n return $this->attributes['id'];\n }",
"function getID() {\n\t\treturn $this->data_array['artifact_id'];\n\t}",
"public function getId() {\n return @$this->attributes['id'];\n }",
"public function getId() {\n return @$this->attributes['id'];\n }"
] |
[
"0.83640516",
"0.7151916",
"0.7017809",
"0.68790793",
"0.682439",
"0.66365945",
"0.6509934",
"0.6475224",
"0.6462162",
"0.63958013",
"0.62428695",
"0.6203188",
"0.6155964",
"0.6151898",
"0.6139722",
"0.61279637",
"0.61110395",
"0.6106148",
"0.6106148",
"0.60986435",
"0.6097766",
"0.6044845",
"0.60320896",
"0.59990484",
"0.59863305",
"0.59628797",
"0.59508127",
"0.59224766",
"0.5918092",
"0.5918092"
] |
0.8289109
|
1
|
transform $srcPath + $operations into a unique filename
|
public function getFilename()
{
$file = basename($this->srcPath);
$ops = str_replace(array('&', ':', ';', '?', '.', ','), '-', $this->operations);
return trim($ops . '-' . $file, './');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function generateProcessedFileNameWithoutExtension() {}",
"private function generateFilename($overwrite = false)\n\t{\n\n\t\tif(strpos( $this->relative_source_path, DIRECTORY_SEPARATOR) === false)\n\t\t{\n\t\t\t$this->full_target_path = $this->target_dir . \"/\" . time() .\"_\". md5( $this->relative_source_path ) . \".jpg\";\n\n\t\t\treturn;\n\t\t}\n\n\n\t\tif($overwrite)\n {\n $this->full_target_path = self::getFullPath($this->relative_source_path);\n }\n else\n {\n $filename = pathinfo($this->relative_source_path, PATHINFO_BASENAME); //PATHINFO_FILENAME ---> must add extension below!!!!\n $this->full_target_path = $this->target_dir . \"/\" . time() . \"_\" . $filename;\n }\n\t\n\t}",
"private function genereteFilename(){\n return strtolower(md5(uniqid($this->document->baseName)) . '.' . $this->document->extension);\n }",
"public function genFilename()\n {\n $filename = $this->getAssetableType().$this->assetable_id.'_';\n $filename .= uniqid();\n if(!empty($this->getThumbnailType())) $filename .= '_'.$this->getThumbnailType();\n $filename .= '.'.$this->uploadedFile->extension;\n $this->filename = $filename;\n }",
"private function buildFilePath(): string\n\t{\n\t\tif ($this->taskName === null) {\n\t\t\tthrow new EmptyTaskNameException('Task name was not set.');\n\t\t}\n\n\t\treturn SafeStream::PROTOCOL . '://' . $this->directory . '/' . sha1($this->taskName);\n\t}",
"function getTargetFileName() ;",
"function dest_path_and_file()\r\n{ \r\n global $xoopsDB, $xoopsUser;\r\n \r\n // Initialize magic_number. This number is used to create unique file names in order to guarantee that 2 file names\r\n // will not be identical if 2 users upload a file at the exact same time. 100000 will allow almost 100000 users to use\r\n // this system. Ok, the odds of this happening are slim; but, I want the odds to be zero.\r\n $magic_number = 100000; \r\n \r\n // Get the location of the document repository\r\n $query = \"SELECT data from \".$xoopsDB->prefix(\"dms_config\").\" WHERE name='doc_path'\";\r\n $file_sys_root = mysql_result(mysql_query($query),'data');\r\n \r\n // Get the current value of max_file_sys_counter\r\n $query = \"SELECT data from \".$xoopsDB->prefix(\"dms_config\").\" WHERE name='max_file_sys_counter'\";\r\n $max_file_sys_counter = (integer) mysql_result(mysql_query($query),'data');\r\n \r\n // Determine the path and filename of the new file\r\n $query = \"SELECT * from \".$xoopsDB->prefix(\"dms_file_sys_counters\");\r\n $dms_file_sys_counters = mysql_fetch_array(mysql_query($query));\r\n \r\n $file_sys_dir_1 = $dms_file_sys_counters['layer_1'];\r\n $file_sys_dir_2 = $dms_file_sys_counters['layer_2'];\r\n $file_sys_dir_3 = $dms_file_sys_counters['layer_3'];\r\n $file_sys_file = $dms_file_sys_counters['file'];\r\n $file_sys_file_name = ($file_sys_file * $magic_number) + $xoopsUser->getVar('uid');\r\n \r\n $dir_path_1 = $file_sys_root.\"/\".$file_sys_dir_1;\r\n $dir_path_2 = $file_sys_root.\"/\".$file_sys_dir_1.\"/\".$file_sys_dir_2;\r\n $dir_path_3 = $file_sys_root.\"/\".$file_sys_dir_1.\"/\".$file_sys_dir_2.\"/\".$file_sys_dir_3;\r\n \r\n //$doc_path = $file_sys_root.\"/\".$file_sys_dir_1.\"/\".$file_sys_dir_2.\"/\".$file_sys_dir_3;\r\n $path_and_file = $file_sys_dir_1.\"/\".$file_sys_dir_2.\"/\".$file_sys_dir_3.\"/\".$file_sys_file_name;\r\n //$dest_path_and_file = $doc_path.\"/\".$file_sys_file_name;\r\n \r\n //print $path_and_file;\r\n //exit(0);\r\n \r\n // Determine the next file system counter values and save them for future use.\r\n $file_sys_file++;\r\n if ($file_sys_file > $max_file_sys_counter) \r\n {\r\n\t$file_sys_file = 1;\r\n\t$file_sys_dir_3++;\r\n\t} \r\n \r\n if ($file_sys_dir_3 > $max_file_sys_counter)\r\n {\r\n\t$file_sys_dir_3 = 1;\r\n\t$file_sys_dir_2++;\r\n\t}\r\n\t\r\n if ($file_sys_dir_2 > $max_file_sys_counter)\r\n {\r\n\t$file_sys_dir_2 = 1;\r\n\t$file_sys_dir_1++;\r\n\t}\r\n\t\r\n $query = \"UPDATE \".$xoopsDB->prefix(\"dms_file_sys_counters\").\" SET \";\r\n $query .= \"layer_1 = '\".(integer) $file_sys_dir_1.\"', \";\r\n $query .= \"layer_2 = '\".(integer) $file_sys_dir_2.\"', \";\r\n $query .= \"layer_3 = '\".(integer) $file_sys_dir_3.\"', \";\r\n $query .= \"file = '\".(integer) $file_sys_file. \"' \";\r\n \r\n mysql_query($query); \r\n\r\n // Ensure that the final destination directories exist...if not, then create the directory or directories.\r\n if (!is_dir($dir_path_1)) \r\n {\r\n\tmkdir($dir_path_1,0775);\r\n chmod($dir_path_1,0777);\r\n\t}\r\n \r\n if (!is_dir($dir_path_2))\r\n {\r\n\tmkdir($dir_path_2,0775); \r\n chmod($dir_path_2,0777);\r\n }\r\n\t\r\n if (!is_dir($dir_path_3)) \r\n {\r\n\tmkdir($dir_path_3,0775);\r\n chmod($dir_path_3,0777);\r\n\t}\r\n\t\r\n return($path_and_file);\r\n}",
"protected function buildFileName()\n\t{\n\t\t$upscale = $this->upscale ? 'upscale' : 'noupscale';\n\t\treturn $this->namePrefix . '-' . $this->width . 'x' . $this->height . '-' . $upscale . '-' . $this->quality . '-' . $this->imageName;\n\t}",
"protected function handleOperation($op) {\n $output = '';\n $op_type = $this->checkAndGet($op, 'operation');\n switch ($op_type) {\n case 'filemodify':\n $mode = $this->convertMode($this->checkAndGet($op, 'mode'));\n $output .= sprintf(\"M %s inline %s\\n\",\n $mode,\n $this->checkAndGet($op, 'path'));\n $output .= $this->handleData($this->checkAndGet($op, 'data'));\n break;\n\n case 'filedelete':\n $output .= sprintf(\"D %s\\n\", $this->checkAndGet($op, 'path'));\n break;\n\n case 'filecopy':\n $output .= sprintf(\"C %s %s\\n\",\n $this->checkAndGet($op, 'src'),\n $this->checkAndGet($op, 'dst'));\n break;\n\n case 'filerename':\n $output .= sprintf(\"R %s %s\\n\",\n $this->checkAndGet($op, 'src'),\n $this->checkAndGet($op, 'dst'));\n break;\n case 'filedeleteall':\n $output .= \"deleteall\\n\";\n break;\n default:\n throw new Exception(\"Unknown operation type '$op_type'.\");\n }\n\n return $output;\n }",
"private function formatFilename() {\n return $this->prefix . $this->name . \".\" . $this->extension;\n }",
"function concatenarPath($nombre, $seccion) {\n\t$path = \"img_\" . $seccion . \"/\" . $nombre;\n\treturn $path;\n}",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"protected function makeFilename()\n {\n return getcwd().'/bolt_'.md5(time().uniqid()).'.zip';\n }",
"function upload_savename_by_gf($courseID,$filename){\n return $courseID.'_'.time().'_'.$filename;\n}",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }",
"public function generatePath($filename);",
"protected function filename()\n {\n return 'IPI_Target_' . date('YmdHis');\n }",
"function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null) {\n $_compile_dir_sep = $this->use_sub_dirs ? DIRECTORY_SEPARATOR : '^';\n $_return = $auto_base . DIRECTORY_SEPARATOR;\n\n if(isset($auto_id)) {\n // make auto_id safe for directory names\n $auto_id = str_replace('%7C',$_compile_dir_sep,(urlencode($auto_id)));\n // split into separate directories\n $_return .= $auto_id . $_compile_dir_sep;\n }\n\n if(isset($auto_source)) {\n // make source name safe for filename\n $_filename = urlencode(basename($auto_source));\n $_crc32 = sprintf('%08X', crc32($auto_source));\n // prepend %% to avoid name conflicts with\n // with $params['auto_id'] names\n $_crc32 = substr($_crc32, 0, 2) . $_compile_dir_sep .\n substr($_crc32, 0, 3) . $_compile_dir_sep . $_crc32;\n// XXX: Changed from $_filename to md5($_filename)\n $_return .= '%%' . $_crc32 . '%%' . md5($_filename);\n }\n return $_return;\n }",
"private function getFileName($raw = false){\n $raw_string = $this->surah . '|' . $this->verses . '|' . $this->translation;\n return $raw ? $raw_string : md5($raw_string).'.png';\n }",
"protected function _generateFilePath() {\n\t\treturn self::normalPaths(\n\t\t\tMage::getBaseDir(),\n\t\t\tMage::helper('pepperjam_network/config', $this->getStore())->getExportFilePath(),\n\t\t\t$this->_getFileName()\n\t\t);\n\t}",
"private function createCacheFileName($params) {\n $parts = pathinfo($this->imgPath);\n $fileExtension = $parts['extension'];\n $this->saveAs = is_null($params['save_as']) ? $fileExtension : $params['save_as'];\n $quality_ = is_null($params['quality']) ? null : \"_q{$params['quality']}\";\n $cropToFit_ = is_null($params['crop_to_fit']) ? null : \"_cf\";\n $dirName = preg_replace('/\\//', '-', dirname($params['src']));\n $cacheFileName = IMAGE_CACHE_PATH . \"-{$dirName}-{$parts['filename']}_{$params['width']}_{$params['height']}{$quality_}{$cropToFit_}.{$this->saveAs}\";\n $cacheFileName = preg_replace('/^a-zA-Z0-9\\.-_/', '', $cacheFileName);\n if($this->verbose) { $this->createVerbose(\"Cache file is: {$cacheFileName}\"); }\n return $cacheFileName;\n \n }",
"public function getTargetFileName() {}",
"protected function getFileGenerationPath()\n {\n $path = $this->getPathByOptionOrConfig('path', 'migration_target_path');\n $fileName = $this->getDatePrefix() . '_' . $this->argument('migrationName') . '.php';\n\n return \"{$path}/{$fileName}\";\n }",
"public function generateFileName()\n {\n $d = new \\DateTime();\n\n return strtoupper($this->fileName).\"_\" . $d->format(\"Y-m-d\");\n }",
"public function getPath(){\n $ext = $this->getExt();\n $filename = $this->id.'.'.$ext;\n return str_replace( $filename, '', $this->filename ); \n }"
] |
[
"0.6364364",
"0.60218924",
"0.59877473",
"0.59445",
"0.5835613",
"0.5823781",
"0.57854074",
"0.57731026",
"0.57242286",
"0.56959367",
"0.56916493",
"0.56726974",
"0.56527823",
"0.56407076",
"0.5625918",
"0.5625918",
"0.5625918",
"0.5625918",
"0.5625918",
"0.5625918",
"0.56159157",
"0.55757374",
"0.55380255",
"0.5521951",
"0.5518856",
"0.5517063",
"0.55132526",
"0.5500388",
"0.54722136",
"0.5461386"
] |
0.6692074
|
0
|
Sets this collection to be immutable once and for all
|
public final function setImmutable()
{
$this->isImmutable = true;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function immutable()\n {\n return new self($this->readers, $this->writers, true);\n }",
"public function immutableCache()\n {\n return $this->addAction(Flag::immutableCache());\n }",
"function setImmutable($immutable) {\n $this->immutable = $immutable;\n }",
"protected function checkRestrictionsBeforeChange()\n {\n if ($this->isImmutable) {\n throw new \\BadMethodCallException('This collection is immutable.');\n }\n }",
"public function markMutable()\n {\n unset($_SESSION['_IMMUTABLE']);\n\n return $this;\n }",
"public function isImmutable()\n\t{\n\t\treturn false;\n\t}",
"public function performReadonlyTransformation()\n {\n return clone $this;\n }",
"public function __set($name, $value)\n {\n throw new \\RuntimeException('Collection is immutable');\n }",
"public function __clone()\n {\n foreach ($this->items as $key => $value) {\n if ($value instanceof interfaces\\Collection) {\n $this->items[$key] = clone $value;\n }\n }\n }",
"public function copy(): self\n {\n return $this->immute(true); // force immute\n }",
"public function setUnmodified()\n {\n\t$this->modified= false;\n }",
"public function isImmutable()\n\t{\n\t\treturn $this->immutable;\n\t}",
"public function __clone()\n {\n if (is_object($this->collection)) {\n $this->collection = clone $this->collection;\n }\n $this->initialize();\n $this->owner = null;\n $this->snapshot = [];\n $this->changed();\n }",
"public function copy(): Collection\n {\n return clone $this;\n }",
"function getImmutable() {\n return $this->immutable;\n }",
"public function set( $index, $value )\n {\n throw new UnmodifiableException(\"This collection cannot be changed\");\n }",
"public function isMutable()\n\t{\n\t\treturn true;\n\t}",
"public function __clone() {\n $this->items = Arrays::copy($this->items);\n }",
"public function offsetSet( $index, $value )\n {\n throw new UnmodifiableException(\"This collection cannot be changed\");\n }",
"public function immutableCopy() {\n return FNArray:: initWith($this->value());\n }",
"public function __clone()\n {\n // memory foot print as low as possible, even though this is trivial.\n $this->cache = array();\n }",
"public function makeReadonly()\n {\n $this->transform(new ReadonlyTransformation());\n return $this;\n }",
"public function immutable(bool $immutable): self\n {\n $realNum = $this->immute();\n $realNum->immutable = $immutable;\n return $realNum; // chainable - immutable\n }",
"public function isImmutable(): bool\n {\n return (bool) ($this->getGC()->u->type_info & ReferenceCountedInterface::GC_IMMUTABLE);\n }",
"public function __clone()\n {\n $this->invalidateCache();\n }",
"public function setReadOnly()\n {\n $this->_allowModifications = false;\n foreach ($this->_data as $key => $value) {\n if ($value instanceof Zend_Config) {\n $value->setReadOnly();\n }\n }\n }",
"private function buildCollection(): void\n {\n //todo 這邊可以在sql裡面處理,但因為時程的關係,先用這種方法處理\n $userId = auth()->user()->id;\n $this->collection->map(function ($item) use ($userId) {\n $item->isAuthor = ($item->user_id == $userId);\n $item->user_id = null;\n });\n }",
"public function __clone()\n {\n $this->_id = null;\n $this->_key = null;\n $this->_rev = null;\n // do not change the _changed flag here\n }",
"public function resetCollectionsForPersist()\n {\n $this->containers = new ArrayCollection();\n $this->functions = new ArrayCollection();\n $this->constants = new ArrayCollection();\n }",
"public function copy(): Collection\n {\n return new Collection($this->array);\n }"
] |
[
"0.64550287",
"0.6205345",
"0.617174",
"0.60920304",
"0.5970816",
"0.5839465",
"0.5746966",
"0.5707203",
"0.5706575",
"0.56980777",
"0.5693463",
"0.5689852",
"0.56843716",
"0.564376",
"0.56021035",
"0.55926687",
"0.5567276",
"0.554698",
"0.554685",
"0.5542179",
"0.5527742",
"0.55160934",
"0.55144304",
"0.5504621",
"0.54822075",
"0.5465371",
"0.5452835",
"0.54363877",
"0.54314417",
"0.5389234"
] |
0.71181655
|
0
|
Performs checks on restrictions before changing the value of this collection
|
protected function checkRestrictionsBeforeChange()
{
if ($this->isImmutable) {
throw new \BadMethodCallException('This collection is immutable.');
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function constrainOnly($flag);",
"private function _applyEditableParam()\n {\n if ($this->editable) {\n // Limit the query to only the global sets the user has permission to edit\n $editableSetIds = Craft::$app->getGlobals()->getEditableSetIds();\n $this->subQuery->andWhere(['elements.id' => $editableSetIds]);\n }\n }",
"private function _applyEditableParam()\n {\n if ($this->editable) {\n // Limit the query to only the global sets the user has permission to edit\n $editableSetIds = Craft::$app->getGlobals()->getEditableSetIds();\n $this->subQuery->andWhere(['elements.id' => $editableSetIds]);\n }\n }",
"protected function restrict_fields()\n {\n }",
"private function _validateModifiable()\n {\n if(!($this->_getDataSource() instanceof wCrudAdapter))\n {\n throw new Exception('Object is read-only.');\n }\n }",
"public function testSetRestrictAccesPieces() {\n\n $obj = new Collaborateurs();\n\n $obj->setRestrictAccesPieces(true);\n $this->assertEquals(true, $obj->getRestrictAccesPieces());\n }",
"protected function _checkForeignKeysRestrict() {}",
"public function set_restriction($countries)\n\t{\n\t\t\n\t}",
"protected function constrain()\n {\n $this->table->where($this->foreign_key(), '=', $this->base->get_key());\n }",
"protected function constrain()\n {\n $other = $this->other_key();\n $foreign = $this->foreign_key();\n\n $this->set_select($foreign, $other)->set_join($other)->set_where($foreign);\n }",
"public function getRestrictions() \n {\n return $this->_restrictions; \n }",
"public static function getRestriction(): Restriction\n {\n return new Restriction('pre-commit');\n }",
"public function setCrit()\n {\n $this->_role->crit = 100;\n }",
"private function allowModify()\n { \n if($this->viewVar['loggedUserRole'] <= 40 )\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }",
"public function setCrit()\n {\n $this->_role->crit = 0;\n }",
"public function get_restriction($key = 0)\n {\n }",
"public function setScmsRestriction($value)\n {\n $this->_scmsRestriction = $value;\n }",
"private function checkBounds()\n {\n $this->page = max($this->page, 0);\n $this->page = min($this->page, $this->lastPage());\n }",
"function allowUpdate($allow){\n\t\t$this->canUpdate=$allow;\n\t}",
"public function setInvalid();",
"public function canModifyVisibilityOfUsers();",
"public function beforeValidationOnUpdate()\n {\n // Timestamp on the update\n $this->modifyAt = time();\n }",
"private function validiate_limits() {\n\n\t\tforeach( $this->limits as $element_role => $element_limits ) {\n\t\t\tToolset_Association::validate_element_role( $element_role );\n\n\t\t\t$min = toolset_getarr( $element_limits, self::MIN, self::INVALID_VALUE );\n\t\t\t$max = toolset_getarr( $element_limits, self::MAX, self::INVALID_VALUE );\n\n\t\t\tif( $min <= self::INVALID_VALUE || $max <= self::INVALID_VALUE ) {\n\t\t\t\tthrow new InvalidArgumentException( 'Invalid cardinality value.' );\n\t\t\t}\n\n\t\t\tif( self::INFINITY != $max && $min > $max ) {\n\t\t\t\tthrow new InvalidArgumentException( 'Minimum element limit is higher than the maximum one.' );\n\t\t\t}\n\n\t\t\tif( self::ZERO_ELEMENTS == $max ) {\n\t\t\t\tthrow new InvalidArgumentException( 'Maximum element limit is zero.' );\n\t\t\t}\n\t\t}\n\n\t}",
"public function constrain()\n\t{\n\t\treturn $this->related\n\t\t ->whereEquals($this->relatedKey, $this->model->{$this->localKey})\n\t\t ->whereEquals($this->shifter, strtolower($this->model->getModelName()));\n\t}",
"protected function computeAllowed() {\n\t\tif($this->tees) {\n\t\t\t$this->exact_handicap = $this->player->handicap;\n\t\t\t$a = $this->player->allowed($this->tees);\n\t\t\t$this->handicap = array_sum($a); // playing handicap\n\t\t\t$this->save();\n\t\t\tif($this->hasDetails()) {\t\t\t\t\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($this->getScoreWithHoles()->each() as $score) {\n\t\t\t\t\t$score->allowed = $a[$i++];\n\t\t\t\t\t$score->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}",
"public function updateRestrictions($options){\n $this->_conf = $options;\n $this->_conf['prefix']=self::$_prefix;\n }",
"public function setAllowedValues($values);",
"public function is_allowed_to_set_content_object_rights();",
"protected function validate()\r\n\t{\r\n\t\tif (!$this->isFetched())\r\n\t\t{\r\n\t\t\treturn;\r\n }\r\n \r\n\t\tif ($this->validationInfo)\r\n\t\t{\r\n\t\t\t$this->validationInfo->validate($this->normalizedValue);\r\n\t\t}\r\n\t\t$this->isValid = true;\r\n\t}",
"public function dispense()\n {\n $this->addValidator('model', new Validator_HasValue());\n }"
] |
[
"0.5725328",
"0.5603723",
"0.5603723",
"0.55768776",
"0.55684996",
"0.53296727",
"0.5323205",
"0.528363",
"0.5259653",
"0.524178",
"0.52088773",
"0.5201181",
"0.5184355",
"0.5112135",
"0.5105114",
"0.5092856",
"0.5088048",
"0.50828505",
"0.50538194",
"0.50471437",
"0.5037162",
"0.50349206",
"0.5029044",
"0.5021677",
"0.49797523",
"0.49604946",
"0.49581563",
"0.4949383",
"0.4949096",
"0.49435195"
] |
0.71002674
|
0
|
/ addCalenderData function is called taht time when user create new schedule there are four parameters in $_REQUEST like from_time, to_time, schedule , date_hidden
|
function addCalenderData(Request $request){
/*
* from time means start time
* to_time means end time
* date_hidden means your selected schedule date
* schedule either 0 ,1 or 2
* 1 means monday to friday
* 2 means monday to saturday
* 3 means daily
*/
$from_time = $request->from_time;
$to_time = $request->to_time;
$id = Auth::user()->id;
$schedule_day = $request->schedule;
$date = $request->date_hidden;
/*
* get_data count the roes according to user logged id in CalendarAvailability table
*/
$get_data=CalendarAvailability::where('user_id',$id)->count();
/*
* if get_data > 0 the redirect back with message
*/
if($get_data>0){
Session::flash('status_warning','Your schedule event already has been created');
return redirect()->back();
}
/*
* if get_data in not grater then 0 then data will add in CalendarAvailability
*/
$data=array('user_id'=>$id,
'start_time'=>$from_time,
'end_time'=>$to_time,
'reocuuring'=>$schedule_day
);
CalendarAvailability::create($data);
Session::flash('status','Successfully added');
return redirect()->back();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function add_shedule(){\n\t\t\n\t\trequire_once(\"dbconnection.php\");\n\t\t$obj=new dbconnection();\n\t\t$con=$obj->getcon();\n\t\t\n\t\t\n\t\t$dbh=$obj->get_pod();\n\n\t\t$act_mode \t= mysqli_real_escape_string($con,$_POST['act_mode']);\n\t\t$cmbtype \t\t= mysqli_real_escape_string($con,$_POST['cmbtype']);\n\t\t$cmbexamtype = mysqli_real_escape_string($con,$_POST['cmbexamtype']);\n\t\t$cmbbatch = mysqli_real_escape_string($con,$_POST['cmbbatch']);\n\t\t$cmbclroom \t= mysqli_real_escape_string($con,$_POST['cmbclroom']);\n\t\t$cmblecturer \t= mysqli_real_escape_string($con,$_POST['cmblecturer']);\n\t\t$txtdosch = mysqli_real_escape_string($con,$_POST['txtdosch']);\n\t\t$txtstime \t= mysqli_real_escape_string($con,$_POST['txtstime']);\n\t\t$txtetime \t= mysqli_real_escape_string($con,$_POST['txtetime']);\t\n\t\t\n\t\t$sqlget1 =\"SELECT * FROM shedule WHERE schtype='$cmbtype' AND examtype='$cmbexamtype' AND batchID='$cmbbatch' AND lecID ='$cmblecturer' AND clroomID ='$cmbclroom' AND date='$txtdosch' AND (starttime >='$txtstime' AND endtime <='$txtetime');\";\n\t\t\n\t\t\n\t\t$resultget1 = mysqli_query($con,$sqlget1) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget1= mysqli_fetch_assoc($resultget1);\n\t\t\n\t\t\n\t\t$sqlget2 =\"SELECT * FROM shedule WHERE lecID ='$cmblecturer' AND date='$txtdosch' AND (starttime >='$txtstime' OR endtime <='$txtetime');\";\n\t\t\n\t\t$resultget2 = mysqli_query($con,$sqlget2) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget2= mysqli_fetch_assoc($resultget2);\n\t\t\n\t\t$sqlget3 =\"SELECT * FROM shedule WHERE clroomID ='$cmbclroom' AND date='$txtdosch' AND (starttime >='$txtstime' OR endtime <='$txtetime');\";\n\t\t\n\t\t$resultget3 = mysqli_query($con,$sqlget3) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget3= mysqli_fetch_assoc($resultget3);\n\t\n\t\t\t\n\t\tif(count($recget1)>0){\n\t\t\t$recget1 =\"sch1\";\n\t\t\techo json_encode($recget1);\n\t\t}\n\t\telse if(count($recget2)>0){\n\t\t\t$recget2 =\"sch2\";\n\t\t\techo json_encode($recget2);\n\t\t}\n\t\telse if(count($recget3)>0){\n\t\t\t$recget3 =\"sch3\";\n\t\t\techo json_encode($recget3);\n\t\t}\n\n\t\telse{\n\t\t\n\t\t$sth = $dbh->prepare('INSERT INTO shedule (schtype,examtype,date,starttime,endtime,batchID,clroomID,lecID,schstatus) VALUES(?,?,?,?,?,?,?,?,?);');\n\t\t$sth->execute(Array($cmbtype,$cmbexamtype,$txtdosch,$txtstime,$txtetime,$cmbbatch,$cmbclroom,$cmblecturer,1));\n\n\t\t\t\tif(count($sth)<0){\n\t\t\t\t\t \n\t\t\t\t\t $status =\"false\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\n\t\t\t\t\t$status =\"true\";\n\t\t\t\t}\n\t\n\t\t\t\techo json_encode($status);\n\n\t\t} \n\n\t}",
"function Create_Edited_Schedule($application_id, $request, $tr_info)\n{\n\t$holidays = Fetch_Holiday_List();\n\t$pd_calc = new Pay_Date_Calc_3($holidays);\n\t$log = get_log(\"scheduling\");\n\n\t$schedule = array();\n\t$status_date = (isset($request->status_date)) ?\n\t(date(\"Y-m-d\", strtotime($request->status_date))) : null;\n\t$date_fund_actual = $request->date_fund_actual;\n\t$log->Write(\"Creating Edited Schedule for {$application_id}\");\n\t$principal_balance = floatval($request->principal_balance);\n\t$fees_balance = floatval($request->fees_balance);\n\t$return_amount = floatval($request->return_amount);\n\t$num_service_charges = ($request->num_service_charges == \"max\") ?\n\t5 : intval($request->num_service_charges);\n\n\t$agent_id = isset($request->controlling_agent) ? $request->controlling_agent : 0;\n\n\t$today = date(\"Y-m-d\");\n\t$next_business_day = $pd_calc->Get_Next_Business_Day($today);\n\tRemove_Unregistered_Events_From_Schedule($application_id);\n\n\t// First generate the service charge placeholders\n\tfor ($i = 0; $i < $num_service_charges; $i++)\n\t{\n\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, array(),\n\t\t'converted_sc_event',\n\t\t'Placeholder for Cashline interest charge');\n\t}\n\n\t// Now generate the balance amounts.\n\tif ($principal_balance > 0.0)\n\t{\n\t\t// If they requested \"Funds Pending\", we want to set the transaction to pending, and set\n\t\t// the event and the transaction to the date they specified.\n\t\tif($request->account_status == '17') // Set Funds Pending\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => $principal_balance));\n\t\t\t$event = Schedule_Event::MakeEvent($status_date, $status_date, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\n\t\t\t$evid = Record_Event($application_id, $event);\n\t\t\tRecord_Scheduled_Event_To_Register_Pending($status_date, $application_id, $evid);\n\t\t}\n\t\telse if ($request->account_status == '15') // Funding Failed\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$principal_balance));\n\t\t\t$event = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\t\t\t$evid = Record_Event($application_id, $event);\n\t\t\t$trids = Record_Scheduled_Event_To_Register_Pending($today, $application_id, $evid);\n\t\t\tforeach ($trids as $trid)\n\t\t\t{\n\t\t\t\tRecord_Transaction_Failure($application_id, $trid);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => $principal_balance));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\t\t}\n\t}\n\tif ($fees_balance > 0.0)\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $fees_balance));\n\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t'converted_service_chg_bal',\n\t\t\"Converted interest charge amount for {$application_id}\");\n\t}\n\n\t// Scheduling section\n\t$rules = Prepare_Rules($tr_info->rules, $tr_info->info);\n\t$scs_left = max($rules['service_charge']['max_svc_charge_only_pmts'] - $num_service_charges, 0);\n\t$sc_amt = $principal_balance * $rules['interest'];\n\t$sc_comment = \"sched svc chg ({$rules['interest']})\";\n\t$payments = $principal_balance / $rules['principal_payment_amount'];\n\t$total_payments = $rules['service_charge']['max_svc_charge_only_pmts'] + $payments + 1; //add one for the loan date\n\n\tif(!in_array($request->account_status, array(\"19\")))\n\t{\n\t\t$dates = Get_Date_List($tr_info->info, $next_business_day, $rules, ($total_payments ) * 4, null, $next_business_day);\n\n\t\t$index = 0;\n\t\tif (isset($date_fund_actual) && ($date_fund_actual != ''))\n\t\t{\n\t\t\t$date_fund_actual = preg_replace(\"/-/\", \"/\", $date_fund_actual);\n\t\t\t$log->Write(\"Date fund actual is: {$date_fund_actual}\");\n\t\t\t$window = date(\"Y-m-d\", strtotime(\"+10 days\", strtotime($date_fund_actual)));\n\t\t\twhile (strtotime($window) > strtotime($dates['event'][$index])) $index++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile (strtotime($today) > strtotime($dates['event'][$index])) $index++;\n\t\t}\n\t}\n\n\tswitch($request->account_status)\n\t{\n\t\tcase \"1\":\n\t\tcase \"2\": $status_chain = array(\"active\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"3\": $status_chain = array(\"sent\", \"external_collections\", \"*root\"); break;\n\t\tcase \"4\": $status_chain = array(\"new\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"5\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"6\": $status_chain = array(\"pending\", \"external_collections\", \"*root\"); break;\n\t\tcase \"7\": $status_chain = array(\"unverified\", \"bankruptcy\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"8\": $status_chain = array(\"recovered\", \"external_collections\", \"*root\"); break;\n\t\tcase \"9\": $status_chain = array(\"paid\", \"customer\", \"*root\"); break;\n\t\tcase \"10\":\n\t\tcase \"12\":\n\t\tcase \"13\": $status_chain = array(\"ready\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"11\":\n\t\tcase \"14\": $status_chain = array(\"sent\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"15\": $status_chain = array(\"funding_failed\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"16\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"17\": $status_chain = array(\"active\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"18\": $status_chain = array(\"past_due\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"19\": $status_chain = array(\"sent\",\"external_collections\",\"*root\"); break;\n\t\tcase \"20\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"21\": $status_chain = array(\"sent\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t}\n\n\tif (in_array($request->account_status, array(\"1\", \"2\", \"4\", \"17\",\"18\")))\n\t{\n\t\tif ($request->account_status == \"18\")\n\t\t{\n\t\t\t$old_sc_amt = $sc_amt;\n\t\t\t$today = date(\"Y-m-d\");\n\t\t\t$next_day = $pd_calc->Get_Business_Days_Forward($today, 1);\n\t\t\tif ($fees_balance != 0.00)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$fees_balance));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t\t$amounts,\n\t\t\t\t'payment_service_chg', 'repull',\n\t\t\t\t'scheduled', 'generated',$application_id,\n\t\t\t\t-$application_id);\n\t\t\t\t$return_amount = bcsub($return_amount,$fees_balance,2);\n\t\t\t}\n\n\t\t\tif ($return_amount > 0)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$return_amount));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t\t$amounts,\n\t\t\t\t'repayment_principal', 'repull',\n\t\t\t\t'scheduled','generated',$application_id,\n\t\t\t\t-$application_id);\n\t\t\t\t$principal_balance = bcsub($principal_balance,$return_amount,2);\n\t\t\t\t$sc_amt = $principal_balance * $rules['interest'];\n\t\t\t}\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts, 'assess_service_chg');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('fee' => $rules['return_transaction_fee']));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today,\n\t\t\t$amounts,\n\t\t\t'assess_fee_ach_fail', 'ACH Fee Assessed');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('fee' => -$rules['return_transaction_fee']));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t$amounts,\n\t\t\t'payment_fee_ach_fail', 'ACH fee payment');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t$dates['effective'][$index],$amounts, 'payment_service_chg');\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($fees_balance != 0.00)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$fees_balance));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t\t$amounts, 'payment_service_chg', 'sched svc chg payment');\n\t\t\t}\n\t\t}\n\t\tfor ($i = 0; $i < $scs_left; $i++)\n\t\t{\n\t\t\tif ($sc_amt == 0.0) break;\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['event'][$index],\n\t\t\t$amounts, 'assess_service_chg', $sc_comment);\n\t\t\t$index++;\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t$amounts, 'payment_service_chg',\n\t\t\t'sched svc chg payment');\n\t\t}\n\n\t\twhile ($principal_balance > 0)\n\t\t{\n\t\t\t$charge_amount = min($principal_balance, $rules['principal_payment_amount']);\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$charge_amount));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t$amounts, 'repayment_principal', 'principal repayment');\n\t\t\t$principal_balance = bcsub($principal_balance,$charge_amount,2);\n\t\t\tif($principal_balance > 0)\n\t\t\t{\n\t\t\t\t$sc_amt = $principal_balance * $rules['interest'];\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t\t$dates['event'][$index],\n\t\t\t\t$amounts, 'assess_service_chg',\n\t\t\t\t$sc_comment);\n\t\t\t\t$index++;\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t\t$dates['effective'][$index],\n\t\t\t\t$amounts, 'payment_service_chg',\n\t\t\t\t'sched svc chg payment');\n\t\t\t}\n\n\t\t}\n\t}\n\telse if ($request->account_status == \"15\") // for Funding Failed\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance\n\t\t));\n\t\t$event = Schedule_Event::MakeEvent($today, $today,\n\t\t$amounts, 'adjustment_internal',\n\t\t'Internal Adjustment');\n\t\tPost_Event($application_id, $event);\n\t}\n\telse if ($request->account_status == \"21\") // ACH Return After QC\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t// Quickcheck (Pending)\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\n\t\t// Cashline Return (Completed)\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'principal' => $request->return_amount\n\t\t));\n\t\t$event = Schedule_Event::MakeEvent($today, $today,\n\t\t$amounts, 'cashline_return',\n\t\t'Cashline Return');\n\t\tPost_Event($application_id, $event);\n\t}\n\tif ($request->account_status == \"5\")\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t$amounts, 'full_balance',\n\t\t'Full Pull Attempt');\n\t}\n\n\tif (in_array($request->account_status, array(\"12\", \"13\", \"14\")))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif (in_array($request->account_status, array(\"14\", \"11\")))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif (in_array($request->account_status, array('6', '3', '20')))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = array();\n\t\t$amounts[] = Event_Amount::MakeEventAmount('principal', -$request->principal_balance);\n\t\t$amounts[] = Event_Amount::MakeEventAmount('service_charge', -$request->fees_balance);\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\n\t\t$amounts = array();\n\t\t$amounts[] = Event_Amount::MakeEventAmount('principal', -$request->principal_balance);\n\t\t$amounts[] = Event_Amount::MakeEventAmount('service_charge', -$request->fees_balance);\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif(in_array($request->account_status, array(\"19\")))\n\t{\n\t\tUpdate_Status(NULL,$application_id,$status_chain);\n\t}\n\n\tif (in_array($request->account_status, array(4,5,10,11,16)) && $agent_id)\n\t{\n\t\t$application = ECash::getApplicationById($application_id);\n\t\t$affiliations = $application->getAffiliations();\n\t\t$affiliations->add(ECash::getAgentById($agent_id), 'collections', 'owner', null);\n\t}\n\n\tif (count($schedule) > 0) Update_Schedule($application_id, $schedule);\n\treturn ($status_chain);\n}",
"public function viewCreateFromCalendar(){\r\n\r\n\r\n\t\tif(isset($_POST['startDate']) && isset($_POST['startTime']) && isset($_POST['endDate']) && isset($_POST['endTime']) ){\r\n\t\t\t$data['start_date'] = $_POST['startDate'];\r\n\t\t\t$data['start_time'] = $_POST['startTime'];\r\n\t\t\t$data['end_date'] = $_POST['endDate'];\r\n\t\t\t$data['end_time'] = $_POST['endTime'];\r\n\t\t\t$result = $this->load->view('vEventForCalendar',$data,TRUE);\r\n\t\t\t//$this->viewCreateEvent();\r\n\t\t\techo $result;\r\n\t\t}\r\n\r\n\r\n\r\n\t}",
"function exam_schedule()\n\t {\n\t\t$standardcode = $_REQUEST['standardcode'];\n\t\t$exam_data \t \t\t\t= $this ->ObjM->get_exam_by_standard($standardcode);\n\t\t//var_dump($exam_data); exit;\n\t\t\n\t\tif(count($exam_data)<1){\n\t\t\t$json_arr[]=array('validation'=>'false');\t\n\t\t\techo json_encode($json_arr);\n\t\t\texit;\t \n\t\t}\n\t\t\n\t\tfor($i=0;$i<count($exam_data);$i++){\n\t\t\t$exam_date = date('d-m-Y',$exam_data[$i]['date_dt']);\n\t\t\t$exam_time = $exam_data[$i]['start_time'].' To '.$exam_data[$i]['end_time'];\n\t\t\t\n\t\t\t$json_arr[]=array(\n\t\t\t\t\t'standard_name'\t\t=>\t$exam_data[$i]['standard_name'],\n\t\t\t\t\t'exam_title'\t\t=>\t$exam_data[$i]['exam_title'],\n\t\t\t\t\t'subject_name'\t\t=>\t$exam_data[$i]['subject_name'],\n\t\t\t\t\t'exam_date'\t\t\t=>\t$exam_date,\n\t\t\t\t\t'exam_time'\t\t\t=>\t$exam_time,\n\t\t\t\t\t'marks'\t\t\t\t=>\t$exam_data[$i]['marks'],\n\t\t\t\t\t'validation'\t \t\t=>\t'true' );\n\t\t }\n\t\t echo json_encode($json_arr);\n\t\t\texit;\n\t }",
"function attendance_construct_sessions_data_for_add($formdata, mod_attendance_structure $att) {\n global $CFG;\n\n $sesstarttime = $formdata->sestime['starthour'] * HOURSECS + $formdata->sestime['startminute'] * MINSECS;\n $sesendtime = $formdata->sestime['endhour'] * HOURSECS + $formdata->sestime['endminute'] * MINSECS;\n $sessiondate = $formdata->sessiondate + $sesstarttime;\n $duration = $sesendtime - $sesstarttime;\n if (empty(get_config('attendance', 'enablewarnings'))) {\n $absenteereport = get_config('attendance', 'absenteereport_default');\n } else {\n $absenteereport = empty($formdata->absenteereport) ? 0 : 1;\n }\n\n $now = time();\n\n if (empty(get_config('attendance', 'studentscanmark'))) {\n $formdata->studentscanmark = 0;\n }\n\n if (empty(get_config('attendance', 'allowupdatestatus'))) {\n $formdata->allowupdatestatus = 0;\n }\n\n $calendarevent = 0;\n if (isset($formdata->calendarevent)) { // Calendar event should be created.\n $calendarevent = 1;\n }\n\n $sessions = array();\n if (isset($formdata->addmultiply)) {\n $startdate = $sessiondate;\n $enddate = $formdata->sessionenddate + DAYSECS; // Because enddate in 0:0am.\n\n if ($enddate < $startdate) {\n return null;\n }\n\n // Getting first day of week.\n $sdate = $startdate;\n $dinfo = usergetdate($sdate);\n if ($CFG->calendar_startwday === '0') { // Week start from sunday.\n $startweek = $startdate - $dinfo['wday'] * DAYSECS; // Call new variable.\n } else {\n $wday = $dinfo['wday'] === 0 ? 7 : $dinfo['wday'];\n $startweek = $startdate - ($wday - 1) * DAYSECS;\n }\n\n $wdaydesc = array(0 => 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');\n\n while ($sdate < $enddate) {\n if ($sdate < strtotime('+1 week', $startweek)) {\n $dinfo = usergetdate($sdate);\n if (isset($formdata->sdays) && array_key_exists($wdaydesc[$dinfo['wday']], $formdata->sdays)) {\n $sess = new stdClass();\n $sess->sessdate = make_timestamp($dinfo['year'], $dinfo['mon'], $dinfo['mday'],\n $formdata->sestime['starthour'], $formdata->sestime['startminute']);\n $sess->duration = $duration;\n $sess->descriptionitemid = $formdata->sdescription['itemid'];\n $sess->description = $formdata->sdescription['text'];\n $sess->descriptionformat = $formdata->sdescription['format'];\n $sess->calendarevent = $calendarevent;\n $sess->timemodified = $now;\n $sess->absenteereport = $absenteereport;\n $sess->studentpassword = '';\n $sess->includeqrcode = 0;\n $sess->rotateqrcode = 0;\n $sess->rotateqrcodesecret = '';\n $sess->automark = !empty($formdata->automark) ? $formdata->automark : 0;\n $sess->automarkcmid = !empty($formdata->automarkcmid) ? $formdata->automarkcmid : 0;\n $sess->automarkcompleted = 0;\n\n if (!empty($formdata->usedefaultsubnet)) {\n $sess->subnet = $att->subnet;\n } else {\n $sess->subnet = $formdata->subnet;\n }\n if (!empty($formdata->preventsharedip)) {\n $sess->preventsharedip = $formdata->preventsharedip;\n }\n if (!empty($formdata->preventsharediptime)) {\n $sess->preventsharediptime = $formdata->preventsharediptime;\n }\n\n if (isset($formdata->studentscanmark)) { // Students will be able to mark their own attendance.\n $sess->studentscanmark = 1;\n if (isset($formdata->allowupdatestatus)) {\n $sess->allowupdatestatus = $formdata->allowupdatestatus;\n } else {\n $sess->allowupdatestatus = 0;\n }\n if (isset($formdata->autoassignstatus)) {\n $sess->autoassignstatus = 1;\n }\n if (isset($formdata->studentsearlyopentime)) {\n $sess->studentsearlyopentime = $formdata->studentsearlyopentime;\n }\n\n if (!empty($formdata->randompassword)) {\n $sess->studentpassword = attendance_random_string();\n } else if (!empty($formdata->studentpassword)) {\n $sess->studentpassword = $formdata->studentpassword;\n }\n if (!empty($formdata->includeqrcode)) {\n $sess->includeqrcode = $formdata->includeqrcode;\n }\n if (!empty($formdata->rotateqrcode)) {\n $sess->rotateqrcode = $formdata->rotateqrcode;\n $sess->studentpassword = attendance_random_string();\n $sess->rotateqrcodesecret = attendance_random_string();\n }\n if (!empty($formdata->preventsharedip)) {\n $sess->preventsharedip = $formdata->preventsharedip;\n }\n if (!empty($formdata->preventsharediptime)) {\n $sess->preventsharediptime = $formdata->preventsharediptime;\n }\n } else {\n $sess->subnet = '';\n $sess->automark = 0;\n $sess->automarkcompleted = 0;\n $sess->preventsharedip = 0;\n $sess->preventsharediptime = '';\n }\n $sess->statusset = $formdata->statusset;\n\n attendance_fill_groupid($formdata, $sessions, $sess);\n }\n\n $sdate = strtotime(\"+1 day\", $sdate); // Set start to tomorrow.\n } else {\n $startweek = strtotime(\"+\".$formdata->period.' weeks', $startweek);\n $sdate = $startweek;\n }\n }\n } else {\n $sess = new stdClass();\n $sess->sessdate = $sessiondate;\n $sess->duration = $duration;\n $sess->descriptionitemid = $formdata->sdescription['itemid'];\n $sess->description = $formdata->sdescription['text'];\n $sess->descriptionformat = $formdata->sdescription['format'];\n $sess->calendarevent = $calendarevent;\n $sess->timemodified = $now;\n $sess->studentscanmark = 0;\n $sess->allowupdatestatus = 0;\n $sess->autoassignstatus = 0;\n $sess->subnet = '';\n $sess->studentpassword = '';\n $sess->automark = 0;\n $sess->automarkcompleted = 0;\n\n if (!empty($formdata->automarkcmid)) {\n $sess->automarkcmid = $formdata->automarkcmid;\n } else {\n $sess->automarkcmid = 0;\n }\n\n $sess->absenteereport = $absenteereport;\n $sess->includeqrcode = 0;\n $sess->rotateqrcode = 0;\n $sess->rotateqrcodesecret = '';\n\n if (!empty($formdata->usedefaultsubnet)) {\n $sess->subnet = $att->subnet;\n } else {\n $sess->subnet = $formdata->subnet;\n }\n\n if (!empty($formdata->automark)) {\n $sess->automark = $formdata->automark;\n }\n if (!empty($formdata->automark)) {\n $sess->automark = $formdata->automark;\n }\n if (!empty($formdata->preventsharedip)) {\n $sess->preventsharedip = $formdata->preventsharedip;\n }\n if (!empty($formdata->preventsharediptime)) {\n $sess->preventsharediptime = $formdata->preventsharediptime;\n }\n\n if (isset($formdata->studentscanmark) && !empty($formdata->studentscanmark)) {\n // Students will be able to mark their own attendance.\n $sess->studentscanmark = 1;\n if (!empty($formdata->allowupdatestatus)) {\n $sess->allowupdatestatus = $formdata->allowupdatestatus;\n } else {\n $sess->allowupdatestatus = 0;\n }\n if (isset($formdata->autoassignstatus) && !empty($formdata->autoassignstatus)) {\n $sess->autoassignstatus = 1;\n }\n if (!empty($formdata->randompassword)) {\n $sess->studentpassword = attendance_random_string();\n } else if (!empty($formdata->studentpassword)) {\n $sess->studentpassword = $formdata->studentpassword;\n }\n if (!empty($formdata->includeqrcode)) {\n $sess->includeqrcode = $formdata->includeqrcode;\n }\n if (!empty($formdata->rotateqrcode)) {\n $sess->rotateqrcode = $formdata->rotateqrcode;\n $sess->studentpassword = attendance_random_string();\n $sess->rotateqrcodesecret = attendance_random_string();\n }\n if (!empty($formdata->usedefaultsubnet)) {\n $sess->subnet = $att->subnet;\n } else {\n $sess->subnet = $formdata->subnet;\n }\n\n if (!empty($formdata->automark)) {\n $sess->automark = $formdata->automark;\n }\n if (!empty($formdata->preventsharedip)) {\n $sess->preventsharedip = $formdata->preventsharedip;\n }\n if (!empty($formdata->studentsearlyopentime)) {\n $sess->studentsearlyopentime = $formdata->studentsearlyopentime;\n }\n }\n $sess->statusset = $formdata->statusset;\n\n attendance_fill_groupid($formdata, $sessions, $sess);\n }\n\n return $sessions;\n}",
"public function addschedule_employee() { \r\n\r\n $this->form_validation->set_rules('datestart','Date Start','trim|required|xss_clean');\r\n $this->form_validation->set_rules('starttime', 'Schedule for In time', 'trim|required|xss_clean');\r\n $this->form_validation->set_rules('endtime', 'Schedule for Out time', 'trim|required|xss_clean');\r\n $this->form_validation->set_rules('dayoff', 'Day off', 'trim|required|xss_clean');\r\n $this->form_validation->set_error_delimiters('', '');\r\n\r\n if ($this->form_validation->run() == FALSE){ \r\n //catch to the errors\r\n echo json_encode(array(\"response\" => \"error\", \"err\" => validation_errors()));\r\n } \r\n else{\r\n date_default_timezone_set(\"Asia/Manila\");\r\n $date= date(\"Y-m-d\");\r\n $year = date('Y', strtotime($date));\r\n $datenow = $year .\"-\". 12 .\"-\". 31;\r\n $set_data = $this->session->userdata('userlogin'); //session data\r\n $applicantid=$this->input->post('applicantid');\r\n $employeeid=$this->input->post('employeeid');\r\n $clientid=$this->input->post('clientid');\r\n $datestart = $this->input->post('datestart');\r\n $dateremain = $this->input->post('datestart');\r\n $datecontract = $datenow;\r\n $starttime = $this->input->post('starttime');\r\n $endtime = $this->input->post('endtime');\r\n $dayoff = $this->input->post('dayoff');\r\n $na = 'na'; \r\n $dateprocess = date(\"Y-m-d\"); \r\n\r\n $day = date(\"j\", strtotime($datestart));\r\n $month = date('m', strtotime($datestart));\r\n $year = date('Y', strtotime($datestart));\r\n $firstDay = mktime(0,0,0,$month, $day, $year);\r\n $countday = 32 - $day;\r\n $timestamp = $firstDay;\r\n $weekDays = array();\r\n for ($i = 0; $i < $countday; $i++) {\r\n $weekDays[] = strftime('%a', $timestamp);\r\n $timestamp = strtotime('+1 day', $timestamp);\r\n }\r\n $start = array();\r\n foreach($weekDays as $weekDay){\r\n if ($weekDay == $dayoff){\r\n $off ='off';\r\n }\r\n else{\r\n $off = '';\r\n }\r\n $start[]=$off;\r\n }\r\n\r\n $this->Employee_Model->addscheduleemployee($datestart, $dateremain, $datecontract, $starttime, $endtime, $dayoff, $employeeid);\r\n $this->Scheduleemployee_Model->addscheduleemployee($set_data['clientID'], $employeeid, $applicantid, $datestart, $starttime, $endtime, $dayoff, $dateprocess);\r\n\r\n if ($day == 2){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $start[17],\r\n $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $start[29], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 3){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 4){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na,$start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 5){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 6){ \r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 7){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $datestart, $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 8){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $datestart, $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 9){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 10){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 11){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 12){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 13){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 14){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 15){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 16){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 17){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 18){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 19){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 20){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 21){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 22){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 23){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 24){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 25){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 26){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n\r\n }\r\n else if ($day == 27){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n\r\n }\r\n else if ($day == 28){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 29){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 30){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n\r\n }\r\n else if ($day == 31){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else{\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $start[17],\r\n $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $start[29], $start[30], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n echo json_encode(array(\"response\" => \"success\", \"message\" => \"Successfully Added Employee\", \"redirect\" => \"CLientController/dashboard\"));\r\n }\r\n }",
"function getCalender(Request $request){\n\n $auth_id=Auth::user()->id;\n\n if((isset($request->start) && $request->start!='') && (isset($request->end) && $request->end!='')){\n \n /*\n * start_date is getting only date like 2017-11-11 in 2017-11-11T9:15:25\n * end_date is getting only date like 2017-11-17 in 2017-11-17T12:35:35 \n */\n $start_date= str_replace(strstr($request->start, 'T') , \"\", $request->start);\n\n $end_date= str_replace(strstr($request->end, 'T') , \"\", $request->end);\n\n $array=array();\n\n /*\n * get_time is getting the record according to user logged id \n */\n $get_time=CalendarAvailability::select('start_time','end_time','reocuuring')\n ->where('user_id',$auth_id)\n ->get();\n \n /*\n * $array[] is getting all dates between two dates 2017-11-11 to 2017-11-17\n * 2017-11-11,\n * 2017-11-12,\n * 2017-11-13,\n * 2017-11-14,\n * 2017-11-15,\n * 2017-11-16,\n * 2017-11-17\n */\n for ($x=strtotime($start_date);$x<strtotime($end_date);$x+=86400){\n \n $array[]=date('Y-m-d',$x);\n\n }\n\n /*\n * $get_time[0]->reocuuring==0 the sunday,saturday schedule is not display\n * $get_time[0]->reocuuring==1 the sunday schedule is not display\n * $get_time[0]->reocuuringis not equal to 0 or 1 then schedule is display for all days means daily\n */\n if(isset($get_time[0]->reocuuring) && $get_time[0]->reocuuring=='0'){\n unset($array[0]);\n unset($array[6]);\n }elseif (isset($get_time[0]->reocuuring) && $get_time[0]->reocuuring=='1') {\n unset($array[0]);\n }\n \n /*\n * get_holiday_days is getting the holiday dates user logged id and all dates \n */\n $get_holiday_days=CalendarHoliday::select('holiday_date')\n ->where('user_id',$auth_id)\n ->whereIn('holiday_date', $array)\n ->get();\n \n /*\n * $array is gettting that dates which is not in CalenderHoliday table\n */\n for ($i=0; $i <count($get_holiday_days) ; $i++) {\n if(array_search ($get_holiday_days[$i]->holiday_date, $array)){\n $array = array_diff($array, [$get_holiday_days[$i]->holiday_date]);\n }\n \n }\n\n /*\n * $arr is getting start date with start time and end date with end time \n */\n $arr = array();\n foreach ($array as $key => $value) {\n $start=$value.'T'.$get_time[0]->start_time;\n $end=$value.'T'.$get_time[0]->end_time;\n $arr[] = array('start' =>$start ,'end' =>$end);\n }\n\n echo json_encode($arr);die;\n \n }\n \n return view('calendar.get_calender');\n }",
"public function add_schedule() {\n\t\t$data['page'] = 'Schedule';\n\t\t$data['pagetitle']='Manage '.$data['page'].' | Add '.$data['page'];\n\t\t$data['ckeditor']=false;\n\t\t$data['gridTable']=false;\n\t\t\n\t\t$formSubmit = $this->input->post('Submit');\n\t\tif($formSubmit==\"Save\")\n\t\t{\n\t\t\tif($this->input->post('is_to_be_confirm')=='on')\n\t\t\t{\n\t\t\t\t$is_to_be_confirm=1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$is_to_be_confirm=0;\n\t\t\t}\n\t\t\t$tblName = \"schedule\";\n\t\t\t$start_date=date('Y-m-d H:i',strtotime($this->input->post('start_date')));\n\t\t\t$end_date=date('Y-m-d H:i',strtotime($this->input->post('end_date')));\n\t\t\t\n\t\t\t\n\t\t\t\t\t$data = array('total_over_id' =>$this->input->post('total_over_id'),\n\t\t\t\t\t\t\t\t 'stage_id' =>$this->input->post('stage_id'),\n\t\t\t\t\t\t\t\t 'venue_id' =>$this->input->post('venue_id'),\n\t\t\t\t\t\t\t\t 'tournament_group_id_1'=>$this->input->post('tournament_group_id1'),\n\t\t\t\t\t\t\t\t 'tournament_group_id_2'=>$this->input->post('tournament_group_id2'),\n\t\t\t\t\t\t\t\t 'team_id_1' =>$this->input->post('team_id_1'),\n\t\t\t\t\t\t\t\t 'team_id_2' =>$this->input->post('team_id_2'),\n\t\t\t\t\t\t\t\t 'start_date' =>$start_date,\n\t\t\t\t\t\t\t\t 'end_date' =>$end_date,\n\t\t\t\t\t\t\t\t 'is_to_be_confirm'=>$is_to_be_confirm,\n\t\t\t\t\t\t\t\t 'is_active'=>1\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$id=$this->input->post('schedule_id');\n\t\t\t\t\t$fieldName=\"schedule_id\";\n\t\t\t\t\t$this->common->update_record($fieldName,$id,$tblName,$data);\n\t\t\t\t\t$this->session->set_flashdata('msg', 'Schedule has been added successfully.');\n\t\t\t\t\tredirect('admin/schedule','refresh'); //redirect in manage with msg\t\n\t\t\t\t//}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t$data['tournament']=$this->tournament->get_tournament();\n\t\t$data['stage']=$this->schedule->get_stage();\n\t\t$data['venue']=$this->schedule->get_venue();\n\t\t$data['over']=$this->schedule->get_over();\n\t\t$this->load->view('admin/controls/vwHeader');\n\t\t$this->load->view('admin/controls/vwLeft',$data);\n\t\t$this->load->view('admin/controls/vwFooterJavascript',$data);\n\t\t$this->load->view('admin/vwAddSchedule',$data); \n\t\t$this->load->view('admin/controls/vwFooter');\n\t\t\n\t}",
"public function set_standard_schedule() {\n $this->load->model('hrd_model');\n $this->data['title'] = \"Kelola Jadwal\";\n $this->data['subtitle'] =\"Kelola Jadwal\";\n\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n $this->data['message_success'] = $this->session->flashdata('message_success');\n\n\n if (isset($_POST) && !empty($_POST)) {\n $office_hour_id=$this->input->post(\"office_hour\");\n $employees=$this->input->post(\"employees\");\n $start_date=$this->input->post(\"start_date\");\n $end_date=$this->input->post(\"end_date\");\n $repeat=$this->input->post(\"repeat\");\n $start_time=$this->input->post(\"start_time\");\n $end_time=$this->input->post(\"end_time\");\n\n $office_hour=$this->hrd_model->get_one(\"hr_office_hours\", $office_hour_id);\n $return=array();\n $return['status']=true;\n $return['message']=\"\";\n\n\n if ($office_hour_id == \"\" || $office_hour_id = 0) {\n if (($start_time == \"\") || ($end_time == \"\")) {\n $return['status']=false;\n $return['message']=\"Jam Mulai dan Jam Akhir harus diisi\";\n } else {\n $office_hour_id = 0;\n $checkin_time = $start_time;\n $checkout_time = $end_time;\n } \n } else {\n $office_hour_id = $this->input->post(\"office_hour\");\n $checkin_time = $office_hour->checkin_time;\n $checkout_time = $office_hour->checkout_time;\n }\n\n for($x=0;$x<sizeof($employees);$x++){\n $user_id = $employees[$x];\n $checking_schedule = $this->hrd_model->checking_schedule(array(\"start_date\"=>$start_date,\"end_date\"=>$end_date,\"repeat\"=>$repeat,\"user_id\"=>$user_id));\n if(sizeof($checking_schedule)>0){\n $return['status']=false;\n foreach($checking_schedule as $c){\n $return['message'].=$c->name.\" sudah mempunyai jadwal di tanggal \".date(\"d/m/Y\",strtotime($c->start_date)).($c->enum_repeat==1 ? \" dan berlaku seterusnya\" : \" s/d \".date(\"d/m/Y\",strtotime($c->end_date))).\"<br>\"; \n }\n }\n }\n\n if (!empty($employees)){\n\n if($return['status']==true){\n \n\n for($x=0;$x<sizeof($employees);$x++){\n $user_id=$employees[$x];\n\n if($repeat == 1){\n\n $save_data = array(\n 'user_id' => $user_id,\n 'start_date' => $start_date,\n 'end_date' => '0000-00-00',\n 'enum_repeat' => $repeat,\n 'free_day' => 0,\n 'is_special_schedule' => 0\n );\n\n } else {\n\n $save_data = array(\n 'user_id' => $user_id,\n 'start_date' => $start_date,\n 'end_date' => $end_date,\n 'enum_repeat' => $repeat,\n 'free_day' => 0,\n 'is_special_schedule' => 0\n );\n\n }\n\n $save_data = $this->hrd_model->save('hr_schedules', $save_data); \n\n if($save_data){\n $save_detail = array(\n 'schedule_id' => $save_data,\n 'office_hour_id' => $office_hour_id,\n 'start_time' => $checkin_time,\n 'end_time' => $checkout_time\n );\n $this->hrd_model->save('hr_schedule_detail', $save_detail);\n }\n\n } \n \n }\n }\n\n \n redirect(base_url(SITE_ADMIN.'/hrd_schedule/set_standard_schedule','refresh'));\n\n \n } else {\n $store = $this->data['setting']['store_id'];\n $this->data['office_hours']= $this->hrd_model->get(\"hr_office_hours\")->result();\n\n $usersch = array();\n $get_user_id = $this->hrd_model->get(\"hr_schedules\")->result();\n foreach ($get_user_id as $key) {\n array_push($usersch, $key->user_id);\n }\n\n $this->data['data_url'] = base_url(SITE_ADMIN . '/hrd_schedule/get_employee_schedule_data');\n $this->data['employees']=$this->hrd_model->get_employee_schedule(array(\"active\"=>1, \"store_id\" => $store),false);\n\n \n $this->data['content'] .= $this->load->view('admin/hrd/set_schedule_standard_view', $this->data, true);\n $this->render('hrd');\n }\n\n }",
"public function get_calendar_data_spec(){\r\n\r\n if (Go_to::is_on_page(\"edit_calendar\")){\r\n \r\n $this->active_month = $_GET['month'];\r\n $this->active_year = $_GET['year']; \r\n \r\n \r\n }\r\n if (Go_to::is_on_page(\"calendar_submit\")){\r\n \r\n $this->active_month = $_SESSION['active_month'];\r\n $this->active_year = $_SESSION['active_year']; \r\n// echo \"MIJESECCCCCC \" . $this->active_month; \r\n \r\n }\r\n \r\n \r\n if (Go_to::is_on_page(\"print_calendar\")){\r\n $room_id = $_POST['room_id'];\r\n \r\n }\r\n \r\n \r\n }",
"function show_next_calendar(){ \n \t\t\t$this->gen_contents['region_search'] \t= $_POST['region'];\n \t\t\t$this->gen_contents['subregion_search'] = $_POST['subregion'];\n $this->gen_contents['course_search'] = $_POST['course'];\n if($this->gen_contents['course_search']=='5'){\n $this->gen_contents['chp_search'] = $_POST['chp'];\n }\n $this->gen_contents[\"chp_list\"] = $this->config->item('chapter_list');\n $this->gen_contents[\"crse_color\"] = $this->config->item('course_color');\n \t\t\t// we call _date function to get all the details of calendar n its event\n\t\t\t$this->gen_contents = array_merge($this->gen_contents,$this->_date($_POST['timeid'],$_POST['course'],$_POST['region'],$_POST['subregion']));\n\t\t\t\n\t\t\t$this->load->view('user/career_event/schedule_calendar',$this->gen_contents);\n \t\t}",
"public function createSchedule(Request $request)\n\t{\n\t\t// $intervel = $req->interval;\n\t\t// $start_time_interval = $request->start_time;\n\t\t// $selectedDays = explode(\" - \", $req->days);\n\t\t// $date_from = strtotime($selectedDays[0]); // Convert date to a UNIX timestamp\n\t\t// $date_to = strtotime($selectedDays[1]); // Convert date to a UNIX timestamp\n\t\t// $days = array();\n\t\t// for ($i = $date_from; $i <= $date_to; $i+=86400) {\n\t\t// $days[] = date(\"d-m-Y\", $i);\n\t\t// }\n\n\t\t// $selectedDays = explode(\" - \", $request->days);\n\t\t// $date_from = strtotime($selectedDays[0]); // Convert date to a UNIX timestamp\n\t\t// $date_to = strtotime($selectedDays[1]); // Convert date to a UNIX timestamp\n\t\t$days = $request->days;\n\t\t// for ($i = $date_from; $i <= $date_to; $i+=86400) {\n\t\t// $days[] = date(\"d-m-Y\", $i);\n\t\t// }\n\n\n\t\tforeach ($days as $key => $day) {\n\t\t\t$intervel = $request->interval;\n\t\t\t$start_time_interval = $request->start_time;\n\t\t\t$end_time_interval = $request->start_time;\n\t\t\t$start_time = $request->start_time;\n\t\t\t$end_time = $request->end_time;\n\t\t\t$end_interval = $request->interval * 2;\n\t\t\t// 90\n\n\t\t\t$loopCount = 0;\n\t\t\twhile ($end_time_interval < $end_time) {\n\t\t\t\t // 12:00\n\t\t\t\tif($loopCount > 0){\n\t\t\t\t\t$start_time_interval = date('h:i A', strtotime(\"+$intervel minutes\", strtotime($start_time_interval)));\n\t\t\t\t}\n\t\t\t\t$end_time_interval = date('h:i A', strtotime(\"+$intervel minutes\", strtotime($start_time_interval)));\n\t\t\t\t$return = $start_time_interval.\" - \".$end_time_interval.\"</br>\";\n\t\t\t\t$loopCount++;\n\t\t\t\t// if ($loopCount > 5) {\n\t\t\t\t// \texit();\n\t\t\t\t// }\n\t\t\t\t// echo $return.\"<br/>\";\n\n\t\t\t\tif (!RecruiterSchedule::where('fair_id',$request->fair_id)\n\t\t\t\t\t->where('company_id',$request->company_id)\n\t\t\t\t\t->where('recruiter_id',$request->recruiter_id)\n\t\t\t\t\t->where('start_time',$start_time_interval)\n\t\t\t\t\t->where('end_time',$end_time_interval)\n\t\t\t\t\t->where('days',$day)->exists()){\n\t\t\t\t\t$create = RecruiterSchedule::create(array(\n\t\t\t\t\t\t'fair_id' => $request->fair_id,\n\t\t\t\t\t\t'company_id' => $request->company_id,\n\t\t\t\t\t\t'recruiter_id' => $request->recruiter_id,\n\t\t\t\t\t\t'start_time' => $start_time_interval,\n\t\t\t\t\t\t'end_time' => $end_time_interval,\n\t\t\t\t\t\t'days' => $day,\n\t\t\t\t\t\t'days_arr' => json_encode($request->days),\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn response()->json([\n 'success' => true,\n 'message' => 'Time Slots Added Successfully'\n ],200);\n\n\t}",
"function setEvent() {\n \n if($_POST['am'] == 1){\n $star_time = $_POST['stime_a'] + 12 . \":\". $_POST['stime_b'];\n }else{\n $star_time = $_POST['stime_a'] . \":\". $_POST['stime_b'];\n }\n \n if($_POST['am1'] == 1){\n $end_time = $_POST['stime_c'] + 12 . \":\". $_POST['stime_d'];\n }else{\n $end_time = $_POST['stime_c'] . \":\". $_POST['stime_d'];\n }\n\n $values = array('event_id' => uniqid(),\n 'web_id' => WEB_ID,\n 'title' => $_POST['title'],\n 's_time' => $star_time,\n 'e_time' => $end_time,\n 'date' => date('Y-m-d H:i:s', strtotime($_POST['sDate'])),\n 'location' => $_POST['location'],\n 'description' => $_POST['disc'],\n 'end_date' => date('Y-m-d H:i:s', strtotime($_POST['eDate'])),\n 'visible' => \"on\"\n );\n\n $this->db->insert('events', $values);\n }",
"public function attendance_calendar($action = 'calendar_list', $attendance_id = 0, $calendar_id = 0)\n {\n $attendance = new Attendance();\n $calendar_id = intval($calendar_id);\n $data = array();\n $data['attendance_id'] = $attendance_id;\n $attendance_id = intval($attendance_id);\n $groupList = isset($_POST['groups']) ? array($_POST['groups']) : array();\n\n if ($action == 'calendar_add') {\n if (strtoupper($_SERVER['REQUEST_METHOD']) == \"POST\") {\n if (!isset($_POST['cancel'])) {\n if (isset($_POST['repeat'])) {\n //@todo check this error_logs\n $start_datetime = api_strtotime(\n api_get_utc_datetime($_POST['date_time']), 'UTC'\n );\n\n $end_datetime = api_strtotime(api_get_utc_datetime($_POST['end_date_time'].' 23:59:59'), 'UTC');\n $checkdate = api_is_valid_date(api_get_utc_datetime($_POST['end_date_time'].' 23:59:59'));\n\n $repeat_type = $_POST['repeat_type'];\n if (($end_datetime > $start_datetime) && $checkdate) {\n $attendance->attendance_repeat_calendar_add(\n $attendance_id,\n $start_datetime,\n $end_datetime,\n $repeat_type,\n $groupList\n );\n $action = 'calendar_list';\n } else {\n if (!$checkdate) {\n $data['error_checkdate'] = true;\n } else {\n $data['error_repeat_date'] = true;\n }\n $data['repeat'] = true;\n $action = 'calendar_add';\n }\n } else {\n $datetime = $_POST['date_time'];\n $datetimezone = api_get_utc_datetime($datetime);\n if (!empty($datetime)) {\n $attendance->set_date_time($datetimezone);\n $attendance->attendance_calendar_add($attendance_id, $groupList);\n $action = 'calendar_list';\n } else {\n $data['error_date'] = true;\n $action = 'calendar_add';\n }\n }\n } else {\n $action = 'calendar_list';\n }\n }\n } else if ($action === 'calendar_edit') {\n $data['calendar_id'] = $calendar_id;\n if (strtoupper($_SERVER['REQUEST_METHOD']) == \"POST\") {\n if (!isset($_POST['cancel'])) {\n $datetime = $_POST['date_time'];\n $datetimezone = api_get_utc_datetime($datetime);\n $attendance->set_date_time($datetimezone);\n $attendance->attendance_calendar_edit($calendar_id, $attendance_id);\n $data['calendar_id'] = 0;\n $action = 'calendar_list';\n } else {\n $action = 'calendar_list';\n }\n }\n } else if ($action == 'calendar_delete') {\n $attendance->attendance_calendar_delete($calendar_id, $attendance_id);\n $action = 'calendar_list';\n } else if ($action == 'calendar_all_delete') {\n $attendance->attendance_calendar_delete(0, $attendance_id, true);\n $action = 'calendar_list';\n }\n\n $data['action'] = $action;\n $data['attendance_calendar'] = $attendance->get_attendance_calendar(\n $attendance_id,\n 'all',\n null,\n null,\n true\n );\n $data['is_locked_attendance'] = $attendance->is_locked_attendance($attendance_id);\n // render to the view\n $this->view->set_data($data);\n $this->view->set_layout('layout');\n $this->view->set_template('attendance_calendar');\n $this->view->render();\n }",
"function get_schedule($usrid){\r\n\t\r\n}",
"public function schedule_add(Request $request)\n {\n \t//save this data to table\n \t$post= schedule::create([\n \t\t\"doc_id\"=>$request->doc_id,\n \t\t\"date_time\"=>$request->date_time,\n \t\t]);\n return redirect('/schedule_show');\n //dd($post)\n }",
"public function schedule(){\n\t\t$this->load->model('Sup_admin');\n\t\t$this->load->model('Crud_model');\n\t\t$this->load->model('Admin_model');\n\t\t$this->load->model('profile_model');\n\t\t$this->form_validation->set_rules('date', 'Meeting Date', 'required');\n\t\t$this->form_validation->set_rules('stime', 'Start Time', 'required');\n\t\t$this->form_validation->set_rules('etime', 'End Time', 'required|callback_time['.$this->input->post('stime').']');\n\t\t\n\t\t$csrf_token=$this->security->get_csrf_hash();\n\t\tif ($this->form_validation->run() == FALSE)\n {\n\t\t\t$ab=array('res'=>0,'errors'=>validation_errors(),'csrf_token'=>$csrf_token);\n echo json_encode($ab);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//functionality\n\t\t\t\t$d = $this->input->post('date');\n\t\t\t\t$st= $this->input->post('stime');\n\t\t\t\t$et=$this->input->post('etime');\n\t\t\t\t$res = explode(\"-\", $d);\n\t\t\t\t$span= $res[2].\"-\".$res[1].\"-\".$res[0].\" \".$st.\" - \".$res[2].\"-\".$res[1].\"-\".$res[0].\" \".$et;\n\t\t\t\t$start_time = substr($span,0,16);\n\t\t\t\t$end_time=substr($span,19,35);\n\t\t\t\t$noti_head=\"New Meeting\";\n\t\t\t\t$st=mdate('%Y-%m-%d at %H:%i hrs', strtotime( $start_time ));\n\t\t\t\t$et=mdate('%Y-%m-%d at %H:%i hrs', strtotime( $end_time ));\n\t\t\t\t$noti_text=\"The next meeting has been scheduled on \".$st.\" and it will end on \".$et.\".\";\n\t\t\t\t$target_audience=\"NMEET00\";\n\t\t\t\t\t$radiosel=2;//broadcast\n\t\t\t\t\t$audience_ut=$this->session->userdata('user_type');\t\n\t\t\t\t\t$audience_loc=$this->session->userdata('location_code');\n\t\t\t\t\t$audience_desig_only=$this->session->userdata('desig');\n\t\t\t\t//2hours relaxation on the provided time\n\t\t\t\t$start_time= mdate('%Y-%m-%d %H:%i',strtotime('-2 hours', strtotime( $start_time )));\n\t\t\t\t$end_time= mdate('%Y-%m-%d %H:%i',strtotime('+2 hours', strtotime( $end_time )));\n\t\t\t\t$data=array(\n\t\t\t\t\t'start_time'=> $start_time,\n\t\t\t\t\t'end_time'=> $end_time,\n\t\t\t\t\t'active_status'=>1\n\t\t\t\t);\n\t\t\t\t$this->db->trans_off();\n\t\t\t\t$this->db->trans_strict(FALSE);\n\t\t\t\t$this->db->trans_start();\n\t\t\t\t$this->Admin_model->meeting_schedule($data);\n\t\t\t\t//$this->load->view('schedule',$data);\n\t\t\t\t$this->profile_model->savenotifs($target_audience,$noti_text,$noti_head,$audience_ut,$audience_loc,$audience_desig_only,$radiosel);\n\t\t\t\t$this->Crud_model->audit_upload($this->session->userdata('loginid'),\n\t\t\t\t\t\t\t\t\t\t\t\tcurrent_url(),\n\t\t\t\t\t\t\t\t\t\t\t\t'Meeting Schedule Updated',\n\t\t\t\t\t\t\t\t\t\t\t\t$start_time.' - '.$end_time);\n\t\t\t\t$this->db->trans_complete();\n\n\t\t\t$ab=array('csrf_token'=>$csrf_token,'res'=>1);\n\t\t\techo json_encode($ab);\n\t\t}\n\t}",
"private function createSchedule()\n {\n $days = DisplayScheduleDay::singleton()->dbObject('Day')->enumValues();\n foreach ($days as $day) {\n $scheduleDay = DisplayScheduleDay::create();\n $scheduleDay->Day = $day;\n $this->Schedule()->add($scheduleDay);\n }\n }",
"public function setSchedule ()\n {\n $this->loadComponent('DateTime');\n $this->loadModel('ScheduleTime');\n $data = $this->Auth->user();\n $id_fortune = $data['id'];\n $days = $this->DateTime->allDayInWeek();\n $months = $this->DateTime->allDayInMonth();\n $times = $this->ScheduleTime->getListTime();\n if ($this->Check->isId($id_fortune)) {\n $this->set([\n 'times' => $times,\n 'days' => $months,\n 'id' => $id_fortune\n ]);\n } else{\n $this->Flash->error(__('Id not found'));\n }\n }",
"public function cal()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Start up\n\t\t// -------------------------------------\n\n\t\t$this->get_first_day_of_week();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$disable = array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date',\n\t\t\t\t//'default' => 'today'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_days',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => 1\n\t\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_weeks',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_months',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'show_years',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '0000'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'time_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'time',\n\t\t\t\t'default' => '2359'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'day_limit',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => '10'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'event_limit',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => '0'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'first_day_of_week',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'default' => $this->first_day_of_week\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'pad_short_weeks',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'bool',\n\t\t\t\t'default' => 'yes',\n\t\t\t\t'allowed_values' => array('yes', 'no')\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'enable',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'default' => '',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'allowed_values' => $disable\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Do some voodoo on P\n\t\t// -------------------------------------\n\n\t\t$this->process_events_params();\n\n\t\t// -------------------------------------\n\t\t// Let's go build us a gosh darn calendar!\n\t\t// -------------------------------------\n\n\t\t$this->parent_method = __FUNCTION__;\n\n\t\treturn $this->build_calendar();\n\t}",
"public function createSchedule()\n\t{\t\t\n\t\t$validator = array('success' => false, 'messages' => array());\n\t\t$attendance = $this->model_schedule->createSchedule();\n\n\t\tif($attendance == true) {\n\t\t\t$validator['success'] = true;\n\t\t\t$validator['messages'] = 'Successfully Added';\n\t\t}\n\t\telse {\n\t\t\t$validator['success'] = false;\n\t\t\t$validator['messages'] = 'Error';\t\n\t\t}\n\n\t\techo json_encode($validator);\n\n\t}",
"public function activities_cal($checkavailableday){\n $calendar_selected['start_date'] = $this->input->post('txtFrom');\n $calendar_selected['end_date'] = $this->input->post('txtTo');\n $calendar_selected['start_time'] = $this->input->post('txtStartTime');\n $calendar_selected['end_time'] = $this->input->post('txtEndTime');\n $day = array(\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\",\"saturday\",\"sunday\");\n if($checkavailableday[0] == \"1_everyday\"){\n $calendar_selected['monday'] = 1;\n $calendar_selected['tuesday'] = 1;\n $calendar_selected['wednesday'] = 1;\n $calendar_selected['thursday'] = 1;\n $calendar_selected['friday'] = 1;\n $calendar_selected['saturday'] = 1;\n $calendar_selected['sunday'] = 1;\n }else{\n if($checkavailableday[0] != \"\" and count($checkavailableday) > 0){\n for($i = 0; $i < count($day); $i++){\n for($j = 0; $j < count($checkavailableday); $j++){\n $explode = explode(\"_\", $checkavailableday[$j]);\n if($explode[1] == $day[$i]){\n $calendar_selected[$day[$i]] = $explode[0];\n }\n }\n if(array_key_exists($day[$i], $calendar_selected) === FALSE){\n $calendar_selected[$day[$i]] = 0;\n }\n }\n }\n }\n return $calendar_selected;\n }",
"public function actionCreatecal($start,$end,$resource)\n\t{\n\t\t$this->layout = '//layouts/iframe1';\n\t\t$model=new Roomclosure;\n\t\t$model->room_id=$resource;\n\t\t$model->start_date=$start;\n\t\t$model->end_date=$end;\n\t\t$model->cl_id = Pattern::generate(\"CLOSURE_CODE\");\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Roomclosure']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Roomclosure'];\n\t\t\t$model->room_id=$resource;\n\t\t\tif($start<=$end){\n\t\t\t\tif($model->validate()) {\n\t\t\t\t #$transaction mulai transaksi\n\t\t\t\t $transaction = Yii::app()->db->beginTransaction();\n\t\t\t\t try{\n\t\t\t\t\t\tPattern::increase('CLOSURE_CODE');\n\t\t\t\t $model->save();\n\t\t\t\t #jika tidak ada error transaksi proses di commit\n\t\t\t\t $transaction->commit();\n\t\t\t\t\t\t#response ke json\n\t\t\t\t\t\t$response = new Resultec();\n\t\t\t\t\t\t$response->result = 'OK';\n\t\t\t\t\t\t$response->message = 'Create successful';\n\n\t\t\t\t\t\tYii::app()->end();\n\t\t\t\t }\n\t\t\t\t catch(exception $e) {\n\t\t\t\t $transaction->rollback();\n\t\t\t\t throw new CHttpException(500, $e->getMessage());\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tYii::app()->user->setFlash('success', \"Created Failed\");\n\t\t\t}\n\t\t}\n\n\t\t$this->render('_formcal',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"function add_event($input = array()) {\r\n \r\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\r\n \r\n // check if user is logged in\r\n if (!isset($_SESSION['active']) || $_SESSION['active'] === false) {\r\n header(\"location: \" . $_SERVER['PHP_SELF'] . \"?action=login&error=err_login_to_add_event\");\r\n return;\r\n }\r\n \r\n require(HOME_DIR . 'libs/event.class.php');\r\n $event = new event;\r\n \r\n\r\n $event->creator_id = $_SESSION['user_id'];\r\n // check if title is empty\r\n if (empty($input['title'])) {\r\n $this->tpl->assign('ERROR_TITLE', 'err_title_empty');\r\n return;\r\n }\r\n $event->title = $input['title'];\r\n \r\n // check description\r\n if (empty($input['description'])) {\r\n $this->tpl->assign('ERROR_DESCRIPTION', 'err_description_empty');\r\n return;\r\n }\r\n $event->description = $input['description'];\r\n\r\n // check label\r\n $label = $input['label'];\r\n $label = json_decode($label);\r\n $event->label = $label;\r\n \r\n // check date\r\n $event->fixed_date = isset($input['fixed_date']) ? 1 : 0;\r\n $event->start_date = date('Y-m-d', mktime($input['start_date']));\r\n $event->start_time = date('h:i', mktime($input['start_time']));\r\n\r\n // check location\r\n $event->fixed_location = isset($input['fixed_location']) ? 1 : 0;;\r\n \r\n // handle number of participants\r\n $event->limited_number_of_participants = isset($input['limited_number_of_participants']) ? 1 : 0;\r\n $event->max_number_of_participants = $input['max_number_of_participants'];\r\n \r\n // handle reservations\r\n $event->advance_reservation_required = isset($input['advance_reservation_required']) ? 1 : 0; \r\n $event->confirm_reservations = isset($input['advance_reservation_required']) && isset($input['confirm_reservations']) ? 1 : 0;\r\n\r\n $event->insert_into_db();\r\n header(\"location: \" . $_SERVER['PHP_SELF'] . \"?action=dashboard&message=event_successfully_created\"); \r\n } \r\n }",
"protected function get_calendar_data(){\r\n global $user;\r\n \r\n \r\n if (Go_to::is_on_page(\"edit_room\")){\r\n $this->room_name = $_GET['room'];\r\n $this->owner = $user->username();\r\n $this->facility_name = $_SESSION['active_fac'] ;\r\n// $this->room = $user->username()\";\r\n// var_dump($_SESSION);\r\n// var_dump($this);\r\n }\r\n \r\n \r\n \r\n\r\n }",
"protected function schedule(Schedule $schedule)\n {\n\n $schedule->call(function () {\n $appointment = Appointment::get();\n for ($i = 0; $i < sizeof($appointment); $i++) {\n $appointObject = $appointment[$i]; // 약속 객체 한개\n $cur_time = new \\DateTime(); // 현재 시간\n $appoint_date = new \\DateTime($appointObject->date . ' ' . $appointObject->date_time); // 약속 날짜\n $date_gap = date_diff($cur_time, $appoint_date); // 현재 시간과 약속 시간의 차이\n if ($date_gap->invert == 1) { // 현재 시간이 약속 시간을 지난 경우 -> 약속 종료 상태로 변경\n if ($appointObject->status == 1) {\n $member = Member::where('Member.appointment_id', $appointObject->id)->get();\n //약속 멤버 모두에게 약속 종료 알림 보내기\n foreach ($member as $object) {\n $user = User::find($object->user_id);\n $user->latitude = 0;\n $user->longitude = 0;\n if ($object->success == 0) {\n $object->Fine_final = $object->Fine_current;\n }\n $user->save();\n\n $object->save();\n }\n\n// NotificationController::SendGameNotification($appointObject->id,$date_gap->h * 60 + $date_gap->i,0,100,$pageTime,array()); //push 알람 보내기\n }\n $appointObject->status = 2; //status가 0이든 1이든 종료상태로\n } else { // 약속 시작 전 또는 진행 중\n\n // 초 단위 차이\n $time_gap = $date_gap->h * 60 * 60 + $date_gap->i * 60 + $date_gap->s;\n // 설정된 타이머(초)\n $timer = 120 * 60; //2시간\n\n\n // 총 게임 진행 시간(초)\n $totalGameTime = $timer;\n // **약속 실행전**\n if ($appointObject->status == 0) {\n if ($date_gap->days == 0) { // 현재 날짜와 같음\n\n if ($time_gap <= $totalGameTime) {\n // 시작 상태로 변경하기\n $appointObject->status = 1;\n $appointObject->radius = 20000;\n\n }\n }\n } // **약속 실행중**\n else {\n\n\n $appointObject->radius = $appointObject->radius - ((20000 / $timer) * 60);\n if ($appointObject->radius < 100)\n $appointObject->radius = 100; //100미터까지\n\n $member = Member::join('users', 'Member.user_id', '=', 'users.id')->where('Member.appointment_id', $appointObject->id)->get();\n if($appointObject->Fine_current==1) {\n\n $appointObject->Fine_current = $appointObject->Fine_time;\n\n\n foreach ($member as $object) {\n $circle_in = true;\n $distance = GpsService::geoDistance($object->latitude, $object->longitude, $appointObject->latitude, $appointObject->longitude) * 1000;\n $member_user = Member::where('appointment_id', $appointObject->id)->where('user_id', $object->user_id)->first();\n if ($appointObject->radius < $distance) { //원 밖에 있다.\n//\n $circle_in = false;\n if($member_user!=null)\n $member_user->update(['Fine_current' => (int)$member_user->Fine_current + $appointObject->Fine_money]);\n\n } else if ($distance < 100) //도착\n {\n if($member_user!=null)\n $member_user->update(['success' => 1, 'Fine_current' => 0]);\n }\n\n $appointObject->results()->create([\n 'user_id' => $object->user_id,\n 'Fine_current' => $member_user->Fine_current,\n 'appointment_radius' => $appointObject->radius,\n 'latitude' => $object->latitude,\n 'longitude'=> $object->longitude,\n 'time'=>date(\"h:i\"),\n 'circle_in'=>$circle_in,\n ]);\n }\n\n }else{\n $appointObject->Fine_current = $appointObject->Fine_current -1;\n }\n NotificationController::SendGameNotification($appointObject->id,$appointObject,$member);\n }\n\n }\n $appointObject->save(); //반지름 변경\n }\n })->everyMinute(); //매 분마다\n }",
"function store(){\n\n date_default_timezone_set( 'Asia/Manila' );\n\n $buffer = '2 Hours';\n\n //INITIAL CHECKS\n if( $_POST['startTime'] < date( 'H:i:s', strtotime( '8:00 am' ) ) || $_POST['startTime'] > date( 'H:i:s', strtotime( '5:00 pm' ) ) ){\n redirect( route( 'reservations?alert=1' ) );\n return false;\n }\n\n $request_start = date( 'Y-m-d H:i:s', strtotime( $_POST['reservation_startdate'].\" \".$_POST['startTime'] ) );\n $duration = where( 'reservation_categories', \"reservation_category = '{$_POST['reservation']}'\")[0]['reservation_duration'];\n\n //Get and Set End of Requested event\n $request_end = date_add(\n date_create( $request_start ),\n date_interval_create_from_date_string( $duration ));\n\n $request_end = date_format( $request_end, 'Y-m-d H:i:s' );\n //END\n\n //Get and Set request date with buffer\n $request_buffered = date_sub(\n date_create( $request_start ),\n date_interval_create_from_date_string( $buffer )\n );\n\n $request_buffered = date_format( $request_buffered, 'Y-m-d H:i:s' );\n //END\n\n\n //First line of defense in checking whether there is already an existing reservation\n $first_check = where( 'reservations', \"'{$request_buffered}' < reservation_enddate AND reservation_enddate < '{$request_end}'\" );\n\n if( !empty( $first_check )){\n\n redirect( route( 'dashboard/reservation/create?alert=1' ) );\n return false;\n\n }\n\n //Last line of defense to check an existing reservation\n $second_check = where( 'reservations', \"'{$request_buffered}' < reservation_startdate AND reservation_startdate < '{$request_end}'\" );\n\n if( !empty( $second_check ) ){\n\n redirect( route( 'dashboard/reservation/create?alert=1' ) );\n return false;\n }\n\n\n\n $data = [\n\n 'reserver_name' => $_POST['reserver_name'],\n 'reserver_contact' => $_POST['reserver_contact'],\n 'reservation' => $_POST['reservation'],\n 'reservation_startdate' => $request_start,\n 'reservation_enddate' => $request_end,\n 'facilitator' => $_POST['facilitator'],\n 'approved_by' => $_POST['approved_by'],\n 'approved_date' => date( 'Y-m-d H:i:s' ),\n 'reservation_status' => 'Approved',\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n\n\n ];\n\n\n insert('reservations', $data );\n\n //START SMS\n $settings = get( 'settings', 1);\n\n if( !insert('reservations', $data ) ){\n redirect( route( 'reservations?alert=2' ) );\n }\n\n $number = $_POST['reserver_contact'];\n $message = $settings[0]['approved_message'];\n $apicode = $settings[0]['sms_key'];\n\n //Notify admin\n itexmo( $number, $message, $apicode );\n\n redirect( route( 'dashboard/reservation' ) );\n return true;\n}",
"public function create() {\n $data[''] \t\t= $this->input->post('date_from'); \n $data[''] \t\t= $this->input->post('date_to');\n\t\t\n\t\t$SendData = array(\n\t\t'' => '',\n\t\t'' => ''\n\t\t);\n \n\t\t\n Template::set('toolbar_title', lang(\"atndnce_proces_title\"));\n Template::set_view('attendance_processing/attendance_processing_form');\n Template::render();\n\t\t\n }",
"function CreateSchedule($arraypost) {\n\tglobal $server;\n\tglobal $user;\n\tglobal $device;\n\t$url = \"http://\".$server.\"/api/\".$user.\"/schedules\";\n\t\n\t$status \t= (empty($arraypost[\"status\"]) ? \"enabled\" : $arraypost[\"status\"]);\n\t\n\t$on \t\t= (empty($arraypost[\"on\"]) ? 0 : $arraypost[\"on\"]);\n\t$colorhex \t= (empty($arraypost[\"colorhex\"]) ? \"#fead59\" : \"#\".$arraypost[\"colorhex\"]);\n\t$alert \t\t= (empty($arraypost[\"alert\"]) ? \"none\" : $arraypost[\"alert\"]);\n\t$bri \t\t= (empty($arraypost[\"bri\"]) ? \"254\" : $arraypost[\"bri\"]);\n\t$ct \t\t= (empty($arraypost[\"ct\"]) ? \"369\" : $arraypost[\"ct\"]);\n\t$hue \t\t= (empty($arraypost[\"hue\"]) ? \"14910\" : $arraypost[\"hue\"]);\n\t$sat \t\t= (empty($arraypost[\"sat\"]) ? \"144\" : $arraypost[\"sat\"]);\n\t$transition = (empty($arraypost[\"transition\"]) ? \"0\" : $arraypost[\"transition\"]);\n\t$effect\t \t= (empty($arraypost[\"effect\"]) ? \"none\" : $arraypost[\"effect\"]);\n\t\n\t$arrayattr = array();\n\t\n\t// Name -------------------------------------\n\t$arrayattr[] = \"\\\"name\\\":\\\"\".$arraypost[\"name\"].\"\\\"\";\n\t\n\t// Description -------------------------------------\n\t$arrayattr[] = \"\\\"description\\\":\\\"\".$arraypost[\"description\"].\"\\\"\";\n\t\n\t// Command -------------------------------------\n\t\n\t// State On ----------------------------------\n\t$arrayattr1[] = \"\\\"on\\\":\".($on==1 ? \"true\" : \"false\").\"\";\n\t\n\t// Color hex ---------------------------------\n\tif (!empty($colorhex)) {\n\t\t$tabcolor = convertColorHextoxyY($colorhex);\n\t\t$x = $tabcolor[\"x\"];\n\t\t$y = $tabcolor[\"y\"];\n\t\t$bri = intval($tabcolor['Y']);\n\t\t$arrayattr1[] = \"\\\"xy\\\":[\".$x.\",\".$y.\"]\";\n\t}\n\tif ($colorhex=\"#fead59\") {\n\t\t$bri = \"254\";\n\t}\n\t/*\n\t// Alert -------------------------------------\n\t$arrayattr1[] = \"\\\"alert\\\":\\\"\".$alert.\"\\\"\";\n\t\n\t// Brightness --------------------------------\n\t$arrayattr1[] = \"\\\"bri\\\":\".$bri;\n\t\n\t// Colour Temperature ------------------------\n\t$arrayattr1[] = \"\\\"ct\\\":\".$ct;\n\t\n\t// Hue ---------------------------------------\n\t$arrayattr1[] = \"\\\"hue\\\":\".$hue;\n\t\n\t// Saturation --------------------------------\n\t$arrayattr1[] = \"\\\"sat\\\":\".$sat;\n\t\n\t// Transition --------------------------------\n\t$arrayattr1[] = \"\\\"transitiontime\\\":\".$transition;\n\t\n\t// Effect ------------------------------------\n\t$arrayattr1[] = \"\\\"effect\\\":\\\"\".$effect.\"\\\"\";\n\t*/\n\t\n\t$arrayattr[] = \"\\\"command\\\":{\n\t\t\\\"address\\\": \\\"/api/\".$user.\"/groups/\".$arraypost[\"group\"].\"/action\\\",\n\t\t\\\"method\\\": \\\"PUT\\\",\n\t\t\\\"body\\\": { \".implode(\",\", $arrayattr1).\" }}\";\n\t\n\t// LocalTime -------------------------------------\n\t$arrayattr[] = \"\\\"localtime\\\":\\\"\".$arraypost[\"localtime\"].\"\\\"\";\n\t\n\t// Status -------------------------------------\n\t$arrayattr[] = \"\\\"status\\\":\\\"\".$status.\"\\\"\";\n\t\n\t$attr = \"{\";\n\t$attr .= implode($arrayattr, \",\");\n\t$attr .= \"}\";\n\techo $attr;\n\treturn LaunchCurl($url,\"post\",$attr);\n}",
"public static function initialize_calendar(){\n \n $event_array[] = array();\n $schedules = \\App\\Event::get();\n if(!empty($schedules)){\n foreach($schedules as $schedule){\n $event_array[] = array(\n 'id' => uniqid(),\n 'title' => $schedule->description,\n 'start' => date('Y-m-d', strtotime($schedule->event_date)),\n 'end' => date('Y-m-d', strtotime($schedule->event_date)),\n 'color' => \"lightblue\",\n \"textEscape\"=> 'false' ,\n 'textColor' => 'black',\n );\n }\n return $get_schedule = json_encode($event_array);\n }\n }"
] |
[
"0.665284",
"0.6614354",
"0.65140843",
"0.6470651",
"0.6466253",
"0.6435226",
"0.6425836",
"0.6293973",
"0.62724364",
"0.62689316",
"0.6236893",
"0.6214921",
"0.6205331",
"0.6174934",
"0.6111102",
"0.609358",
"0.6072556",
"0.59779507",
"0.5975258",
"0.5942163",
"0.5918675",
"0.5901123",
"0.5899198",
"0.5898153",
"0.5894734",
"0.5889633",
"0.588667",
"0.58768946",
"0.58544654",
"0.5851793"
] |
0.70999044
|
0
|
/ calenderHolidayDel function is call that time when user mark schedule as a holiday or delete there are two parameters in $_REQUEST like date_hidden,schedule date_hiiden means selected schedule day schedule is either 1 or 2 1 means holiday and 2 means delete
|
function calenderHolidayDel(Request $request){
$id = Auth::user()->id;
$date = $request->date_hidden;
$action = $request->schedule;
if($action==1){
CalendarHoliday::create(['user_id'=>$id,
'holiday_date'=>$date]);
$status_msg='Successfully updated';
}
else{
CalendarAvailability::where('user_id',$id)->delete();
CalendarHoliday::where('user_id',$id)->delete();
$status_msg='Successfully deleted';
}
Session::flash('status',$status_msg);
return redirect()->back();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function employee_holidays() {\n $this->data['title'] = \"Kelola Hari Libur\";\n $this->data['subtitle'] =\"Kelola Hari Libur\";\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n $this->data['message_success'] = $this->session->flashdata('message_success');\n\n $this->form_validation->set_rules('holiday-date', 'Tanggal Libur', 'required');\n $this->form_validation->set_rules('employees', 'Karyawan', 'required');\n\n if ($this->form_validation->run()==TRUE) {\n \n $employees=$this->input->post(\"employees\");\n $date = $this->input->post('holiday-date');\n\n if (!empty($employees) || !empty($date)) {\n\n\n // $this->hrd_model->delete_by_limit(\"hr_employee_holidays\",array(\"day\"=>$day),0);\n foreach($employees as $e){\n $this->hrd_model->save(\"hr_employee_holidays\",array(\n \"created_at\"=>date(\"Y-m-d H:i:s\"),\n \"created_by\"=>$this->data['user_profile_data']->id,\n \"user_id\"=>$e,\n \"day\"=>$date\n ));\n }\n $this->session->set_flashdata('message_success', \"Hari libur berhasil disimpan.\");\n } else {\n $this->session->set_flashdata('message', \"Gagal menyimpan. \");\n }\n\n redirect(base_url(SITE_ADMIN.\"/hrd_schedule/employee_holidays\"));\n\n } else {\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n $this->data['message_success'] = $this->session->flashdata('message_success');\n $this->data['employees']=$this->hrd_model->get_all_where(\"users\",array(\"active\"=>1,\"name !=\"=>$this->config->config['sync_user_username']));\n\n $this->data['data_url'] = base_url(SITE_ADMIN . '/hrd_schedule/get_holidays_data/');\n $this->data['content'] .= $this->load->view('admin/hrd/set_employee_holiday_view', $this->data, true);\n $this->render('hrd');\n } \n\n\n\n }",
"public function delete_holiday_list($id) {\n $this->settings_model->_table_name = \"tbl_holiday\"; //table name \n $this->settings_model->_primary_key = \"holiday_id\"; //id\n $this->settings_model->delete($id);\n $type = \"success\";\n $message = \"Holiday Information Successfully Delete!\";\n set_message($type, $message);\n redirect('admin/settings/holiday_list'); //redirect page\n }",
"public function forceDeleted(Holiday $holiday)\n {\n //\n }",
"public function destroy(Holiday $holiday)\n {\n //\n }",
"public function destroy(Holiday $holiday)\n {\n //\n }",
"public function destroy()\n {\n if (request()->ajax()) {\n if (request()->has('id'))\n {\n foreach (request('id') as $id) {\n HolidayDay::destroy($id);\n }\n }\n }\n return response(['status'=>true]);\n }",
"public function create_holidays()\n {\n\n\n\t $data['d_start'] = form_input('date_start', '', 'maxlength=\"10\" class=\"datepicker dpBH\"');\n\t $data['d_end'] = form_input('date_end', '', 'maxlength=\"10\" class=\"datepicker dpBH\"');\n\n\t $data['t_start'] = $this->format->timeSelect((date('H:i', time())), 'start');\n\t $data['t_end'] = $this->format->timeSelect(date('H:i', time()), 'end');\n\n\t // Render the view and echo for ajax \n\t $form = $this->load->view('admin/form_create_holidays', $data, true);\n\t echo $form;\n }",
"public function holiday() {\n\t\t// Disable cron\n\t\t$output = shell_exec('crontab -l');\n\t\t$lines = explode(\"\\n\", trim($output));\n\t\tif (count($lines) > 3) {\n\t\t\t$x='';\n\t\t\twhile ($lines[0] != \"#BEGIN\") {\n\t\t\t\t$x .=$lines[0].PHP_EOL; //copy first header lines of cron file\n\t\t\t\tarray_shift($lines);\n\t\t\t}\n\t\t\t$x .=$lines[0].PHP_EOL; //copy first header lines of cron file\n\t\t\tarray_shift($lines);\n\t\t\tforeach ($lines as $line) {\n\t\t\t\tif (substr($line,0,1) != '#') $x .= '#'.$line.PHP_EOL; //comment cron line\n\t\t\t\telse $x .= $line.PHP_EOL;\n\t\t\t}\n\t\t\tfile_put_contents(Flight::get(\"pathCron\"), $x);\n\t\t\texec(\"cat \".Flight::get(\"pathCron\").\" | crontab -\");\n\t\t\t$ret = array('Status' => 'OK');\n\n\t\t}\n\t\telse { $ret = array('Status' => 'KO','Cron' => 'Not Found'); }\n\t\t// del all \"At\"\n\t\t$x = shell_exec('atq');\n\t\tif (count($x) >= 1) {\n\t\t\t$x = explode(\"\\n\",trim($x));\n\t\t\tforeach ($x as $at) {\n\t\t\t\t$at = explode(\"\\t\", $at);\n\t\t\t\tpassthru('atrm '.$at[0],$x1);\n\t\t\t}\n\t\t}\n\t\tFlight::json($ret);\n\t}",
"function holidays() {\nglobal $template;\n\n\n// Конфигурация\n$klvmsg=\"7\"; // Сколько выводить дат?\n$klvdays=\"30\"; // Максимальное удалённое событие, дней\n$datafile=root.\"plugins/holidays/dat_holidays/holidays.dat\"; // Имя файла базы данных\n$months = array(\"\", \"января\", \"февраля\", \"марта\", \"апреля\", \"мая\", \"июня\", \"июля\", \"августа\", \"сентября\", \"октября\", \"ноября\", \"декабря\");\n$date=date(\"d \".$months[date('n')].\" Y\"); // число.месяц.год\n$time=date(\"H:i:s\"); // часы:минуты:секунды\n\n$holidays .= \"\";\n$day=$date=date(\"d\"); // день\n$month=$date=date(\"n\"); // месяц\n$year=$date=date(\"Y\"); // год\nif ($month==12) {$year++;} // Чтобы верно считал январские праздники\n$vchera=$day-1;\n$klvchasov=$klvdays*30;\n$lines=file($datafile);\n$itogo=count($lines); $i=0;\n\ndo {$dt=explode(\"|\",$lines[$i]);\n\n$todaydate=date(\"d \".$months[date('n')].\" Y\");\n$tekdt=mktime();\n\n$newdate=mktime(0,0,0,$dt[1],$dy[0],$year);\n$dayx=date(\"d \".$months[date('n')].\" Y\",$newdate); // конверируем дни до праздника в человеческий формат\n$hdate=ceil(($newdate-$tekdt)/3600); // через сколько ЧАСОВ наступит событие\n$ddate=ceil($hdate/24); // считаем сколько дней до события\n\n// приводим слово ДЕНЬ/ДНЯ/ДНЕЙ к нужному типу\n$dney=\"дней\"; if ($ddate==\"1\") {$dney=\"день\";} if ($ddate==\"2\" or $ddate==\"3\" or $ddate==\"4\") {$dney=\"дня\";}\n\nif (($dt[0]==$vchera) and ($dt[1]==$month)) {$holidays .= \"<IMG src='/engine/plugins/holidays/images/happy2.gif'> Вчера был праздник:<IMG src='/engine/plugins/holidays/images/down.gif'> <strong>$dt[2]</strong>\";}\nif (($dt[0]==$day) and ($dt[1]==$month)) {$holidays .= \"<IMG src='/engine/plugins/holidays/images/happy.gif'> Сегодня праздник:<IMG src='/engine/plugins/holidays/images/down.gif'> <strong>$dt[2]</strong><br>\";}\nif ($klvmsg>1) {\n\nif (($hdate>1) and ($hdate<$klvchasov)) {\nif (!isset($m1)) {$holidays .= \"<IMG src='/engine/plugins/holidays/images/info.gif'> В ближайщее время ожидаются праздники:<DIV style='BORDER-BOTTOM: #515151 1px dashed'></DIV>\"; $m1=1;}\n$klvmsg--; $holidays .=\"<IMG src='/engine/plugins/holidays/images/data.gif'> <font color='#cc0017'><B>$dayx</B></font> <small>через <B>$ddate</B> $dney</small><br><IMG src='/engine/plugins/holidays/images/down.gif'> $dt[2]<DIV style='BORDER-BOTTOM: #515151 1px dashed'></DIV>\";} }\n\n$i++;\n} while($i<$itogo);\n\n$holidays .= \"\";\n\n\n$output = $holidays;\n\n$template['vars']['plugin_holidays'] = $output;\n}",
"public function holiday() {\n $this->data['title'] = \"Kelola Cuti Pegawai\";\n $this->data['subtitle'] = \"Kelola Cuti Pegawai\";\n\n $this->data['users'] = $this->hrd_model->get_user_dropdown(array(\"active\"=>1));\n\n $this->data['data_url'] = base_url(SITE_ADMIN . '/hrd_schedule/get_leave_data/');\n $this->data['content'] .= $this->load->view('admin/hrd/schedule_holiday_view', $this->data, true);\n $this->render('hrd');\n }",
"public function workingdays(Request $request){\n\n\n\t\tif($request->isMethod('post')){\n\n\t\t\t$request->validate([\n\n\t\t\t\t'year' => 'required',\n\t\t\t\t'month' => 'required',\n\t\t\t\t'workingdays' => 'required|integer',\n\n\t\t\t]);\n\n\t\tDB::beginTransaction();\n\t\t try {\n\n\t\t\t$year = $request->year;\n\t\t\t$month = $request->month;\n\t\t\t$workingdays = $request->workingdays;\n\t\t\t$nonworkingdats = !empty($request->nonworkingdate) ? $request->nonworkingdate : [];\n\n\t\t\t$nonworgdayscount = count($nonworkingdats);\n\n\t\t\t$month_exist = WorkingDays::where('year', $year)->where('month', $month)->get()->all();\n\n\t\t\tif(!empty($month_exist)){\n\t\t\t\treturn redirect()->back()->with('error', 'Month already Exist')->withInput(Input::all());\n\t\t\t}\n\n\t\t\tif($request->month == 'Janaury'){\n\t\t\t\t$cal_month = 1;\n\t\t\t}else if($request->month == 'February'){\n\t\t\t\t$cal_month = 2;\n\t\t\t}else if($request->month == 'March'){\n\t\t\t\t$cal_month = 3;\n\t\t\t}else if($request->month == 'April'){\n\t\t\t\t$cal_month = 4;\n\t\t\t}else if($request->month == 'May'){\n\t\t\t\t$cal_month = 5;\n\t\t\t}else if($request->month == 'June'){\n\t\t\t\t$cal_month = 6;\n\t\t\t}else if($request->month == 'July'){\n\t\t\t\t$cal_month = 7;\n\t\t\t}else if($request->month == 'August'){\n\t\t\t\t$cal_month = 8;\n\t\t\t}else if($request->month == 'September'){\n\t\t\t\t$cal_month = 9;\n\t\t\t}else if($request->month == 'October'){\n\t\t\t\t$cal_month = 10;\n\t\t\t}else if($request->month == 'November'){\n\t\t\t\t$cal_month = 11;\n\t\t\t}else{\n\t\t\t\t$cal_month = 12;\n\t\t\t}\n\n\t\t\t$day_in_month = cal_days_in_month(CAL_GREGORIAN,$cal_month,$year);\n\n\t\t\t$holiday_cal = $day_in_month - $nonworgdayscount; \n\n\t\t\t$workingdays_obj = new WorkingDays();\n\t\t\t$workingdays_obj->year = $year;\n\t\t\t$workingdays_obj->month = $request->month;\n\t\t\t$workingdays_obj->holidays = $nonworgdayscount;\n\t\t\t$workingdays_obj->workingdays = $holiday_cal;\n\t\t\t$workingdays_obj->save();\n\n\t\t\t$working_days_id = $workingdays_obj->workingcalid;\n\n\t\t\tif($nonworgdayscount > 0){\n\t\t\t\tforeach($nonworkingdats as $nondate){\n\t\t\t\t\tif(!empty($nondate)){\n\t\t\t\t\t\t$nondateins = new MonthLeave();\n\t\t\t\t\t\t$nondateins->workingcalanderid = $working_days_id;\n\t\t\t\t\t\t$nondateins->nonworkingdate = date('Y-m-d', strtotime($nondate));\n\t\t\t\t\t\t$nondateins->action_by = session()->get('admin_id');\n\t\t\t\t\t\t$nondateins->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tDB::commit();\n\t\t\t$success = true;\n\n\t\t\tSession::flash('message', 'Working days is added successfully');\n \t\tSession::flash('alert-type', 'success');\n\n\t\t\treturn redirect()->route('viewworkingdays');\n\n\t\t } catch (\\Exception $e) {\n Helper::errormail('HR', 'Add Workingdays', 'High');\n $success = false;\n DB::rollback();\n\n }\n \n if ($success == false) { \n return redirect('dashboard');\n }\n\n\n\t\t}\n\n\n\t\treturn view('hr.workingdays.addworkingdays');\n\n\t}",
"private function setHoliday(Request $request , Holiday $holiday){\n $holiday->year = $request->input('year');\n $holiday->hol_name = $request->input('hol_name');\n $holiday->day_off = $request->input('day_off');\n //Format Date then insert it to the database\n $holiday->date_from = date('Y-m-d', strtotime(str_replace('-', '/', $request->input('date_from'))));\n $holiday->date_to = date('Y-m-d', strtotime(str_replace('-', '/', $request->input('date_to'))));\n\n $holiday->save();\n }",
"public function deselectHolidays()\n {\n $current_year = date('Y-m-d',strtotime(date('Y-01-01')));\n $next_year = date('Y-m-d', strtotime('last day of december next year'));\n $dates = [];\n\n $available_days = AvailableDays::where('available_date', '>=', $current_year)\n ->where('available_date', '<=', $next_year)\n ->get();\n $available_adhocs = AvailableAdhocs::where('date', '>=', $current_year)\n ->where('date', '<=', $next_year)\n ->get();\n $unavailable_days = UnavailableDays::where('date', '>=', $current_year)\n ->where('date', '<=', $next_year)\n ->get();\n $unavailable_adhocs = UnavailableAdhocs::where('date', '>=', $current_year)\n ->where('date', '<=', $next_year)\n ->get();\n $holidays = $this->getTwoYearDates();\n foreach ($holidays as $key => $holiday) {\n $dates[] = date('Y-m-d', strtotime($holiday->date));\n }\n\n foreach ($available_days as $key => $available_day) {\n if(in_array($available_day->available_date, $dates) ) {\n $available_day->delete();\n }\n }\n\n foreach ($available_adhocs as $key => $available_adhoc) {\n if(in_array($available_adhoc->date, $dates) ) {\n $available_adhoc->delete();\n }\n }\n\n foreach ($unavailable_days as $key => $unavailable_day) {\n if(in_array($unavailable_day->date, $dates) ) {\n $unavailable_day->delete();\n }\n }\n\n foreach ($unavailable_adhocs as $key => $unavailable_adhoc) {\n if(in_array($unavailable_adhoc->date, $dates) ) {\n $unavailable_adhoc->delete();\n }\n }\n }",
"public function addschedule_employee() { \r\n\r\n $this->form_validation->set_rules('datestart','Date Start','trim|required|xss_clean');\r\n $this->form_validation->set_rules('starttime', 'Schedule for In time', 'trim|required|xss_clean');\r\n $this->form_validation->set_rules('endtime', 'Schedule for Out time', 'trim|required|xss_clean');\r\n $this->form_validation->set_rules('dayoff', 'Day off', 'trim|required|xss_clean');\r\n $this->form_validation->set_error_delimiters('', '');\r\n\r\n if ($this->form_validation->run() == FALSE){ \r\n //catch to the errors\r\n echo json_encode(array(\"response\" => \"error\", \"err\" => validation_errors()));\r\n } \r\n else{\r\n date_default_timezone_set(\"Asia/Manila\");\r\n $date= date(\"Y-m-d\");\r\n $year = date('Y', strtotime($date));\r\n $datenow = $year .\"-\". 12 .\"-\". 31;\r\n $set_data = $this->session->userdata('userlogin'); //session data\r\n $applicantid=$this->input->post('applicantid');\r\n $employeeid=$this->input->post('employeeid');\r\n $clientid=$this->input->post('clientid');\r\n $datestart = $this->input->post('datestart');\r\n $dateremain = $this->input->post('datestart');\r\n $datecontract = $datenow;\r\n $starttime = $this->input->post('starttime');\r\n $endtime = $this->input->post('endtime');\r\n $dayoff = $this->input->post('dayoff');\r\n $na = 'na'; \r\n $dateprocess = date(\"Y-m-d\"); \r\n\r\n $day = date(\"j\", strtotime($datestart));\r\n $month = date('m', strtotime($datestart));\r\n $year = date('Y', strtotime($datestart));\r\n $firstDay = mktime(0,0,0,$month, $day, $year);\r\n $countday = 32 - $day;\r\n $timestamp = $firstDay;\r\n $weekDays = array();\r\n for ($i = 0; $i < $countday; $i++) {\r\n $weekDays[] = strftime('%a', $timestamp);\r\n $timestamp = strtotime('+1 day', $timestamp);\r\n }\r\n $start = array();\r\n foreach($weekDays as $weekDay){\r\n if ($weekDay == $dayoff){\r\n $off ='off';\r\n }\r\n else{\r\n $off = '';\r\n }\r\n $start[]=$off;\r\n }\r\n\r\n $this->Employee_Model->addscheduleemployee($datestart, $dateremain, $datecontract, $starttime, $endtime, $dayoff, $employeeid);\r\n $this->Scheduleemployee_Model->addscheduleemployee($set_data['clientID'], $employeeid, $applicantid, $datestart, $starttime, $endtime, $dayoff, $dateprocess);\r\n\r\n if ($day == 2){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $start[17],\r\n $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $start[29], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 3){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 4){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na,$start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 5){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 6){ \r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 7){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $datestart, $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 8){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $datestart, $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 9){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 10){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 11){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 12){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 13){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 14){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 15){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 16){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 17){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 18){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 19){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 20){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 21){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 22){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 23){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 24){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 25){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 26){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n\r\n }\r\n else if ($day == 27){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n\r\n }\r\n else if ($day == 28){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 29){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 30){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n\r\n }\r\n else if ($day == 31){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else{\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $start[17],\r\n $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $start[29], $start[30], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n echo json_encode(array(\"response\" => \"success\", \"message\" => \"Successfully Added Employee\", \"redirect\" => \"CLientController/dashboard\"));\r\n }\r\n }",
"function formHolidays() {\n\t\t$output = $formField = $deductionBox = \"\"; $status = 1;\n\t\t$this->schema = Info::DB_NAME;\n\t\t$getPopupValue[] = $fieldValue[] = \"\";\n\t\tif($this->popupFormID){\n\t\t\t$getPopupValue = $this->getValueDB([\"table\"=>$this->Params['table'],\"id\"=>$this->popupFormID]);\n\t\t\t$status = $getPopupValue['status'];\n\t\t}\n\t\t$varLists = ['holiday_type','set_date','title','description'];\n\t\tforeach($varLists as $var){\n\t\t\t$fieldValue[$var] = (isset($getPopupValue[$var]) && $this->popupFormID) ? $getPopupValue[$var] : \"\";\n\t\t}\n\t\t$holiday_type = $this->inputGroup(['label'=>'Type','type'=>'select','id'=>'holiday_type','name'=>'holiday_type','meta_key'=>'holiday_type','meta'=>'codebook','placeholder'=>'Type of Holiday','value'=>$fieldValue['holiday_type']]);\n\t\t$title = $this->inputGroup(['label'=>'Title','type'=>'text','id'=>'title','name'=>'title','placeholder'=>'Title/Name','value'=>$fieldValue['title']]);//$this->Params['first_name']\n\t\t$set_date = $this->inputGroup(['label'=>'Date','type'=>'date','id'=>'set_date','name'=>'','placeholder'=>'Date of Holiday','value'=>$fieldValue['set_date']]);//$this->Params['middle_name']\n\t\t$description = $this->inputGroup(['label'=>'Description','type'=>'text','id'=>'description','name'=>'description','title'=>'Description','placeholder'=>'Description/Notes','value'=>$fieldValue['description']]);//$getValue[0]['address']\n\t\t$popUpTitle = str_replace(\"_\",\" \",$this->Params['table']);\n\t\t$formField .= \"<div class='x_panel no-padding'><div class='box_title'><h2 class='left capitalize'>{$popUpTitle} Information Details</h2></div><div class='x_content no-padding'>\";\n\t\t$formField .= \"\n\t\t\t<div class=''>\n\t\t\t\t<div class='form-group no-padding item'>\n\t\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$holiday_type}</div>\n\t\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$set_date}</div>\n\t\t\t\t</div>\n\t\t\t\t<div class='form-group no-padding item'>\n\t\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$title}</div>\n\t\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$description}</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t</div>\n\t\t\";\n\t\t$output .= \"\n <form id='createRecords' data-toggle='validator' name='{$this->Params['meta']}' class='form-label-left input_mask' novalidate>\n\t\t\t\t<input type='hidden' name='action' id='action' value='createRecords' />\n\t\t\t\t<input type='hidden' name='table' id='table' value='{$this->Params['table']}' />\n\t\t\t\t<input type='hidden' name='set_date' id='this_date' value='{$fieldValue['set_date']}' />\n\t\t\t\t<input type='hidden' name='theID' id='theID' value='{$this->Params['value']}' />\n\t\t\t\t{$formField}\n\t\t\t</form>\n \";\n\t\t$output .= \"<script>\n\t\t\t$(document).ready(function() {\n\t\t\t\twebshims.setOptions('forms-ext', {replaceUI: 'auto', types: 'number'});webshims.polyfill('forms forms-ext');\n\t\t\t\t$('.select2_single').each(function() {\n\t\t\t\t\t$(this).select2({\n\t\t\t\t\t\tplaceholder: $(this).attr('placeholder'),\n\t\t\t\t\t\tallowClear: false\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\t$(':input').inputmask();\n\t\t\t\t$('input#set_date.date-picker').val(moment($('input#set_date.date-picker').val(),'YYYY/MM/DD').format('MMMM D'));\n\t\t\t});\n\t\t\t\n\t\t\t$('input#set_date.date-picker').daterangepicker({\n\t\t\t\tsingleDatePicker: true,\n\t\t\t\topens: 'right',\n\t\t\t\tcalender_style: 'picker_4',\n\t\t\t\tautoUpdateInput: false,\n\t\t\t\tlocale: {\n\t\t\t\t\tformat: 'MMMM D'\n\t\t\t\t}\n\t\t\t}, function (start, end, label) {\n\t\t\t\t$('input[name=set_date]').val(moment(end,'MMMM D').format('YYYY/MM/DD'));\n\t\t\t\tconsole.log(start.toISOString(), end.toISOString(), label);\n\t\t\t});\n\t\t\t\n\t\t\t$('input#set_date').on('apply.daterangepicker', function(ev, picker) {\n\t\t\t\t$(this).val(picker.startDate.format('MMMM D'));\n\t\t\t\t$('input[name=set_date]').val(picker.startDate.format('YYYY/MM/DD'));\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t</script>\";\n\t\treturn $output;\n\t}",
"public function update(Request $request, Holiday $holiday)\n {\n //\n }",
"public function update(Request $request,WeekHolidayMaster $week_holiday_master)\n { \n DB::table('week_holiday')->where('week_holiday_master_id', $week_holiday_master->id)->delete();\n\n $week_holiday_master->update($request->all()); \n foreach ($request->checked_days as $key => $value) {\n WeekHoliday::create([\n 'day_name_id'=>intval($value),\n 'week_holiday_master_id'=>$week_holiday_master->id\n ]);\n }\n\n $request->session()->flash('status', 'Task was successful!');\n return redirect('/week_holiday');\n }",
"public function cleanScheduleAction(){\n \t$actual = new Frogg_Time_Time();\n \t$cleaning_day = $actual->subtract(3*24*60*60);\n \t$cleaning_stamp = $cleaning_day->getUnixTstamp();\n \t$sql = new Frogg_Db_Sql('DELETE FROM `scheduled` WHERE `timestamp` < '.$cleaning_stamp);\n \tdie;\n }",
"public function save() {\r\n $data = array(\r\n 'HolidayDate' => date('Y-m-d', strtotime($this->input->post('HolidayDate'))),\r\n 'Category' => $this->Category\r\n );\r\n $this->db->insert('tbl_holidays', $data);\r\n }",
"public function edit(Holiday $holiday)\n {\n //\n }",
"public function isHoliday($date);",
"public function destroy(Request $request, WeekHolidayMaster $week_holiday_master)\n { \n $week_holiday_master->delete();\n $request->session()->flash('status', 'Task was successful!'); \n }",
"public function getDelete($id){\n return $this->holiday->postDelete(1);\n }",
"function cancel(){\n\t\t//echo \"In Cancel\";\n\t\t\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ';\n\t\t//echo JFactory::getDate('now', JFactory::getApplication()->getCfg('offset'))->toFormat() . \"\\n<br/><br/>\";\n\t\t\n\t\t//$date = JFactory::getDate();\n\t\t//$date->setOffset(JFactory::getApplication()->getCfg('offset'));\n\t \n\t \t//echo \"Offset: \" . JFactory::getApplication()->getCfg('offset');\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat() . \"\\n\";\n\t\t$date =& JFactory::getDate($time= 'now', $tzOffset=0);\n\n\t\t//$date->setOffset($mainframe->getCfg('offset'));\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat();\n\t\t\n\t\t//echo \"New date: \" . date('Y-m-d H:i:s');\n\n\t\t//return false;\n\t\t\n\t\t$insData =new stdClass();\n\t\t$insData->idt_drivin_event_apply = $_POST['appCanId'];\n\n\t\t//$date = new DateTime();\n\t\t$insData->dt_cancel = date('Y-m-d H:i:s'); //'CURRENT_TIMESTAMP';//$date->getTimestamp();\n\t\t\n\t\t$db = JFactory::getDBO();\n\t\tif(!$db->updateObject( '#__jevent_events_apply', $insData, 'idt_drivin_event_apply' )){\n\t\t\techo $database->stderr();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;//resendCancelEmailById($insData->idt_drivin_event_apply);\n\t}",
"public function guardarDeshabEsp(Request $request, $dropEspecialistas, $datepickedInicio,\n\t$datepickedFin, $horaInicio, $horaFin)\n\t{\n\t\t//$datepickedFin . $horaInicio . $horaFin]);\n\t\t$deshab_esp = new Deshabilitar_horarios_especialista();\n\n\t\t$deshab_esp->id_especialista = $dropEspecialistas;\n\t\t$deshab_esp->fecha_inicio_deshabilitar = Carbon::parse($datepickedInicio)->format('Y-m-d');\n\t\t$deshab_esp->fecha_fin_deshabilitar = Carbon::parse($datepickedFin)->format('Y-m-d');\n\t\t$deshab_esp->hora_inicio_deshabilitar = $horaInicio;\n\t\t$deshab_esp->hora_fin_deshabilitar = $horaFin;\n\t\t$deshab_esp->active_flag = 1;\n\n\t\t//return json_encode([\"a\"=>$bloqueo_especialistum]);\n\n\t\t$deshab_esp->save();\n\n\t\tSession::flash('message_type', 'negative');\n\t\tSession::flash('message_icon', 'hide');\n\t\tSession::flash('message_header', 'Success');\n\t\tSession::flash('message', 'Deshabilitación de horario creada exitosamente');//shows confirm message that schedule disable was succesfully created\n\n\n\t\treturn json_encode([\"varInnecesaria\"=>\"ESTOESNECESARIOSINOELAJAXNOSIRVE:c\"]);\n\t}",
"public function store(HolidayRequest $request)\n {\n DB::beginTransaction();\n // in case of single\n if (is_null($request['clinics']) && auth()->user()->role_id == self::ROLE_ASSISTANT) {\n $request['clinic_id'] = auth()->user()->clinic_id;\n if (!$this->storeFunction($request)) {\n return response()->json(['status' => false, 'msg' => $this->error]);\n }\n } else {\n if (in_array('-1', $request['clinics'])) {\n $clinics_list = (new ClinicRepository())->getIdsOfAccountClinics(auth()->user()->account_id);\n // in case of all clinic\n } else {\n // in case of some clinics only\n $clinics_list = $request['clinics'];\n }\n foreach ($clinics_list as $clinic_id) {\n $request['clinic_id'] = $clinic_id;\n if (!$this->storeFunction($request)) {\n return response()->json(['status' => false, 'msg' => $this->error]);\n }\n }\n }\n return response()->json(['status' => true, 'msg' => trans('lang.holiday_added_ok')]);\n }",
"public function set_standard_schedule() {\n $this->load->model('hrd_model');\n $this->data['title'] = \"Kelola Jadwal\";\n $this->data['subtitle'] =\"Kelola Jadwal\";\n\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n $this->data['message_success'] = $this->session->flashdata('message_success');\n\n\n if (isset($_POST) && !empty($_POST)) {\n $office_hour_id=$this->input->post(\"office_hour\");\n $employees=$this->input->post(\"employees\");\n $start_date=$this->input->post(\"start_date\");\n $end_date=$this->input->post(\"end_date\");\n $repeat=$this->input->post(\"repeat\");\n $start_time=$this->input->post(\"start_time\");\n $end_time=$this->input->post(\"end_time\");\n\n $office_hour=$this->hrd_model->get_one(\"hr_office_hours\", $office_hour_id);\n $return=array();\n $return['status']=true;\n $return['message']=\"\";\n\n\n if ($office_hour_id == \"\" || $office_hour_id = 0) {\n if (($start_time == \"\") || ($end_time == \"\")) {\n $return['status']=false;\n $return['message']=\"Jam Mulai dan Jam Akhir harus diisi\";\n } else {\n $office_hour_id = 0;\n $checkin_time = $start_time;\n $checkout_time = $end_time;\n } \n } else {\n $office_hour_id = $this->input->post(\"office_hour\");\n $checkin_time = $office_hour->checkin_time;\n $checkout_time = $office_hour->checkout_time;\n }\n\n for($x=0;$x<sizeof($employees);$x++){\n $user_id = $employees[$x];\n $checking_schedule = $this->hrd_model->checking_schedule(array(\"start_date\"=>$start_date,\"end_date\"=>$end_date,\"repeat\"=>$repeat,\"user_id\"=>$user_id));\n if(sizeof($checking_schedule)>0){\n $return['status']=false;\n foreach($checking_schedule as $c){\n $return['message'].=$c->name.\" sudah mempunyai jadwal di tanggal \".date(\"d/m/Y\",strtotime($c->start_date)).($c->enum_repeat==1 ? \" dan berlaku seterusnya\" : \" s/d \".date(\"d/m/Y\",strtotime($c->end_date))).\"<br>\"; \n }\n }\n }\n\n if (!empty($employees)){\n\n if($return['status']==true){\n \n\n for($x=0;$x<sizeof($employees);$x++){\n $user_id=$employees[$x];\n\n if($repeat == 1){\n\n $save_data = array(\n 'user_id' => $user_id,\n 'start_date' => $start_date,\n 'end_date' => '0000-00-00',\n 'enum_repeat' => $repeat,\n 'free_day' => 0,\n 'is_special_schedule' => 0\n );\n\n } else {\n\n $save_data = array(\n 'user_id' => $user_id,\n 'start_date' => $start_date,\n 'end_date' => $end_date,\n 'enum_repeat' => $repeat,\n 'free_day' => 0,\n 'is_special_schedule' => 0\n );\n\n }\n\n $save_data = $this->hrd_model->save('hr_schedules', $save_data); \n\n if($save_data){\n $save_detail = array(\n 'schedule_id' => $save_data,\n 'office_hour_id' => $office_hour_id,\n 'start_time' => $checkin_time,\n 'end_time' => $checkout_time\n );\n $this->hrd_model->save('hr_schedule_detail', $save_detail);\n }\n\n } \n \n }\n }\n\n \n redirect(base_url(SITE_ADMIN.'/hrd_schedule/set_standard_schedule','refresh'));\n\n \n } else {\n $store = $this->data['setting']['store_id'];\n $this->data['office_hours']= $this->hrd_model->get(\"hr_office_hours\")->result();\n\n $usersch = array();\n $get_user_id = $this->hrd_model->get(\"hr_schedules\")->result();\n foreach ($get_user_id as $key) {\n array_push($usersch, $key->user_id);\n }\n\n $this->data['data_url'] = base_url(SITE_ADMIN . '/hrd_schedule/get_employee_schedule_data');\n $this->data['employees']=$this->hrd_model->get_employee_schedule(array(\"active\"=>1, \"store_id\" => $store),false);\n\n \n $this->data['content'] .= $this->load->view('admin/hrd/set_schedule_standard_view', $this->data, true);\n $this->render('hrd');\n }\n\n }",
"public function changeschedule_employee() { \r\n\r\n $this->form_validation->set_rules('datestart','Date Start','trim|required|xss_clean');\r\n $this->form_validation->set_rules('starttime', 'Schedule for In time', 'trim|required|xss_clean');\r\n $this->form_validation->set_rules('endtime', 'Schedule for Out time', 'trim|required|xss_clean');\r\n $this->form_validation->set_rules('dayoff', 'Day off', 'trim|required|xss_clean');\r\n $this->form_validation->set_error_delimiters('', '');\r\n\r\n if ($this->form_validation->run() == FALSE){ \r\n //catch to the errors\r\n echo json_encode(array(\"response\" => \"error\", \"message\" => validation_errors()));\r\n } \r\n else{\r\n $set_data = $this->session->userdata('userlogin'); //session data\r\n\r\n $applicantid = $this->input->post('applicantid');\r\n $employeeid = $this->input->post('employeeid');\r\n $clientid = $this->input->post('clientid');\r\n $attendanceid = $this->input->post('attendanceid');\r\n\r\n $datestart = $this->input->post('datestart');\r\n $dateschedule = $this->input->post('dateschedule');\r\n $starttime = $this->input->post('starttime');\r\n $endtime = $this->input->post('endtime');\r\n $dayoff = $this->input->post('dayoff');\r\n $day1 = $this->input->post('day1');\r\n $day2 = $this->input->post('day2');\r\n $day3 = $this->input->post('day3');\r\n $day4 = $this->input->post('day4');\r\n $day5 = $this->input->post('day5');\r\n $day6 = $this->input->post('day6');\r\n $day7 = $this->input->post('day7');\r\n $day8 = $this->input->post('day8');\r\n $day9 = $this->input->post('day9');\r\n $day10 = $this->input->post('day10');\r\n $day11 = $this->input->post('day11');\r\n $day12 = $this->input->post('day12');\r\n $day13 = $this->input->post('day13');\r\n $day14 = $this->input->post('day14');\r\n $day15 = $this->input->post('day15');\r\n $day16 = $this->input->post('day16');\r\n $day17 = $this->input->post('day17');\r\n $day18 = $this->input->post('day18');\r\n $day19 = $this->input->post('day19');\r\n $day20 = $this->input->post('day20');\r\n $day21 = $this->input->post('day21');\r\n $day22 = $this->input->post('day22');\r\n $day23 = $this->input->post('day23');\r\n $day24 = $this->input->post('day24');\r\n $day25 = $this->input->post('day25');\r\n $day26 = $this->input->post('day26');\r\n $day27 = $this->input->post('day27');\r\n $day28 = $this->input->post('day28');\r\n $day29 = $this->input->post('day29');\r\n $day30 = $this->input->post('day30');\r\n $day31 = $this->input->post('day31');\r\n $na = 'na'; \r\n $dateprocess = date(\"Y-m-d\"); \r\n\r\n $day = date(\"j\", strtotime($datestart));\r\n $month = date('m', strtotime($datestart));\r\n $year = date('Y', strtotime($datestart));\r\n $nowmonth = date('m', strtotime($dateschedule));\r\n \r\n if ($nowmonth < $month){\r\n\r\n $firstDay = mktime(0,0,0,$nowmonth, $day, $year);\r\n $countday = 32 - $day;\r\n $timestamp = $firstDay;\r\n $weekDays = array();\r\n for ($i = 0; $i < $countday; $i++) {\r\n $weekDays[] = strftime('%a', $timestamp);\r\n $timestamp = strtotime('+1 day', $timestamp);\r\n }\r\n $start = array();\r\n foreach($weekDays as $weekDay){\r\n if ($weekDay == $dayoff){\r\n $off ='off';\r\n }\r\n else{\r\n $off = '';\r\n }\r\n $start[]=$off;\r\n }\r\n $this->Scheduleemployee_Model->addscheduleemployee($set_data['clientID'], $employeeid, $applicantid, $datestart, $starttime, $endtime, $dayoff, $dateprocess);\r\n\r\n if ($day == 2){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $start[17],\r\n $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $start[29], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 3){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 4){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na,$start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 5){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 6){ \r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 7){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $datestart, $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 8){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $datestart, $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 9){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 10){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 11){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 12){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 13){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 14){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 15){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 16){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 17){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 18){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 19){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 20){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 21){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 22){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 23){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 24){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 25){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 26){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n\r\n }\r\n else if ($day == 27){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n\r\n }\r\n else if ($day == 28){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 29){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 30){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n\r\n }\r\n else if ($day == 31){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else{\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $start[17],\r\n $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $start[29], $start[30], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n echo json_encode(array(\"response\" => \"success\", \"message\" => \"Successfully Updated Attendance\", \"redirect\" => \"EmployeeController/schedule_employee\"));\r\n }\r\n else if ($month == $nowmonth){\r\n $firstDay = mktime(0,0,0,$month, $day, $year);\r\n $countday = 32 - $day;\r\n $timestamp = $firstDay;\r\n $weekDays = array();\r\n for ($i = 0; $i < $countday; $i++) {\r\n $weekDays[] = strftime('%a', $timestamp);\r\n $timestamp = strtotime('+1 day', $timestamp);\r\n }\r\n $start = array();\r\n foreach($weekDays as $weekDay){\r\n if ($weekDay == $dayoff){\r\n $off ='off';\r\n }\r\n else{\r\n $off = '';\r\n }\r\n $start[]=$off;\r\n }\r\n\r\n $this->Scheduleemployee_Model->addscheduleemployee($set_data['clientID'], $employeeid, $applicantid, $datestart, $starttime, $endtime, $dayoff, $dateprocess);\r\n\r\n if ($day == 2){\r\n $this->Attendance_Model->updateatendance($day1, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $start[17],\r\n $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $start[29], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 3){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 4){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3,$start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 5){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 6){ \r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 7){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 8){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 9){\r\n $this->Attendance_Model->updateatendance($employeeid, $clientid, $applicantid, $day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 10){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 11){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 12){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 13){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 14){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 15){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 16){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 17){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 18){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 19){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 20){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 21){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 22){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 23){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 24){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 25){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $day24, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 26){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $day24, $day25, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 27){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $day24, $day25, $day26, $start[0], $start[1], $start[2], $start[3], $start[4], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 28){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $day24, $day25, $day26, $day27, $start[0], $start[1], $start[2], $start[3], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 29){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $day24, $day25, $day26, $day27, $day28, $start[0], $start[1], $start[2], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 30){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $day24, $day25, $day26, $day27, $day28, $day29, $start[0], $start[1], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 31){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $day24, $day25, $day26, $day27, $day28, $day29, $day30, $start[0], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else{\r\n $this->Attendance_Model->updateatendance($start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $start[17],\r\n $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $start[29],$start[30], $datestart, $starttime, $endtime, $dayoff, $attendanceid); }\r\n echo json_encode(array(\"response\" => \"success\", \"message\" => \"Successfully change Attendance\", \"redirect\" => \"EmployeeController/schedule_employee\"));\r\n }\r\n }\r\n\r\n\r\n }",
"function companydatesupdate(){\n $this->auth(SUPPORT_ADM_LEVEL);\n $contest_id = $this->input->post('contest_id');\n $start = $this->input->post('start');\n $stop = $this->input->post('stop');\n if($this->m_contest->updateContestDates($contest_id, $start, $stop)){\n if($this->m_contest_dates->updateContestDates($contest_id, $stop)){\n $this->companyadmin();\n }\n }else{\n //todo not able to update, show error on admin page\n echo 'error';\n }\n }",
"public function deleting(Holiday $holiday)\n {\n $old_allowance = $this->rollBackHolidayAllowance($holiday);\n $meta = UserData::where('user_id', $holiday->user_id);\n $allowance = $old_allowance + $meta->first()->holiday_allowance;\n\n $meta->update(['holiday_allowance' => $allowance]);\n }"
] |
[
"0.6365389",
"0.5880762",
"0.5845328",
"0.58289045",
"0.58289045",
"0.5797461",
"0.5789376",
"0.5728371",
"0.5726872",
"0.5719753",
"0.568778",
"0.56652856",
"0.5637293",
"0.56364197",
"0.5607723",
"0.5591405",
"0.5555638",
"0.5546818",
"0.5512482",
"0.5468298",
"0.5465086",
"0.5451856",
"0.54486936",
"0.5439339",
"0.5437394",
"0.54259676",
"0.539994",
"0.5396051",
"0.5390777",
"0.5380619"
] |
0.73122454
|
0
|
/ changeSchedule function is call when user change schedule time There are three parameters in $_REQUEST like start time,end time and today date
|
function changeSchedule(Request $request){
$id = Auth::user()->id;
$from_time = $request->from_time;
$to_time = $request->to_time;
$today_date = date('Y-m-d');
/*
* update end time using to_time variable
* according to logged id
*/
CalendarAvailability::where('user_id',$id)
->update(['end_time'=>$to_time]);
Session::flash('status','Successfully updated');
return redirect()->back();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function updateSchedule(Request $req)\n\t{\n\t\t$selectedDays = explode(\" - \", $req->days);\n\t\t$date_from = strtotime($selectedDays[0]); // Convert date to a UNIX timestamp\n\t\t$date_to = strtotime($selectedDays[1]); // Convert date to a UNIX timestamp\n\t\t$days = array();\n\t\tfor ($i = $date_from; $i <= $date_to; $i+=86400) {\n\t\t\t\t$days[] = date(\"d-m-Y\", $i);\n\t\t}\n\t\t$update = RecruiterSchedule::where('id',$req->schedule_id)->update(array(\n\t\t\t'recruiter_id' => $req->recruiter_id,\n\t\t\t'start_time' => $req->start_time,\n\t\t\t'end_time' => $req->end_time,\n\t\t\t'days' => $req->days,\n\t\t\t'days_arr' => json_encode($days),\n\t\t));\n\n\t\tif ($update) {\n\t\t\treturn response()->json([\n 'success' => true,\n 'message' => 'Time Slot Updated Successfully'\n ],200);\n\t\t}\n\n\t}",
"public function setSchedule ()\n {\n $this->loadComponent('DateTime');\n $this->loadModel('ScheduleTime');\n $data = $this->Auth->user();\n $id_fortune = $data['id'];\n $days = $this->DateTime->allDayInWeek();\n $months = $this->DateTime->allDayInMonth();\n $times = $this->ScheduleTime->getListTime();\n if ($this->Check->isId($id_fortune)) {\n $this->set([\n 'times' => $times,\n 'days' => $months,\n 'id' => $id_fortune\n ]);\n } else{\n $this->Flash->error(__('Id not found'));\n }\n }",
"public function editassigntimeAction()\n {\n $prevurl = getenv(\"HTTP_REFERER\");\n $user_params=$this->_request->getParams();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvpausetime_obj = new Ep_Ftv_FtvPauseTime();\n $requestId = $user_params['requestId'];\n $requestsdetail = $ftvrequest_obj->getRequestsDetails($requestId);\n\n ($user_params['editftvspentdays'] == '') ? $days=0 : $days=$user_params['editftvspentdays'];\n ($user_params['editftvspenthours'] == '') ? $hours=0 : $hours=$user_params['editftvspenthours'];\n ($user_params['editftvspentminutes'] == '') ? $minutes=0 : $minutes=$user_params['editftvspentminutes'];\n ($user_params['editftvspentseconds'] == '') ? $seconds=0 : $seconds=$user_params['editftvspentseconds'];\n\n /*if($user_params['addasigntime'] == 'addasigntime') ///when time changes in mail content in publish ao popup//\n {\n /*$editdate = date('Y-m-d', strtotime($user_params['editftvassigndate']));\n $edittime = date('H:i:s', strtotime($user_params['editftvassigntime']));\n $editdatetime =$editdate.\" \".$edittime;\n $data = array(\"assigned_at\"=>$editdatetime);////////updating\n $query = \"identifier= '\".$user_params['requestId'].\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $parameters['ftvType'] = \"chaine\";\n // $newseconds = $this->allToSeconds($user_params['editftvspentdays'],$user_params['editftvspenthours'],$user_params['editftvspentminutes'],$user_params['editftvspentseconds']);\n echo \"<br>\".$format = \"P\".$days.\"DT\".$hours.\"H\".$minutes.\"M\".$seconds.\"S\";\n echo \"<br>\".$requestsdetail[0]['assigned_at'];\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->sub(new DateInterval($format));\n echo \"<br>\".$assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n echo $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }\n elseif($user_params['subasigntime'] == 'subasigntime')\n {\n $format = \"P\".$days.\"DT\".$hours.\"H\".$minutes.\"M\".$seconds.\"S\";\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->add(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }*/\n $inpause = $ftvpausetime_obj->inPause($requestId);\n $requestsdetail[0]['inpause'] = $inpause;\n $ptimes = $ftvpausetime_obj->getPauseDuration($requestId);\n $assigntime = $requestsdetail[0]['assigned_at'];\n //echo $requestId; echo $requestsdetail[0]['assigned_at'];\n\n if(($requestsdetail[0]['status'] == 'done' || $inpause == 'yes') && $requestsdetail[0]['assigned_at'] != null)\n {\n if($requestsdetail[0]['status'] == \"closed\")\n $time1 = ($requestsdetail[0]['cancelled_at']); /// created time\n elseif ($requestsdetail[0]['status'] == \"done\")\n $time1 = ($requestsdetail[0]['closed_at']); /// created time\n else{\n if($inpause == 'yes') {\n $time1 = ($requestsdetail[0]['pause_at']);\n }else {\n $time1 = (date('Y-m-d H:i:s'));///curent time\n }\n }\n $pausedrequests = $ftvpausetime_obj->pausedRequest($requestId);\n if($pausedrequests == 'yes')\n {\n $time2 = $this->subDiffFromDate($requestId, $requestsdetail[0]['assigned_at']);\n }else{\n $time2 = $requestsdetail[0]['assigned_at'];\n }\n $difference = $this->timeDifference($time1, $time2);\n\n }elseif($requestsdetail[0]['assigned_at'] != null){\n $time1 = (date('Y-m-d H:i:s'));///curent time\n\n $pausedrequests = $ftvpausetime_obj->pausedRequest($requestId);\n if($pausedrequests == 'yes')\n {\n $updatedassigntime = $this->subDiffFromDate($requestId, $requestsdetail[0]['assigned_at']);\n }else{\n $updatedassigntime = $requestsdetail[0]['assigned_at'];\n }\n $time2 = $updatedassigntime;\n $difference = $this->timeDifference($time1, $time2);\n }\n ////when user trying to edit the time spent///\n if($user_params['editftvassignsubmit'] == 'editftvassignsubmit') ///when button submitted in popup//\n {\n $newseconds = $this->allToSeconds($days,$hours,$minutes,$seconds);\n $previousseconds = $this->allToSeconds($difference['days'],$difference['hours'],$difference['minutes'],$difference['seconds']);\n if($newseconds > $previousseconds){\n $diffseconds = $newseconds-$previousseconds;\n $difftime = $this->secondsTodayshours($diffseconds);\n $format = \"P\".$difftime['days'].\"DT\".$difftime['hours'].\"H\".$difftime['minutes'].\"M\".$difftime['seconds'].\"S\";\n $requestsdetail[0]['assigned_at'];\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->sub(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }elseif($newseconds < $previousseconds){\n $diffseconds = $previousseconds-$newseconds;\n $difftime = $this->secondsTodayshours($diffseconds);\n $format = \"P\".$difftime['days'].\"DT\".$difftime['hours'].\"H\".$difftime['minutes'].\"M\".$difftime['seconds'].\"S\";\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->add(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }else\n $this->_redirect($prevurl);\n }\n /*$this->_view->reqasgndate = date(\"d-m-Y\", strtotime($reqdetails[0]['assigned_at']));\n $this->_view->reqasgntime = date(\"g:i A\", strtotime($reqdetails[0]['assigned_at']));*/\n $this->_view->days = $difference['days'];\n $this->_view->hours = $difference['hours'];\n $this->_view->minutes = $difference['minutes'];\n $this->_view->seconds = $difference['seconds'];\n $this->_view->requestId = $user_params['requestId'];\n $this->_view->requestobject = $requestsdetail[0]['request_object'];\n $this->_view->current_duration= $difference['days'].\"j \".$difference['hours'].\"h \".$difference['minutes'].\"m \".$difference['seconds'].\"s \";\n\n $this->_view->extendparttime = 'no';\n $this->_view->extendcrtparttime = 'no';\n $this->_view->editftvassigntime = 'yes';\n $this->_view->nores = 'true';\n $this->_view->render(\"ongoing_extendtime_writer_popup\");\n\n }",
"function Create_Edited_Schedule($application_id, $request, $tr_info)\n{\n\t$holidays = Fetch_Holiday_List();\n\t$pd_calc = new Pay_Date_Calc_3($holidays);\n\t$log = get_log(\"scheduling\");\n\n\t$schedule = array();\n\t$status_date = (isset($request->status_date)) ?\n\t(date(\"Y-m-d\", strtotime($request->status_date))) : null;\n\t$date_fund_actual = $request->date_fund_actual;\n\t$log->Write(\"Creating Edited Schedule for {$application_id}\");\n\t$principal_balance = floatval($request->principal_balance);\n\t$fees_balance = floatval($request->fees_balance);\n\t$return_amount = floatval($request->return_amount);\n\t$num_service_charges = ($request->num_service_charges == \"max\") ?\n\t5 : intval($request->num_service_charges);\n\n\t$agent_id = isset($request->controlling_agent) ? $request->controlling_agent : 0;\n\n\t$today = date(\"Y-m-d\");\n\t$next_business_day = $pd_calc->Get_Next_Business_Day($today);\n\tRemove_Unregistered_Events_From_Schedule($application_id);\n\n\t// First generate the service charge placeholders\n\tfor ($i = 0; $i < $num_service_charges; $i++)\n\t{\n\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, array(),\n\t\t'converted_sc_event',\n\t\t'Placeholder for Cashline interest charge');\n\t}\n\n\t// Now generate the balance amounts.\n\tif ($principal_balance > 0.0)\n\t{\n\t\t// If they requested \"Funds Pending\", we want to set the transaction to pending, and set\n\t\t// the event and the transaction to the date they specified.\n\t\tif($request->account_status == '17') // Set Funds Pending\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => $principal_balance));\n\t\t\t$event = Schedule_Event::MakeEvent($status_date, $status_date, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\n\t\t\t$evid = Record_Event($application_id, $event);\n\t\t\tRecord_Scheduled_Event_To_Register_Pending($status_date, $application_id, $evid);\n\t\t}\n\t\telse if ($request->account_status == '15') // Funding Failed\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$principal_balance));\n\t\t\t$event = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\t\t\t$evid = Record_Event($application_id, $event);\n\t\t\t$trids = Record_Scheduled_Event_To_Register_Pending($today, $application_id, $evid);\n\t\t\tforeach ($trids as $trid)\n\t\t\t{\n\t\t\t\tRecord_Transaction_Failure($application_id, $trid);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => $principal_balance));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\t\t}\n\t}\n\tif ($fees_balance > 0.0)\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $fees_balance));\n\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t'converted_service_chg_bal',\n\t\t\"Converted interest charge amount for {$application_id}\");\n\t}\n\n\t// Scheduling section\n\t$rules = Prepare_Rules($tr_info->rules, $tr_info->info);\n\t$scs_left = max($rules['service_charge']['max_svc_charge_only_pmts'] - $num_service_charges, 0);\n\t$sc_amt = $principal_balance * $rules['interest'];\n\t$sc_comment = \"sched svc chg ({$rules['interest']})\";\n\t$payments = $principal_balance / $rules['principal_payment_amount'];\n\t$total_payments = $rules['service_charge']['max_svc_charge_only_pmts'] + $payments + 1; //add one for the loan date\n\n\tif(!in_array($request->account_status, array(\"19\")))\n\t{\n\t\t$dates = Get_Date_List($tr_info->info, $next_business_day, $rules, ($total_payments ) * 4, null, $next_business_day);\n\n\t\t$index = 0;\n\t\tif (isset($date_fund_actual) && ($date_fund_actual != ''))\n\t\t{\n\t\t\t$date_fund_actual = preg_replace(\"/-/\", \"/\", $date_fund_actual);\n\t\t\t$log->Write(\"Date fund actual is: {$date_fund_actual}\");\n\t\t\t$window = date(\"Y-m-d\", strtotime(\"+10 days\", strtotime($date_fund_actual)));\n\t\t\twhile (strtotime($window) > strtotime($dates['event'][$index])) $index++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile (strtotime($today) > strtotime($dates['event'][$index])) $index++;\n\t\t}\n\t}\n\n\tswitch($request->account_status)\n\t{\n\t\tcase \"1\":\n\t\tcase \"2\": $status_chain = array(\"active\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"3\": $status_chain = array(\"sent\", \"external_collections\", \"*root\"); break;\n\t\tcase \"4\": $status_chain = array(\"new\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"5\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"6\": $status_chain = array(\"pending\", \"external_collections\", \"*root\"); break;\n\t\tcase \"7\": $status_chain = array(\"unverified\", \"bankruptcy\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"8\": $status_chain = array(\"recovered\", \"external_collections\", \"*root\"); break;\n\t\tcase \"9\": $status_chain = array(\"paid\", \"customer\", \"*root\"); break;\n\t\tcase \"10\":\n\t\tcase \"12\":\n\t\tcase \"13\": $status_chain = array(\"ready\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"11\":\n\t\tcase \"14\": $status_chain = array(\"sent\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"15\": $status_chain = array(\"funding_failed\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"16\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"17\": $status_chain = array(\"active\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"18\": $status_chain = array(\"past_due\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"19\": $status_chain = array(\"sent\",\"external_collections\",\"*root\"); break;\n\t\tcase \"20\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"21\": $status_chain = array(\"sent\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t}\n\n\tif (in_array($request->account_status, array(\"1\", \"2\", \"4\", \"17\",\"18\")))\n\t{\n\t\tif ($request->account_status == \"18\")\n\t\t{\n\t\t\t$old_sc_amt = $sc_amt;\n\t\t\t$today = date(\"Y-m-d\");\n\t\t\t$next_day = $pd_calc->Get_Business_Days_Forward($today, 1);\n\t\t\tif ($fees_balance != 0.00)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$fees_balance));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t\t$amounts,\n\t\t\t\t'payment_service_chg', 'repull',\n\t\t\t\t'scheduled', 'generated',$application_id,\n\t\t\t\t-$application_id);\n\t\t\t\t$return_amount = bcsub($return_amount,$fees_balance,2);\n\t\t\t}\n\n\t\t\tif ($return_amount > 0)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$return_amount));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t\t$amounts,\n\t\t\t\t'repayment_principal', 'repull',\n\t\t\t\t'scheduled','generated',$application_id,\n\t\t\t\t-$application_id);\n\t\t\t\t$principal_balance = bcsub($principal_balance,$return_amount,2);\n\t\t\t\t$sc_amt = $principal_balance * $rules['interest'];\n\t\t\t}\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts, 'assess_service_chg');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('fee' => $rules['return_transaction_fee']));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today,\n\t\t\t$amounts,\n\t\t\t'assess_fee_ach_fail', 'ACH Fee Assessed');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('fee' => -$rules['return_transaction_fee']));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t$amounts,\n\t\t\t'payment_fee_ach_fail', 'ACH fee payment');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t$dates['effective'][$index],$amounts, 'payment_service_chg');\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($fees_balance != 0.00)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$fees_balance));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t\t$amounts, 'payment_service_chg', 'sched svc chg payment');\n\t\t\t}\n\t\t}\n\t\tfor ($i = 0; $i < $scs_left; $i++)\n\t\t{\n\t\t\tif ($sc_amt == 0.0) break;\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['event'][$index],\n\t\t\t$amounts, 'assess_service_chg', $sc_comment);\n\t\t\t$index++;\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t$amounts, 'payment_service_chg',\n\t\t\t'sched svc chg payment');\n\t\t}\n\n\t\twhile ($principal_balance > 0)\n\t\t{\n\t\t\t$charge_amount = min($principal_balance, $rules['principal_payment_amount']);\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$charge_amount));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t$amounts, 'repayment_principal', 'principal repayment');\n\t\t\t$principal_balance = bcsub($principal_balance,$charge_amount,2);\n\t\t\tif($principal_balance > 0)\n\t\t\t{\n\t\t\t\t$sc_amt = $principal_balance * $rules['interest'];\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t\t$dates['event'][$index],\n\t\t\t\t$amounts, 'assess_service_chg',\n\t\t\t\t$sc_comment);\n\t\t\t\t$index++;\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t\t$dates['effective'][$index],\n\t\t\t\t$amounts, 'payment_service_chg',\n\t\t\t\t'sched svc chg payment');\n\t\t\t}\n\n\t\t}\n\t}\n\telse if ($request->account_status == \"15\") // for Funding Failed\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance\n\t\t));\n\t\t$event = Schedule_Event::MakeEvent($today, $today,\n\t\t$amounts, 'adjustment_internal',\n\t\t'Internal Adjustment');\n\t\tPost_Event($application_id, $event);\n\t}\n\telse if ($request->account_status == \"21\") // ACH Return After QC\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t// Quickcheck (Pending)\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\n\t\t// Cashline Return (Completed)\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'principal' => $request->return_amount\n\t\t));\n\t\t$event = Schedule_Event::MakeEvent($today, $today,\n\t\t$amounts, 'cashline_return',\n\t\t'Cashline Return');\n\t\tPost_Event($application_id, $event);\n\t}\n\tif ($request->account_status == \"5\")\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t$amounts, 'full_balance',\n\t\t'Full Pull Attempt');\n\t}\n\n\tif (in_array($request->account_status, array(\"12\", \"13\", \"14\")))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif (in_array($request->account_status, array(\"14\", \"11\")))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif (in_array($request->account_status, array('6', '3', '20')))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = array();\n\t\t$amounts[] = Event_Amount::MakeEventAmount('principal', -$request->principal_balance);\n\t\t$amounts[] = Event_Amount::MakeEventAmount('service_charge', -$request->fees_balance);\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\n\t\t$amounts = array();\n\t\t$amounts[] = Event_Amount::MakeEventAmount('principal', -$request->principal_balance);\n\t\t$amounts[] = Event_Amount::MakeEventAmount('service_charge', -$request->fees_balance);\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif(in_array($request->account_status, array(\"19\")))\n\t{\n\t\tUpdate_Status(NULL,$application_id,$status_chain);\n\t}\n\n\tif (in_array($request->account_status, array(4,5,10,11,16)) && $agent_id)\n\t{\n\t\t$application = ECash::getApplicationById($application_id);\n\t\t$affiliations = $application->getAffiliations();\n\t\t$affiliations->add(ECash::getAgentById($agent_id), 'collections', 'owner', null);\n\t}\n\n\tif (count($schedule) > 0) Update_Schedule($application_id, $schedule);\n\treturn ($status_chain);\n}",
"function updateSchedule($startH, $dayId){\n $DB = connect();\n $query = \"UPDATE \".SCHEDULE_TABLE.\" SET \";\n $query.= \"startHour='\" . $startH.\"' \";\n $query.= \"WHERE dayId='\".$dayId.\"';\";\n mysqli_query($DB, $query);\n}",
"protected function schedule(Schedule $schedule)\n\t{\n\t}",
"protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n\n $schedule->call('App\\Http\\Controllers\\RequestKPController@rejectExpiredRequests')\n ->daily();\n $schedule->call('App\\Http\\Controllers\\RequestSkripsiController@rejectExpiredRequests')\n ->daily();\n\n // steven add new\n // kp\n // schedule to notify prodi admin for reschedule and update for prodi admin able to reschedule\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangKPController@notifyProdiAdminToRescheduleIfNeed')\n ->daily();\n // ->everyMinute();\n // set schedule end by the expired date\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangKPController@updateNoRevisionOnH2Request')\n ->daily();\n // ->everyMinute();\n // set the penjadwalan already past and it was old data\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangKPController@updatePenjadwalanIntoOldData')\n ->daily();\n // ->everyMinute();\n // set form to be available on participant list table to enter the form each row\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangKPController@scheduleBeritaAcaraForm')\n ->daily();\n // ->everyMinute();\n // set form cannot be open while expired date or if already submitted status completed dont need to show to the participant again\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangKPController@expiredDateForSubmitForm')\n ->daily();\n // ->everyMinute();\n\n // skripsi\n // schedule to notify prodi admin for reschedule and update for prodi admin able to reschedule\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangSkripsiController@notifyProdiAdminToRescheduleIfNeed')\n ->daily();\n // ->everyMinute();\n // set schedule end by the expired date\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangSkripsiController@updateNoRevisionOnH2Request')\n ->daily();\n // ->everyMinute();\n // set the penjadwalan already past and it was old data\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangSkripsiController@updatePenjadwalanIntoOldData')\n ->daily();\n // ->everyMinute();\n // set form to be available on participant list table to enter the form each row\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangSkripsiController@scheduleBeritaAcaraForm')\n ->daily();\n // ->everyMinute();\n // set form cannot be open while expired date or if already submitted status completed dont need to show to the participant again\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangSkripsiController@expiredDateForSubmitForm')\n ->daily();\n // ->everyMinute();\n\n // tesis\n // schedule to notify prodi admin for reschedule and update for prodi admin able to reschedule\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangTesisController@notifyProdiAdminToRescheduleIfNeed')\n ->daily();\n // ->everyMinute();\n // set schedule end by the expired date\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangTesisController@updateNoRevisionOnH2Request')\n ->daily();\n // ->everyMinute();\n // set the penjadwalan already past and it was old data\n $schedule->call('App\\Http\\Controllers\\ProdiPenjadwalanSidangTesisController@updatePenjadwalanIntoOldData')\n ->daily();\n // ->everyMinute();\n // set form to be available on participant list table to enter the form each row\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangTesisController@scheduleBeritaAcaraForm')\n ->daily();\n // ->everyMinute();\n // set form cannot be open while expired date or if already submitted status completed dont need to show to the participant again\n $schedule->call('App\\Http\\Controllers\\ProdiBeritaAcaraSidangTesisController@expiredDateForSubmitForm')\n ->daily();\n // ->everyMinute();\n\n // hard cover kp, skripsi, tesis api to store db every daily\n // on going status\n // validated status\n // first ongoing \n $schedule->call('App\\Http\\Controllers\\AdminHardcoverKPController@storeOngoingHardcoverKPByAPI')\n // ->daily();\n ->everyMinute();\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverSkripsiController@storeOngoingHardcoverSkripsiByAPI')\n // ->daily();\n ->everyMinute();\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverTesisController@storeOngoingHardcoverTesisByAPI')\n ->daily();\n // ->everyMinute();\n // second validated\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverKPController@storeValidateHardcoverKPByAPI')\n ->daily();\n // ->everyMinute();\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverSkripsiController@storeValidateHardcoverSkripsiByAPI')\n ->daily();\n // ->everyMinute();\n $schedule->call('App\\Http\\Controllers\\AdminHardcoverTesisController@storeValidateHardcoverTesisByAPI')\n ->daily();\n // ->everyMinute(); \n }",
"protected function schedule(Schedule $schedule)\n {\n //\n }",
"protected function schedule(Schedule $schedule)\n {\n //\n }",
"protected function schedule(Schedule $schedule)\n {\n //\n }",
"function get_schedule($usrid){\r\n\t\r\n}",
"public function updateSchedule()\n\t{\n\t\t// Removing old days if we have any days\n\t\tif (count(self::$schedule) > 0) {\n\t\t\t$currDate = date('Y/m/d');\n\n\t\t\twhile (isset(self::$schedule[0]) && self::$schedule[0]->date != $currDate) {\n\t\t\t\tarray_shift(self::$schedule);\n\t\t\t}\n\t\t}\n\n\t\t// Building out the schedule if we're missing days\n\t\tif (count(self::$schedule) < 7) $this->build();\n\t}",
"public function update(Schedule $schedule, Request $request)\n\t{\n $in = $request->filled('time_in') ? new Carbon($request->time_in) : null;\n $out = $request->filled('time_out') ? new Carbon($request->time_out) : null;\n\n\t\t$schedule->time_in = $request->time_in;\n\t\t$schedule->time_out = $request->time_out;\n\t\t$schedule->save();\n\n\t\treturn $this->weekSchedule($request);\n\t}",
"public function createSchedule(Request $request)\n\t{\n\t\t// $intervel = $req->interval;\n\t\t// $start_time_interval = $request->start_time;\n\t\t// $selectedDays = explode(\" - \", $req->days);\n\t\t// $date_from = strtotime($selectedDays[0]); // Convert date to a UNIX timestamp\n\t\t// $date_to = strtotime($selectedDays[1]); // Convert date to a UNIX timestamp\n\t\t// $days = array();\n\t\t// for ($i = $date_from; $i <= $date_to; $i+=86400) {\n\t\t// $days[] = date(\"d-m-Y\", $i);\n\t\t// }\n\n\t\t// $selectedDays = explode(\" - \", $request->days);\n\t\t// $date_from = strtotime($selectedDays[0]); // Convert date to a UNIX timestamp\n\t\t// $date_to = strtotime($selectedDays[1]); // Convert date to a UNIX timestamp\n\t\t$days = $request->days;\n\t\t// for ($i = $date_from; $i <= $date_to; $i+=86400) {\n\t\t// $days[] = date(\"d-m-Y\", $i);\n\t\t// }\n\n\n\t\tforeach ($days as $key => $day) {\n\t\t\t$intervel = $request->interval;\n\t\t\t$start_time_interval = $request->start_time;\n\t\t\t$end_time_interval = $request->start_time;\n\t\t\t$start_time = $request->start_time;\n\t\t\t$end_time = $request->end_time;\n\t\t\t$end_interval = $request->interval * 2;\n\t\t\t// 90\n\n\t\t\t$loopCount = 0;\n\t\t\twhile ($end_time_interval < $end_time) {\n\t\t\t\t // 12:00\n\t\t\t\tif($loopCount > 0){\n\t\t\t\t\t$start_time_interval = date('h:i A', strtotime(\"+$intervel minutes\", strtotime($start_time_interval)));\n\t\t\t\t}\n\t\t\t\t$end_time_interval = date('h:i A', strtotime(\"+$intervel minutes\", strtotime($start_time_interval)));\n\t\t\t\t$return = $start_time_interval.\" - \".$end_time_interval.\"</br>\";\n\t\t\t\t$loopCount++;\n\t\t\t\t// if ($loopCount > 5) {\n\t\t\t\t// \texit();\n\t\t\t\t// }\n\t\t\t\t// echo $return.\"<br/>\";\n\n\t\t\t\tif (!RecruiterSchedule::where('fair_id',$request->fair_id)\n\t\t\t\t\t->where('company_id',$request->company_id)\n\t\t\t\t\t->where('recruiter_id',$request->recruiter_id)\n\t\t\t\t\t->where('start_time',$start_time_interval)\n\t\t\t\t\t->where('end_time',$end_time_interval)\n\t\t\t\t\t->where('days',$day)->exists()){\n\t\t\t\t\t$create = RecruiterSchedule::create(array(\n\t\t\t\t\t\t'fair_id' => $request->fair_id,\n\t\t\t\t\t\t'company_id' => $request->company_id,\n\t\t\t\t\t\t'recruiter_id' => $request->recruiter_id,\n\t\t\t\t\t\t'start_time' => $start_time_interval,\n\t\t\t\t\t\t'end_time' => $end_time_interval,\n\t\t\t\t\t\t'days' => $day,\n\t\t\t\t\t\t'days_arr' => json_encode($request->days),\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn response()->json([\n 'success' => true,\n 'message' => 'Time Slots Added Successfully'\n ],200);\n\n\t}",
"public function actionSchedule()\n\t{\n\t\tif (!$this->title) {\n\t\t\t$this->title = \"Schedule operation\";\n\t\t}\n\n\t\t$operation = $this->operation;\n\t\t$schedule_options = Element_OphTrOperationbooking_ScheduleOperation::model()->find('event_id = ?', array($this->event->id));\n\n\t\tif ($operation->status->name == 'Cancelled') {\n\t\t\treturn $this->redirect(array('default/view/'.$this->event->id));\n\t\t}\n\n\t\tif (@$_GET['firm_id']) {\n\t\t\tif ($_GET['firm_id'] == 'EMG') {\n\t\t\t\t$firm = new Firm;\n\t\t\t\t$firm->name = 'Emergency List';\n\t\t\t} else {\n\t\t\t\tif (!$firm = Firm::model()->findByPk(@$_GET['firm_id'])) {\n\t\t\t\t\tthrow new Exception('Unknown firm id: '.$_GET['firm_id']);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$firm = $this->firm;\n\t\t}\n\n\t\t// allowing the referral to be updated\n\t\tif (@$_GET['referral_id']) {\n\t\t\tif ($referral = Referral::model()->findByPk($_GET['referral_id'])) {\n\t\t\t\t$operation->referral_id = $_GET['referral_id'];\n\t\t\t\t$operation->referral = $referral;\n\t\t\t}\n\t\t}\n\n\t\tif (preg_match('/^([0-9]{4})([0-9]{2})$/',@$_GET['date'],$m)) {\n\t\t\t$date = mktime(0,0,0,$m[2],1,$m[1]);\n\t\t} else {\n\t\t\t$date = $operation->minDate;\n\t\t}\n\n\t\tif (ctype_digit(@$_GET['day'])) {\n\t\t\t$selectedDate = date('Y-m-d', mktime(0,0,0,date('m', $date), $_GET['day'], date('Y', $date)));\n\t\t\t$theatres = $operation->getTheatres($selectedDate, $firm->id);\n\n\t\t\tif ($session = OphTrOperationbooking_Operation_Session::model()->findByPk(@$_GET['session_id'])) {\n\t\t\t\t$criteria = new CDbCriteria;\n\t\t\t\t$criteria->compare('session_id', $session->id);\n\t\t\t\t$criteria->addCondition('`t`.booking_cancellation_date is null');\n\t\t\t\t$criteria->addCondition('event.deleted = 0');\n\t\t\t\t$criteria->order = 'display_order ASC';\n\t\t\t\t//FIXME: this should be retrieved by a method on the operation\n\t\t\t\t$bookings = OphTrOperationbooking_Operation_Booking::model()->with(array('operation'=>array('with'=>'event')))->findAll($criteria);\n\n\t\t\t\tforeach ($theatres as $theatre) {\n\t\t\t\t\tforeach ($theatre->sessions as $_session) {\n\t\t\t\t\t\tif ($session->id == $_session->id) {\n\t\t\t\t\t\t\t$bookable = $_session->operationBookable($operation);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!empty($_POST['Booking']['element_id'])) {\n\t\t\t\t\tif (!$operation = Element_OphTrOperationbooking_Operation::model()->findByPk($_POST['Booking']['element_id'])) {\n\t\t\t\t\t\tthrow new Exception('Operation not found: '.$_POST['Booking']['element_id']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$transaction = Yii::app()->db->beginTransaction();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$cancellation_data = array(\n\t\t\t\t\t\t\t'submitted' => isset($_POST['cancellation_reason']),\n\t\t\t\t\t\t\t'reason_id' => @$_POST['cancellation_reason'],\n\t\t\t\t\t\t\t'comment' => @$_POST['cancellation_comment']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$booking = new OphTrOperationbooking_Operation_Booking;\n\t\t\t\t\t\t$booking->attributes = $_POST['Booking'];\n\n\t\t\t\t\t\t// referral might have been altered in scheduling form, so should update the operation here\n\t\t\t\t\t\t// (different from the GET changes above which handle the selection down to the session)\n\t\t\t\t\t\tif ($operation->canChangeReferral()) {\n\t\t\t\t\t\t\t$operation->referral_id = $_POST['Operation']['referral_id'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (($result = $operation->schedule(\n\t\t\t\t\t\t\t\t$booking,\n\t\t\t\t\t\t\t\t$_POST['Operation']['comments'],\n\t\t\t\t\t\t\t\t$_POST['Session']['comments'],\n\t\t\t\t\t\t\t\t$_POST['Operation']['comments_rtt'],\n\t\t\t\t\t\t\t\t($this->reschedule !== true),\n\t\t\t\t\t\t\t\t$cancellation_data,\n\t\t\t\t\t\t\t\t$schedule_options)) !== true) {\n\t\t\t\t\t\t\t$errors = $result;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$transaction->commit();\n\t\t\t\t\t\t\t$this->redirect(array('default/view/'.$operation->event_id));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (RaceConditionException $e) {\n\t\t\t\t\t\t$transaction->rollback();\n\t\t\t\t\t\tYii::app()->user->setFlash('notice',$e->getMessage());\n\t\t\t\t\t\t$this->redirect(array('default/view/'.$operation->event_id));\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception $e) {\n\t\t\t\t\t\t// no handling of this at the moment\n\t\t\t\t\t\t$transaction->rollback();\n\t\t\t\t\t\tthrow $e;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_POST['Booking']['admission_time'] = substr($session['default_admission_time'],0,5);\n\t\t\t\t\t$_POST['Booking']['ward_id'] = key($operation->getWardOptions($_session));\n\t\t\t\t\t$_POST['Session']['comments'] = $session['comments'];\n\t\t\t\t\t$_POST['Operation']['referral_id'] = $operation->referral_id;\n\t\t\t\t\t$_POST['Operation']['comments'] = $operation->comments;\n\t\t\t\t\t$_POST['Operation']['comments_rtt'] = $operation->comments_rtt;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ($operation->booking) {\n\t\t\t$selectedDate = $operation->booking->session->date;\n\t\t}\n\n\t\t$this->processJsVars();\n\n\t\t$this->render('schedule', array(\n\t\t\t'event' => $this->event,\n\t\t\t'operation' => $operation,\n\t\t\t'schedule_options' => $schedule_options,\n\t\t\t'firm' => $firm,\n\t\t\t'firmList' => Firm::model()->listWithSpecialties,\n\t\t\t'date' => $date,\n\t\t\t'selectedDate' => @$selectedDate,\n\t\t\t'sessions' => $operation->getFirmCalendarForMonth($firm, $date, $schedule_options),\n\t\t\t'theatres' => @$theatres,\n\t\t\t'session' => @$session,\n\t\t\t'bookings' => @$bookings,\n\t\t\t'bookable' => @$bookable,\n\t\t\t'errors' => @$errors,\n\t\t));\n\t}",
"protected function schedule(Schedule $schedule)\n {\n //每天五点钟执行\n $cron = new ACXCronController();\n $schedule->call(function ()use($cron){\n try{\n $cron->bak_block_opt_data();;\n }catch (\\Exception $exception){\n $data = ['email'=>'[email protected]','newEmail'=>$exception->getMessage(),'url'=>now()];\n Mail::to('[email protected]')->send(new ChangeEmail($data));\n }\n })->dailyAt('5:01');\n\n //每一个小时执行一次\n $schedule->call(function ()use($cron){\n try{\n $cron->update_withdraw_change_from_24hour();\n }catch (\\Exception $exception){\n $data = ['email'=>'[email protected]','newEmail'=>$exception->getMessage().'###update_withdraw_change_from_24hour','url'=>now()];\n Mail::to('[email protected]')->send(new ChangeEmail($data));\n }\n })->hourly();\n\n\n //--每分钟执行一次图表\n $schedule->call(function (){\n try{\n $croncontroller = new CronController();\n $croncontroller->oneMinute();\n $minute = date(\"i\",time());\n //--执行分钟任务\n $croncontroller->oneMinute();\n if($minute%5==0)$croncontroller->fiveMinute();\n if($minute%15==0)$croncontroller->fifteen();\n if($minute%30==0) $croncontroller->halfHour();\n }catch (\\Exception $exception){\n $data = ['email'=>'[email protected]','newEmail'=>$exception->getMessage().'###update_withdraw_change_from_24hour','url'=>now()];\n Mail::to('[email protected]')->bcc('[email protected]')->send(new ChangeEmail($data));\n }\n }) ->everyMinute();\n\n //--每小时\n //--每分钟执行一次图表\n $schedule->call(function (){\n try{\n $croncontroller = new CronController();\n $hour =date(\"H\",time());\n //--执行小时任务\n $croncontroller->oneHour();\n if($hour%2==0)$croncontroller->twoHour();\n if($hour%6==0)$croncontroller->sixHour();\n if($hour%12==0)$croncontroller->twelveHour();\n if($hour==0)$croncontroller->oneDay();\n }catch (\\Exception $exception){\n $data = ['email'=>'[email protected]','newEmail'=>$exception->getMessage().'###update_withdraw_change_from_24hour','url'=>now()];\n Mail::to('[email protected]')->bcc('[email protected]')->send(new ChangeEmail($data));\n }\n }) ->hourly();\n\n\n $schedule->call(function (){\n try{\n $croncontroller = new CronController();\n $croncontroller->week();\n }catch (\\Exception $exception){\n $data = ['email'=>'[email protected]','newEmail'=>$exception->getMessage().'###update_withdraw_change_from_24hour','url'=>now()];\n Mail::to('[email protected]')->bcc('[email protected]')->send(new ChangeEmail($data));\n }\n }) ->weekly();\n\n\n //充值确认定时任务 15分钟一次\n $schedule->call(function (){\n try{\n $acxCron = new ACXCronController();\n $acxCron->getReceiveHistory();\n }catch (\\Exception $exception){\n $data = ['email'=>'[email protected]','newEmail'=>$exception->getMessage().'###update_withdraw_change_from_24hour','url'=>now()];\n Mail::to('[email protected]')->bcc('[email protected]')->send(new ChangeEmail($data));\n }\n })->everyFiveMinutes();\n\n //每月执行当\n $withdrawal = new WithdrawalControl();\n $schedule->call(function ()use($withdrawal){\n $resOne = $withdrawal->upgrade();\n $dataOne = ['email'=>'[email protected]','newEmail'=>'upgrade'.json_encode($resOne),'url'=>now()];\n Mail::to('[email protected]')->send(new ChangeEmail($dataOne));\n })->monthly();\n\n //自定义规则提现额度 每是分钟\n $schedule->call(function ()use($withdrawal){\n //开始\n $resOne = $withdrawal->customizeRunStart();\n if (!$resOne[0]){\n $dataOne = ['email'=>'[email protected]','newEmail'=>'customizeRunStart'.json_encode($resOne),'url'=>now()];\n Mail::to('[email protected]')->send(new ChangeEmail($dataOne));\n }\n //结束\n $resTwo = $withdrawal->customizeRunEnd();\n if (!$resTwo[0]){\n $dataTwo = ['email'=>'[email protected]','newEmail'=>'customizeRunEnd'.json_encode($resTwo),'url'=>now()];\n Mail::to('[email protected]')->send(new ChangeEmail($dataTwo));\n }\n })->daily();\n\n\n //增加每分钟判断是不是有低价订单\n $schedule->call(function(){\n #CronController::getSendHistory('BTC');\n $check_order_controller=new CheckOrderController();\n $result=$check_order_controller->check_order_list_dingshi(\"admin\",\"fZGGz4BmSNbHzYr1cEYgfMEl0UOs59cn\");\n $data = ['email'=>'[email protected]','newEmail'=>$result,'url'=>now()];\n # Mail::to('[email protected]')->send(new ChangeEmail($data));\n })->everyMinute();\n\n \n $schedule->call(function() {\n CronController::getWithdrawConfirmations1('BTC');\n })->everyFiveMinutes();\n $schedule->call(function() {\n CronController::getWithdrawConfirmations1('LTC');\n })->everyFiveMinutes();\n $schedule->call(function() {\n CronController::getWithdrawConfirmations1('BCH');\n })->everyFiveMinutes();\n $schedule->call(function() {\n CronController::getWithdrawConfirmations1('RPZ');\n })->everyFiveMinutes();\n $schedule->call(function() {\n CronController::getWithdrawConfirmations1('XVG');\n })->everyFiveMinutes();\n $schedule->call(function() {\n CronController::getWithdrawConfirmations1('BTG');\n })->everyFiveMinutes();\n $schedule->call(function() {\n CronController::getWithdrawConfirmations1('DASH');\n })->everyFiveMinutes();\n\n //后台-----------------------\n $schedule->call(function() {\n BackController::getCurrencyInfoRun();\n })->everyTenMinutes();\n }",
"public function editscheduleAction()\n {\n $this->view->pageTitle = 'Edit Schedule';\n\n $request = $this->getRequest();\n $service = new App_Service_Member();\n $users = self::fetchMemberOptions($service);\n\n $this->view->form = new Application_Model_Member_ScheduleForm($users);\n\n if (!$request->isPost()) {\n // If this isn't a POST request, fill the form from existing entries.\n $this->view->form->setEntries(Zend_Registry::get('schedule'));\n return;\n }\n\n // Repopulate the form with POST data.\n $data = $request->getPost();\n $this->view->form->preValidate($data);\n $this->view->form->populate($data);\n\n if ($this->view->form->handleAddRemoveEntries($data)\n || !$this->view->form->isValid($data)) {\n // If the user just added or removed a schedule entry, then we're done. Do likewise for\n // validation errors.\n return;\n }\n\n // Handle added, modified, and deleted schedule entries.\n foreach ($this->view->form->getChangedEntries() as $changedEntry) {\n $service->changeScheduleEntry($changedEntry);\n }\n $service->removeScheduleEntries($this->view->form->getRemovedEntries());\n $this->_helper->redirector('editSchedule');\n }",
"public function update(Request $request, schedule $schedule)\n {\n //\n }",
"protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')\n// ->hourly();\n// $schedule->call(function(){\n// $time=date('H');\n $date=date('Y-m-d');\n// $data=[];\n// if($time>0){\n// $reserves=Reserve::where('date',$date)->whereIn('progress',[1,3])->get();\n// foreach($reserves as $k=>$v){\n// $v->progress=2;\n// $v->save();\n// $number=Number::where('reserve_id',$v->id)->where('number_class',1)->first();\n// if($number){\n// $number->number_push=1;\n// $number->number_status=0;\n// $number->save();\n// }\n// }\n// DB::table('reserves')->where('date',$date)->whereIn('progress',[1,3])->where('halt',0)->update('progress',2);\n//// }\n// })->everyMinute();\n\n }",
"protected function schedule(Schedule $schedule)\n {\n $schedule->call(function () {\n DB::transaction(function () {\n $actions = Action::where('state', 'started')->lockForUpdate()->get();\n\n foreach ($actions as $action){\n $user_point = $action->user->userPoint->lockForUpdate()->first();\n\n $user_point->update([\n 'approval_point' => ($user_point->approval_point + $action->point),\n 'pending_point' => ($user_point->pending_point - $action->point),\n ]);\n\n $action->update([\n 'state' => 'approval'\n ]);\n }\n });\n })->hourly();\n\n }",
"protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')->hourly();\n }",
"function eo_schedule_start($format='d-m-Y',$id=''){\n\techo eo_get_schedule_start($format,$id);\n}",
"protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n // Da ka Event\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/PunchEvent';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('9:13');\n // Check sprint progress.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/amChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('10:00');\n // Verify completed tasks\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/doneIssueChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('17:30');\n // volunteer for unassigned task.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/todoChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n })->weekdays()\n ->everyFiveMinutes()\n ->timezone('Asia/Shanghai')\n ->between('9:50', '22:00');\n }",
"public function setSchedule($schedule)\n {\n $this->schedule = $schedule;\n }",
"protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')\n// ->hourly();\n $schedule->call(function () {\n Log::info('更新热度');\n Commodity::updateCommodityTemperature();\n Article::updateArticleTemperature();\n Activity::updateActivityTemperature();\n Recruit::updateRecruitTemperature();\n News::updateNewsTemperature();\n })->hourly();\n }",
"function add_shedule(){\n\t\t\n\t\trequire_once(\"dbconnection.php\");\n\t\t$obj=new dbconnection();\n\t\t$con=$obj->getcon();\n\t\t\n\t\t\n\t\t$dbh=$obj->get_pod();\n\n\t\t$act_mode \t= mysqli_real_escape_string($con,$_POST['act_mode']);\n\t\t$cmbtype \t\t= mysqli_real_escape_string($con,$_POST['cmbtype']);\n\t\t$cmbexamtype = mysqli_real_escape_string($con,$_POST['cmbexamtype']);\n\t\t$cmbbatch = mysqli_real_escape_string($con,$_POST['cmbbatch']);\n\t\t$cmbclroom \t= mysqli_real_escape_string($con,$_POST['cmbclroom']);\n\t\t$cmblecturer \t= mysqli_real_escape_string($con,$_POST['cmblecturer']);\n\t\t$txtdosch = mysqli_real_escape_string($con,$_POST['txtdosch']);\n\t\t$txtstime \t= mysqli_real_escape_string($con,$_POST['txtstime']);\n\t\t$txtetime \t= mysqli_real_escape_string($con,$_POST['txtetime']);\t\n\t\t\n\t\t$sqlget1 =\"SELECT * FROM shedule WHERE schtype='$cmbtype' AND examtype='$cmbexamtype' AND batchID='$cmbbatch' AND lecID ='$cmblecturer' AND clroomID ='$cmbclroom' AND date='$txtdosch' AND (starttime >='$txtstime' AND endtime <='$txtetime');\";\n\t\t\n\t\t\n\t\t$resultget1 = mysqli_query($con,$sqlget1) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget1= mysqli_fetch_assoc($resultget1);\n\t\t\n\t\t\n\t\t$sqlget2 =\"SELECT * FROM shedule WHERE lecID ='$cmblecturer' AND date='$txtdosch' AND (starttime >='$txtstime' OR endtime <='$txtetime');\";\n\t\t\n\t\t$resultget2 = mysqli_query($con,$sqlget2) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget2= mysqli_fetch_assoc($resultget2);\n\t\t\n\t\t$sqlget3 =\"SELECT * FROM shedule WHERE clroomID ='$cmbclroom' AND date='$txtdosch' AND (starttime >='$txtstime' OR endtime <='$txtetime');\";\n\t\t\n\t\t$resultget3 = mysqli_query($con,$sqlget3) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget3= mysqli_fetch_assoc($resultget3);\n\t\n\t\t\t\n\t\tif(count($recget1)>0){\n\t\t\t$recget1 =\"sch1\";\n\t\t\techo json_encode($recget1);\n\t\t}\n\t\telse if(count($recget2)>0){\n\t\t\t$recget2 =\"sch2\";\n\t\t\techo json_encode($recget2);\n\t\t}\n\t\telse if(count($recget3)>0){\n\t\t\t$recget3 =\"sch3\";\n\t\t\techo json_encode($recget3);\n\t\t}\n\n\t\telse{\n\t\t\n\t\t$sth = $dbh->prepare('INSERT INTO shedule (schtype,examtype,date,starttime,endtime,batchID,clroomID,lecID,schstatus) VALUES(?,?,?,?,?,?,?,?,?);');\n\t\t$sth->execute(Array($cmbtype,$cmbexamtype,$txtdosch,$txtstime,$txtetime,$cmbbatch,$cmbclroom,$cmblecturer,1));\n\n\t\t\t\tif(count($sth)<0){\n\t\t\t\t\t \n\t\t\t\t\t $status =\"false\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\n\t\t\t\t\t$status =\"true\";\n\t\t\t\t}\n\t\n\t\t\t\techo json_encode($status);\n\n\t\t} \n\n\t}",
"public function setSchedule($schedule)\n\t{\n\t\tif ($schedule === '') {\n\t\t\t$schedule = '* * * * * *';\n\t\t} elseif ($schedule === null) {\n\t\t\t$this->_schedule = $schedule;\n\t\t\treturn;\n\t\t}\n\t\t$schedule = trim($schedule);\n\t\t$this->_schedule = $schedule;\n\t\t$this->_attr = [];\n\t\tif (strlen($schedule) > 1 && $schedule[0] == '@') {\n\t\t\tif (is_numeric($triggerTime = substr($schedule, 1))) {\n\t\t\t\t$this->_triggerTime = (int) $triggerTime;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (self::$_validatorCache) {\n\t\t\t$minuteValidator = self::$_validatorCache['m'];\n\t\t\t$hourValidator = self::$_validatorCache['h'];\n\t\t\t$domValidator = self::$_validatorCache['dom'];\n\t\t\t$monthValidator = self::$_validatorCache['mo'];\n\t\t\t$dowValidator = self::$_validatorCache['dow'];\n\t\t\t$yearValidator = self::$_validatorCache['y'];\n\t\t\t$fullValidator = self::$_validatorCache['f'];\n\t\t} else {\n\t\t\t$minute = '(?:[0-9]|[1-5][0-9])';\n\t\t\t$minuteStar = '\\*(?:\\/(?:[1-9]|[1-5][0-9]))?';\n\t\t\t$minuteRegex = $minute . '(?:\\-(?:[1-9]|[1-5][0-9]))?(?:\\/(?:[1-9]|[1-5][0-9]))?';\n\t\t\t$hour = '(?:[0-9]|1[0-9]|2[0-3])';\n\t\t\t$hourStar = '\\*(?:\\/(?:[1-9]|1[0-9]|2[0-3]))?';\n\t\t\t$hourRegex = $hour . '(?:\\-(?:[1-9]|1[0-9]|2[0-3]))?(?:\\/(?:[1-9]|1[0-9]|2[0-3]))?';\n\t\t\t$dom = '(?:(?:[1-9]|[12][0-9]|3[01])W?)';\n\t\t\t$domWOW = '(?:[1-9]|[12][0-9]|3[01])';\n\t\t\t$domStar = '\\*(?:\\/(?:[1-9]|[12][0-9]|3[01]))?';\n\t\t\t$domRegex = '(?:' . $dom . '(?:\\-' . $dom . ')?(?:\\/' . $domWOW . ')?|' . '(?:L(?:\\-[1-5])?)' . ')';\n\t\t\t$month = '(?:[1-9]|1[012]|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][1] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][2] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][3] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][4] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][5] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][6] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][7] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][8] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][9] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][10] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][11] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][12] . ')';\n\t\t\t$monthStar = '\\*(?:\\/(?:[1-9]|1[012]))?';\n\t\t\t$monthRegex = $month . '(?:\\-' . $month . ')?(?:\\/(?:[1-9]|1[012]))?';\n\t\t\t$dow = '(?:[0-6]|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][0] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][1] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][2] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][3] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][4] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][5] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][6] . ')';\n\t\t\t$dowStar = '\\*(?:\\/[0-6])?';\n\t\t\t$dowRegex = '(?:[0-6]L|' . $dow . '(?:(?:\\-' . $dow . ')?(?:\\/[0-6])?|#[1-5])?)';\n\t\t\t$year = '(?:19[7-9][0-9]|20[0-9][0-9])';\n\t\t\t$yearStar = '\\*(?:\\/[0-9]?[0-9])?';\n\t\t\t$yearRegex = $year . '(?:\\-' . $year . ')?(?:\\/[0-9]?[0-9])?';\n\t\t\t$fullValidator = '/^(?:(@(?:annually|yearly|monthly|weekly|daily|hourly))|' .\n\t\t\t\t'(?#minute)((?:' . $minuteStar . '|' . $minuteRegex . ')(?:\\,(?:' . $minuteStar . '|' . $minuteRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#hour)((?:' . $hourStar . '|' . $hourRegex . ')(?:\\,(?:' . $hourStar . '|' . $hourRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#DoM)(\\?|(?:(?:' . $domStar . '|' . $domRegex . ')(?:,(?:' . $domStar . '|' . $domRegex . '))*))[\\s]+' .\n\t\t\t\t'(?#month)((?:' . $monthStar . '|' . $monthRegex . ')(?:\\,(?:' . $monthStar . '|' . $monthRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#DoW)(\\?|(?:' . $dowStar . '|' . $dowRegex . ')(?:\\,(?:' . $dowStar . '|' . $dowRegex . '))*)' .\n\t\t\t\t'(?#year)(?:[\\s]+' .\n\t\t\t\t\t'((?:' . $yearStar . '|' . $yearRegex . ')(?:\\,(?:' . $yearStar . '|' . $yearRegex . '))*)' .\n\t\t\t\t')?' .\n\t\t\t')$/i';\n\n\t\t\t$minuteValidator = '/^(\\*|' . $minute . ')(?:\\-(' . $minute . '))?(?:\\/(' . $minute . '))?$/i';\n\t\t\t$hourValidator = '/^(\\*|' . $hour . ')(?:\\-(' . $hour . '))?(?:\\/(' . $hour . '))?$/i';\n\t\t\t$domValidator = '/^(\\*|\\?|L|' . $domWOW . ')(W)?(?:\\-(' . $domWOW . ')(W)?)?(?:\\/(' . $domWOW . '))?$/i';\n\t\t\t$monthValidator = '/^(\\*|' . $month . ')(?:\\-(' . $month . '))?(?:\\/(' . $month . '))?$/i';\n\t\t\t$dowValidator = '/^(\\*|\\?|' . $dow . ')(L)?(?:\\-(' . $dow . ')(L)?)?(?:\\/(' . $dow . '))?(?:#([1-5]))?$/i';\n\t\t\t$yearValidator = '/^(\\*|' . $year . ')(?:\\-(' . $year . '))?(?:\\/([1-9]?[0-9]))?$/i';\n\t\t\tself::$_validatorCache = [\n\t\t\t\t\t'm' => $minuteValidator,\n\t\t\t\t\t'h' => $hourValidator,\n\t\t\t\t\t'dom' => $domValidator,\n\t\t\t\t\t'mo' => $monthValidator,\n\t\t\t\t\t'dow' => $dowValidator,\n\t\t\t\t\t'y' => $yearValidator,\n\t\t\t\t\t'f' => $fullValidator,\n\t\t\t\t];\n\t\t}\n\n\t\t$i = 0;\n\t\tdo {\n\t\t\tif (!preg_match($fullValidator, $schedule, $matches)) {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $schedule);\n\t\t\t}\n\t\t\tif ($matches[1]) {\n\t\t\t\tforeach (self::$_intervals as $interval => $intervalSchedule) {\n\t\t\t\t\tif ($interval == $matches[1]) {\n\t\t\t\t\t\t$schedule = $intervalSchedule;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} while ($matches[1]);\n\n\t\t$this->_attr[self::MINUTE] = [];\n\t\tforeach (explode(',', $matches[2]) as $match) {\n\t\t\tif (preg_match($minuteValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['min' => 0, 'end' => 59];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['min' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $data['min'];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 59; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::MINUTE][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::HOUR] = [];\n\t\tforeach (explode(',', $matches[3]) as $match) {\n\t\t\tif (preg_match($hourValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['hour' => 0, 'end' => 23];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['hour' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $m2[1];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 23; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::HOUR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::DAY_OF_MONTH] = [];\n\t\tforeach (explode(',', $matches[4]) as $match) {\n\t\t\tif (preg_match($domValidator, $match, $m2)) {\n\t\t\t\t$data = ['dom' => $m2[1]]; // *, ?, \\d, L\n\t\t\t\t$data['domWeekday'] = $m2[2] ?? null;\n\t\t\t\t$data['end'] = $m2[3] ?? ($m2[1] != 'L' ? $m2[1] : null);\n\t\t\t\t//$data['endWeekday'] = $m2[4] ?? null;\n\t\t\t\t$data['endWeekday'] = $m2[4] ?? (($m2[3] ?? null) ? null : $data['domWeekday']);\n\t\t\t\t$data['period'] = (int) max($m2[5] ?? 1, 1);\n\t\t\t\tif (!($m2[3] ?? 0) && ($m2[5] ?? 0)) {\n\t\t\t\t\t$data['end'] = 31; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::DAY_OF_MONTH][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::MONTH_OF_YEAR] = [];\n\t\tforeach (explode(',', $matches[5]) as $match) {\n\t\t\tif (preg_match($monthValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['moy' => 1, 'end' => 12];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['moy' => (int) $this->translateMonthOfYear($m2[1])];\n\t\t\t\t\t$data['end'] = (isset($m2[2]) && $m2[2]) ? (int) $this->translateMonthOfYear($m2[2]) : $data['moy'];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 12; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::MONTH_OF_YEAR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::DAY_OF_WEEK] = [];\n\t\tforeach (explode(',', $matches[6]) as $match) {\n\t\t\tif (preg_match($dowValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*' || $m2[1] === '?') {\n\t\t\t\t\t$data = ['dow' => 0, 'end' => 6];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['dow' => (int) $this->translateDayOfWeek($m2[1])];\n\t\t\t\t\t$data['end'] = (isset($m2[3]) && $m2[3]) ? (int) $this->translateDayOfWeek($m2[3]) : $data['dow'];\n\t\t\t\t}\n\t\t\t\t$data['lastDow'] = $m2[2] ?? null;\n\t\t\t\t$data['lastEnd'] = $m2[4] ?? null;\n\t\t\t\t$data['period'] = (int) max($m2[5] ?? 1, 1);\n\t\t\t\t$data['week'] = $m2[6] ?? null;\n\t\t\t\tif (!($m2[3] ?? 0) && ($m2[5] ?? 0)) {\n\t\t\t\t\t$data['end'] = 6; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::DAY_OF_WEEK][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::YEAR] = [];\n\t\t$matches[7] ??= '*';\n\t\tforeach (explode(',', $matches[7]) as $match) {\n\t\t\tif (preg_match($yearValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['year' => self::YEAR_MIN];\n\t\t\t\t\t$data['end'] = self::YEAR_MAX;\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['year' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $m2[1];\n\t\t\t\t}\n\t\t\t\t$data['period'] = max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = self::YEAR_MAX; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::YEAR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\t}",
"protected function schedule(Schedule $schedule)\n {\n\n $schedule->call(function () {\n $appointment = Appointment::get();\n for ($i = 0; $i < sizeof($appointment); $i++) {\n $appointObject = $appointment[$i]; // 약속 객체 한개\n $cur_time = new \\DateTime(); // 현재 시간\n $appoint_date = new \\DateTime($appointObject->date . ' ' . $appointObject->date_time); // 약속 날짜\n $date_gap = date_diff($cur_time, $appoint_date); // 현재 시간과 약속 시간의 차이\n if ($date_gap->invert == 1) { // 현재 시간이 약속 시간을 지난 경우 -> 약속 종료 상태로 변경\n if ($appointObject->status == 1) {\n $member = Member::where('Member.appointment_id', $appointObject->id)->get();\n //약속 멤버 모두에게 약속 종료 알림 보내기\n foreach ($member as $object) {\n $user = User::find($object->user_id);\n $user->latitude = 0;\n $user->longitude = 0;\n if ($object->success == 0) {\n $object->Fine_final = $object->Fine_current;\n }\n $user->save();\n\n $object->save();\n }\n\n// NotificationController::SendGameNotification($appointObject->id,$date_gap->h * 60 + $date_gap->i,0,100,$pageTime,array()); //push 알람 보내기\n }\n $appointObject->status = 2; //status가 0이든 1이든 종료상태로\n } else { // 약속 시작 전 또는 진행 중\n\n // 초 단위 차이\n $time_gap = $date_gap->h * 60 * 60 + $date_gap->i * 60 + $date_gap->s;\n // 설정된 타이머(초)\n $timer = 120 * 60; //2시간\n\n\n // 총 게임 진행 시간(초)\n $totalGameTime = $timer;\n // **약속 실행전**\n if ($appointObject->status == 0) {\n if ($date_gap->days == 0) { // 현재 날짜와 같음\n\n if ($time_gap <= $totalGameTime) {\n // 시작 상태로 변경하기\n $appointObject->status = 1;\n $appointObject->radius = 20000;\n\n }\n }\n } // **약속 실행중**\n else {\n\n\n $appointObject->radius = $appointObject->radius - ((20000 / $timer) * 60);\n if ($appointObject->radius < 100)\n $appointObject->radius = 100; //100미터까지\n\n $member = Member::join('users', 'Member.user_id', '=', 'users.id')->where('Member.appointment_id', $appointObject->id)->get();\n if($appointObject->Fine_current==1) {\n\n $appointObject->Fine_current = $appointObject->Fine_time;\n\n\n foreach ($member as $object) {\n $circle_in = true;\n $distance = GpsService::geoDistance($object->latitude, $object->longitude, $appointObject->latitude, $appointObject->longitude) * 1000;\n $member_user = Member::where('appointment_id', $appointObject->id)->where('user_id', $object->user_id)->first();\n if ($appointObject->radius < $distance) { //원 밖에 있다.\n//\n $circle_in = false;\n if($member_user!=null)\n $member_user->update(['Fine_current' => (int)$member_user->Fine_current + $appointObject->Fine_money]);\n\n } else if ($distance < 100) //도착\n {\n if($member_user!=null)\n $member_user->update(['success' => 1, 'Fine_current' => 0]);\n }\n\n $appointObject->results()->create([\n 'user_id' => $object->user_id,\n 'Fine_current' => $member_user->Fine_current,\n 'appointment_radius' => $appointObject->radius,\n 'latitude' => $object->latitude,\n 'longitude'=> $object->longitude,\n 'time'=>date(\"h:i\"),\n 'circle_in'=>$circle_in,\n ]);\n }\n\n }else{\n $appointObject->Fine_current = $appointObject->Fine_current -1;\n }\n NotificationController::SendGameNotification($appointObject->id,$appointObject,$member);\n }\n\n }\n $appointObject->save(); //반지름 변경\n }\n })->everyMinute(); //매 분마다\n }",
"public function changeschedule_employee() { \r\n\r\n $this->form_validation->set_rules('datestart','Date Start','trim|required|xss_clean');\r\n $this->form_validation->set_rules('starttime', 'Schedule for In time', 'trim|required|xss_clean');\r\n $this->form_validation->set_rules('endtime', 'Schedule for Out time', 'trim|required|xss_clean');\r\n $this->form_validation->set_rules('dayoff', 'Day off', 'trim|required|xss_clean');\r\n $this->form_validation->set_error_delimiters('', '');\r\n\r\n if ($this->form_validation->run() == FALSE){ \r\n //catch to the errors\r\n echo json_encode(array(\"response\" => \"error\", \"message\" => validation_errors()));\r\n } \r\n else{\r\n $set_data = $this->session->userdata('userlogin'); //session data\r\n\r\n $applicantid = $this->input->post('applicantid');\r\n $employeeid = $this->input->post('employeeid');\r\n $clientid = $this->input->post('clientid');\r\n $attendanceid = $this->input->post('attendanceid');\r\n\r\n $datestart = $this->input->post('datestart');\r\n $dateschedule = $this->input->post('dateschedule');\r\n $starttime = $this->input->post('starttime');\r\n $endtime = $this->input->post('endtime');\r\n $dayoff = $this->input->post('dayoff');\r\n $day1 = $this->input->post('day1');\r\n $day2 = $this->input->post('day2');\r\n $day3 = $this->input->post('day3');\r\n $day4 = $this->input->post('day4');\r\n $day5 = $this->input->post('day5');\r\n $day6 = $this->input->post('day6');\r\n $day7 = $this->input->post('day7');\r\n $day8 = $this->input->post('day8');\r\n $day9 = $this->input->post('day9');\r\n $day10 = $this->input->post('day10');\r\n $day11 = $this->input->post('day11');\r\n $day12 = $this->input->post('day12');\r\n $day13 = $this->input->post('day13');\r\n $day14 = $this->input->post('day14');\r\n $day15 = $this->input->post('day15');\r\n $day16 = $this->input->post('day16');\r\n $day17 = $this->input->post('day17');\r\n $day18 = $this->input->post('day18');\r\n $day19 = $this->input->post('day19');\r\n $day20 = $this->input->post('day20');\r\n $day21 = $this->input->post('day21');\r\n $day22 = $this->input->post('day22');\r\n $day23 = $this->input->post('day23');\r\n $day24 = $this->input->post('day24');\r\n $day25 = $this->input->post('day25');\r\n $day26 = $this->input->post('day26');\r\n $day27 = $this->input->post('day27');\r\n $day28 = $this->input->post('day28');\r\n $day29 = $this->input->post('day29');\r\n $day30 = $this->input->post('day30');\r\n $day31 = $this->input->post('day31');\r\n $na = 'na'; \r\n $dateprocess = date(\"Y-m-d\"); \r\n\r\n $day = date(\"j\", strtotime($datestart));\r\n $month = date('m', strtotime($datestart));\r\n $year = date('Y', strtotime($datestart));\r\n $nowmonth = date('m', strtotime($dateschedule));\r\n \r\n if ($nowmonth < $month){\r\n\r\n $firstDay = mktime(0,0,0,$nowmonth, $day, $year);\r\n $countday = 32 - $day;\r\n $timestamp = $firstDay;\r\n $weekDays = array();\r\n for ($i = 0; $i < $countday; $i++) {\r\n $weekDays[] = strftime('%a', $timestamp);\r\n $timestamp = strtotime('+1 day', $timestamp);\r\n }\r\n $start = array();\r\n foreach($weekDays as $weekDay){\r\n if ($weekDay == $dayoff){\r\n $off ='off';\r\n }\r\n else{\r\n $off = '';\r\n }\r\n $start[]=$off;\r\n }\r\n $this->Scheduleemployee_Model->addscheduleemployee($set_data['clientID'], $employeeid, $applicantid, $datestart, $starttime, $endtime, $dayoff, $dateprocess);\r\n\r\n if ($day == 2){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $start[17],\r\n $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $start[29], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 3){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 4){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na,$start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 5){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 6){ \r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 7){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $datestart, $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 8){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $datestart, $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 9){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 10){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 11){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 12){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 13){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 14){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 15){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 16){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 17){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 18){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 19){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 20){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 21){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 22){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 23){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 24){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 25){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 26){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n\r\n }\r\n else if ($day == 27){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $start[4], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n\r\n }\r\n else if ($day == 28){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $start[3], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 29){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $start[2], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else if ($day == 30){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $start[1], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n\r\n }\r\n else if ($day == 31){\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $na, $start[0], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n else{\r\n $this->Attendance_Model->insertattendance($employeeid, $clientid, $applicantid, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $start[17],\r\n $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $start[29], $start[30], $datestart, $datestart, $starttime, $endtime, $starttime, $endtime, $dayoff, $dayoff);\r\n }\r\n echo json_encode(array(\"response\" => \"success\", \"message\" => \"Successfully Updated Attendance\", \"redirect\" => \"EmployeeController/schedule_employee\"));\r\n }\r\n else if ($month == $nowmonth){\r\n $firstDay = mktime(0,0,0,$month, $day, $year);\r\n $countday = 32 - $day;\r\n $timestamp = $firstDay;\r\n $weekDays = array();\r\n for ($i = 0; $i < $countday; $i++) {\r\n $weekDays[] = strftime('%a', $timestamp);\r\n $timestamp = strtotime('+1 day', $timestamp);\r\n }\r\n $start = array();\r\n foreach($weekDays as $weekDay){\r\n if ($weekDay == $dayoff){\r\n $off ='off';\r\n }\r\n else{\r\n $off = '';\r\n }\r\n $start[]=$off;\r\n }\r\n\r\n $this->Scheduleemployee_Model->addscheduleemployee($set_data['clientID'], $employeeid, $applicantid, $datestart, $starttime, $endtime, $dayoff, $dateprocess);\r\n\r\n if ($day == 2){\r\n $this->Attendance_Model->updateatendance($day1, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $start[17],\r\n $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $start[29], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 3){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 4){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3,$start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 5){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 6){ \r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 7){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 8){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 9){\r\n $this->Attendance_Model->updateatendance($employeeid, $clientid, $applicantid, $day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $start[22], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 10){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $start[21], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 11){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $start[20], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 12){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $start[19], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 13){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $start[18], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 14){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16],\r\n $start[17], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 15){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 16){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 17){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 18){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 19){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 20){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 21){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 22){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 23){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 24){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 25){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $day24, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 26){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $day24, $day25, $start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 27){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $day24, $day25, $day26, $start[0], $start[1], $start[2], $start[3], $start[4], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 28){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $day24, $day25, $day26, $day27, $start[0], $start[1], $start[2], $start[3], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 29){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $day24, $day25, $day26, $day27, $day28, $start[0], $start[1], $start[2], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 30){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $day24, $day25, $day26, $day27, $day28, $day29, $start[0], $start[1], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else if ($day == 31){\r\n $this->Attendance_Model->updateatendance($day1, $day2, $day3, $day4, $day5, $day6, $day7, $day8, $day9, $day10, $day11, $day12, $day13, $day14, $day15, $day16, $day17, $day18, $day19, $day20, $day21, $day22, $day23, $day24, $day25, $day26, $day27, $day28, $day29, $day30, $start[0], $datestart, $starttime, $endtime, $dayoff, $attendanceid);\r\n }\r\n else{\r\n $this->Attendance_Model->updateatendance($start[0], $start[1], $start[2], $start[3], $start[4], $start[5], $start[6], $start[7], $start[8], $start[9], $start[10], $start[11], $start[12], $start[13], $start[14], $start[15], $start[16], $start[17],\r\n $start[18], $start[19], $start[20], $start[21], $start[22], $start[23], $start[24], $start[25], $start[26], $start[27], $start[28], $start[29],$start[30], $datestart, $starttime, $endtime, $dayoff, $attendanceid); }\r\n echo json_encode(array(\"response\" => \"success\", \"message\" => \"Successfully change Attendance\", \"redirect\" => \"EmployeeController/schedule_employee\"));\r\n }\r\n }\r\n\r\n\r\n }",
"protected function schedule(Schedule $schedule)\n {\n $schedule->call(function () {amoController::setWaybills();})\n ->cron('0 0-23/3 * * *');\n $schedule->call(function () {amoController::getStatistics();})\n ->hourly();\n }"
] |
[
"0.66659254",
"0.65835875",
"0.65764564",
"0.64076054",
"0.63796544",
"0.63662434",
"0.63432854",
"0.6336525",
"0.6336525",
"0.6336525",
"0.6312242",
"0.6295488",
"0.62710726",
"0.626871",
"0.6225493",
"0.62149525",
"0.61881405",
"0.6151509",
"0.6139939",
"0.6108373",
"0.6102347",
"0.6091133",
"0.6091042",
"0.6088736",
"0.60828215",
"0.6076739",
"0.60767084",
"0.6068567",
"0.6051128",
"0.60325336"
] |
0.7545806
|
0
|
Searches for issues using JQL.
|
public function search($jql)
{
$request = $this->newRequest()
->setMethod('POST')
->setEndpoint($this->endpoints[__FUNCTION__])
->setParams(['jql' => $jql]);
$response = $this->sendRequest($request);
return new Collection($this->transformValues($response['issues'], Issue::class));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function searchIssues($jql)\n {\n $response = $this->client->get('/search', array('jql' => urlencode($jql)));\n\n $issues = array();\n foreach ($response['issues'] as $jsonIssue) {\n $issues[] = new Issue($jsonIssue);\n }\n\n return $issues;\n }",
"public function findOpenIssues() { \n $q = $this->createQueryBuilder('e')\n ->select('e.eoid as id,e.joid,e.alarm,e.alarmTime,e.state,e.stateTime,e.response,e.theUser,e.eventComment,j.jobName,j.description,j.status')\n ->leftjoin('AriiATSBundle:UjoJobst','j',\\Doctrine\\ORM\\Query\\Expr\\Join::WITH,'e.joid = j.joid')\n ->where('e.state < 45')\n ->orderBy('e.eoid','desc')\n ->setMaxResults(1000)\n ->getQuery();\n return $q->getResult();\n }",
"public function search($jql)\n {\n return $this->client->get('/rest/api/2/search?jql='.urlencode($jql));\n }",
"function searchIssue()\n\t\t{\n\t\t\t//Server Requirements\n\t\t\t$servername = \"localhost\";\n\t\t\t$username = \"root\";\n\t\t\t$password = \"\";\n\t\t\t$dbname = \"lms\";\n\n\t\t\t//Create MySQL Server Connection\n\t\t\t$connection = new mysqli($servername, $username, $password, $dbname);\n\n\t\t\t//Check if connection error of server or nor\n\t\t\tif($connection->connect_error)\n\t\t\t{\n\t\t\t\t?>\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\talert(\"Unable to connect with server...\");\n\t\t\t\t</script>\n\t\t\t\t\"<?php\n\t\t\t\t$connection->close();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//Select SQL query in PHP Code\n\t\t\t\t$sql = \"SELECT * FROM issue WHERE id='$_POST[txtID]' OR registerNo ='$_POST[txtMID]' OR issuedate='$_POST[txtissueDT]' OR returndate='$_POST[txtreturnDT]'\";\n\n\t\t\t\t//Check the query is executed\n\t\t\t\t$result = $connection->query($sql);\n\n\t\t\t\t//Check if result rows > 0 or not\n\t\t\t\tif($result->num_rows>0)\n\t\t\t\t{\n\t\t\t\t\t?>\n\t\t\t\t\t<table id=\"tblSearch\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>Issue ID</th>\n\t\t\t\t\t\t\t<th>Book ID</th>\n\t\t\t\t\t\t\t<th>Member ID</th>\n\t\t\t\t\t\t\t<th>Issue Date</th>\n\t\t\t\t\t\t\t<th>Return Date</th>\n\t\t\t\t\t\t\t<th>Currnet Status</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t<?php\n\t\t\t\t\t\twhile($row = $result->fetch_assoc())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\".$row['issueID'].\"</td>\n\t\t\t\t\t\t\t\t\t<td>\".$row['id'].\"</td>\n\t\t\t\t\t\t\t\t\t<td>\".$row['registerNo'].\"</td>\n\t\t\t\t\t\t\t\t\t<td>\".$row['issuedate'].\"</td>\n\t\t\t\t\t\t\t\t\t<td>\".$row['returndate'].\"</td>\n\t\t\t\t\t\t\t\t\t<td>\".$row['status'].\"</td></tr>\";\n\t\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Close connection of MySQL Server\n\t\t\t$connection->close();\n\t\t}",
"private function getIssues()\n {\n\n $issues = [];\n $total_issues = $this->totalIssues();\n if ($this->infos['errorBoolean']) {\n return 0;\n }\n if ($total_issues % 100 !== 0 ) {\n $total_int = intdiv($total_issues, 100) +1;\n }else {\n $total_int = $total_issues/100;\n }\n for ($i=0; $i < $total_int ; $i++) {\n $start = 100*$i;\n $max = 100*($i+1);\n $url = $this->base_uri.'search?jql=project='.$this->project.'&startAt='.$start.'&maxResults='.$max;\n $temp= $this->request($url);\n $issues[] = array(json_decode($temp));\n }\n\n return $issues;\n\n }",
"function fetchIssues($project, $statuses){\n\n // default project\n $project = (isset($project)) ? $project : 'DEVOPS' ;\n\n // default statuses to fetch\n $defaultStatuses = array(\n 'Backlog' => 'Backlog',\n 'In Progress' => 'In Progress',\n 'Done' => 'Done'\n );\n\n // default statuses\n $statuses = (isset($statuses)) ? $statuses : $defaultStatuses ;\n\n // initialize list of issues\n $list = [];\n\n // walk through statuses\n foreach ($statuses as $key => $status) {\n\n // define the JIRA JQL\n $jql = 'project = '.$project.' AND status = \"'.$status.'\" ORDER BY updated ASC';\n\n try {\n $issueService = new IssueService();\n\n // fetch issues\n $response = $issueService->search($jql);\n\n\n // issues walker\n foreach ($response->issues as $issue) {\n\n // get epic link\n if (isset($issue->fields->customFields['customfield_10008'])) {\n $jql = 'issue = '.$issue->fields->customFields['customfield_10008'];\n $issueService = new issueService();\n $response = $issueService->search($jql);\n $epicLink = $response->issues[0]->fields->summary;\n }\n\n // define details\n $issueDetails = array(\n \"key\" => $issue->key,\n \"summary\" => $issue->fields->summary,\n \"type\" => $issue->fields->issuetype->name,\n \"epiclink\" => $epicLink,\n // \"date\" => $issue->fields->duedate->format('Y-m-d H:i:s')\n );\n\n // push the issue details to the list\n $list[$status][] = $issueDetails;\n\n }\n\n } catch (JiraException $e) {\n $this->assertTrue(false, 'Query Failed : '.$e->getMessage());\n }\n }\n\n // return the list\n return $list;\n}",
"protected function getIssues()\n\t{\n\t\t$rangeFrom = 0;\n\t\t$rangeTo = 0;\n\n\t\t// Limit issues to process\n\t\t$this->out('GH issues to process? [a]ll / [r]ange :', false);\n\n\t\t$resp = trim($this->in());\n\n\t\tif ($resp == 'r' || $resp == 'range')\n\t\t{\n\t\t\t// Get the first GitHub issue (from)\n\t\t\t$this->out('Enter the first GitHub issue ID to process (from) :', false);\n\t\t\t$rangeFrom = (int) trim($this->in());\n\n\t\t\t// Get the ending GitHub issue (to)\n\t\t\t$this->out('Enter the latest GitHub issue ID to process (to) :', false);\n\t\t\t$rangeTo = (int) trim($this->in());\n\t\t}\n\n\t\t$query = $this->db->getQuery(true);\n\n\t\t$query->select($this->db->quoteName(array('id', 'gh_id')));\n\t\t$query->from($this->db->quoteName('#__issues'));\n\t\t$query->where($this->db->quoteName('gh_id') . ' IS NOT NULL');\n\n\t\t// Issues range selected?\n\t\tif ($rangeTo != 0 && $rangeTo >= $rangeFrom)\n\t\t{\n\t\t\t$query->where($this->db->quoteName('gh_id') . ' >= ' . (int) $rangeFrom);\n\t\t\t$query->where($this->db->quoteName('gh_id') . ' <= ' . (int) $rangeTo);\n\t\t}\n\n\t\t$this->db->setQuery($query);\n\n\t\ttry\n\t\t{\n\t\t\t$this->issues = $this->db->loadObjectList();\n\t\t}\n\t\tcatch (RuntimeException $e)\n\t\t{\n\t\t\t$this->out('Error ' . $e->getCode() . ' - ' . $e->getMessage(), true);\n\t\t\t$this->close();\n\t\t}\n\t}",
"public function getIssues($filters = array())\n\t{\n\t\t$params \t = array();\n\t\t\n\t\t// Search title/description\n\t\t$searchQuery = isset($filters['query']) ? urldecode($filters['query']) : '';\n\t\t$searchQuerySQL = '';\n\t\t\n\t\tif ($searchQuery) {\n\t\t\t$searchQuerySQL \t\t= sprintf('AND (b.title \t\t LIKE :searchQuery \n\t\t\t\t\t\t\t\t\t\t\t OR b.description LIKE :searchQueryDesc)');\n\t\t\t$params[':searchQuery'] = sprintf('%%%s%%', $searchQuery); \n\t\t\t$params[':searchQueryDesc'] = sprintf('%%%s%%', $searchQuery); \n\t\t}\n\t\t\n\t\t// Status filter\n\t\t$status = isset($filters['status']) ? array_map('intval', $filters['status']) : array();\n\t\t$statusSQL = '';\n\t\tif ($status) {\n\t\t\t$tmp \t \t\t = array_map('intval', $status);\n\t\t\t$statusIDs \t\t = implode(',', $tmp);\n\t\t\t$statusSQL \t\t = sprintf('AND b.status IN(%s)', $statusIDs);\n\t\t}\n\t\t\n\t\t// Severity filter\n\t\t$severity = isset($filters['severity']) ? intval($filters['severity']) : 0;\n\t\t$severitySQL = '';\n\t\tif ($severity) {\n\t\t\t$severitySQL \t\t = 'AND b.severity = :severity';\n\t\t\t$params[':severity'] = $severity;\n\t\t}\n\t\t\n\t\t// Assigned filter\n\t\t$assigned = isset($filters['assigned']) ? intval($filters['assigned']) : 0;\n\t\t$assignedSQL = '';\n\t\tif ($assigned > 0 || $assigned === -1) {\n\t\t\t$assignedSQL \t\t = 'AND b.assigned_to = :assigned';\n\t\t\t$params[':assigned'] = $assigned;\n\t\t\t\n\t\t\t// Unassigned is set to -1\n\t\t\tif ($assigned === -1) {\n\t\t\t\t$assignedSQL = 'AND b.assigned_to IS NULL';\n\t\t\t\t\n\t\t\t\t// Won't be needing this then\n\t\t\t\tunset($params[':assigned']);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$params = array_filter($params);\n\t\t\n\t\t$q = sprintf(\"SELECT b.id,\n\t\t\t\t\t\t \t\tb.title,\n\t\t\t\t\t\t \t\tb.slug,\n\t\t\t\t\t\t \t\tb.description,\n\t\t\t\t\t\t\t\tsv.name AS severity,\n\t\t\t\t\t\t \t\tb.created_at AS createdAt,\n\t\t\t\t\t\t \t\tu.login AS openedByUserLogin,\n b.status AS statusID,\n\t\t\t\t\t\t \t\tbs.name AS statusName,\n\t\t\t\t\t\t \t\tbs.style_name AS statusStyleName,\n\t\t\t\t\t\t\t\tCOALESCE(ua.display_name, ua.login, 'Unassigned') AS assignedToUserLogin,\n\t\t\t\t\t\t\t\tb.assigned_to AS assignedToUserID\n\t\t\t\t\t\t FROM issue b\n\t\t\t\t\t\t INNER JOIN user \t\t u ON b.opened_by = u.id\n\t\t\t\t\t\t INNER JOIN issue_status bs ON b.status = bs.id \n\t\t\t\t\t\t INNER JOIN issue_severity sv ON sv.id \t\t = b.severity\n\t\t\t\t\t\t LEFT JOIN user \t\t ua ON b.assigned_to = ua.id\n\t\t\t\t\t\t WHERE 1=1 \n\t\t\t\t\t\t %s\n\t\t\t\t\t\t %s\n\t\t\t\t\t\t %s\n\t\t\t\t\t\t %s\n\t\t\t\t\t\t ORDER BY b.created_at DESC, b.updated_at DESC\",\n\t\t\t\t\t\t $statusSQL,\n\t\t\t\t\t\t $severitySQL,\n\t\t\t\t\t\t $assignedSQL,\n\t\t\t\t\t\t $searchQuerySQL);\n \n\t\treturn $this->db->fetchAll($q, $params);\n\t}",
"function getSearchType()\n {\n return 'issues';\n }",
"public function get_issues() {\n \n $issues = [];\n \n $q = 'SELECT nid, title FROM {node_field_data} ';\n $q .= 'WHERE type = :t ';\n $q .= 'AND status = :s ';\n $q .= 'ORDER BY created DESC ';\n $args = [\n ':t' => 'issue',\n ':s' => 1\n ];\n \n $connection = \\Drupal::database();\n $result = $connection->query($q, $args);\n if ($result) {\n \n $am = \\Drupal::service('path.alias_manager');\n \n while ($row = $result->fetchAssoc()) {\n \n $d = [\n 'id' => $row['nid'],\n 'name' => $row['title'],\n 'url' => $am->getAliasByPath('/node/'.$row['nid'])\n ];\n $issues[$row['nid']] = $d;\n } \n }\n \n return $issues;\n \n }",
"public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}",
"function dosearchProblem($search,$tags)\r\n{\r\n //Puede ser ver si el search esta vacio en ese caso solo tomas en Tags\r\n //Si no tiene tags entonces es como esta normal\r\n $conn = connectToDB();\r\n $resultArr[\"status\"] = \"OK\";\r\n $resultArr[\"data\"] = array();\r\n\r\n if($conn != NULL)\r\n {\r\n if(count($tags) == 1)\r\n {\r\n $sql2 = \"SELECT * FROM problems WHERE id = '$search' OR title = '$search'\";\r\n }\r\n else if($search == \"\" && count($tags) > 1)\r\n {\r\n //Poner Query solo tomar en cueta los tags juntar tags y problems\r\n $sql2 = \"SELECT * FROM problems,tags\r\n WHERE tags.id = problems.id\r\n and problems.id IN (SELECT id FROM tags WHERE \";\r\n\r\n for ($x = 1; $x < count($tags); $x++) \r\n {\r\n if($x == 1)\r\n {\r\n $sql2 .= \" tag = \" . \"'\" . $tags[$x] . \"'\";\r\n }\r\n else\r\n {\r\n $sql2 .= \" or tag = \" . \"'\" . $tags[$x] . \"'\";\r\n }\r\n }\r\n $sql2 .= \" GROUP by id HAVING COUNT(id) = \". (count($tags)-1) .\")\";\r\n }\r\n else\r\n {\r\n //Poner el query con ambos usar la base que tenemos y concatenar cada uno\r\n //que este en la lista de tags\r\n $sql2 = \"SELECT * FROM problems,tags\r\n WHERE tags.id = problems.id and (problems.id = '$search' OR problems.title = '$search')\r\n and problems.id IN (SELECT id FROM tags WHERE \";\r\n\r\n for ($x = 1; $x < count($tags); $x++) \r\n {\r\n if($x == 1)\r\n {\r\n $sql2 .= \" tag = \" . \"'\" . $tags[$x] . \"'\";\r\n }\r\n else\r\n {\r\n $sql2 .= \" or tag = \" . \"'\" . $tags[$x] . \"'\";\r\n }\r\n }\r\n\r\n $sql2.=\" GROUP by id HAVING COUNT(id) = \". (count($tags)-1) .\")\";\r\n }\r\n\r\n $sql2.=\" GROUP BY problems.id;\";\r\n $result = $conn->query($sql2);\r\n\r\n if($result->num_rows > 0)\r\n {\r\n while($row = $result->fetch_assoc())\r\n {\r\n $tags = array();\r\n $aux = $row['id'];\r\n $sql3 = \"SELECT * FROM tags WHERE id = '$aux'\";\r\n $result2 = $conn->query($sql3);\r\n\r\n while($row2 = $result2->fetch_assoc())\r\n {\r\n array_push($tags, $row2[\"tag\"]);\r\n }\r\n\r\n $response = array(\"link\" => $row[\"link\"], \"id\" => $row[\"id\"], \"title\" => $row[\"title\"], \"orgFROM\" => $row[\"OrgFROM\"], \"tags\" => $tags);\r\n array_push($resultArr[\"data\"], $response);\r\n }\r\n\r\n $conn -> close();\r\n return $resultArr;\r\n }\r\n else\r\n {\r\n $conn -> close();\r\n return $resultArr;\r\n }\r\n }\r\n else\r\n {\r\n return array(\"status\" => \"500\");\r\n }\r\n}",
"public function search($q);",
"public function listGithubSearchResults( $query ) {\n\n }",
"public function searchJiraIssues($title, $hits, SearcherModel $searcher)\n {\n $this->_searcher = $searcher;\n\n return $this->renderHeader($title)\n . $this->renderResults($hits, $searcher)\n . $this->renderFooter();\n }",
"public function index(Request $request)\n {\n $perPage = $request->query('perPage');\n $search = $request->query('search');\n $query = company()->issues()->latest('date');\n if ($search) $query = $query->where('code', 'like', '%' . $search . '%')->orWhere('description', 'like', '%' . $search . '%');\n $query = $perPage ? $query->paginate($perPage) : $query->get();\n return IssueResource::collection($query);\n }",
"public function search($query);",
"public function search(Query $query);",
"abstract public function query($q, $params = []);",
"public static function search($query, &$results = array()) {\n\n }",
"public function searchResult($jobId = 0) {\n\n\t\t$query = Input::get('query', '');\n\t\t$searchQuery = Input::get('searchQuery');\n\t\t$searchQuery = explode(',', $searchQuery);\n\t\t$searcType = Input::get('searchType');\n \t$designation = Input::get('designation', '');\n \t$visa = Input::get('visa', []);\n \t$region = Input::get('region', []);\n \t$email = Input::get('email');\n\n \t$searching_text = '';\n\t\tif($email != \"\" || $query || $designation || count($visa) > 0 || count($region) > 0 || (!empty(Input::get('from_date')) && !empty(Input::get('to_date'))) ) {\n\t\t // Use the Elasticquent search method to search ElasticSearch\n\t\t try {\n\t\t \t$searching_text_to_send = $email.\"---\".$designation.\"---\".join(\"---\",$visa).\"---\".join(\"---\",$region).\"---\".$query;\n\t\t \t$searching_text = $email.\" \".$designation.\" \".join(\" \",$visa).\" \".join(\" \",$region).\" \".$query;\n\n\t\t \t$q = CandidateResume::query();\n\n\t\t \tif( isset($visa) && count($visa) > 0 ) {\n\t\t \t\t //print \"IN visa\".$visa;exit;\n\t\t \t\t //$q->where('visa','like', \"'%\".$visa.\"%'\");\n\t\t \t\t $q->whereIn('visa', $visa);\n\t\t \t}\n\n\t\t \tif( isset($region) && count($region) > 0 ) {\n\n\t\t \t\t $q->whereIn('region', $region);\n\t\t \t}\n\n\n\t\t \tif( isset($designation) && !empty($designation) ) {\n\t\t\t\t\t$q->where('designation','like', $designation.\"%\");\n\t\t \t}\n\n\t\t \tif( isset($email) && !empty(trim($email)) ) {\n\t\t\t\t\t$q->whereHas('candidate', function($j) use (&$email){\n\t\t\t\t \t$j->where('email','like', trim($email).\"%\");\n\t\t\t\t\t});\n\t\t \t}\n\n\t\t \tif(!empty(Input::get('from_date')) && !empty(Input::get('to_date'))) {\n\t\t\t\t\t$fromDateTime = datetime::createfromformat('m/d/Y',Input::get('from_date'))->format('Y-m-d 00:00:00');\n\t\t\t\t\t$toDateTime = datetime::createfromformat('m/d/Y', Input::get('to_date'))->format('Y-m-d 23:59:59');\n\t\t\t\t\t$q->whereBetween('created_at', [$fromDateTime, $toDateTime]);\n\t\t\t\t\t$searching_text_to_send .= $fromDateTime.\"---\".$toDateTime;\n\t\t \t\t$searching_text .= $fromDateTime.\" \".$toDateTime;\n\t\t\t\t}\n\n\t\t // \tif( isset($query) && !empty($query) ) {\n\t\t\t\t\t// $ands = preg_split(\"/ AND /i\", $query);\n\t\t\t\t\t// foreach($ands as $item) {\n\t\t\t\t\t// \t$ors = preg_split(\"/ OR /i\", $item);\n\t\t\t\t\t// \t$count = 0;\n\t\t\t\t\t// \tforeach($ors as $term) {\n\t\t\t\t\t// \t\tif($count == 0){\n\t\t\t\t\t// \t\t\t$q->where('resume','like', \"%\".$term.\"%\");\n\t\t\t\t\t// \t\t} else {\n\t\t\t\t\t// \t\t\t$q->orWhere('resume','like', \"%\".$term.\"%\");\n\t\t\t\t\t// \t\t\t//$q->Where('resume','like', \"%\".$term.\"%\");\n\t\t\t\t\t// \t\t}\n\t\t\t\t\t// \t\t$count++;\n\t\t\t\t\t// \t}\n\t\t\t\t\t// }\n\t\t // \t}\n\n\t\t \tif(isset($searchQuery) && !empty($searchQuery) && isset($searcType) && !empty($searcType)) {\n\t\t \t\tLog::info(json_encode($searchQuery));\n\t\t \t\tif($searcType == 3 && count($searchQuery) > 0) {\n\t\t\t\t\t\tforeach($searchQuery as $item) {\n\t\t\t\t\t\t\t$q->where('resume','like', \"%\".$item.\"%\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif($searcType == 2 && count($searchQuery) > 0) {\n\t\t\t\t\t\tforeach($searchQuery as $index => $item) {\n\t\t\t\t\t\t\t// $ands = preg_split(\"/ AND /i\", $query);\n\t\t\t\t\t\t\t// foreach($ands as $item) {\n\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\tif($index == 0) {\n\n\t\t\t\t\t\t\t\t$q->where(function ($query) use ($item) {\n\t\t\t\t\t\t\t\t\t$ands = preg_split(\"/ and /i\", $item);\n\t\t\t\t\t\t\t\t\tforeach($ands as $childItem) {\n\t\t\t\t\t\t\t\t\t\t$query->where('resume','like', \"%\".$childItem.\"%\");\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} else {\n\t\t\t\t\t\t\t\t$q->orWhere(function ($query) use ($item) {\n\t\t\t\t\t\t\t\t $ands = preg_split(\"/ and /i\", $item);\n\t\t\t\t\t\t\t\t\tforeach($ands as $childItem) {\n\t\t\t\t\t\t\t\t\t\t$query->where('resume','like', \"%\".$childItem.\"%\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//$q->where('resume','like', \"%\".$item.\"%\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$q->where('resume','like', \"%\".$searchQuery.\"%\");\n\t\t\t\t\t}\n\t\t \t}\n\n\t\t\t \tif(!empty(Input::get('csv_download_input'))) {\n\t\t\t\t\t$arrSelectFields = array('designation', 'visa', 'region', 'resume');\n\n\t\t\t $q->select($arrSelectFields);\n\t\t\t $data = $q->get();\n\n\t\t\t // passing the columns which I want from the result set. Useful when we have not selected required fields\n\t\t\t $arrColumns = array('designation', 'visa', 'region', 'resume');\n\t\t\t \n\t\t\t // define the first row which will come as the first row in the csv\n\t\t\t $arrFirstRow = array('Designation', 'Visa', 'Region', 'Resume');\n\t\t\t \n\t\t\t // building the options array\n\t\t\t $options = array(\n\t\t\t 'columns' => $arrColumns,\n\t\t\t 'firstRow' => $arrFirstRow,\n\t\t\t );\n\n\t\t\t return $this->convertToCSV($data, $options);\n\t\t\t\t}\n\t\t\t\t$q->orderBy('created_at', 'DESC');\n\t\t \t$candidate_resumes = $q->paginate(100);\t\n\n\t\t \t/*\n\t\t \t$designation = $designation?str_ireplace(\" and \", \" \", $designation):\"\";\n\t\t \t//$candidate_resumes = CandidateResume::searchByQuery(['bool' => ['should' => [['match' => ['resume' => $query]], ['match' => ['designation' => $designation]], ['match' => ['visa' => $visa]], ['match' => ['region' => $region]]]]]);\n\t\t \tif(preg_match('/\"/', $query)){\n\t\t \t\t$candidate_resumes = CandidateResume::searchByQuery([\n\t\t \t\t\t'bool' => [\n\t\t \t\t\t\t'should' => [\n\t\t \t\t\t\t\t[\n\t\t \t\t\t\t\t\t'match_phrase_prefix' => [\n\t\t \t\t\t\t\t\t\t'resume' => $query\n\t\t \t\t\t\t\t\t]\n\t\t \t\t\t\t\t], \n\t\t \t\t\t\t\t[\n\t\t \t\t\t\t\t\t'match_phrase_prefix' => [\n\t\t \t\t\t\t\t\t\t'designation' => $designation\n\t\t \t\t\t\t\t\t]\n\t\t \t\t\t\t\t],\n\t\t \t\t\t\t\t[\n\t\t\t \t\t\t\t\t'match' => [\n\t\t\t \t\t\t\t\t\t'visa' => $visa\n\t\t\t \t\t\t\t\t]\n\t\t \t\t\t\t\t],\n\t\t \t\t\t\t\t[\n\t\t \t\t\t\t\t\t'match' => [\n\t\t \t\t\t\t\t\t\t'region' => $region\n\t\t \t\t\t\t\t\t]\n\t\t \t\t\t\t\t]\n\t\t \t\t\t\t]\n\t\t \t\t\t]\n\t\t \t\t]);\n\t\t \t} else {\n\t\t \t\t$query = $query?str_ireplace(\" and \", \" \", $query): \"\";\n\t\t \t\t$candidate_resumes = CandidateResume::searchByQuery([\n\t\t \t\t\t'bool' => [\n\t\t\t \t\t\t'should' => [\n\t\t\t \t\t\t\t[\n\t\t\t \t\t\t\t\t'match' => [\n\t\t\t \t\t\t\t\t\t'resume' => $query\n\t\t\t \t\t\t\t\t]\n\t\t\t \t\t\t\t],\n\t\t\t \t\t\t\t[\n\t\t\t \t\t\t\t\t'match_phrase_prefix' => [\n\t\t\t \t\t\t\t\t\t'designation' => $designation\n\t\t\t \t\t\t\t\t]\n\t\t\t \t\t\t\t], \n\t\t\t \t\t\t\t[\n\t\t\t \t\t\t\t\t'match' => [\n\t\t\t \t\t\t\t\t\t'visa' => $visa\n\t\t\t \t\t\t\t\t]\n\t\t\t \t\t\t\t],\n\t\t\t \t\t\t\t[\n\t\t\t \t\t\t\t\t'match' => [\n\t\t\t \t\t\t\t\t\t'region' => $region\n\t\t\t \t\t\t\t\t]\n\t\t\t \t\t\t\t]\n\t\t\t \t\t\t]\n\t\t\t \t\t]\n\t\t \t\t]);\t\n\t\t \t}*/\n\n\t\t } catch(Exception $e){\n\t\t \tprint $e->getMessage();\n\t\t }\n\t \t} else {\n\t \t// Show all posts if no query is set\n\t \tif(!empty(Input::get('csv_download_input'))) {\n\t\t\t\t$arrSelectFields = array('designation', 'visa', 'region', 'resume');\n\t\t\t\t$q = CandidateResume::query();\n\t\t $q->select($arrSelectFields);\n\t\t $data = $q->get();\n\n\t\t // passing the columns which I want from the result set. Useful when we have not selected required fields\n\t\t $arrColumns = array('designation', 'visa', 'region', 'resume');\n\t\t \n\t\t // define the first row which will come as the first row in the csv\n\t\t $arrFirstRow = array('Designation', 'Visa', 'Region', 'Resume');\n\t\t \n\t\t // building the options array\n\t\t $options = array(\n\t\t 'columns' => $arrColumns,\n\t\t 'firstRow' => $arrFirstRow,\n\t\t );\n\n\t\t return $this->convertToCSV($data, $options);\n\t\t\t}\n\t \t$candidate_resumes = CandidateResume::paginate(100);\n\t }\n\t $queries = DB::getQueryLog();\n\t\t$last_query = end($queries);\n\t\tLog::info(json_encode($last_query));\n\t //echo $query;exit;\n\t\t/*echo \"<pre>\". count($candidate_resumes);\n\t\tprint_r($candidate_resumes[0]);\n\t\tdie;*/\n\n\t \t#return 'Done';\n\t\treturn View::make('search.searchResult')->with(\n\t\t\tarray(\n\t\t\t\t'title' => 'Search - Headhunting',\n\t\t\t\t'searching_text_to_send' => isset($searching_text_to_send)?urlencode($searching_text_to_send): \"\",\n\t\t\t\t'searching_text' => $searching_text,\n\t\t\t\t'candidate_resumes' => $candidate_resumes,\n\t\t\t\t'jobId' => $jobId,\n\t\t\t\t'query' => $query,\n\t\t\t\t'designation' => $designation, \n\t\t\t\t'visa' => $visa,\n\t\t\t\t'region'=>$region\n\t\t\t)\n\t\t);\n\t}",
"public function searchAction()\n\t{\n\t\t// search query\n\t\tif (empty($_GET['query'])) {\n\t\t\t$this->_forward('index');\n\t\t}\n\n\t\t$raw_query = urldecode($_GET['query']);\n\n\t\t// explicitly check to see if it's a barcode\n\t\t$tickets = Tickets::getByBarcode($raw_query);\n\n\t\t// that didn't work; now do a generic search\n\t\tif (empty($tickets)) {\n\t\t\t// split the query up into terms; these are ANDed together by the search function\n\t\t\t// TODO: fullstop too\n\t\t\t$terms = preg_split('/[\\s\\t-_()\\[\\]\\/\\\\,\"\\']+/', $raw_query, PREG_SPLIT_NO_EMPTY);\n\t\t\t$tickets = Tickets::getBySearch($terms, User::isAdmin());\n\t\t}\n\n\t\tif (!empty($tickets)) {\n\t\t\t$this->view->tickets = $tickets;\n\n\t\t\t// if a single ticket, run a check to see if it has been scanned before, \n\t\t\t// or is invalid\n\t\t\tif (count($tickets) == 1) {\n\t\t\t\t$ticket = reset($tickets);\n\n\t\t\t\tif (!$ticket['received_payment']) {\n\t\t\t\t\t$this->view->flagNoPayment = TRUE;\n\t\t\t\t}\n\t\t\t\t$day = date('l', time());\n\n\t\t\t\t// HACK TODO: Magic numbers.\n\t\t\t\tif (($ticket['ticket_type_id'] == 2 && $day == 'Sunday') ||\n\t\t\t\t ($ticket['ticket_type_id'] == 3 && $day == 'Saturday'))\n\t\t\t\t{\n\t\t\t\t\t$this->view->flagWrongDay = TRUE;\n\t\t\t\t}\n\n\t\t\t\t// has this been scanned before?\n\t\t\t\t$scans = Tickets::getScans($ticket['barcode']);\n\t\t\t\tif (!empty($scans)) {\n\t\t\t\t\t$this->view->flagScannedBefore = TRUE;\n\t\t\t\t\t$this->view->scans = $scans;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// no tickets, bail out.\n\t\t$this->view->flagFailedSearch = TRUE;\n\t\t$this->_forward('index');\n\t}",
"public function search($params) {\n\t\t$callUrl = \"https://en.wikipedia.org/w/api.php?action=query&list=search&utf8=&format=json&srlimit=5&srsearch=\".urlencode($params[\"q\"]);\n\n\t\t/**\n\t\t* Create curl request and send it\n\t\t*/\n\t\t$process = curl_init($callUrl);\n\t\tcurl_setopt($process, CURLOPT_HTTPHEADER, array('Accept: application/json'));\n\t\tcurl_setopt($process, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($process, CURLOPT_TIMEOUT, 5);\n\t\tcurl_setopt($process, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t$text = curl_exec($process);\n\t\tcurl_close($process);\n\t\t$raw = json_decode($text);\n\n\t\t/**\n\t\t * return message, if we could not get any results\n\t\t */\n\t\tif( count($raw->query->search) <= 0 ) {\n\t\t\t$answer = new Answer();\n\t\t\t$answer->addText(\"Unfortunately I was not able to find anything for *\" . $params[\"q\"] . \"*.\");\n\t\t\treturn $answer;\n\t\t}\n\n\t\t/**\n\t\t * get results into list\n\t\t */\n\t\t$answer = new Answer();\n\t\t$answer->addText(\"Here are the top wikipedia articles for *\" . $params[\"q\"] . \"*: \");\n\n\t\tforeach($raw->query->search as $res) {\n\t\t\t$answer->addAttachment(\n\t\t\t\tnew Attachment(\n\t\t\t\t\t$res->title,\n\t\t\t\t\tstrip_tags($res->snippet),\n\t\t\t\t\t\"https://en.wikipedia.org/wiki/\" . rawurlencode($res->title)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $answer;\n\t}",
"public function searchByName($query);",
"public function fetchAll($params = array())\n {\n $limit = $this->getEvent()->getRequest()->getQuery('limit', false);\n $parameters = array('filterId' => 'All Issues');\n if ($limit) {\n if ($limit < 2) {\n return new ApiProblem(400, 'Limit shall be greater than 1');\n }\n $parameters['limit'] = $limit;\n }\n $response = $this->webapicall->request('monitorGetIssuesByPredefinedFilter', $parameters);\n return $response->responseData->issues;\n }",
"public function get()\n {\n return $this->apiSearch($this->endpoint, ['class' => 'Managed\\Issue', 'parameters' => ['id']]);\n }",
"public function search($params = []);",
"private function totalIssues()\n {\n $url = $this->base_uri.'search?jql=project='.$this->project.'&startAt=0&maxResults=0';\n $issues = $this->request($url);\n if (!$this->infos['errorBoolean']) {\n return json_decode($issues)->total;\n }\n }",
"function issuesByStudentName( $name, $order ){\r\n\t\t$name = str_replace(' ', '%', $name);\r\n\t\t$return = array();\r\n\t\t$query = \"SELECT distinct i.ID, i.* from issues i, X_PNSY_STUDENT s, contacts c, `contacts-students` cs WHERE\r\n\t\t\t\ts.ID = cs.studentid and\r\n\t\t\t\tcs.contactid = c.id and\r\n\t\t\t\tc.issue = i.id and\r\n\t\t\t\tCONCAT(s.FIRST_NAME, ' ', s.MIDDLE_NAME, ' ', s.LAST_NAME) LIKE '%$name%'\";\r\n// Michael Thompson * 12/07/2005 * Added Below line to tack order onto sql sentence\r\n if ($order != \"\") $query .= \" ORDER BY $order\";\r\n\t\t$result = mysql_query($query);\r\n\t\twhile( $row = mysql_fetch_assoc($result) ) {\r\n\t\t\tarray_push( $return, $row );\r\n\t\t}\r\n\t\treturn $return;\r\n\t}",
"public static function searchByName($q)\n {\n // //->query(['query_string' => ['query' => '*'.$q.'*', 'fields' => ['name', 'notes']]])\n // ->query(['multi_match' => ['query' => $q, 'fields' => ['name', 'notes']]], ['term' => ['user_id' => UserUtil::getBrockerIds()]])\n // ->source(['user_id', 'name', 'notes'])\n // ->from(0)\n // ->size(1000)\n // ->raw();\n\n $searchResult = Deal::rawSearch()\n ->query([\n 'bool' => [\n 'must' => [\n ['terms' => ['user_id' => UserUtil::getBrockerIds()]],\n ['multi_match' => ['query' => $q, 'fields' => ['name', 'notes']]]\n ]\n ]\n ])\n ->source(['user_id'])\n ->from(0)\n ->size(10000)\n ->raw();\n\n\n $results = [];\n if($searchResult['hits']['total']['value'] == 0){}\n else\n $results = $searchResult['hits']['hits'];\n\n $dealResult = array_map('intval', Arr::pluck($results, '_id'));\n\n //-----------\n\n // $searchResult = DealContact::rawSearch()\n // ->query(['query_string' => ['query' => '*'.$q.'*', 'fields' => ['firstname', 'lastname', 'company', 'email', 'address1', 'address2', 'suburb', 'state', 'postcode', 'notes', 'phone']]])\n // ->source(['deal_id'])\n // ->from(0)\n // ->size(1000)\n // ->raw();\n // $results = [];\n // if($searchResult['hits']['total']['value'] == 0)\n // return [];\n // else\n // $results = $searchResult['hits']['hits'];\n\n $searchResult = DealContact::rawSearch()\n ->query([\n 'bool' => [\n 'must' => [\n ['terms' => ['user_id' => UserUtil::getBrockerIds()]],\n ['multi_match' => ['query' => $q, 'fields' => ['firstname', 'lastname', 'company', 'email', 'address1', 'address2', 'suburb', 'state', 'postcode', 'notes', 'phone']]]\n ]\n ]\n ])\n ->source(['deal_id', 'phone'])\n ->from(0)\n ->size(10000)\n ->raw();\n $results = [];\n if($searchResult['hits']['total']['value'] == 0){}\n else\n $results = $searchResult['hits']['hits'];\n\n\n $dealcontactResult = Arr::pluck($results, '_source.deal_id');\n\n //--------------\n\n // $searchResult = Reminder::rawSearch()\n // ->query(['query_string' => ['query' => '*'.$q.'*', 'fields' => ['details', 'tags']]])\n // ->source(['deal_id','details', 'tags'])\n // ->from(0)\n // ->size(1000)\n // ->raw();\n // $results = [];\n // if($searchResult['hits']['total']['value'] == 0)\n // return [];\n // else\n // $results = $searchResult['hits']['hits'];\n\n $searchResult = Reminder::rawSearch()\n ->query([\n 'bool' => [\n 'must' => [\n ['terms' => ['user_id' => UserUtil::getBrockerIds()]],\n ['multi_match' => ['query' => $q, 'fields' => ['details', 'tags']]]\n ]\n ]\n ])\n ->source(['deal_id','details', 'tags'])\n ->from(0)\n ->size(10000)\n ->raw();\n $results = [];\n if($searchResult['hits']['total']['value'] == 0){}\n else\n $results = $searchResult['hits']['hits'];\n\n $reminderResult = Arr::pluck($results, '_source.deal_id');\n\n $searchResult = JournalEntry::rawSearch()\n ->query([\n 'bool' => [\n 'must' => [\n ['terms' => ['user_id' => UserUtil::getBrockerIds()]],\n ['multi_match' => ['query' => $q, 'fields' => ['notes', 'tags']]]\n ]\n ]\n ])\n ->source(['deal_id','notes', 'tags'])\n ->from(0)\n ->size(10000)\n ->raw();\n $results = [];\n if($searchResult['hits']['total']['value'] == 0){}\n else\n $results = $searchResult['hits']['hits'];\n\n $journalentryResult = Arr::pluck($results, '_source.deal_id');\n\n\n return array_values(Arr::sort(array_values(array_unique(Arr::collapse([$dealResult, $dealcontactResult, $reminderResult, $journalentryResult])))));\n }"
] |
[
"0.72833693",
"0.6058222",
"0.5952352",
"0.58870554",
"0.58418506",
"0.5590672",
"0.5538738",
"0.5508943",
"0.54888016",
"0.5475737",
"0.53731436",
"0.5324228",
"0.53211635",
"0.5315455",
"0.52421737",
"0.5227945",
"0.5205282",
"0.5197008",
"0.5158517",
"0.5151872",
"0.51508194",
"0.51444554",
"0.51326436",
"0.5103848",
"0.50826234",
"0.5067737",
"0.50591224",
"0.50501424",
"0.50396633",
"0.50366056"
] |
0.6730205
|
1
|
Returns the id of the payment method configuration.
|
public function getPaymentMethodConfigurationId()
{
return $this->_paymentMethodConfigurationId;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getPaymentMethodId();",
"public function getPaymentId()\n {\n return $this->_getValue('oepaypal_paymentid');\n }",
"public function getServiceConfigId()\n {\n return $this->service_config_id;\n }",
"public function getIdconfig()\n {\n return $this->idconfig;\n }",
"public function getPaymentId() \n {\n if (!$this->hasPaymentId()) \n {\n $this->paymentId = '';\n }\n\n return $this->paymentId;\n }",
"public function getPaymentId()\n {\n return $this->paymentId;\n }",
"private function getPaymentId()\n {\n return Session::get('mall.payment.id');\n }",
"public function getPaymentid()\r\n {\r\n return $this->paymentid;\r\n }",
"public function getPaymentMethodConfiguration()\n {\n if ($this->_paymentMethodConfiguration == null) {\n $this->_paymentMethodConfiguration = Mage::getModel(\n 'postfinancecheckout_payment/entity_paymentMethodConfiguration')->load(\n $this->_paymentMethodConfigurationId);\n }\n\n return $this->_paymentMethodConfiguration;\n }",
"public function paymentId() : string;",
"public function getDeliveryMethodId()\n\t{\n\t\t$retval = '';\n\t\tif (isset($this->data[self::KEY_DELIVERY_METHOD_ID])) {\n\t\t\t$retval = $this->data[self::KEY_DELIVERY_METHOD_ID];\n\t\t}\n\t\treturn $retval;\n\t}",
"public static function getCwhConfigId()\n {\n $cwhConfigId = null;\n $cwhConfig = CwhConfig::findOne(['tablename' => static::tableName()]);\n if (!is_null($cwhConfig)) {\n $cwhConfigId = $cwhConfig->id;\n }\n return $cwhConfigId;\n }",
"public function getMailCfgId()\n {\n return $this->get(self::_MAIL_CFG_ID);\n }",
"public function getId()\n {\n return $this->savePayment();\n }",
"public function getId(){\n if(!$this->id){\n return $this->getShippingOptionId().'_'.md5($this->getShippingServiceName());\n }\n return $this->id;\n }",
"public function getPaymentInstrumentID()\n {\n return $this->paymentInstrumentID;\n }",
"public function getPayId()\n {\n return $this->pay_id;\n }",
"function payment_id($payment_id=null)\n {\n if (isset($payment_id)) $this->payment_id = $payment_id;\n return $this->payment_id;\n }",
"private function _getPaymentMethod ()\n\t{\n\t\t$id = craft()->config->get('paymentMethodId', 'commercepaybear');\n\t\treturn craft()->commerce_paymentMethods->getPaymentMethodById($id);\n\t}",
"protected function get_method_id() {\n\n\t\treturn $this->id;\n\t}",
"public function getPaymentGateway()\n {\n return Mage::getStoreConfig(\"fontis_masterpass/settings/payment_gateway\");\n }",
"protected function getMerchantId()\r\n {\r\n return $this->processor_data['processor_params']['merchant_id'];\r\n }",
"public function getParentPaymentId()\n {\n return $this->getParameter('parentPaymentId');\n }",
"function getQueuedPaymentId() {\n\t\tif (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');\n\t\treturn parent::getPaymentId();\n\t}",
"public function getCheckoutIdentifier()\n {\n return Mage::getStoreConfig(\"fontis_masterpass/settings/checkout_identifier\");\n }",
"public function get_woo_payer_id() {\n\n\t\t$environment = $this->wc_gateway()->get_option( 'environment', 'live' );\n\n\t\t$api_prefix = '';\n\n\t\tif ( 'live' !== $environment ) {\n\t\t\t$api_prefix = 'sandbox_';\n\t\t}\n\n\t\t$option_key = 'woocommerce_ppec_payer_id_' . $environment . '_' . md5( $this->wc_gateway()->get_option( $api_prefix . 'api_username' ) . ':' . $this->wc_gateway()->get_option( $api_prefix . 'api_password' ) );\n\n\t\t$payer_id = get_option( $option_key );\n\n\t\tif ( $payer_id ) {\n\t\t\treturn $payer_id;\n\t\t} else {\n\t\t\t$result = $this->get_woo_pal_details();\n\n\t\t\tif ( ! empty( $result['PAL'] ) ) {\n\t\t\t\tupdate_option( $option_key, wc_clean( $result['PAL'] ) );\n\n\t\t\t\treturn $payer_id;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function getMerchantId()\n {\n return $this->getParameter('merchantId');\n }",
"protected function getConfigName()\n {\n return 'hashids';\n }",
"public function getMerchantId()\n {\n return $this->isSandboxMode() ? $this->getSetting( 'MerchantIdTest' ) : $this->getSetting( 'MerchantId' );\n }",
"public function getCompanyId()\n {\n return array_get($this->config, 'company_id');\n }"
] |
[
"0.7648721",
"0.69091266",
"0.6882788",
"0.6865458",
"0.6830397",
"0.6794658",
"0.66661173",
"0.6609008",
"0.6508471",
"0.6470761",
"0.6303148",
"0.6295842",
"0.6277136",
"0.619672",
"0.6192481",
"0.6158457",
"0.60733944",
"0.6020274",
"0.6008001",
"0.59806424",
"0.59570193",
"0.595023",
"0.59373707",
"0.5922402",
"0.58871037",
"0.58586603",
"0.5828902",
"0.5823701",
"0.5798975",
"0.57915944"
] |
0.8683274
|
0
|
Returns the payment method configuration.
|
public function getPaymentMethodConfiguration()
{
if ($this->_paymentMethodConfiguration == null) {
$this->_paymentMethodConfiguration = Mage::getModel(
'postfinancecheckout_payment/entity_paymentMethodConfiguration')->load(
$this->_paymentMethodConfigurationId);
}
return $this->_paymentMethodConfiguration;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getPaymentMethodConfigurationId()\n {\n return $this->_paymentMethodConfigurationId;\n }",
"public function getConfig()\n {\n\n $methodCode = self::CODE;\n $config = [];\n\n $testMode = $this->_config->getValue('payment/brick/test_mode');\n $publicTestKey = $this->_config->getValue('payment/brick/public_test_key');\n $publicKey = $this->_config->getValue('payment/brick/public_key');\n $autoFillCardInfo = $this->_config->getValue('payment/brick/auto_fill_card_info');\n $config = array_merge_recursive($config, [\n 'payment' => [\n 'ccform' => [\n 'availableTypes' => [$methodCode => $this->getCcAvailableTypes()],\n 'months' => [$methodCode => $this->getCcMonths()],\n 'years' => [$methodCode => $this->getCcYears()],\n 'hasVerification' => [$methodCode => true],\n 'hasSsCardType' => [$methodCode => false],\n 'ssStartYears' => [$methodCode => $this->getSsStartYears()],\n 'cvvImageUrl' => [$methodCode => $this->getCvvImageUrl()]\n ],\n $methodCode => [\n 'public_key' => $testMode ? $publicTestKey : $publicKey,\n 'auto_fill_card_info' => $autoFillCardInfo,\n 'isActive' => true\n ]\n ]\n ]);\n return $config;\n }",
"protected function _get_configuration(){\n\n return new Payment_Configuration();\n\n }",
"public function getConfig()\n {\n $config = [\n 'payment' => [\n 'ccform' => [\n 'availableTypes' => [\n self::CODE => $this->getCardTypes()\n ],\n 'months' => [\n self::CODE => $this->getMonths()\n ],\n 'years' => [\n self::CODE => $this->getYears()\n ],\n 'hasVerification' => [\n self::CODE => $this->config->getValue('enable_cvv') ? true : false\n ],\n 'cvvImageUrl' => [\n self::CODE => $this->getCvvImageUrl()\n ],\n 'testMode' => [\n self::CODE => $this->config->getValue('test')\n ],\n 'jsToken' => [\n self::CODE => $this->config->getValue('js_token')\n ]\n ]\n ]\n ];\n return $config;\n }",
"protected function _getConfig()\n {\n if (is_null($this->_config)) {\n $this->_config = Mage::getModel('cjcheckout/config', array($this->_paymentMethodCode, Mage::app()->getStore()->getId()));\n }\n return $this->_config;\n }",
"public function getConfig()\n {\n return [\n 'payment' => [\n self::CODE => [\n // get setting values using events.xml section/group/field ids for path\n 'apiKey' => $this->helper->getConfig('payment/payio/integration/api_key'),\n 'apiTransactionPath' => $this->helper->getApiTransactionPath(),\n 'apiSettingsPath' => $this->helper->getApiSettingPath(),\n 'gatewayPath' => $this->helper->getGatewayPath(),\n 'checkoutUrl' => $this->helper->getCheckoutUrl(),\n 'paymentSuccessUrl' => $this->helper->getPaymentSuccessUrl(),\n 'currency' => $this->helper->getCurrentCurrencyCode(),\n 'cartTax' => $this->helper->getUKTaxRate(),\n 'shippingMethods' => $this->helper->getActiveShippingMethods()\n ]\n ]\n ];\n }",
"abstract public function getPaymentConfig($payment);",
"protected function _getConfig()\n {\n return $this->_paypalConfig;\n }",
"public function getConfig()\n {\n $storeId = $this->session->getStoreId();\n return [\n 'payment' => [\n self::CODE => [\n 'isActive' => $this->config->isActive($storeId),\n 'ccTypesMapper' => $this->config->getCcTypesMapper(),\n 'availableCardTypes' => $this->config->getAvailableCardTypes($storeId),\n 'useCvv' => $this->config->isCvvEnabled($storeId),\n 'environment' => $this->config->getEnvironment($storeId),\n 'environmentUrl' => $this->config->getEnvironmentUrl(),\n 'use_sandbox' => $this->config->useSandbox($storeId),\n 'profile_id' => $this->config->getProfileId($storeId),\n 'profile_key' => $this->config->getProfileKey($storeId),\n 'ccVaultCode' => self::CC_VAULT_CODE,\n ]\n ],\n ];\n }",
"public function getMerchantConfig()\n {\n return $this->config;\n }",
"public function getConfig()\n {\n $config = [\n 'payment' => []\n ];\n // show logos turned on by default\n if ($this->_showLogos()) {\n $config['payment']['adyen']['showLogo'] = true;\n } else {\n $config['payment']['adyen']['showLogo'] = false;\n }\n\n\t\t$config['payment']['checkoutCardComponentSource'] = $this->_adyenHelper->getCheckoutCardComponentJs($this->storeManager->getStore()->getId());\n\n return $config;\n }",
"private function _getPaymentMethod ()\n\t{\n\t\t$id = craft()->config->get('paymentMethodId', 'commercepaybear');\n\t\treturn craft()->commerce_paymentMethods->getPaymentMethodById($id);\n\t}",
"public function getPaymentGateway()\n {\n return Mage::getStoreConfig(\"fontis_masterpass/settings/payment_gateway\");\n }",
"public function getConfig()\n {\n if (!$this->stripeEnabledValidator->validate()) {\n return [];\n }\n\n return [\n 'payment' => [\n static::CODE => [\n 'isActive' => $this->config->isActive(),\n 'isApplePayEnabled' => $this->config->isApplePayEnabled(),\n 'publicKey' => $this->config->getPublicKey(),\n 'sdkUrl' => $this->config->getSdkUrl(),\n 'threedSecureAlways' => $this->config->getThreedSecureAlways(),\n 'imageUrl' => $this->config->getImageUrl(),\n 'savedCards' => $this->stripeAccountManagement->getAllCards(),\n 'enableSaveCards' => $this->config->isEnableSaveCards(),\n 'zeroDecimal' => AmountHelper::CURRENCY_ZERO_DECIMAL\n ],\n ]\n ];\n }",
"public function makeConfiguration($paymentMethod,$order,$transaction){\n\n\t\t$conf['merchantId'] = $paymentMethod->options->merchantId ?? null;\n\t \t$conf['publicKey'] = $paymentMethod->options->publicKey ?? null;\n\t \t\n\t \t$conf['sandboxMode'] = true;\n\t \tif($paymentMethod->options->mode!='sandbox')\n\t \t\t$conf['sandboxMode'] = false;\n\t \t\n\t \t$conf['reedirectAfterPayment'] = $order->url;\n\t \t\n\t \t$conf['order'] = $order;\n\n\t \treturn json_decode(json_encode($conf));\n \n\t}",
"protected function getPaymentMethod(){\n return $this->method;\n }",
"public function getCheckoutConfig()\n {\n return $this->_get('checkoutConfig');\n }",
"public function getConfig()\n {\n return [\n 'payment' => [\n EWallet::CODE => [\n 'redirectUrl' => $this->helperData->getEWalletRedirectUrl(),\n 'subtypes' => [\n [\n 'name' => 'pagseguro',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/pagseguro-logo.png')\n ],\n [\n 'name' => 'paypal',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/paypal-logo.png')\n ],\n ]\n ]\n ]\n ];\n }",
"public function getPaymentMethod()\n {\n return $this->paymentMethod;\n }",
"public function getPaymentMethod()\n {\n return $this->paymentMethod;\n }",
"public function getPaymentMethod()\n {\n return $this->payment_method;\n }",
"public function getConfig()\n {\n $isVisaCheckoutActive = $this->config->isActive();\n return [\n 'payment' => [\n self::CODE => [\n 'isActive' => $isVisaCheckoutActive,\n 'title' => $this->config->getTitle(),\n 'api_key' => $this->config->getApiKey(),\n 'isDeveloperMode' => $this->config->isDeveloperMode(),\n 'placeOrderUrl' => $this->url->getUrl('paymentsvisa/index/placeorder'),\n 'buttonUrl' =>\n $this->config->isTest()\n ? 'https://sandbox.secure.checkout.visa.com/wallet-services-web/xo/button.png'\n : 'https://secure.checkout.visa.com/wallet-services-web/xo/button.png',\n ]\n ]\n ];\n }",
"public function getPaymentMethod(){\n return $this->_getData(self::PAYMENT_METHOD);\n }",
"public function getPaymentMethod() \n {\n return $this->_fields['PaymentMethod']['FieldValue'];\n }",
"public function getPaymentMode()\n {\n return $this->payment_mode;\n }",
"public function getConfig()\n {\n if (!$this->config->getIsActive()) {\n return [];\n }\n\n return [\n 'payment' => [\n 'collector_checkout' => [\n 'image_remove_item' => $this->getViewFileUrl('Webbhuset_CollectorCheckout::images/times-solid.svg'),\n 'image_plus_qty' => $this->getViewFileUrl('Webbhuset_CollectorCheckout::images/plus-solid.svg'),\n 'image_minus_qty' => $this->getViewFileUrl('Webbhuset_CollectorCheckout::images/minus-solid.svg'),\n 'newsletter_url' => $this->getNewsletterUrl(),\n 'reinit_url' => $this->getReinitUrl(),\n 'update_url' => $this->getUpdateUrl(),\n 'delivery_checkout' => $this->config->getIsDeliveryCheckoutActive(),\n ],\n ],\n ];\n }",
"public function configurationForm() {\n return new PaymentRequestConfigurationForm();\n }",
"public function getConfig()\n {\n return [\n 'payment' => [\n self::CODE => [\n 'transactionResults' => [\n ClientMock::SUCCESS => __('Success'),\n ClientMock::FAILURE => __('Fraud')\n ]\n ]\n ]\n ];\n }",
"public function getGatewayConfig() {\r\n return $this->gatewayConfig;\r\n }",
"public function getPaymentMethod() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->paymentMethod;\r\n\t}"
] |
[
"0.75777453",
"0.75674",
"0.7381567",
"0.73125285",
"0.7307551",
"0.72640365",
"0.7257031",
"0.72051096",
"0.7010639",
"0.6985636",
"0.6951192",
"0.6940241",
"0.6929824",
"0.6917494",
"0.68885744",
"0.6887468",
"0.683851",
"0.6786996",
"0.6776377",
"0.6776377",
"0.6766729",
"0.67204404",
"0.6711077",
"0.66880405",
"0.6621468",
"0.6577656",
"0.6555138",
"0.6541707",
"0.6491667",
"0.64411086"
] |
0.83638227
|
0
|
Returns whether there is an existing refund job for the given order.
|
protected function hasExistingRefundJob($order)
{
/* @var PostFinanceCheckout_Payment_Model_Entity_RefundJob $existingRefundJob */
$existingRefundJob = Mage::getModel('postfinancecheckout_payment/entity_refundJob');
$existingRefundJob->loadByOrder($order);
return $existingRefundJob->getId() > 0;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function checkExistingRefundJob(Mage_Sales_Model_Order $order)\n {\n /* @var PostFinanceCheckout_Payment_Model_Entity_RefundJob $existingRefundJob */\n $existingRefundJob = Mage::getModel('postfinancecheckout_payment/entity_refundJob');\n $existingRefundJob->loadByOrder($order);\n if ($existingRefundJob->getId() > 0) {\n try {\n /* @var PostFinanceCheckout_Payment_Model_Service_Refund $refundService */\n $refundService = Mage::getSingleton('postfinancecheckout_payment/service_refund');\n $refundService->refund($existingRefundJob->getSpaceId(), $existingRefundJob->getRefund());\n } catch (Exception $e) {\n Mage::log('Failed to refund because of an exception: ' . $e->getMessage(), null,\n 'postfinancecheckout.log');\n }\n\n Mage::throwException(\n $this->getHelper()->__(\n 'As long as there is an open creditmemo for the order, no new creditmemo can be created.'));\n }\n }",
"public function canRefund($order)\r\n {\r\n if($order->getStatus()!='alipay_trade_finished' && $order->getStatus()!='alipay_trade_success' && $order->getStatus()!=Mage_Sales_Model_Order::STATE_PROCESSING){\r\n return false;\r\n }\r\n $payment = $order->getPayment();\r\n if($payment->getMethod()!='alipay_payment'){\r\n return false;\r\n }\r\n $payment = Mage::getModel('imaginato_alipay/payment');\r\n return $payment->trade_query($order);\r\n }",
"public function is_order_refunded( $order ) {\n\n\t\tif ( is_numeric( $order ) ) {\n\t\t\t$order = wc_get_order( $order );\n\t\t}\n\n\t\treturn ( $this->order_has_status( $order, 'refunded' ) );\n\t}",
"public function isRefunded()\n {\n $result = false;\n\n if ($this->getBackendTransactions()) {\n foreach ($this->getBackendTransactions() as $transaction) {\n if (\n $transaction->isRefund()\n && $transaction->isSucceed()\n ) {\n $result = true;\n break;\n }\n }\n }\n\n return $result;\n }",
"public function orderExists ( $orderId ) {\n\t\treturn $this->mapper->orderExist( $orderId );\n\t}",
"protected function checkPreConditions($refund)\n {\n $job = $refund->job;\n $account = $refund->financialAccount;\n\n if(!$job->quickbook_id) {\n $this->task->markFailed(\"Dependency Error: Job not synced on Quickbook.\", $this->queueJob->attempts());\n return false;\n }\n\n if($job->quickbook_id) {\n $isExists = QuickBooks::isCustomerExistsOnQuickbooks($job->quickbook_id);\n\n if(!$isExists){\n QuickBooks::unlinkJPEntities($job);\n $this->task->markFailed(\"Dependency Error: Job not found on Quickbook.\", $this->queueJob->attempts());\n $this->resynchCustomerAccount($job->customer_id, $this->task->created_source);\n return false;\n }\n }\n\n if($account && !$account->getQBOId()){\n $task = QBAccount::createTask($account->id, QuickBookTask::CREATE, $this->task->created_source, QuickBookTask::ORIGIN_JP);\n $this->task->parent_id = $task ? $task->id : null;\n $this->task->status = QuickBookTask::STATUS_PENDING;\n $this->task->save();\n return false;\n }\n\n return true;\n }",
"public function checkIfOrderExist($orderId);",
"private function is_order_complete($order) {\r\n\t\t$status = '';\r\n\t\t$status = (method_exists($Order,'get_status') == true )? $order->get_status(): $order->status;\r\n\r\n\t\tif ($status == 'pending') {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"public function canCancelManually($order)\n {\n $payment = $order->getPayment();\n\n //If order has state 'pending_payment' and the payment has Ingenico Payment Services-status 0 or null (unknown) then cancel the order\n if ($order->getState() == Mage_Sales_Model_Order::STATE_PENDING_PAYMENT\n && (true === is_null($payment->getAdditionalInformation('status')) || ($payment->getAdditionalInformation('status') == '0'))) {\n return true;\n } else {\n return false;\n }\n }",
"public function hasRecurringOrder(OrderInterface $order);",
"public function check_invoice_exists($orderId)\n\t{\n\t\t$invoiceTable = Mage::getSingleton('core/resource')->getTableName('sales_flat_invoice');\n\t\t$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);\n\t\t$Id = $order->getId();\n\t\t$sql = \"select entity_id from \" . $invoiceTable . \"\n\t\t\t\t\t\t\twhere order_id = '\" . (int) $Id . \"'\";\n\n\t\t$invoice = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchRow($sql);\n\t\t\n\t\tif (!empty($invoice)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function checkByOrderId($orderId)\n {\n // Clear the error variable\n $this->error = '';\n\n /**\n * Check value is string\n * If string return false and set error message on error variable\n */\n if (\n !self::__validateString($orderId, 1, 50)\n )\n return false;\n\n $param = array(\n \"apikey\" => $this->apiKey,\n \"mob\" => $this->mobile,\n \"id\" => $orderId\n );\n\n return self::__sendCheckRequest('invoice/byorderid', $param);\n }",
"public function refund():bool {\n request::xhr(\"orders/refund\", \"csrf_token=\".run::$runner->user->csrf.\"&id=\".substr($this->ID, 1),run::$runner->user->session);\n return true;\n }",
"public function exists()\n {\n try {\n $this->connection->getJob($this->identity + ['fields' => 'jobReference']);\n } catch (NotFoundException $ex) {\n return false;\n }\n\n return true;\n }",
"public function isRefundTransactionAllowed()\n {\n return $this->isCaptured() && !$this->isRefunded();\n }",
"public function hasInvoiceNeedsCapture($order)\n {\n foreach ($order->getInvoiceCollection() as $invoice) {\n /* @var $invoice Mage_Sales_Model_Order_Invoice */\n if ($invoice->canCapture()) {\n return true;\n }\n }\n\n return false;\n }",
"private function isTotalPaidEnoughForRefund(OrderInterface $order)\n {\n return !abs($this->priceCurrency->round($order->getTotalPaid()) - $order->getTotalRefunded()) < .0001;\n }",
"protected function order_contains_subscription( $order ) {\n\t\treturn WC_Subscriptions_Order::order_contains_subscription( $order );\n\t}",
"public function hasRecurringOrders();",
"public function hasOrder()\n {\n return $this->_has('_order');\n }",
"public function process_refund($order_id, $amount = null, $reason = '') {\n $order = wc_get_order( $order_id );\n $refundResponse = $this->refund( $order, $order_id, $amount, $reason );\n\n if ($refundResponse == '200') return true;\n else {\n $this->setLogError($refundResponse);\n return new WP_Error( 'midtrans_refund_error', $refundResponse);\n }\n }",
"public function hasBillsafePayment(Mage_Sales_Model_Order $order)\n {\n $billsafeCode = Netresearch_Billsafe_Model_Payment::CODE;\n $paymentCode = $order->getPayment()->getMethodInstance()->getCode();\n return ($paymentCode === $billsafeCode);\n }",
"public function isAvailable(Order $order)\n {\n $availabilityPolicy = AvailabilityPolicyFactory::create($this, $order);\n\n return $availabilityPolicy->isAvailable();\n }",
"public function hasJob(): bool;",
"private function checkIsYourOrder($order)\n {\n $customerData = $this->sessionCustomer->getCustomer();\n $nameCustomerOrder = $order->getCustomerName();\n $nameCustomerSesstion = $customerData->getName();\n if ($nameCustomerOrder !== $nameCustomerSesstion) {\n return false;\n }\n return true;\n }",
"public function is_order_voided( $order ) {\n\n\t\tif ( is_numeric( $order ) ) {\n\t\t\t$order = wc_get_order( $order );\n\t\t}\n\n\t\treturn ( $this->order_has_status( $order, 'voided' ) );\n\t}",
"public function is_order_ready( WC_Order $order ) {\n\n\t\t// Assume it's not ready\n\t\t$is_ready = false;\n\n\t\t// Only continue checking if the order hasn't already been sent to AvaTax\n\t\tif ( ! $this->is_order_posted( $order ) ) {\n\n\t\t\t$status = $order->get_status();\n\n\t\t\t/**\n\t\t\t * Filter the order statuses that allow manual order sending.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t * @param array $ready_statuses The valid statuses.\n\t\t\t */\n\t\t\t$ready_statuses = apply_filters( 'wc_avatax_order_ready_statuses', array(\n\t\t\t\t'processing',\n\t\t\t\t'completed',\n\t\t\t) );\n\n\t\t\t// See if the order has one of the ready statuses\n\t\t\t$is_ready = in_array( $status, $ready_statuses );\n\n\t\t\t// If not, and Order Status Manager is active, then check the status' paid property\n\t\t\tif ( class_exists( 'WC_Order_Status_Manager_Order_Status' ) && ! $is_ready ) {\n\n\t\t\t\t$status = new WC_Order_Status_Manager_Order_Status( $status );\n\n\t\t\t\t$is_ready = ( $status->get_id() > 0 && ! $status->is_core_status() && $status->is_paid() );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filter whether an order is ready to be sent to AvaTax.\n\t\t *\n\t\t * @since 1.0.0\n\t\t * @param bool $is_ready\n\t\t * @param int $order_id The order ID\n\t\t */\n\t\treturn apply_filters( 'wc_avatax_order_is_ready', $is_ready, SV_WC_Order_Compatibility::get_prop( $order, 'id' ) );\n\t}",
"public function shouldRefund()\n {\n $paidMoney = $this -> countPaidMoney();\n $consumedMoney = $this -> countConsumedMoney();\n \n return $consumedMoney < $paidMoney;\n }",
"public static function order_contains_pre_order( $order ) {\n\n\t\tif ( ! is_object( $order ) )\n\t\t\t$order = new WC_Order( $order );\n\n\t\tif ( isset( $order->order_custom_fields['_wc_pre_orders_is_pre_order'][0] ) )\n\t\t\treturn (bool) $order->order_custom_fields['_wc_pre_orders_is_pre_order'][0];\n\t\telse\n\t\t\treturn false;\n\t}",
"function hasOrder($user_id, $order_id)\n {\n $order = $this->order($order_id)\n ->where('uzivatele_id', $user_id)\n ->fetch();\n\n return $order !== false;\n }"
] |
[
"0.7344658",
"0.70023465",
"0.68404955",
"0.6252571",
"0.6059617",
"0.5994858",
"0.5966403",
"0.596431",
"0.59266174",
"0.59163165",
"0.5819851",
"0.57154167",
"0.5709076",
"0.56458646",
"0.5638768",
"0.5580314",
"0.5524379",
"0.552231",
"0.5515488",
"0.5447247",
"0.54364884",
"0.5392332",
"0.5349479",
"0.5337933",
"0.5326078",
"0.5314687",
"0.5312181",
"0.5300454",
"0.5293911",
"0.5286514"
] |
0.83637035
|
0
|
Returns whether this payment method can be used with the given quote. It will perform an online check on PostFinance Checkout.
|
public function isAvailable($quote = null)
{
$isAvailable = parent::isAvailable($quote);
if (! $isAvailable) {
return false;
}
if ($quote != null && $quote->getGrandTotal() < 0.0001) {
return false;
}
$client = $this->getHelper()->getApiClient(true);
if ($quote != null && $client) {
$spaceId = $quote->getStore()->getConfig('postfinancecheckout_payment/general/space_id');
if ($spaceId) {
/* @var PostFinanceCheckout_Payment_Model_Service_Transaction $transactionService */
$transactionService = Mage::getSingleton('postfinancecheckout_payment/service_transaction');
try {
$possiblePaymentMethods = $transactionService->getPossiblePaymentMethods($quote);
$paymentMethodPossible = false;
foreach ($possiblePaymentMethods as $possiblePaymentMethod) {
if ($possiblePaymentMethod->getId() ==
$this->getPaymentMethodConfiguration()->getConfigurationId()) {
$paymentMethodPossible = true;
break;
}
}
if (! $paymentMethodPossible) {
return false;
}
} catch (Exception $e) {
Mage::log(
(!empty($quote->getPostfinancecheckoutSpaceId()) ? '[Space ' . $quote->getPostfinancecheckoutSpaceId() . '] ' : '' ) .
(!empty($quote->getPostfinancecheckoutTransactionId()) ? '[Transaction ' . $quote->getPostfinancecheckoutTransactionId() . '] ' : '' ) .
'The payment method ' . $this->getTitle() . ' is not available because of an exception: ' .
$e->getMessage(), null, 'postfinancecheckout.log');
return false;
}
} else {
return false;
}
} else {
return false;
}
return true;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function isAvailable($quote = null)\n {\n // Check Magento's internal methods allow us to run\n if (parent::isAvailable($quote)) {\n // Should the method be hidden from the checkout?\n if (!$this->getIsSetupRequiredCall() && $this->_getConfig('disable_checkout') === 1) {\n return false;\n }\n\n // Validate the configuration is okay\n if ($this->_getWrapper()->validateCredentialsOnce()) {\n return true;\n }\n }\n\n // Otherwise it's a no\n return false;\n }",
"public function isAvailable($quote = null)\n {\n return parent::isAvailable($quote) &&\n $this->getConfigHelper()->isMethodActive() &&\n $this->getConfigHelper()->isMethodConfigured() &&\n Mage::app()->getStore()->isCurrentlySecure();\n }",
"public function isAvailable($quote = null)\n {\n return Mage::getStoreConfig('payment/vindi_creditcard/active')\n && Mage::helper('vindi_subscription')->getKey();\n }",
"public function isAvailable($quote = null) {\n $checkResult = new StdClass;\n\n //Custom\n $flubitorder = Mage::helper('flubit')->isFlubitOrder();\n $validation = false;\n if ($flubitorder && $this->_code == 'flubitterms') {\n $validation = true;\n }\n\n $isActive = (bool) (int) $this->getConfigData('active', $quote ? $quote->getStoreId() : null);\n\n //Custom\n if ($validation) {\n $isActive = true;\n } else {\n $isActive = false;\n }\n\n $checkResult->isAvailable = $isActive;\n $checkResult->isDeniedInConfig = !$isActive; // for future use in observers\n Mage::dispatchEvent('payment_method_is_active', array(\n 'result' => $checkResult,\n 'method_instance' => $this,\n 'quote' => $quote,\n ));\n $magentoVersion = Mage::getVersion();\n if (version_compare($magentoVersion, '1.8', '>=')) {\n if ($checkResult->isAvailable && $quote) {\n $checkResult->isAvailable = $this->isApplicableToQuote($quote, self::CHECK_RECURRING_PROFILES);\n }\n } else if (version_compare($magentoVersion, '1.7', '>=')) {\n if ($checkResult->isAvailable) {\n $implementsRecurring = $this->canManageRecurringProfiles();\n // the $quote->hasRecurringItems() causes big performance impact, thus it has to be called last\n if ($quote && !$implementsRecurring && $quote->hasRecurringItems()) {\n $checkResult->isAvailable = false;\n }\n }\n } else {\n \n }\n\n return $checkResult->isAvailable;\n }",
"public function isAvailable($quote = null) {\n $checkResult = new StdClass;\n $checkResult->isAvailable = (bool)Mage::helper('checkoutbyamazon')->getConfigData('active');\n Mage::dispatchEvent('payment_method_is_active', array(\n 'result' => $checkResult,\n 'method_instance' => $this,\n 'quote' => $quote,\n ));\n return $checkResult->isAvailable;\n }",
"public function isAvailable($quote = null)\n {\n return parent::isAvailable($quote) && !empty($quote) && Mage::helper('ls_cashpresso')->isModuleEnabled();\n }",
"public function canAccept($quote)\n {\n return $quote->canAccept();\n }",
"public function isAvailable($quote = null)\n {\n $parent = parent::isAvailable($quote);\n $clientId = Mage::getStoreConfig(MercadoPago_Core_Helper_Data::XML_PATH_CLIENT_ID);\n $clientSecret = Mage::getStoreConfig(MercadoPago_Core_Helper_Data::XML_PATH_CLIENT_SECRET);\n $standard = (!empty($clientId) && !empty($clientSecret));\n\n if (!$parent || !$standard) {\n return false;\n }\n\n return Mage::helper('mercadopago')->isValidClientCredentials($clientId, $clientSecret);\n\n }",
"public function isAvailable($quote = null)\n {\n $isAvailable = parent::isAvailable($quote);\n $quoteCurrency = $quote->getData(\"quote_currency_code\");\n $currencies = array_map('trim', explode(',', Mage::getStoreConfig('payment/bitcoin/currencies')));\n $is_allowed_to_use_currency = array_search($quoteCurrency, $currencies) !== false;\n return ($isAvailable && $is_allowed_to_use_currency);\n }",
"public function isAvailable($quote = null) {\n\t\treturn true;\n\t}",
"public function isAvailable($quote = null) {\n if(Mage::getSingleton('checkout/session')->getIsFromlengow())\n \treturn true;\n return false;\n }",
"public function isAllowed()\n {\n return in_array(\n $this->vippsQuote->getStatus(),\n [\n QuoteStatusInterface::STATUS_NEW,\n QuoteStatusInterface::STATUS_PENDING,\n QuoteStatusInterface::STATUS_RESERVE_FAILED,\n QuoteStatusInterface::STATUS_REVERT_FAILED\n ],\n true\n );\n }",
"public function isAvailable($quote=null) {\r\n\t\treturn (bool)($this->getConfigData('active'));\r\n\t}",
"public function isAvailable($quote = null)\n {\n\n $storeId = 0;\n // allow multi store/site for backend orders with disabled backend payment methods in default store\n if (!is_null($quote) && !is_null($quote->getId())) {\n $storeId = $quote->getStoreId();\n }\n if (Mage_Core_Model_App::ADMIN_STORE_ID == Mage::app()->getStore()->getId()\n && false == $this->isEnabledForBackend($storeId)\n ) {\n return false;\n }\n\n return parent::isAvailable($quote);\n }",
"protected function _shouldRenderQuote()\n {\n $quote = $this->_getQuote();\n\n // validate minimum quote amount and validate quote for zero grandtotal\n if (null !== $quote && $this->_hasZeroGrandTotal($quote)) {\n return false;\n }\n // check payment method availability\n $methodInstance = $this->_paymentHelper->getMethodInstance(\n $this->_paymentMethodCode\n );\n if (!$methodInstance || !$methodInstance->isAvailable($quote)) {\n return false;\n }\n return true;\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('MageWorx_ShippingRules::quote');\n }",
"public function isToQuoteAllowed($quote)\n {\n $showMessageNotLoggedIn = $this->showMessageNotLoggedIn();\n if ($showMessageNotLoggedIn && ($quote->getCustomerGroupId() == GroupInterface::NOT_LOGGED_IN_ID)) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __('Login to request a Quote')\n );\n }\n\n foreach ($quote->getAllVisibleItems() as $item) {\n //if dynamic add buttons enabled and product type is configurable, check the child item\n if ($this->isDynamicAddButtonsEnabled()\n && $item->getProductType() == \\Magento\\ConfigurableProduct\\Model\\Product\\Type\\Configurable::TYPE_CODE) {\n $children = $item->getChildren();\n if (!empty($children) && is_array($children) && isset($children[0])) {\n $childItem = $children[0];\n if ($childItem instanceof \\Magento\\Quote\\Model\\Quote\\Item) {\n //overwrite the configurable item with the child item\n $item = $childItem;\n }\n }\n }\n\n if (!$this->isQuotable($item->getProduct(), $quote->getCustomerGroupId())) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __(\n 'Quotes are not available for %1. Please remove item from your cart and try again.',\n $item->getName()\n )\n );\n }\n }\n\n return true;\n }",
"public function isAvailable($quote = null) {\n $available = parent::isAvailable($quote);\n if(!$available) return false;\n\n //T: Email checking will now be done before LIST request.\n return true;\n\n\n $email = $quote->getBillingAddress()->getEmail();\n\n if (strlen($email) == 0) {\n $email = $quote->getCustomerEmail();\n }\n\n if(strlen($email) == 0) return false;\n\n return true;\n }",
"public function isAvailable($quote = null)\n {\n return parent::isAvailable($quote) && !empty($quote)\n && Mage::app()->getStore()->roundPrice($quote->getGrandTotal()) > 0;\n }",
"public function canChangeRequestQuote($quote)\n {\n if (!$this->isAllowed($quote->getStore())) {\n return false;\n }\n if ($this->customerSession->isLoggedIn()) {\n return $quote->canChangeRequest();\n } else {\n return true;\n }\n }",
"private function checkMethodAvailable(CartInterface $quote, $code)\n {\n $kQuote = $this->quoteRepository->getActiveByQuote($quote);\n return (in_array($code, $kQuote->getPaymentMethods()));\n }",
"public function canPayment()\n {\n return true;\n }",
"public function isBillsafeOnsiteCheckout(Mage_Sales_Model_Quote $quote = null)\n {\n if (!$quote) {\n $quote = $this->getHelper()->getQuotefromSession();\n }\n\n // onsite checkout must be enabled via config\n $onsiteConfig = Mage::getModel('billsafe/config')\n ->isBillSafeDirectEnabled($quote->getStoreId());\n // b2b orders (company is set in quote) must use redirect gateway\n $onsiteCompany = !Mage::helper('billsafe/customer')\n ->getCustomerCompany($quote);\n return ($onsiteConfig && $onsiteCompany);\n }",
"public function isDirectQuoteAllowed($quote) {\n return $this->isToQuoteAllowed($quote);\n }",
"public function isAvailable(\\Magento\\Quote\\Api\\Data\\CartInterface $quote = null)\n {\n if ($this->worlpayhelper->isWorldPayEnable() && $this->worlpayhelper->isApmEnabled()) {\n return true;\n }\n return false;\n }",
"public function isAvailable($quote = null)\n\t{\n\t\tif($quote == null)\n\t\t\t$quote = Mage::getSingleton('checkout/session')->getQuote();\n\n\t\t$result = (parent::isAvailable($quote) && $this->getConfig()->getLicenseAgreement() && count($quote->getAllVisibleItems()) >= 1);\n\t\tif(!$result){\n\t\t\tMage::getSingleton('core/session')->setKCOMessage(\"Klarna Checkout is not available\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif(in_array($quote->getShippingAddress()->getShippingMethod(), $this->getConfig()->getDisallowedShippingMethods())){\n\t\t\tMage::getSingleton('core/session')->setKCOMessage(\"Klarna Checkout is not available with selected shipping method\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif(!Mage::getSingleton('customer/session')->isLoggedIn() && !Mage::helper('checkout')->isAllowedGuestCheckout($quote)){\n\t\t\tMage::getSingleton('core/session')->setKCOMessage(\"Please login to use Klarna Checkout\");\n\t\t\tMage::getSingleton('core/session')->setKCORequireLogin(true);\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$quote->validateMinimumAmount()){\n\t\t\t$minimumAmount = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())\n\t\t\t->toCurrency(Mage::getStoreConfig('sales/minimum_order/amount'));\n\n\t\t\t$msg = Mage::getStoreConfig('sales/minimum_order/description')\n\t\t\t\t? Mage::getStoreConfig('sales/minimum_order/description')\n\t\t\t\t: Mage::helper('checkout')->__('Minimum order amount is %s', $minimumAmount);\n\n\t\t\tMage::getSingleton('core/session')->setKCOMessage($msg);\n\t\t\treturn false;\n\t\t}\n\n\t\tif(!$this->helper->getConnectionStatus($this, $quote)){\n\t\t\tMage::getSingleton('core/session')->setKCOMessage(\"Klarna Checkout is not available\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function canUseCheckout()\n {\n if (!$this->isApiKeyConfigured()) {\n return false;\n }\n return $this->_canUseCheckout;\n }",
"public function isAvailable($quote = null)\n {\n $result = parent::isAvailable($quote);\n if ($result && $quote->getCustomerId()) {\n /** @var Netresearch_OPS_Model_Mysql4_Alias_Collection $aliasCollection */\n $aliasCollection = Mage::helper('ops/alias')->getAliasesForCustomer(\n $quote->getCustomer()->getId(),\n $quote\n );\n $aliasCount = $aliasCollection\n ->addFieldToFilter('state', Netresearch_OPS_Model_Alias_State::ACTIVE)\n ->setOrder('created_at', Varien_Data_Collection::SORT_ORDER_DESC)\n ->count();\n\n $result = $aliasCount > 0;\n } else {\n $result = false;\n }\n\n return $result;\n }",
"protected function _isFreeQuote()\n {\n /**\n *\n * @note Get free payment method\n *\n */\n $method = $this->_paymentHelper->getMethodInstance(Free::PAYMENT_METHOD_FREE_CODE);\n\n /**\n *\n * @note Check if free method is available\n * @note If it is available then it is a free quote\n *\n */\n return $method->isAvailable($this->getQuote());\n }",
"public function isAllowedToProcess($quoteId)\n {\n if ($this->giftCardQuote->getGiftCardCollection($quoteId)->getSize() == 0) {\n return false;\n }\n return true;\n }"
] |
[
"0.77292526",
"0.7617641",
"0.75822717",
"0.7568712",
"0.7523579",
"0.7437796",
"0.7412199",
"0.7354921",
"0.72583663",
"0.7186141",
"0.7125511",
"0.7089598",
"0.7085736",
"0.7066469",
"0.68535835",
"0.68254435",
"0.68039584",
"0.6791791",
"0.67739356",
"0.67293245",
"0.6672796",
"0.66641724",
"0.66225016",
"0.66197735",
"0.660921",
"0.6602677",
"0.65589213",
"0.655463",
"0.64437515",
"0.6433249"
] |
0.77729344
|
0
|
Checks whether the transaction info for the transaction linked to the order is already linked to another order.
|
protected function checkTransactionInfo(Mage_Sales_Model_Order $order)
{
/* @var PostFinanceCheckout_Payment_Model_Entity_TransactionInfo $info */
$info = Mage::getModel('postfinancecheckout_payment/entity_transactionInfo')->loadByTransaction(
$order->getPostfinancecheckoutSpaceId(), $order->getPostfinancecheckoutTransactionId());
if ($info->getId() && $info->getOrderId() != $order->getId()) {
return false;
} else {
return true;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function checkIfOrderExist($orderId);",
"private function checkIsYourOrder($order)\n {\n $customerData = $this->sessionCustomer->getCustomer();\n $nameCustomerOrder = $order->getCustomerName();\n $nameCustomerSesstion = $customerData->getName();\n if ($nameCustomerOrder !== $nameCustomerSesstion) {\n return false;\n }\n return true;\n }",
"protected function _canViewOrder($order)\r\n {\r\n $currentOrder = Mage::registry('current_order');\r\n if ($order->getId() && ($order->getId() === $currentOrder->getId())) {\r\n return true;\r\n }\r\n return false;\r\n }",
"public function isAddToRelationship();",
"public function hasOrder()\n {\n return $this->_has('_order');\n }",
"public function unique_order(){\n\t\t\t\n\t\t\t$where = array(\n\t\t\t\t'reference' => $this->input->post('reference'),\n\t\t\t\t'order_description' => $this->input->post('order_description'),\n\t\t\t\t'total_price' => $this->input->post('total_price'),\n\t\t\t\t'num_of_items' => $this->input->post('num_of_items'),\n\t\t\t\t'customer_email' => $this->input->post('customer_email'),\n\t\t\t);\n\t\t\t\n\t\t\tif (!$this->Orders->is_unique($where))\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('unique_order', 'You already have this order on record!');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}",
"public function isOrderNumberNotAlreadyExisting($order_number){\n \n $cmd =Yii::app()->db->createCommand();\n $cmd->select('COUNT(*)')\n ->from('order')\n ->where(\"order_number = '$order_number'\");\n $result = $cmd->queryScalar();\n \n if($result == 0){\n return true;\n }else{\n return false;\n }\n \n \n }",
"public function checkTransactionAlreadyExists($data) { \n\t\t$transaction1=new Transaction(); \n $transaction=$transaction1->hasAny(array('trans_date'=>$this->data['Transaction']['trans_date'], 'trans_desc'=>$this->data['Transaction']['trans_desc']));\n\t\tif($transaction == \"1\"){\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\t\t\n }",
"public function canStoreOrder();",
"public function isLinked() {\n if ($this->credential->getAccessToken() == null)\n return false;\n else\n return true;\n }",
"public function hasChain(/* ... */)\n {\n return (null !== $this->_parent);\n }",
"function is_upsell_exists( $order ) {\n\n\t\t$flow_id = wcf()->utils->get_flow_id_from_order( $order->get_id() );\n\n\t\tif ( $flow_id ) {\n\n\t\t\t$navigation = false;\n\n\t\t\t$step_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );\n\n\t\t\t$next_step_id = wcf()->utils->get_next_step_id( $flow_id, $step_id );\n\n\t\t\tif ( $next_step_id && wcf()->utils->check_is_offer_page( $next_step_id ) ) {\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isInTransaction();",
"public function has_changes() {\n\t\t\t$properties = array_keys(get_object_vars($this));\n\t\t\t$order = SalesOrderEdit::load($this->sessionid, $this->orderno);\n\n\t\t\tforeach ($properties as $property) {\n\t\t\t\tif ($this->$property != $order->$property) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"public function isOrder();",
"public function process(Order $order)\n {\n /** @var Payment $payment */\n $payment = $order->getPayment();\n\n $orderWasUpdated = false;\n\n if (ConfigProvider::CODE !== $payment->getMethod()) {\n throw new LocalizedException(__('This order was not placed via Ingenico ePayments'));\n }\n $orderTransactions = $this->transactionManager->retrieveTransactions($payment);\n\n $ingenicoPaymentId = $payment->getAdditionalInformation(Config::PAYMENT_ID_KEY);\n if (!$ingenicoPaymentId && empty($orderTransactions)) {\n try {\n $orderWasUpdated = $this->updateHostedCheckoutStatus($order);\n } catch (\\Exception $e) {\n throw new LocalizedException(__('Order is not linked with Ingenico ePayments orders.'));\n }\n }\n\n foreach ($orderTransactions as $transaction) {\n $currentStatus = $this->getCurrentStatus($payment, $transaction);\n $updateStatus = $this->getUpdateStatus($order, $currentStatus);\n if ($updateStatus->status !== $currentStatus->status) {\n $this->statusResolver->resolve($order, $updateStatus);\n\n /** @var Payment\\Transaction $transaction */\n $transaction = $this->transactionManager->retrieveTransaction($transaction->getTxnId());\n if ($transaction !== null) {\n $order->addRelatedObject($transaction);\n }\n $order->addRelatedObject($payment);\n $orderWasUpdated = true;\n } else {\n $this->statusResponseManager->set($payment, $updateStatus->id, $updateStatus);\n }\n }\n\n if ($orderWasUpdated) {\n $this->orderRepository->save($order);\n }\n\n return $orderWasUpdated;\n }",
"public function isTransactionPart()\n {\n return $this->_transaction != null;\n }",
"public function transaction(): bool\r\n {\r\n return $this->instance->inTransaction() === true;\r\n }",
"protected function isValidOrder()\n {\n return true;\n }",
"protected function isOrderLocked(OrderEvent $event)\n {\n if (!$event->getForce() && $event->getOrder()->getLocked()) {\n $event->addMessage(new ResourceMessage('ekyna_order.event.locked', ResourceMessage::TYPE_ERROR));\n return true;\n }\n return false;\n }",
"public function isUnderTransaction();",
"function checkOut($order, $cart)\n {\n $db = new Database();\n $conn = $db->getConnection();\n\n $success = false;\n\n $conn->autocommit(FALSE);\n $conn->begin_transaction();\n\n $ordersDataService = new OrderDataService();\n $productBusinessService = new ProductBusinessService();\n\n $orderID = $this->addOrdersLine($order, $conn);\n\n foreach ($cart->getItems() as $product_id => $qty) {\n\n $product = $productBusinessService->getProductByID($product_id);\n\n $orderDetails = new OrderDetails($orderID, $product_id, $qty, ($qty * $product->getPrice()), \"here is some description\");\n $okdetails = $this->addDetailsLine($orderID, $orderDetails, $conn);\n }\n\n if ($orderID && $okdetails) {\n $conn->commit();\n $success = true;\n } else {\n $conn->rollback();\n }\n\n $conn->close();\n\n return $success;\n }",
"function is_equal(state $other): bool {\n return $this->log_op_list == $other->log_op_list &&\n $this->tree->is_equal($other->tree);\n }",
"public function isRelated();",
"public function enterOrder() {\n\t\t\tif ($this->order->enterOrder()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function hasDestinationLicenceId(): bool\n {\n return $this->offsetExists(static::TRANSFER_TO_LICENSE_ID);\n }",
"protected function _isTigoMoneyOrder()\n {\n $lastOrder = $this->_getLastOrder();\n return ($lastOrder->getPayment()->getMethod() == Tigo_TigoMoney_Model_Payment_Redirect::METHOD_CODE);\n }",
"public function is_transaction_exist() {\n\n $transaction = $this->ci->generic_model->retrieve_one(\n \"transaction_general\",\n array(\n \"package_id\" => $this->ci->input->post(\"package_id\"),\n \"package_type\" => $this->ci->input->post(\"package_type\")\n )\n );\n\n if ($transaction) { // there exists an object.\n return TRUE;\n } else { // object is not found.\n $this->ci->form_validation->set_message(\"is_transaction_exist\", \"Paket belum dibeli.\");\n return FALSE;\n }\n }",
"public function orderExists ( $orderId ) {\n\t\treturn $this->mapper->orderExist( $orderId );\n\t}",
"public function testAddSibling_Duplicate()\n\t{\n\t\t$this->sibling->Save();\n\t\t$this->object->AddSibling($this->sibling);\n\t\t$this->object->AddSibling($this->sibling);\n\t\t$this->assertEquals(1, sizeof($this->object->siblingList));\n\t}"
] |
[
"0.5633532",
"0.5415818",
"0.54020905",
"0.5341953",
"0.52621233",
"0.524369",
"0.5218528",
"0.5179651",
"0.51787996",
"0.51778346",
"0.5161936",
"0.51549417",
"0.51449674",
"0.51406443",
"0.5128062",
"0.5116319",
"0.5092508",
"0.509182",
"0.5075954",
"0.5052846",
"0.50202",
"0.5000583",
"0.49974912",
"0.49971974",
"0.4992809",
"0.49812114",
"0.4980352",
"0.49721122",
"0.49610105",
"0.49499387"
] |
0.6452272
|
0
|
Accepts the payment by marking the delivery indication as suitable.
|
public function acceptPayment(Mage_Payment_Model_Info $payment)
{
parent::acceptPayment($payment);
Mage::getSingleton('postfinancecheckout_payment/service_deliveryIndication')->markAsSuitable($payment);
return true;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function acceptPayment($receipt)\n\t{\n\t}",
"public function acceptPayment() {\n $paymentResponse = new PayWayMessage(\\Drupal::request()->query->all());\n\n // 'POST' indicates that it is a one time response after the payment has been made, in our case, to send an email\n if ($paymentResponse->isSignValid() && $paymentResponse->get('POST')) {\n $userId = $paymentResponse->get('userid');\n $orderId = $paymentResponse->get('orderid');\n\n // TODO: Deprecated\n if ($userId !== NULL) {\n $participant = $this->getParticipant($userId);\n $participant->setPaymentId($orderId);\n $participant->save();\n }\n\n // Also make sure the CMS side is aware of the update of this order\n $refreshOrderApi = new RefreshOrderApi();\n $refreshOrderApi->refreshOrder($orderId);\n\n // Send an email to inform the user his payment has been accepted\n $sendEmailApi = new SendEmailApi();\n $sendEmailApi->sendPaymentAcceptedEmail($userId, $orderId);\n }\n\n return array('#markup' => iish_t('Thank you. The procedure has been completed successfully! ' .\n 'Within a few minutes you will receive an email from us confirming your \\'final registration and payment\\' ' .\n 'and you will receive a second email from the payment provider confirming your payment.'));\n }",
"public function acceptPayment(Mage_Payment_Model_Info $payment)\n {\n// parent::acceptPayment($payment);\n //Note: $_canReviewPayment is set to false, but we are overriding\n // the parent method that checks for this property.\n // This is because we do not want to give a Merchant possibility\n // to manually accept or deny payment in Magento admin - order page.\n return true; // Will make the payment model approve the payment.\n }",
"public function test_manual_deliverOrder_deliverCardOrder_use_ConfirmTransaction_and_is_accepted() {\n $this->markTestIncomplete(\n 'skeleton for manual test, needs a pre-existing card transactionId with status AUTHORIZED'\n );\n \n // 1. remove (put in a comment) the above code to enable the test\n // 2. run the test, and check status of transaction in backoffice logs\n \n $orderId = 585714; // pre-existing card transactionId with status AUTHORIZED \n \n $DeliverOrderBuilder = WebPay::deliverOrder( Svea\\SveaConfig::getDefaultConfig() )\n ->setCountryCode(\"SE\")\n ->setOrderId( $orderId )\n ;\n \n $response = $DeliverOrderBuilder->deliverCardOrder()->doRequest();\n\n ////print_r( $response );\n $this->assertEquals(1, $response->accepted);\n $this->assertInstanceOf( \"Svea\\HostedService\\ConfirmTransactionResponse\", $response ); \n }",
"public function processPayment(){\r\n return true;\r\n }",
"public function approve()\n {\n // Make sure that all necessary payment plugins are loaded at this point.\n $this->getDi()->plugins_payment->loadEnabled();\n if ($this->isConfirmed())\n return true;\n $old_status = $this->is_confirmed;\n $this->is_confirmed = self::IS_CONFIRMED_CONFIRMED;\n\n $this->updateSelectedFields('is_confirmed');\n $saved = array();\n foreach ($this->data()->getAll() as $k => $v) {\n if (strpos($k, self::SAVED_TRANSACTION_KEY) !== false) {\n list(, $time, $payment_id) = explode('-', $k);\n $saved[$time] = array($payment_id, $v);\n }\n }\n ksort($saved);\n foreach ($saved as $time => $v) {\n $this->addAccessPeriod($v[1], $v[0] ? $v[0] : null);\n $this->data()->set(self::SAVED_TRANSACTION_KEY . '-' . $time . '-' . $v[0], null)->update();\n }\n if ($old_status == self::IS_CONFIRMED_NOT_CONFIRMED)\n {\n $this->sendApprovedEmail();\n $this->getDi()->hook->call(Am_Event::INVOICE_AFTER_APPROVE, array('invoice' => $this));\n }\n return true;\n }",
"public function setPaymentAccepted($value)\n {\n $this->paymentAccepted = $value;\n }",
"public function acceptPayment(Order $order)\n {\n $order->payment->update(['status' => 1]);\n $order->update(['status' => '2']);\n\n return back()->withToastSuccess('Payment Accepted');\n }",
"public function isValidForDelivery();",
"public function notifyPayment()\n {\n }",
"function mark_as_paid() {\n if (!$this->active_invoice->isLoaded()) {\n $this->response->notFound();\n } // if\n\n if($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n if(!$this->active_invoice->canEdit($this->logged_user)) {\n $this->response->forbidden();\n } // if\n\n try{\n if($this->request->isAsyncCall()) {\n $this->active_invoice->setStatus(INVOICE_STATUS_PAID);\n $this->active_invoice->save();\n $this->response->respondWithData($this->active_invoice, array(\n 'as' => 'invoice',\n 'detailed' => true,\n ));\n } else {\n $this->response->badRequest();\n } //if\n } catch (Exception $e) {\n $this->response->exception($e);\n } //try\n }",
"public function fulfill()\n {\n $this->status = true;\n\n $this->save();\n\n $this->user->notify(new OrderFulfilled($this));\n }",
"public function processPayment() {\n\t\t\tif ($this->order->authorizeTransaction()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"abstract protected function handlePayment();",
"public function markPaid()\n {\n $this->order->update(['status' => OrderStatus::PAID]);\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order is marked as paid.'),\n ]);\n }",
"public function approveAndEarmark() {\n // Check if user has enough money available on card to pay for amount on authorization request.\n // Assumption: it's enough to check if the available balance is no greater than the amount that has been authorized.\n if ($this->card->availableBalance() > $this->authorizationRequest->getAuthorizedAmount()) {\n // Approve request.\n $this->authorizationRequest->approve();\n // Earmark the amount in the authorization request on the card.\n $this->card->earmark($this->authorizationRequest);\n } else {\n throw new Exception(\"User does not have enough money available on their card.\");\n }\n }",
"public function canBeAccepted()\n {\n return $this->isReadyForIssuing();\n }",
"public function sellerConfirm() {\n\t\tLog::info ( 'Seller has confirmed the payment:' . $this->user_pk, array (\n\t\t\t\t'c' => '1' \n\t\t) );\n\t\tif (isset ( $_POST ['time'] ) && $_POST ['time'] != '') {\n\t\t\t$timePeriod = $_POST ['time'];\n\t\t\t$subscriptionStartsAt = date ( 'Y-m-d H:i:s' );\n\t\t\t$subscriptionEndsAt = '';\n\t\t\t\n\t\t\tif ($timePeriod == 'quarterPeriod') {\n\t\t\t\t$subscriptionEndsAt = date ( 'Y-m-d H:i:s', strtotime ( '+3 months' ) );\n\t\t\t} else if ($timePeriod == 'halfannualPeriod') {\n\t\t\t\t$subscriptionEndsAt = date ( 'Y-m-d H:i:s', strtotime ( '+6 months' ) );\n\t\t\t} else if ($timePeriod == 'annualPeriod') {\n\t\t\t\t$subscriptionEndsAt = date ( 'Y-m-d H:i:s', strtotime ( '+1 years' ) );\n\t\t\t} else if ($timePeriod == 'phantomPeriod') {\n\t\t\t\t$subscriptionEndsAt = date ( 'Y-m-d H:i:s', strtotime ( '+5 years' ) );\n\t\t\t} else if ($timePeriod == 'freeTrail') {\n\t\t\t\t$subscriptionEndsAt = date(\"2016-12-31 00:00:00\");\n\t\t\t}\n\t\t\t\n\t\t\t$userRecord = \\DB::table ( 'users' )->where ( 'id', '=', $this->user_pk )->first ();\n\t\t\t$is_business = $userRecord->is_business;\n\t\t\t\n\t\t\t// add subscription start and end date to seller\n\t\t\t$subscription = ThankyouController::addSubscription ( $subscriptionStartsAt, $subscriptionEndsAt, $is_business );\n\t\tif($subscription==1){\n\t\t\tCommonComponent::activityLog ( \"SELLER_CONFIRM_PAYMENT\", SELLER_CONFIRM_PAYMENT, 0, HTTP_REFERRER, CURRENT_URL );\n\t\t\t$stored_uid = $this->user_pk;\n\t\t\t\t\n\t\t\ttry{\n\t\t\t\tif(isset(Auth::User()->lkp_role_id) && (Auth::User()->lkp_role_id == '1')){\n\t\t\t\t\t\n\t\t\t\t\tDB::table ( 'users' )->where ( 'id', $this->user_pk )->update ( array (\n\t\t\t\t\t'is_active' => 1,\n\t\t\t\t\t'is_confirmed' => 1,\n\t\t\t\t\t'is_approved' => 1,\n\t\t\t\t\t'secondary_role_id'=>'2',\n\t\t\t\t\t'is_buyer_paid'=>1,\n\t\t\t\t\t'mail_sent' => 1\n\t\t\t\t\t) );\n\t\t\t\t\tSession::put('last_login_role_id','2');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\tDB::table ( 'users' )->where ( 'id', $this->user_pk )->update ( array (\n\t\t\t'lkp_role_id' => 2,\n\t\t\t'is_active' => 1,\n\t\t\t'is_confirmed' => 1,\n\t\t\t'is_approved' => 1,\n\t\t\t'is_buyer_paid'=>1,\n\t\t\t'mail_sent' => 1\n\t\t\t) );\n\t\t\t\t}\n\t\t\t}catch(Exception $ex){\n\t\t\t}\n\t\t\t// Information email to seller after payment\n\t\t\t\t\n\t\t\t$userData = DB::table ( 'users' )->where ( 'id', $this->user_pk )->select ( 'users.*' )->get ();\n\t\t\t\t\n\t\t\tCommonComponent::send_email ( SELLER_PAYMENT_INFO_MAIL, $userData );\n\t\t\t\n\t\t}\n\t\t\t\n\t\t}\n\t}",
"public function isReadyForIssuing()\n {\n return $this->isFeePaid();\n }",
"protected function _registerPaymentSuccess()\n {\n $payment = $this->_order->getPayment();\n $payment->setTransactionId($this->getRequestData('transaction_id'))\n ->setPreparedMessage($this->_createNotifyComment(''))\n ->registerCaptureNotification($this->getRequestData('paid'));\n $this->_order->save();\n\n // notify customer\n $invoice = $payment->getCreatedInvoice();\n if ($invoice && !$this->_order->getEmailSent()) {\n $this->_order->sendNewOrderEmail()->addStatusHistoryComment(\n Mage::helper('payssion')->__('Notified customer about invoice #%s.', $invoice->getIncrementId())\n )\n ->setIsCustomerNotified(true)\n ->save();\n }\n }",
"public function markAsPaid() {\n $this->status = parent::STATUS_PAID;\n $this->admin_id = Yii::app()->user->getId();\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }",
"public function acceptPayment($invoice)\n {\n $order = Order::with(['payment'])->where('invoice', $invoice)->first();\n //UBAH STATUS DI TABLE PAYMENTS MELALUI ORDER YANG TERKAIT\n $order->payment()->update(['status' => 1]);\n //UBAH STATUS ORDER MENJADI PROSES\n $order->update(['status' => 2]);\n //REDIRECT KE HALAMAN YANG SAMA.\n return redirect(route('orders.view', $order->invoice));\n }",
"abstract function is_paying();",
"public function processPayment();",
"public function canPayment()\n {\n return true;\n }",
"public function test_deliverOrder_deliverInvoiceOrder_with_orderrows_use_DeliverOrderEU_and_is_accepted() {\n $createOrderBuilder = TestUtil::createOrder();\n $response = $createOrderBuilder->useInvoicePayment()->doRequest();\n $this->assertEquals(1, $response->accepted);\n \n $orderId = $response->sveaOrderId;\n \n $DeliverOrderBuilder = WebPay::deliverOrder( Svea\\SveaConfig::getDefaultConfig() )\n ->addOrderRow( TestUtil::createOrderRow() )\n ->setCountryCode(\"SE\")\n ->setOrderId( $orderId )\n ->setInvoiceDistributionType(\\DistributionType::POST)\n ;\n \n $response = $DeliverOrderBuilder->deliverInvoiceOrder()->doRequest();\n\n ////print_r( $response );\n $this->assertEquals(1, $response->accepted); \n $this->assertInstanceOf( \"Svea\\WebService\\DeliverOrderResult\", $response ); // deliverOrderResult => deliverOrderEU \n }",
"function wcfm_wcpvendors_order_mark_fulfilled() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( $order_item_id ) {\r\n\t\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t\t$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );\r\n\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::clear_reports_transients();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';\r\n\t\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Update Shipping Tracking Info\r\n\t\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\t\r\n\t\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"complete\";\r\n\t\tdie;\r\n\t}",
"public function returnAction() \n\t\t{\n\t\t\t$oIdealcheckoutdirectebankingModel = Mage::getSingleton('idealcheckoutdirectebanking/idealcheckoutdirectebanking');\n\n\t\t\t$sOrderId = $this->getRequest()->get('order_id');\n\t\t\t$sOrderCode = $this->getRequest()->get('order_code');\n\n\t\t\tif($oIdealcheckoutdirectebankingModel->validatePayment($sOrderId, $sOrderCode))\n\t\t\t{ \n\t\t\t\t$this->_redirect('checkout/onepage/success', array('_secure' => true));\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$this->_redirect('checkout/cart');\n\t\t\t} \n\t\t}",
"function coordinator_mark_as_paid() {\n $this->SearchPagination->setup();\n $this->layout = \"coordinator/index\";\n $deliveryDates = $this->Delivery->getDeliveryDatesList(true); \n $nextDelivery = $this->Delivery->findByNextDelivery(true); \n $this->set('nextDelivery', $nextDelivery);\n $condition = array();\n $condition += array('User.organization_id' => $this->currentUser['User']['organization_id']);\n if (!empty($this->params['url']['id'])) {\n $condition += array('Order.id' => $this->params['url']['id']);\n }\n if (!empty($this->params['url']['user_name'])) {\n $condition += $this->User->findByNameCondition($this->params['url']['user_name']);\n \n }\n if (!empty($this->params['url']['delivery_date'])) {\n if ($this->params['url']['delivery_date'] > 0) {\n $condition += array('Order.delivery_id' => $this->params['url']['delivery_date']);\n } \n } else {\n $condition += array('Order.delivery_id' => $nextDelivery['Delivery']['id']);\n }\n $this->paginate = array(\n 'conditions' => $condition, 'limit' => $this->Order->find('count', array('conditions' => $condition))\n );\n $this->set('delivery_dates', $deliveryDates);\n $this->set('orders', $this->paginate());\t \n }",
"public function authorize(Varien_Object $payment, $amount)\n {\n $requestData = Mage::app()->getRequest()->getParam('payment');\n $session = Mage::getSingleton('ckopayment/session_quote');\n\n // Order information\n $order = $payment->getOrder();\n $quoteId = $order->getQuoteId();\n $orderId = $payment->getOrder()->getIncrementId();\n\n $currencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n // Format amount to cent\n $amountCent = Mage::getModel('ckopayment/checkoutcomUtils')->valueToDecimal($amount, $currencyCode);\n\n // Charge request params\n $requestParam = $this->_getRequestParam($requestData, $amountCent, $currencyCode, $quoteId, $orderId);\n\n $secretKey = Mage::getModel('ckopayment/checkoutcomConfig')->getSecretKey();\n\n $environment = Mage::getModel('ckopayment/checkoutcomConfig')->getEnvironment() == 'sandbox' ? true : false;\n // Initialize the Checkout Api\n $checkout = new CheckoutApi($secretKey, $environment);\n\n try {\n\n // Call to create charge\n $response = $checkout->payments()->request($requestParam);\n\n // Check if payment successful\n if ($response->isSuccessful()) {\n if ($response->isPending() || $response->status == 'Authorized') {\n if ($response->getRedirection()) {\n // Update order payment information with payment id from checkout.com\n $payment->setAdditionalInformation('isApm', true);\n $payment->setIsTransactionPending(true);\n\n $session\n ->setIsApm(true)\n ->setPaymentRedirectUrl($response->getRedirection());\n } else {\n\n // Verify payment id\n $verifyPayment = $checkout->payments()->details($response->id);\n $source = $verifyPayment->source;\n\n // Check if payment is successful\n if ($verifyPayment->isSuccessful()) {\n $metadata = $verifyPayment->metadata;\n\n // Check if payment source is sepa\n if ($source['type'] == 'sepa') {\n $payment->setTransactionId($response->id);\n $payment->setIsTransactionClosed(0);\n\n // Set message to order with mandate id\n $order->addStatusHistoryComment(\"Sepa payment completed. Mandate Id : \" .$metadata['mandate_id']);\n $order->save();\n\n return $this;\n }\n }\n\n // Check if payment source if Fawry\n if ($source['type'] == 'fawry'){\n $payment->setTransactionId($response->id);\n $payment->setIsTransactionClosed(0);\n\n // Set message to order with mandate id\n $order->addStatusHistoryComment(\"Fawry payment completed.\");\n $order->save();\n\n return $this;\n }\n\n $errorMessage = \"Redirection url not found.\";\n\n // Log error in var/log/checkoutcomapms.log\n Mage::log($errorMessage, null, $this->_code . '.log');\n Mage::log($response, Zend_Log::DEBUG, $this->_code . '.log', true);\n\n //Throw exception and stop order process\n Mage::throwException($errorMessage);\n }\n } else {\n $errorMessage = \"An error has occurred while processing your payment. Please check your payment details and try again.\";\n\n // Log error in var/log/checkoutcomapms.log\n Mage::log($errorMessage, null, $this->_code . '.log');\n Mage::log($response, Zend_Log::DEBUG, $this->_code . '.log', true);\n\n //Throw exception and stop order process\n Mage::throwException($errorMessage);\n }\n } else {\n $errorMessage = \"An error has occurred while processing your payment. Please check your payment details and try again.\";\n\n // Log error in var/log/checkoutcomapms.log\n Mage::log($errorMessage, null, $this->_code . '.log');\n Mage::log($response, Zend_Log::DEBUG, $this->_code . '.log', true);\n\n //Throw exception and stop order process\n Mage::throwException($errorMessage);\n }\n } catch (CheckoutModelException $ex) {\n Mage::log($ex->getBody(), Zend_Log::DEBUG, $this->_code . '.log', true);\n $errorMessage = \"An error has occurred while processing your payment. Please check your payment details and try again.\";\n Mage::throwException($errorMessage);\n } catch (CheckoutHttpException $ex) {\n Mage::log($ex->getBody(), Zend_Log::DEBUG, $this->_code . '.log', true);\n $errorMessage = \"An error has occurred . Please check your payment details and try again.\";\n Mage::throwException($errorMessage);\n }\n\n return $this;\n }"
] |
[
"0.7213732",
"0.71798277",
"0.6999568",
"0.67269933",
"0.6378734",
"0.63549733",
"0.6350468",
"0.63501394",
"0.61724764",
"0.61605763",
"0.6095004",
"0.608575",
"0.60521805",
"0.59910643",
"0.5909966",
"0.5889469",
"0.5883363",
"0.5853349",
"0.5847222",
"0.58224607",
"0.5804553",
"0.5783296",
"0.5763475",
"0.5756706",
"0.57492065",
"0.57488394",
"0.573795",
"0.57343006",
"0.5728631",
"0.5707992"
] |
0.77163404
|
0
|
Denies the payment by marking the delivery indication as not suitable.
|
public function denyPayment(Mage_Payment_Model_Info $payment)
{
parent::denyPayment($payment);
Mage::getSingleton('postfinancecheckout_payment/service_deliveryIndication')->markAsNotSuitable($payment);
$payment->getOrder()->setPostfinancecheckoutPaymentInvoiceAllowManipulation(true);
return true;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function declinePayment() {\n return array('#markup' => iish_t('Unfortunately, your payment has been declined. Please try to finish your final registration ' .\n 'at a later moment or try a different payment method.'));\n }",
"public function markAsUnpaid() {\n $this->status = parent::STATUS_APPROVED_BY_USER;\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }",
"private function rejectOrder($order){\r\n $this->log('Rejecting order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'La orden fue rechazada por Flow');\r\n $order->update_status('failed');\r\n }",
"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 }",
"public function deliveryPriceOutDhaka()\n {\n }",
"public function payment_status_denied()\n {\n return $this->payment_status_failed();\n }",
"public function testNotPaid()\n {\n $this->browse(function (Browser $browser) {\n $bill = Bill::factory()->create([\n 'contract_id' => $this->contract->id,\n 'requisite_id' => $this->requisite->id,\n 'tenant_id' => $this->tenant->id,\n ]);\n $service = $bill->services()->save(Service::factory()->make([\n 'name' => 'Rent',\n 'quantity' => '2',\n 'measure' => 'pc',\n 'price' => '1234'\n ]));\n\n $browser->loginAs($this->user)\n ->visit('/tenants/'.$this->tenant->id.'?tab=bills#tab')\n ->press('Оплатить')\n ->assertSee('Недостаточно средств');\n });\n }",
"public function declined()\n\t{\n\t\treturn !$this->approved();\n\t}",
"function is_not_paying() {\n\t\t\treturn ( $this->is_trial() || $this->is_free_plan() );\n\t\t}",
"public function unpaid(): bool\n {\n return in_array($this->status, [self::PENDING]);\n }",
"public function rejected()\n {\n $this->setStatus(self::STATUS_REJECTED);\n }",
"function hook_commerce_adyen_capture_rejected(\\Commerce\\Adyen\\Payment\\Transaction\\Payment $transaction, \\stdClass $order) {\n\n}",
"public function testOrderReceiptDisabled() {\n $order_type = OrderType::load($this->order->bundle());\n $order_type->setSendReceipt(FALSE);\n $order_type->save();\n\n $this->order->getState()->applyTransitionById('place');\n $this->order->save();\n\n $this->assertCount(0, $this->getMails());\n }",
"public function disapprove()\n {\n return $this->approve(false);\n }",
"public function testSetNotForPaymentDisabledFields()\n {\n $this->slipData->setWithReferenceNumber(false);\n $this->slipData->setWithBankingCustomerId(false);\n\n $this->slipData->setNotForPayment(true);\n }",
"public function isUnpaid()\n {\n return $this->getStatus() === OpenNode_Bitcoin_Model_Bitcoin::OPENNODE_STATUS_UNPAID;\n }",
"public function isStatusNotPaid()\n {\n return $this->status == self::_ORDER_STATUS_NEW || $this->status == self::_ORDER_STATUS_REJECTED;\n }",
"public function testSetNotForPayment()\n {\n $returned = $this->slipData->setNotForPayment(true);\n $this->assertInstanceOf('SwissPaymentSlip\\SwissPaymentSlip\\OrangePaymentSlipData', $returned);\n $this->assertTrue($this->slipData->getNotForPayment());\n\n $this->assertEquals('XXXXXXXXXXXXXXXXXXXX', $this->slipData->getReferenceNumber());\n $this->assertEquals('XXXXXXXXXXXXXXXXXXXXXXXXXXX', $this->slipData->getCompleteReferenceNumber(false));\n $this->assertEquals('XX XXXXX XXXXX XXXXX XXXXX XXXXX', $this->slipData->getCompleteReferenceNumber());\n\n $this->assertEquals('XXXXXXXXXXXXX>XXXXXXXXXXXXXXXXXXXXXXXXXXX+ XXXXXXXXX>', $this->slipData->getCodeLine());\n }",
"public function paymentFailed()\n {\n $this->logStatus('failed');\n\n // Send the failed email\n Mail::send('bedard.photography::mail.failed', $this->attributes, function ($message) {\n $message->to($this->email, $this->name);\n });\n }",
"public static function rejectSettlementRequest($request, $note = null);",
"public function disableSelectingDifferentAddressInPayPal()\n {\n $this->getPayPalRequest()->setParameter(\"ADDROVERRIDE\", \"1\");\n }",
"function reject( $booking_ids ){\n\t\treturn $this->set_status(2, $booking_ids);\n\t}",
"public function reject() {\n }",
"public function markUnapproved()\n {\n $this->Moderated = false;\n $this->write();\n $this->extend('afterMarkUnapproved');\n }",
"function pp_sg_disable_renewal_notice( $send, $license_id, $notice_id ) {\n\t$license = edd_software_licensing()->get_license( $license_id );\n\n\tif( 6377 === (int) $license->download_id ) {\n\t\t$send = false;\n\t}\n\n\treturn $send;\n}",
"function deny($reason) {\n $this->denied_reasons[] = $reason;\n }",
"public function rejected()\n {\n $spare_parts_orders_id = Input::get('spare_parts_orders_id');\n $data = SparePartsOrderModel::where('spare_parts_orders_id', $spare_parts_orders_id)->first();\n $data->confirmation = 'rejected';\n if ($data->save()) {\n $notification = array(\n 'message' => 'Successfully Rejected this Order.',\n 'alert-type' => 'success'\n );\n return redirect()->back()->with($notification);\n }\n }",
"public function tellNotEnoughMoneyInAccount()\n {\n }",
"abstract public function cancel_payment( Payment $payment );",
"public function setIgnoreValidation() {\r\n\t\t$this->getOnepage()->getQuote()->getBillingAddress()->setShouldIgnoreValidation(true);\r\n\t\t$this->getOnepage()->getQuote()->getShippingAddress()->setShouldIgnoreValidation(true);\r\n\t}"
] |
[
"0.64841986",
"0.6475994",
"0.6252473",
"0.6243994",
"0.5881785",
"0.5879075",
"0.5814151",
"0.57831967",
"0.5774112",
"0.5728116",
"0.5726544",
"0.57189536",
"0.56879306",
"0.567439",
"0.5636609",
"0.5627581",
"0.56028086",
"0.5552948",
"0.5536569",
"0.5518697",
"0.5499864",
"0.5499406",
"0.5494095",
"0.54611",
"0.5449771",
"0.5446883",
"0.5438105",
"0.54341245",
"0.5423137",
"0.54155785"
] |
0.6704872
|
0
|
Creates a new refund job for the given order and refund.
|
protected function createRefundJob(Mage_Sales_Model_Order $order,
\PostFinanceCheckout\Sdk\Model\RefundCreate $refund)
{
/* @var PostFinanceCheckout_Payment_Model_Entity_RefundJob $refundJob */
$refundJob = Mage::getModel('postfinancecheckout_payment/entity_refundJob');
$refundJob->setOrderId($order->getId());
$refundJob->setSpaceId($order->getPostfinancecheckoutSpaceId());
$refundJob->setExternalId($refund->getExternalId());
$refundJob->setRefund($refund);
$refundJob->save();
return $refundJob;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function CreateRefund($transferId, $refund, $idempotencyKey = null)\n {\n return $this->CreateObject('transfers_createrefunds', $refund, '\\MangoPay\\Refund', $transferId, null, $idempotencyKey);\n }",
"protected function checkExistingRefundJob(Mage_Sales_Model_Order $order)\n {\n /* @var PostFinanceCheckout_Payment_Model_Entity_RefundJob $existingRefundJob */\n $existingRefundJob = Mage::getModel('postfinancecheckout_payment/entity_refundJob');\n $existingRefundJob->loadByOrder($order);\n if ($existingRefundJob->getId() > 0) {\n try {\n /* @var PostFinanceCheckout_Payment_Model_Service_Refund $refundService */\n $refundService = Mage::getSingleton('postfinancecheckout_payment/service_refund');\n $refundService->refund($existingRefundJob->getSpaceId(), $existingRefundJob->getRefund());\n } catch (Exception $e) {\n Mage::log('Failed to refund because of an exception: ' . $e->getMessage(), null,\n 'postfinancecheckout.log');\n }\n\n Mage::throwException(\n $this->getHelper()->__(\n 'As long as there is an open creditmemo for the order, no new creditmemo can be created.'));\n }\n }",
"public function addRefund($bill, $refund, $order);",
"public function create(\n string $orderId,\n string $amount,\n string $currency,\n string $idempotencyKey,\n ?string $reason = null\n ): InputInterface {\n return new RefundCreateInput($orderId, $amount, $currency, $idempotencyKey, $reason ?? '');\n }",
"public function applyRefund(Order $order, array $parsedData);",
"public function make_payment_refund($order, $amount)\n {\n\n if (!($details = $this->get_payment_details($order))) {\n return null;\n }\n\n $request = array(\n 'charge_id' => $details['id'],\n 'amount' => $amount,\n );\n\n WC_Gateway_Orangepay::log('Orangepay - make_payment_refund() request parameters: ' . $order->get_order_number() . ': ' . wc_print_r($request, true));\n\n $raw_response = wp_safe_remote_post(\n $this->endpoint . '/refunds',\n array(\n 'method' => 'POST',\n 'timeout' => 300,\n 'user-agent' => 'WooCommerce/' . WC()->version,\n 'headers' => array(\n 'Content-Type' => 'application/json;',\n 'Authorization' => 'Bearer ' . $this->gateway->get_option('api_token')\n ),\n 'body' => json_encode($request),\n 'httpversion' => '1.1',\n )\n );\n\n WC_Gateway_Orangepay::log('Orangepay - make_payment_refund() response: ' . wc_print_r($raw_response, true));\n\n if (isset($raw_response['body']) && ($response = json_decode($raw_response['body'], true))) {\n if (isset($response['data'])) {\n $data = $response['data'];\n if (isset($data['charge'])) {\n $charge = $data['charge'];\n if (isset($charge['included'])) {\n foreach ($charge['included'] as $included) {\n if ($included['type'] === 'refund') {\n return $included['id'];\n }\n }\n }\n }\n }\n }\n\n return null;\n }",
"public function CreateRefund($payInId, $refund) {\n return $this->CreateObject('payins_createrefunds', $refund, '\\P4M\\MangoPayBundle\\MangoPaySDK\\Refund', $payInId);\n }",
"public function refund($orderId, array $options = [])\n {\n return Paddle::refundPayment($orderId, $options);\n }",
"function createRefund($payload, $charge_id) {\r\n $end_point = $this->tpi_server_domain . '/payment/xendit/credit-card/charges/' . $charge_id . '/refund';\r\n\r\n $args = array(\r\n 'headers' => $this->defaultHeader(),\r\n 'timeout' => WC_Xendit_PG_API::DEFAULT_TIME_OUT,\r\n 'body' => json_encode($payload)\r\n );\r\n $response = wp_remote_post($end_point, $args);\r\n $jsonResponse = json_decode($response['body'], true);\r\n\r\n return $jsonResponse;\r\n }",
"public function refund($params)\n {\n return $this->request(Resource::RESOURCE_ORDER_REFUND, $params);\n }",
"public function refund($url, $orderUUID, $amount);",
"public function afterCreate($refund)\n {\n $products = [];\n\n foreach ($refund->all_items as $item) {\n $products[] = $item->product;\n }\n\n $this->inventoryIndexer->reindexRows($products);\n }",
"function wp_aff_handle_woocommerce_order_refund($order_id) {\n wp_affiliate_log_debug(\"WooCommerce Affiliate integration - order refunded. Order ID: \" . $order_id, true);\n //$order = new WC_Order($order_id);\n $txn_id = $order_id;\n wp_aff_handle_refund($txn_id);\n}",
"public function refund($refund, $apiContext = null, $restCall = null)\n {\n ArgumentValidator::validate($this->getId(), \"Id\");\n ArgumentValidator::validate($refund, 'refund');\n $payLoad = $refund->toJSON();\n $json = self::executeCall(\n \"/v1/payments/sale/{$this->getId()}/refund\",\n \"POST\",\n $payLoad,\n null,\n $apiContext,\n $restCall\n );\n $ret = new Refund();\n $ret->fromJson($json);\n return $ret;\n }",
"public function refundOrder(Request $request)\n {\n $refund_data['merc_refund_ref_no'] = $request->merc_refund_ref_no;\n $refund_data['orderid'] = $request->orderid;\n $refund_data['transaction_id'] = $request->transaction_id;\n $refund_data['transaction_date'] = $request->transaction_date;\n $refund_data['refund_amount'] = $request->refund_amount;\n $refund_data['txn_amount'] = $request->txn_amount;\n\n $response = BilldeskHmac::refundOrder($refund_data);\n }",
"public function refund($refund, $apiContext = null, $restCall = null)\n {\n ArgumentValidator::validate($this->getId(), \"Id\");\n ArgumentValidator::validate($refund, 'refund');\n $payLoad = $refund->toJSON();\n $json = self::executeCall(\n \"/v1/payments/capture/{$this->getId()}/refund\",\n \"POST\",\n $payLoad,\n null,\n $apiContext,\n $restCall\n );\n $ret = new Refund();\n $ret->fromJson($json);\n return $ret;\n }",
"public function refund($transactionId, $orderId, $description, array $options = array())\n {\n $params = $options;\n\n $params['IDENTIFIER'] = $this->identifier;\n $params['OPERATIONTYPE'] = 'refund';\n $params['DESCRIPTION'] = $description;\n $params['TRANSACTIONID'] = $transactionId;\n $params['VERSION'] = self::API_VERSION;\n $params['ORDERID'] = $orderId;\n\n $params['HASH'] = $this->hash($params);\n\n return $this->requests($this->getDirectLinkUrls(), $params);\n }",
"public function refund(Request $request)\n {\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(env('ANET_API_LOGIN_ID'));\n $merchantAuthentication->setTransactionKey(env('ANET_TRANSACTION_KEY'));\n\n // Set the transaction's refId\n $refId = 'ref' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($request->cc_number);\n $creditCard->setExpirationDate($request->input('expiry_year') . \"-\" . $request->input('expiry_month'));\n\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n //create a transaction\n $transactionRequest = new AnetAPI\\TransactionRequestType();\n $transactionRequest->setTransactionType(\"refundTransaction\");\n $transactionRequest->setAmount($request->amount);\n $transactionRequest->setPayment($paymentOne);\n $transactionRequest->setRefTransId($request->transactionReference);\n\n\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setTransactionRequest($transactionRequest);\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse(ANetEnvironment::PRODUCTION);\n\n if ($response != null) {\n $tresponse = $response->getTransactionResponse();\n if ($response->getMessages()->getResultCode() == \"Ok\") {\n if ($tresponse != null && $tresponse->getMessages() != null) {\n $message_text = $tresponse->getMessages()[0]->getDescription() . \", Response code: \" . $tresponse->getResponseCode() . \", Refund SUCCESS: \" . $tresponse->getTransId();\n $msg_type = \"successMessage\";\n return redirect()->route('orderList')->with($msg_type, $message_text);\n } else {\n $message_text = \"Transaction Failed\";\n $msg_type = \"errorMessage\";\n if ($tresponse->getErrors() != null) {\n $message_text = $tresponse->getErrors()[0]->getErrorText();\n $msg_type = \"errorMessage\";\n }\n }\n } else {\n if ($tresponse != null && $tresponse->getErrors() != null) {\n $message_text = $tresponse->getErrors()[0]->getErrorText();\n } else {\n $message_text = $response->getMessages()->getMessage()[0]->getText();\n }\n $msg_type = \"errorMessage\";\n }\n } else {\n $message_text = \"No response returned\";\n $msg_type = \"errorMessage\";\n }\n\n return redirect()->route('refundView')->with($msg_type, $message_text);\n }",
"public function refund($orderId, $amount = null, $reason = '')\n {\n $payload = array_merge([\n 'order_id' => $orderId,\n 'reason' => $reason,\n ], $this->paddleOptions());\n\n if ($amount) {\n $payload['amount'] = $amount;\n }\n\n return Cashier::post('/payment/refund', $payload)['response']['refund_request_id'];\n }",
"function submit_refund_to_taxamo( $payment_id, $new_status, $old_status ) {\n\n global $edd_options;\n\n if ( 'refunded' != $new_status )\n return;\n\n\n // Get Taxamo Tansaction Key.\n $payment_meta = edd_get_payment_meta( $payment_id );\n $taxamo_transaction_lines = $payment_meta['taxamo_transaction_lines'];\n $transaction_key = $payment_meta['taxamo_transaction_key'];\n\n // Get Order Total and create an array for it.\n foreach ( $taxamo_transaction_lines as $taxamo_transaction_line ) {\n $line_key = $taxamo_transaction_line['taxamo_line_key'];\n $amount = $taxamo_transaction_line['taxamo_total_amount'];\n\n $taxamo_body_array = array( \"total_amount\"=>$amount,\n \"line_key\" => $line_key );\n $taxamo_body_json = json_encode( $taxamo_body_array );\n\n // Create Taxamo Object and Submit a refund\n $private_key = $edd_options['taxedd_private_token'];\n $refundtaxamo = new Taxamo( new APIClient( $private_key, 'https://api.taxamo.com' ) );\n $resp = $refundtaxamo->createRefund( $transaction_key, $taxamo_body_array );\n }\n }",
"protected function refundCancelledOrder(Varien_Object $payment)\n {\n $order = $payment->getOrder();\n\n $this->checkExistingRefundJob($order);\n\n /* @var PostFinanceCheckout_Payment_Model_Service_Refund $refundService */\n $refundService = Mage::getSingleton('postfinancecheckout_payment/service_refund');\n $refund = $refundService->createForPayment($payment);\n\n $refundJob = $this->createRefundJob($order, $refund);\n\n try {\n $refund = $refundService->refund($refundJob->getSpaceId(), $refund);\n } catch (\\PostFinanceCheckout\\Sdk\\ApiException $e) {\n if ($e->getResponseObject() instanceof \\PostFinanceCheckout\\Sdk\\Model\\ClientError) {\n $refundJob->delete();\n Mage::throwException($e->getResponseObject()->getMessage());\n } else {\n Mage::throwException(\n $this->getHelper()->__('There has been an error while sending the refund to the gateway.'));\n }\n } catch (Exception $e) {\n Mage::throwException(\n $this->getHelper()->__('There has been an error while sending the refund to the gateway.'));\n }\n\n if ($refund->getState() == \\PostFinanceCheckout\\Sdk\\Model\\RefundState::FAILED) {\n $refundJob->delete();\n Mage::throwException($this->getHelper()->translate($refund->getFailureReason()\n ->getDescription()));\n } elseif ($refund->getState() == \\PostFinanceCheckout\\Sdk\\Model\\RefundState::PENDING) {\n Mage::throwException(\n $this->getHelper()->__('The refund was requested successfully, but is still pending on the gateway.'));\n }\n\n $refundJob->delete();\n }",
"public function refundCancel($refundHandle);",
"public function refund();",
"public function ajax_swedbank_pay_refund() {\n\t\tif ( ! wp_verify_nonce( $_REQUEST['nonce'], 'swedbank_pay' ) ) {\n\t\t\texit( 'No naughty business' );\n\t\t}\n\n\t\t$order_id = (int) $_REQUEST['order_id'];\n\t\t$order = wc_get_order( $order_id );\n\n\t\ttry {\n\t\t\t// Create the refund object.\n\t\t\t$refund = wc_create_refund(\n\t\t\t\tarray(\n\t\t\t\t\t'amount' => $order->get_total(),\n\t\t\t\t\t'reason' => __( 'Full refund.', 'swedbank-pay-woocommerce-checkout' ),\n\t\t\t\t\t'order_id' => $order_id,\n\t\t\t\t\t'refund_payment' => true\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( is_wp_error( $refund ) ) {\n\t\t\t\tthrow new Exception( $refund->get_error_message() );\n\t\t\t}\n\n\t\t\twp_send_json_success( __( 'Refund has been successful.', 'swedbank-pay-woocommerce-checkout' ) );\n\t\t} catch ( Exception $e ) {\n\t\t\twp_send_json_error( $e->getMessage() );\n\t\t}\n\t}",
"public function refund($options);",
"public function refund_order(Refund $refund,RetailerOrder $order){\n $walletController = new WalletController();\n if ($order->has_user != null) {\n $user = User::find($order->has_user->id);\n if ($user->has_wallet == null) {\n\n $wallet = $walletController->wallet_create($order->has_user->id);\n } else {\n $wallet = $user->has_wallet;\n }\n } else {\n $shop = $order->has_store;\n if (count($shop->has_user) > 0) {\n if ($shop->has_user[0]->has_wallet == null) {\n $wallet = $walletController->wallet_create($shop->has_user[0]->id);\n } else {\n $wallet = $shop->has_user[0]->has_wallet;\n }\n }\n else {\n return redirect()->back()->with('error', 'Order Cant Refund Automatically Because No Wallet Found!');\n }\n }\n\n $wallet->available = $wallet->available+(double)$order->cost_to_pay;\n $wallet->save();\n /*Wallet Log*/\n $wallet_log = new WalletLog();\n $wallet_log->wallet_id = $wallet->id;\n $wallet_log->status = \"Top-up through Refund\";\n $wallet_log->amount = $order->cost_to_pay;\n $wallet_log->message = 'A Top-up of Amount '.number_format($order->cost_to_pay,2).' USD On Behalf on Refund '.$order->name.' Against Wallet ' . $wallet->wallet_token . ' At ' . now()->format('d M, Y h:i a');\n $wallet_log->save();\n\n /*Refund Order*/\n $order->status = 'cancelled';\n $order->paid = 2;\n $order->save();\n /*Order Log*/\n $order_log = new OrderLog();\n $order_log->message = \"An amount of \".$order->cost_to_pay.\" USD refunded to Wallet on \".now()->format('d M, Y h:i a');\n $order_log->status = \"refunded\";\n $order_log->retailer_order_id = $order->id;\n $order_log->save();\n\n $refund->status_id = 4;\n $refund->status = 'Closed';\n $refund->save();\n\n $tl = new RefundLog();\n $tl->message = 'A Refund Generated \"'.$refund->title.'\" against \"'.$order->name.'\" at '.now()->format('d M, Y h:i a');\n $tl->status = \"Generated\";\n $tl->refund_id = $refund->id;\n $tl->save();\n\n $this->notify->generate('Refund','Order Refund',$order->name.' Refund Approved',$refund);\n $this->inventory->OrderQuantityUpdate($order,'refund');\n return redirect()->back()->with('success','Order Refunded Successfully!');\n\n\n }",
"public function gETRefundIdOrderRequest($refund_id)\n {\n // verify the required parameter 'refund_id' is set\n if ($refund_id === null || (is_array($refund_id) && count($refund_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $refund_id when calling gETRefundIdOrder'\n );\n }\n\n $resourcePath = '/refunds/{refundId}/order';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($refund_id !== null) {\n $resourcePath = str_replace(\n '{' . 'refundId' . '}',\n ObjectSerializer::toPathValue($refund_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getRefundByReference(string $refund_reference): RefundInterface;",
"public function testCanMakeUpdateRefundMessage()\n {\n $opt = new DocRefundUpdateRefundOptions([\n //Other parameters omitted\n 'ticketNumber' => '17246548165740',\n 'tourCode' => '01JUL86LH11A',\n 'refundedItinerary' => [\n new RefundItinOpt([\n 'company' => 'AF',\n 'origin' => 'NCE',\n 'destination' => 'PAR'\n ])\n ]\n ]);\n\n $msg = new UpdateRefund($opt);\n\n $this->assertEquals('17246548165740', $msg->ticketNumber->documentDetails->number);\n $this->assertNull($msg->ticketNumber->documentDetails->type);\n\n $this->assertEquals('01JUL86LH11A', $msg->tourInformation->tourInformationDetails->tourCode);\n\n $this->assertCount(1, $msg->refundedItinerary);\n $this->assertEquals('AF', $msg->refundedItinerary[0]->airlineCodeRfndItinerary->companyIdentification->operatingCompany);\n $this->assertEquals('NCE', $msg->refundedItinerary[0]->originDestinationRfndItinerary->origin);\n $this->assertEquals('PAR', $msg->refundedItinerary[0]->originDestinationRfndItinerary->destination);\n\n $this->assertEmpty($msg->ticket);\n $this->assertEmpty($msg->interactiveFreeText);\n $this->assertEmpty($msg->fopGroup);\n $this->assertEmpty($msg->taxDetailsInformation);\n $this->assertEmpty($msg->dateTimeInformation);\n $this->assertNull($msg->referenceInformation);\n $this->assertNull($msg->travellerPriorityInfo);\n $this->assertNull($msg->refundedRoute);\n $this->assertNull($msg->travellerInformation);\n $this->assertNull($msg->monetaryInformation);\n $this->assertNull($msg->pricingDetails);\n $this->assertNull($msg->commission);\n $this->assertNull($msg->structuredAddress);\n $this->assertNull($msg->userIdentification);\n $this->assertNull($msg->feeGroup);\n $this->assertNull($msg->firstAndLastSegmentDates);\n $this->assertNull($msg->originAndDestination);\n $this->assertNull($msg->transactionContext);\n\n }",
"public function refund($mixed = null) {\n\t\t$validParameters = array(\n\t\t\t'(orderv2\\refund)',\n\t\t);\n\t\t$args = func_get_args();\n\t\t$this->_checkArguments($args, $validParameters);\n\t\treturn $this->__soapCall('refund', $this->make_soap_params($mixed));\n\t}"
] |
[
"0.62944394",
"0.62536377",
"0.60474825",
"0.59276277",
"0.59244746",
"0.58436084",
"0.58091515",
"0.5790636",
"0.5710887",
"0.56786114",
"0.5664097",
"0.56163424",
"0.5595191",
"0.5541357",
"0.55353993",
"0.5531913",
"0.54716533",
"0.54541886",
"0.54415774",
"0.5435193",
"0.542262",
"0.53866357",
"0.5384999",
"0.5383346",
"0.5352887",
"0.5342809",
"0.5310682",
"0.53071785",
"0.5242158",
"0.5213449"
] |
0.7428825
|
0
|
Checks if there is an existing refund job for the given order. If yes, the refund is sent to the gateway and an exception is thrown.
|
protected function checkExistingRefundJob(Mage_Sales_Model_Order $order)
{
/* @var PostFinanceCheckout_Payment_Model_Entity_RefundJob $existingRefundJob */
$existingRefundJob = Mage::getModel('postfinancecheckout_payment/entity_refundJob');
$existingRefundJob->loadByOrder($order);
if ($existingRefundJob->getId() > 0) {
try {
/* @var PostFinanceCheckout_Payment_Model_Service_Refund $refundService */
$refundService = Mage::getSingleton('postfinancecheckout_payment/service_refund');
$refundService->refund($existingRefundJob->getSpaceId(), $existingRefundJob->getRefund());
} catch (Exception $e) {
Mage::log('Failed to refund because of an exception: ' . $e->getMessage(), null,
'postfinancecheckout.log');
}
Mage::throwException(
$this->getHelper()->__(
'As long as there is an open creditmemo for the order, no new creditmemo can be created.'));
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function hasExistingRefundJob($order)\n {\n /* @var PostFinanceCheckout_Payment_Model_Entity_RefundJob $existingRefundJob */\n $existingRefundJob = Mage::getModel('postfinancecheckout_payment/entity_refundJob');\n $existingRefundJob->loadByOrder($order);\n return $existingRefundJob->getId() > 0;\n }",
"public function canRefund($order)\r\n {\r\n if($order->getStatus()!='alipay_trade_finished' && $order->getStatus()!='alipay_trade_success' && $order->getStatus()!=Mage_Sales_Model_Order::STATE_PROCESSING){\r\n return false;\r\n }\r\n $payment = $order->getPayment();\r\n if($payment->getMethod()!='alipay_payment'){\r\n return false;\r\n }\r\n $payment = Mage::getModel('imaginato_alipay/payment');\r\n return $payment->trade_query($order);\r\n }",
"public function process_refund($order_id, $amount = null, $reason = '') {\n $order = wc_get_order( $order_id );\n $refundResponse = $this->refund( $order, $order_id, $amount, $reason );\n\n if ($refundResponse == '200') return true;\n else {\n $this->setLogError($refundResponse);\n return new WP_Error( 'midtrans_refund_error', $refundResponse);\n }\n }",
"public function is_order_refunded( $order ) {\n\n\t\tif ( is_numeric( $order ) ) {\n\t\t\t$order = wc_get_order( $order );\n\t\t}\n\n\t\treturn ( $this->order_has_status( $order, 'refunded' ) );\n\t}",
"protected function refundCancelledOrder(Varien_Object $payment)\n {\n $order = $payment->getOrder();\n\n $this->checkExistingRefundJob($order);\n\n /* @var PostFinanceCheckout_Payment_Model_Service_Refund $refundService */\n $refundService = Mage::getSingleton('postfinancecheckout_payment/service_refund');\n $refund = $refundService->createForPayment($payment);\n\n $refundJob = $this->createRefundJob($order, $refund);\n\n try {\n $refund = $refundService->refund($refundJob->getSpaceId(), $refund);\n } catch (\\PostFinanceCheckout\\Sdk\\ApiException $e) {\n if ($e->getResponseObject() instanceof \\PostFinanceCheckout\\Sdk\\Model\\ClientError) {\n $refundJob->delete();\n Mage::throwException($e->getResponseObject()->getMessage());\n } else {\n Mage::throwException(\n $this->getHelper()->__('There has been an error while sending the refund to the gateway.'));\n }\n } catch (Exception $e) {\n Mage::throwException(\n $this->getHelper()->__('There has been an error while sending the refund to the gateway.'));\n }\n\n if ($refund->getState() == \\PostFinanceCheckout\\Sdk\\Model\\RefundState::FAILED) {\n $refundJob->delete();\n Mage::throwException($this->getHelper()->translate($refund->getFailureReason()\n ->getDescription()));\n } elseif ($refund->getState() == \\PostFinanceCheckout\\Sdk\\Model\\RefundState::PENDING) {\n Mage::throwException(\n $this->getHelper()->__('The refund was requested successfully, but is still pending on the gateway.'));\n }\n\n $refundJob->delete();\n }",
"function wp_aff_handle_woocommerce_order_refund($order_id) {\n wp_affiliate_log_debug(\"WooCommerce Affiliate integration - order refunded. Order ID: \" . $order_id, true);\n //$order = new WC_Order($order_id);\n $txn_id = $order_id;\n wp_aff_handle_refund($txn_id);\n}",
"public function applyRefund(Order $order, array $parsedData);",
"public function refundAction() {\n $this->chekcingForMarketplaceSellerOrNot ();\n /**\n * Initilize refund variables\n */\n $orderId = $this->getRequest ()->getParam ( 'id' );\n $produtId = $this->getRequest ()->getParam ( 'item' );\n $sellerId = Mage::getSingleton ( 'customer/session' )->getId ();\n /**\n * Collect the produts from the order details.\n */\n $orderPrdouctIds = Mage::helper ( 'marketplace/vieworder' )->getOrderProductIds ( Mage::getSingleton ( 'customer/session' )->getId (), $orderId );\n\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n /**\n * Check whether product id is in array\n */\n if (in_array ( $produtId, $orderPrdouctIds ) && $orderStatusFlag == 1) {\n\n Mage::getModel ( 'marketplace/order' )->updateSellerRequest ( $produtId, $orderId, Mage::getSingleton ( 'customer/session' )->getId (), '', 2 );\n\n try {\n\n /**\n * Sending order email\n */\n $templateId = ( int ) Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_cancel_request_notification_template_selection' );\n $adminEmailId = Mage::getStoreConfig ( 'marketplace/marketplace/admin_email_id' );\n $toMailId = Mage::getStoreConfig ( \"trans_email/ident_$adminEmailId/email\" );\n $toName = Mage::getStoreConfig ( \"trans_email/ident_$adminEmailId/name\" );\n /**\n * Select email template\n */\n if ($templateId) {\n $emailTemplate = Mage::helper ( 'marketplace/marketplace' )->loadEmailTemplate ( $templateId );\n } else {\n $emailTemplate = Mage::getModel ( 'core/email_template' )->loadDefault ( 'marketplace_cancel_order_admin_email_template_selection' );\n }\n /**\n * Load product collection for cancel\n */\n $productCollection = Mage::getModel ( 'catalog/product' )->getCollection ()->addAttributeToSelect ( '*' )->addUrlRewrite ()->addAttributeToFilter ( 'entity_id', array (\n 'eq' => $produtId\n ) );\n\n $productDetails = \"<ul>\";\n /**\n * Prepare product details for cancel email\n */\n foreach ( $productCollection as $product ) {\n $productDetails .= \"<li>\";\n $productDetails .= \"<div><a href='{$product->getProductUrl()}'>{$product->getName()}</a><div>\";\n $productDetails .= \"</li>\";\n }\n\n $productDetails .= \"</ul>\";\n /**\n * load order details\n * @var object\n */\n $incrementId = Mage::getModel ( 'sales/order' )->load ( $orderId )->getIncrementId ();\n\n /**\n * Get seller information.\n */\n $customer = Mage::getModel ( 'customer/customer' )->load ( $sellerId );\n /**\n * Initilize variable for send mail to seller\n */\n $sellerEmail = $customer->getEmail ();\n $sellerName = $customer->getName ();\n $recipient = $toMailId;\n $emailTemplate->setSenderName ( $sellerName );\n $emailTemplate->setSenderEmail ( $sellerEmail );\n\n /**\n * Prepare temail templave variables\n */\n $emailTemplateVariables = array (\n 'ownername' => $toName,\n 'productdetails' => $productDetails,\n 'order_id' => $incrementId,\n 'customer_email' => $sellerEmail,\n 'customer_firstname' => $sellerName,\n 'reason' => $this->__ ( 'Buyer wants to refund the item' ),\n 'requesttype' => $this->__ ( 'refund' ),\n 'requestperson' => $this->__ ( 'Seller' )\n );\n $emailTemplate->setDesignConfig ( array (\n 'area' => 'frontend'\n ) );\n /**\n * Sending email to admin\n */\n $emailTemplate->getProcessedTemplate ( $emailTemplateVariables );\n $emailTemplate->send ( $recipient, $toName, $emailTemplateVariables );\n\n /**\n * Redirect to order view page\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"The item refund request has been sent.\" ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n } catch ( Exception $e ) {\n /**\n * when error message occured, redirected to view order page.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n }\n } else {\n /**\n * Check the permission.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/manage' );\n return false;\n }\n }",
"public function process(Order $order)\n {\n /** @var Payment $payment */\n $payment = $order->getPayment();\n\n $orderWasUpdated = false;\n\n if (ConfigProvider::CODE !== $payment->getMethod()) {\n throw new LocalizedException(__('This order was not placed via Ingenico ePayments'));\n }\n $orderTransactions = $this->transactionManager->retrieveTransactions($payment);\n\n $ingenicoPaymentId = $payment->getAdditionalInformation(Config::PAYMENT_ID_KEY);\n if (!$ingenicoPaymentId && empty($orderTransactions)) {\n try {\n $orderWasUpdated = $this->updateHostedCheckoutStatus($order);\n } catch (\\Exception $e) {\n throw new LocalizedException(__('Order is not linked with Ingenico ePayments orders.'));\n }\n }\n\n foreach ($orderTransactions as $transaction) {\n $currentStatus = $this->getCurrentStatus($payment, $transaction);\n $updateStatus = $this->getUpdateStatus($order, $currentStatus);\n if ($updateStatus->status !== $currentStatus->status) {\n $this->statusResolver->resolve($order, $updateStatus);\n\n /** @var Payment\\Transaction $transaction */\n $transaction = $this->transactionManager->retrieveTransaction($transaction->getTxnId());\n if ($transaction !== null) {\n $order->addRelatedObject($transaction);\n }\n $order->addRelatedObject($payment);\n $orderWasUpdated = true;\n } else {\n $this->statusResponseManager->set($payment, $updateStatus->id, $updateStatus);\n }\n }\n\n if ($orderWasUpdated) {\n $this->orderRepository->save($order);\n }\n\n return $orderWasUpdated;\n }",
"public function checkIfOrderExist($orderId);",
"function _doRefund($oID, $amount = 0) {\r\n global $db, $messageStack;\r\n $new_order_status = (int)MODULE_PAYMENT_AUTHORIZENET_ECHECK_REFUNDED_ORDER_STATUS_ID;\r\n if ($new_order_status == 0) $new_order_status = 1;\r\n $proceedToRefund = true;\r\n $refundNote = strip_tags(zen_db_input($_POST['refnote']));\r\n if (isset($_POST['refconfirm']) && $_POST['refconfirm'] != 'on') {\r\n $messageStack->add_session(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_REFUND_CONFIRM_ERROR, 'error');\r\n $proceedToRefund = false;\r\n }\r\n if (isset($_POST['buttonrefund']) && $_POST['buttonrefund'] == MODULE_PAYMENT_AUTHORIZENET_ECHECK_ENTRY_REFUND_BUTTON_TEXT) {\r\n $refundAmt = (float)$_POST['refamt'];\r\n $new_order_status = (int)MODULE_PAYMENT_AUTHORIZENET_ECHECK_REFUNDED_ORDER_STATUS_ID;\r\n if ($refundAmt == 0) {\r\n $messageStack->add_session(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_INVALID_REFUND_AMOUNT, 'error');\r\n $proceedToRefund = false;\r\n }\r\n }\r\n if (isset($_POST['cc_number']) && trim($_POST['cc_number']) == '') {\r\n $messageStack->add_session(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_CC_NUM_REQUIRED_ERROR, 'error');\r\n }\r\n if (isset($_POST['trans_id']) && trim($_POST['trans_id']) == '') {\r\n $messageStack->add_session(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_TRANS_ID_REQUIRED_ERROR, 'error');\r\n $proceedToRefund = false;\r\n }\r\n\r\n /**\r\n * Submit refund request to gateway\r\n */\r\n if ($proceedToRefund) {\r\n $submit_data = array('x_type' => 'CREDIT',\r\n 'x_card_num' => trim($_POST['cc_number']),\r\n 'x_amount' => number_format($refundAmt, 2),\r\n 'x_trans_id' => trim($_POST['trans_id'])\r\n );\r\n unset($response);\r\n $response = $this->_sendRequest($submit_data);\r\n $response_code = $response[0];\r\n $response_text = $response[3];\r\n $response_alert = $response_text . ($this->commError == '' ? '' : ' Communications Error - Please notify webmaster.');\r\n $this->reportable_submit_data['Note'] = $refundNote;\r\n $this->_debugActions($response);\r\n\r\n if ($response_code != '1') {\r\n $messageStack->add_session($response_alert, 'error');\r\n } else {\r\n // Success, so save the results\r\n $sql_data_array = array('orders_id' => $oID,\r\n 'orders_status_id' => (int)$new_order_status,\r\n 'date_added' => 'now()',\r\n 'comments' => 'REFUND INITIATED. Trans ID:' . $response[6] . ' ' . $response[4]. \"\\n\" . ' Gross Refund Amt: ' . $response[9] . \"\\n\" . $refundNote,\r\n 'customer_notified' => 0\r\n );\r\n zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\r\n $db->Execute(\"update \" . TABLE_ORDERS . \"\r\n set orders_status = '\" . (int)$new_order_status . \"'\r\n where orders_id = '\" . (int)$oID . \"'\");\r\n $messageStack->add_session(sprintf(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_REFUND_INITIATED, $response[9], $response[6]), 'success');\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"public function process_refund( $order_id, $amount = null, $reason = '' ) {\n\t\t$details = $this->get_transaction_details( $order_id );\n\t\t$is_order_txn_id_active = $this->is_transaction_active( $details );\n\t\t$txn_type = $is_order_txn_id_active ? self::TXN_TYPE_REVERSAL : self::TXN_TYPE_REFUND;\n\n\t\t$order = new WC_Order( $order_id );\n\t\t$request = $this->prepare_request( $txn_type, $order );\n\t\t$response = $this->submit_request( $request );\n\t\t$is_successful = $this->handle_response( $request, $response );\n\n\t\tif ($is_successful) {\n\t\t\t$note_text = sprintf(\n\t\t\t\t'%s%s was reversed or refunded. Transaction ID: %s ',\n\t\t\t\tget_woocommerce_currency_symbol(), $amount, $response->transactionReference->transactionId\n\t\t\t);\n\n\t\t\t$order->add_order_note($note_text);\n\t\t}\n\n\t\treturn $is_successful;\n\t}",
"function get_refund_or_order()\n{\n\t// Fail\n}",
"public function make_payment_refund($order, $amount)\n {\n\n if (!($details = $this->get_payment_details($order))) {\n return null;\n }\n\n $request = array(\n 'charge_id' => $details['id'],\n 'amount' => $amount,\n );\n\n WC_Gateway_Orangepay::log('Orangepay - make_payment_refund() request parameters: ' . $order->get_order_number() . ': ' . wc_print_r($request, true));\n\n $raw_response = wp_safe_remote_post(\n $this->endpoint . '/refunds',\n array(\n 'method' => 'POST',\n 'timeout' => 300,\n 'user-agent' => 'WooCommerce/' . WC()->version,\n 'headers' => array(\n 'Content-Type' => 'application/json;',\n 'Authorization' => 'Bearer ' . $this->gateway->get_option('api_token')\n ),\n 'body' => json_encode($request),\n 'httpversion' => '1.1',\n )\n );\n\n WC_Gateway_Orangepay::log('Orangepay - make_payment_refund() response: ' . wc_print_r($raw_response, true));\n\n if (isset($raw_response['body']) && ($response = json_decode($raw_response['body'], true))) {\n if (isset($response['data'])) {\n $data = $response['data'];\n if (isset($data['charge'])) {\n $charge = $data['charge'];\n if (isset($charge['included'])) {\n foreach ($charge['included'] as $included) {\n if ($included['type'] === 'refund') {\n return $included['id'];\n }\n }\n }\n }\n }\n }\n\n return null;\n }",
"public function checkByOrderId($orderId)\n {\n // Clear the error variable\n $this->error = '';\n\n /**\n * Check value is string\n * If string return false and set error message on error variable\n */\n if (\n !self::__validateString($orderId, 1, 50)\n )\n return false;\n\n $param = array(\n \"apikey\" => $this->apiKey,\n \"mob\" => $this->mobile,\n \"id\" => $orderId\n );\n\n return self::__sendCheckRequest('invoice/byorderid', $param);\n }",
"public function refund():bool {\n request::xhr(\"orders/refund\", \"csrf_token=\".run::$runner->user->csrf.\"&id=\".substr($this->ID, 1),run::$runner->user->session);\n return true;\n }",
"public function buyer_cancel($order_id)\n {\n $changes = array('progress' => '0',\n 'shipping_costs' => 0.00000000,\n 'fees' => 0.00000000,\n 'confirmed_time' => '',\n 'buyer_public_key' => '');\n $this->db->where('id', $order_id);\n return $this->db->update('orders', $changes) == TRUE;\n }",
"public function ajax_swedbank_pay_refund() {\n\t\tif ( ! wp_verify_nonce( $_REQUEST['nonce'], 'swedbank_pay' ) ) {\n\t\t\texit( 'No naughty business' );\n\t\t}\n\n\t\t$order_id = (int) $_REQUEST['order_id'];\n\t\t$order = wc_get_order( $order_id );\n\n\t\ttry {\n\t\t\t// Create the refund object.\n\t\t\t$refund = wc_create_refund(\n\t\t\t\tarray(\n\t\t\t\t\t'amount' => $order->get_total(),\n\t\t\t\t\t'reason' => __( 'Full refund.', 'swedbank-pay-woocommerce-checkout' ),\n\t\t\t\t\t'order_id' => $order_id,\n\t\t\t\t\t'refund_payment' => true\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( is_wp_error( $refund ) ) {\n\t\t\t\tthrow new Exception( $refund->get_error_message() );\n\t\t\t}\n\n\t\t\twp_send_json_success( __( 'Refund has been successful.', 'swedbank-pay-woocommerce-checkout' ) );\n\t\t} catch ( Exception $e ) {\n\t\t\twp_send_json_error( $e->getMessage() );\n\t\t}\n\t}",
"public function refund_order(Refund $refund,RetailerOrder $order){\n $walletController = new WalletController();\n if ($order->has_user != null) {\n $user = User::find($order->has_user->id);\n if ($user->has_wallet == null) {\n\n $wallet = $walletController->wallet_create($order->has_user->id);\n } else {\n $wallet = $user->has_wallet;\n }\n } else {\n $shop = $order->has_store;\n if (count($shop->has_user) > 0) {\n if ($shop->has_user[0]->has_wallet == null) {\n $wallet = $walletController->wallet_create($shop->has_user[0]->id);\n } else {\n $wallet = $shop->has_user[0]->has_wallet;\n }\n }\n else {\n return redirect()->back()->with('error', 'Order Cant Refund Automatically Because No Wallet Found!');\n }\n }\n\n $wallet->available = $wallet->available+(double)$order->cost_to_pay;\n $wallet->save();\n /*Wallet Log*/\n $wallet_log = new WalletLog();\n $wallet_log->wallet_id = $wallet->id;\n $wallet_log->status = \"Top-up through Refund\";\n $wallet_log->amount = $order->cost_to_pay;\n $wallet_log->message = 'A Top-up of Amount '.number_format($order->cost_to_pay,2).' USD On Behalf on Refund '.$order->name.' Against Wallet ' . $wallet->wallet_token . ' At ' . now()->format('d M, Y h:i a');\n $wallet_log->save();\n\n /*Refund Order*/\n $order->status = 'cancelled';\n $order->paid = 2;\n $order->save();\n /*Order Log*/\n $order_log = new OrderLog();\n $order_log->message = \"An amount of \".$order->cost_to_pay.\" USD refunded to Wallet on \".now()->format('d M, Y h:i a');\n $order_log->status = \"refunded\";\n $order_log->retailer_order_id = $order->id;\n $order_log->save();\n\n $refund->status_id = 4;\n $refund->status = 'Closed';\n $refund->save();\n\n $tl = new RefundLog();\n $tl->message = 'A Refund Generated \"'.$refund->title.'\" against \"'.$order->name.'\" at '.now()->format('d M, Y h:i a');\n $tl->status = \"Generated\";\n $tl->refund_id = $refund->id;\n $tl->save();\n\n $this->notify->generate('Refund','Order Refund',$order->name.' Refund Approved',$refund);\n $this->inventory->OrderQuantityUpdate($order,'refund');\n return redirect()->back()->with('success','Order Refunded Successfully!');\n\n\n }",
"public function testOrderStatusPartialRefund()\n {\n /** @var \\Magento\\Sales\\Model\\Order $existingOrder */\n $existingOrder = $this->objectManager->create(\\Magento\\Sales\\Model\\Order::class)\n ->loadByIncrementId('100000001');\n\n $items = $this->getOrderItems($existingOrder);\n $items[0]['qty'] -= 1;\n $result = $this->_webApiCall(\n $this->getServiceData($existingOrder),\n [\n 'orderId' => $existingOrder->getEntityId(),\n 'items' => $items,\n ]\n );\n\n $this->assertNotEmpty(\n $result,\n 'Failed asserting that the received response is correct'\n );\n\n /** @var \\Magento\\Sales\\Model\\Order $updatedOrder */\n $updatedOrder = $this->objectManager->create(\\Magento\\Sales\\Model\\Order::class)\n ->loadByIncrementId($existingOrder->getIncrementId());\n\n $this->assertSame('custom_processing', $updatedOrder->getStatus());\n $this->assertSame('processing', $updatedOrder->getState());\n }",
"public function refund(Collection $order)\r\n {\r\n }",
"public function webhook() {\n\n\t\t$this->log( 'Fire webhook' );\n\n\t\t/* \n\t\t * Received redirect from acquiring service with succesful order status\n\t\t */\n\t\tif( $_SERVER['REQUEST_METHOD'] == 'POST' and isset( $_POST['payment_id'] ) ) {\n\n\t\t\t$this->log( 'Received callback from acquiring service with order processing status' );\n\t\t\t$this->log( print_r($_POST, true ) );\n\n\t\t\t// Get payment UUID\n\t\t\t$paymentcode = isset( $_POST['payment_id'] ) ? $_POST['payment_id'] : null;\n\n\t\t\t// Get our Order ID returned through acquiring\n\t\t\t$order_id = isset ( $_POST['cf'] ) ? $_POST['cf'] : null;\n\n\t\t\t// Get Order status (ОК, КО, CANCEL, CHARGEBACK)\n\t\t\t$status = isset ( $_POST['status'] ) ? $_POST['status'] : null;\n\n\t\t\t// Get Order signature to verify payment validity\n\t\t\t$sign = isset ( $_POST['sign'] ) ? $_POST['sign'] : null;\n\t\t\t$sign_check = md5( $this->merchant_id . $paymentcode . $status . $order_id . $this->secret_word );\n\n\t\t\t$order = wc_get_order( $order_id );\n\n\t\t\t// Validate payment data\n\t\t\tif( $sign == $sign_check ) {\n\n\t\t\t\tswitch( $status ) {\n\t\t\t\t\tcase 'OK':\n\t\t\t\t\t\t// Payment succesful\n\n\t\t\t\t\t\t// Check if Order stay in our payment method\n\t\t\t\t\t\tif( $order->get_payment_method() == $this->id ) {\n\n\t\t\t\t\t\t\t// Link acquiring payment UUID with our Order\n\t\t\t\t\t\t\tif( strlen( $paymentcode ) ) {\n\t\t\t\t\t\t\t\tupdate_post_meta( $order_id, '_' . $this->id . '_paymentcode', $paymentcode );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Set Order status to Processing\n\t\t\t\t\t\t\t$order->update_status('processing');\n\n\t\t\t\t\t\t\t$this->log( 'Payment processed sucesfully' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// Wrong payment method\n\t\t\t\t\t\t\t$this->log( 'Wrong payment method' );\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'КО':\n\t\t\t\t\t// Do nothing. Keep order status as is\n\t\t\t\t\t\t$this->log( 'Payment not processed' );\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'CANCEL':\n\t\t\t\t\t\t// Do nothing. Keep order status as is\n\t\t\t\t\t\t$this->log( 'Payment cancelled by acquirer' );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Clear http output. \n\t\techo '0';\n\t\texit;\n \t}",
"function getRefundOrOrder()\n{\n\t// Fail\n}",
"public function postCancelRecurring($order) {\n Auth::user()\n ->requires('delete')\n ->ofScope('Subscriber',Subscriber::current()->id)\n ->orScope('Protocol')\n ->orScope('Client',$order->client->id)\n ->over('Order',$order->id);\n\n $order->autoship->delete();\n\n return Redirect::route('order',array($order->id));\n }",
"function hook_commerce_adyen_refund_rejected(\\Commerce\\Adyen\\Payment\\Transaction\\Refund $transaction, \\stdClass $order) {\n\n}",
"public function refund();",
"public function revoke_referral_on_delete( $order ) {\n\n\t\t$order_id = $order;\n\n\t\tif( $this->is_version_3 ){\n\t\t\t$order_id = $order->ID;\n\t\t}\n\n\t\tif( ! affiliate_wp()->settings->get( 'revoke_on_refund' ) ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif( 'mp_order' != get_post_type( $order_id ) ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t$this->reject_referral( $order_id );\n\n\t}",
"function hook_commerce_adyen_refund_received(\\Commerce\\Adyen\\Payment\\Transaction\\Refund $transaction, \\stdClass $order) {\n\n}",
"protected function checkPreConditions($refund)\n {\n $job = $refund->job;\n $account = $refund->financialAccount;\n\n if(!$job->quickbook_id) {\n $this->task->markFailed(\"Dependency Error: Job not synced on Quickbook.\", $this->queueJob->attempts());\n return false;\n }\n\n if($job->quickbook_id) {\n $isExists = QuickBooks::isCustomerExistsOnQuickbooks($job->quickbook_id);\n\n if(!$isExists){\n QuickBooks::unlinkJPEntities($job);\n $this->task->markFailed(\"Dependency Error: Job not found on Quickbook.\", $this->queueJob->attempts());\n $this->resynchCustomerAccount($job->customer_id, $this->task->created_source);\n return false;\n }\n }\n\n if($account && !$account->getQBOId()){\n $task = QBAccount::createTask($account->id, QuickBookTask::CREATE, $this->task->created_source, QuickBookTask::ORIGIN_JP);\n $this->task->parent_id = $task ? $task->id : null;\n $this->task->status = QuickBookTask::STATUS_PENDING;\n $this->task->save();\n return false;\n }\n\n return true;\n }",
"public function refund($url, $orderUUID, $amount);"
] |
[
"0.7113045",
"0.67847407",
"0.6256904",
"0.6127498",
"0.611388",
"0.60876817",
"0.5992566",
"0.59419",
"0.5853449",
"0.5841467",
"0.578844",
"0.5785396",
"0.5779941",
"0.5771396",
"0.5770424",
"0.57661164",
"0.5707647",
"0.56620026",
"0.5633168",
"0.56067395",
"0.56047577",
"0.56015766",
"0.55815446",
"0.5581487",
"0.55798393",
"0.55758715",
"0.5532002",
"0.550441",
"0.55000114",
"0.54737204"
] |
0.7951616
|
0
|
First check: is the url just a domain name? (allow a slash at the end)
|
function is_valid_url($url) {
$_domain_regex = "|^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(\.[A-Za-z]{2,})/?$|";
if (preg_match($_domain_regex, $url)) {
return true;
}
// Second: Check if it's a url with a scheme and all
$_regex = '#^([a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))$#';
if (preg_match($_regex, $url, $matches)) {
// pull out the domain name, and make sure that the domain is valid.
$_parts = parse_url($url);
if (!in_array($_parts['scheme'], array('http', 'https')))
return false;
// Check the domain using the regex, stops domains like "-example.com" passing through
if (!preg_match($_domain_regex, $_parts['host']))
return false;
// This domain looks pretty valid. Only way to check it now is to download it!
return true;
}
return false;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function domain_name($url) {\n $pieces = parse_url($url);\n $domain = isset($pieces['host']) ? $pieces['host'] : '';\n if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\\-]{1,63}\\.[a-z\\.]{2,6})$/i', $domain, $regs)) {\n return $regs['domain'];\n }\n return false;\n}",
"public function testParseDomainFromUrl()\n\t{\n\t\t$res = $this->object->getDomain('http://www.facebook.com/liren');\n\t\t$exp = 'facebook';\n\n\t $this->assertEquals($res, $exp, 'Domain name was not parsed correctly.');\n\n\t}",
"function validateRawDomain($url)\n {\n $result=false;\n\n if (!empty($url))\n {\n if (preg_match('/^[a-z0-9-.]+\\.[a-z\\.]{2,7}$/', strtolower($url))) //check if this is valid tld\n {\n $result=true;\n }\n else\n {\n $result=false;\n }\n }\n\n return $result;\n }",
"function netrics_is_url_domain( $url, $domain ) {\n $host = parse_url( $url, PHP_URL_HOST );\n $check = ( $domain === $host || strpos( $host, '.' . $domain ) ) ? true : false;\n\n return $check;\n}",
"function checkUrlString( $url )\t\n\t{\n\t\t$url = trim($url);\t\t\n\t\t\tif( 'http://' != strtolower( substr($url, 0, 7)) && 'https://' != strtolower(substr($url, 0, 8)) )\n\t\t\t\treturn false;\n\t\t\telse\t\t\t\t\t\n\t\t\t\treturn true;\n\t}",
"function get_domain_name_only($url){\r\n $match = preg_match(\"/(.*:\\/\\/)\\w{0,}(.*)\\.(.*)/\",$url,$patterns);\r\n $patterns[2] = str_replace(\".\",\"\",$patterns[2]);\r\n return $patterns[2];\r\n}",
"protected function validateUrlFormat($url) \n\t{\n return filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED);\n }",
"private static function _get_domain($url) {\n if (substr($url, 0, 4) === \"http\") {\n // if url is https://www.some-url/ or http://www.some-url/\n $trim_loc = self::_get_char_loc($url, \"/\", 3);\n } else {\n // if url is www.some-url or some other format\n $trim_loc = self::_get_char_loc($url, \"/\", 1);\n }\n return ($trim_loc !== -1) ? substr($url, 0, $trim_loc+1) : $url;\n }",
"function heateor_ss_validate_url($url){\r\n\treturn filter_var(trim($url), FILTER_VALIDATE_URL);\r\n}",
"function auth_server_validate_domain($domain) {\n\n return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $domain);\n //return true;\n}",
"function cleanSocialUrl($url)\n{\n $segment = '[^.:\\/]+';\n preg_match('/(?:https?:\\/\\/)?(?:' . $segment . '\\.)?(' . $segment . '(?:\\.' . $segment . ')+)/', $url, $matches);\n return isset($matches[1]) ? $matches[1] : false;\n}",
"function isValidDomainName($domain_name)\n{\n //FILTER_VALIDATE_URL checks length but..why not? so we dont move forward with more expensive operations\n $domain_len = strlen($domain_name);\n if ($domain_len < 3 OR $domain_len > 253)\n return FALSE;\n //check HTTP/S just in case was passed.\n if(stripos($domain_name, 'http://') === 0)\n return FALSE;\n elseif(stripos($domain_name, 'https://') === 0)\n return FALSE;\n\n //www is also not allowed\n if(stripos($domain_name, 'www.') === 0)\n return FALSE;\n\n if(stripos($domain_name, '@') !== false)\n return false;\n\n //Checking for a '.' at least, not in the beginning nor end, since http://.abcd. is reported valid\n if(strpos($domain_name, '.') === FALSE OR $domain_name[strlen($domain_name)-1]=='.' OR $domain_name[0]=='.')\n return FALSE;\n\n //now we use the FILTER_VALIDATE_URL, concatenating http so we can use it, and return BOOL\n return (filter_var ('http://' . $domain_name, FILTER_VALIDATE_URL)===FALSE)? FALSE:TRUE;\n}",
"function xss_check_url( $url )\n\t{\n\t\t$url = trim( urldecode( $url ) );\n\t\t\n\t\tif ( ! preg_match( \"#^https?://(?:[^<>*\\\"]+|[a-z0-9/\\._\\- !]+)$#iU\", $url ) )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}",
"public static function getDomain($url) {\n\t\t$nowww = preg_replace('/www./','',$url);\n\t\t$domain = parse_url($nowww);\n\t\tif(!empty($domain[\"path\"]))\t{\n\t\t\treturn $domain[\"path\"];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function clean_url($url, $base_url)\r\n{\r\n\tif(filter_var($url, FILTER_VALIDATE_URL) )\r\n\t{\r\n\r\n\t\t$parse = parse_url($url);\r\n\t\tif( !empty($parse['host']) && $parse['host'] == $base_url )\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}",
"public function validateUrl($url)\n {\n return substr($url, 0, 1) == '/' ? substr($url, 1) : $url;\n }",
"function checkURL($url) {\n\t\t\tif(!eregi(\"^http:\\/\\/\", $url)) {return false;}\n\t\t\treturn true;\n\t\t}",
"function formatURL($url) {\n $url = trim($url, '/');\n if (!preg_match('#^http(s)?://#', $url)) {\n $url = 'http://' . $url;\n }\n $urlParts = parse_url($url);\n $domain = preg_replace('/^www\\./', '', $urlParts['host']);\n return $domain;\n}",
"function wp_http_validate_url($url)\n {\n }",
"private static function _url_is_valid($url) {\n // Consulted https://www.w3schools.com/Php/php_form_url_email.asp\n return preg_match(\"/\\b(?:(?:https?|ftp):\\/\\/|www\\.)[-a-z0-9+&@#\\/%?=~_|!:,.;]*[-a-z0-9+&@#\\/%=~_|]/i\", $url);\n }",
"function validateUrl($value) {\n\tif(ereg(\"^(http|https|ftp)\\://[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\\-\\._\\?\\,\\'/\\\\\\+&%\\$#\\=~])*[^\\.\\,\\)\\(\\s]$\", $value, $regs)) {\n\t\techo \"true\";\n\t} else {\n\t\techo \"false\";\n\t}\n}",
"private function checkFormat($url){\n if(stripos($url, 'http://') !== false){\n return $url;\n } else {\n return 'http://'.$url;\n }\n }",
"function checkurl($url){\n if(!filter_var($url, FILTER_VALIDATE_URL)){\n return \" \";\n }\n else{\n return $url;\n }\n }",
"function isValidURL($url)\n{\n if (! preg_match(\"/\\b(?:(?:https?|ftp):\\/\\/|www\\.)[-a-z0-9+&@#\\/%?=~_|!:,.;]*[-a-z0-9+&@#\\/%=~_|]/i\", $url)) {\n return false;\n }\n return true;\n}",
"function getDomainName($url) {\r\n\r\n $matches = parse_url($url);\r\n\r\n if (isset($matches['host'])) {\r\n\r\n $domain = $matches['host'];\r\n\r\n $domain = str_replace(array('www.'), '', $domain);\r\n\r\n return $domain;\r\n }\r\n\r\n return $url;\r\n}",
"function is_url($url){\r\n $url = substr($url,-1) == \"/\" ? substr($url,0,-1) : $url;\r\n if ( !$url || $url==\"\" ) return false;\r\n if ( !( $parts = @parse_url( $url ) ) ) return false;\r\n else {\r\n if ( $parts[scheme] != \"http\" && $parts[scheme] != \"https\" && $parts[scheme] != \"ftp\" && $parts[scheme] != \"gopher\" ) return false;\r\n else if ( !eregi( \"^[0-9a-z]([-.]?[0-9a-z])*.[a-z]{2,4}$\", $parts[host], $regs ) ) return false;\r\n else if ( !eregi( \"^([0-9a-z-]|[_])*$\", $parts[user], $regs ) ) return false;\r\n else if ( !eregi( \"^([0-9a-z-]|[_])*$\", $parts[pass], $regs ) ) return false;\r\n else if ( !eregi( \"^[0-9a-z/_.@~-]*$\", $parts[path], $regs ) ) return false;\r\n else if ( !eregi( \"^[0-9a-z?&=#,]*$\", $parts[query], $regs ) ) return false;\r\n }\r\n return true;\r\n}",
"function isValidURL($url)\n{\n\tif(substr($url, 0, 7)!=\"http://\") $url = \"http://\".$url;\n\tif(filter_var($url, FILTER_VALIDATE_URL))\n\t{return true;} else {return false;}\n}",
"function oos_validate_is_url($sUrl) {\n if (strlen($sUrl) == 0) {\n return false;\n }\n\n return preg_match('!^http(s)?://[\\w-]+\\.[\\w-]+(\\S+)?$!i', $sUrl);\n }",
"function validate_url( $url, $hostname=null) {\n if ( ( $hostname && parse_url($url, PHP_URL_HOST) === $hostname ) || !$hostname ) {\n return wp_http_validate_url( $url ); // https://developer.wordpress.org/reference/functions/wp_http_validate_url/#\n } else {\n return false;\n }\n }",
"static function is_url($url) {\n return ($url && ($info=parse_url($url)) && $info['host']);\n }"
] |
[
"0.76959115",
"0.7444056",
"0.7423606",
"0.7332506",
"0.7328598",
"0.73059595",
"0.72948855",
"0.7275469",
"0.7274936",
"0.72316283",
"0.72161055",
"0.7188006",
"0.7141955",
"0.71239066",
"0.7120396",
"0.70635676",
"0.70539063",
"0.70251226",
"0.70197874",
"0.7014992",
"0.7004593",
"0.69605124",
"0.6958614",
"0.6938586",
"0.69185495",
"0.6911236",
"0.6906669",
"0.6896721",
"0.687288",
"0.68616873"
] |
0.75133127
|
1
|
Gets Title of assessment
|
public function getTitle() {
return $this->assessment_desc;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function get_name()\r\n {\r\n \t$data = $this->get_exercise_data();\r\n \treturn $data['title'];\r\n }",
"public function getTitle()\n {\n\treturn $this->get('SUMMARY');\n }",
"public function get_title () {\r\n\t\treturn $this->get_info()['title'];\r\n\t}",
"public function getTitle()\n {\n return $this->getValue('title');\n }",
"public function getTitle()\n {\n return $this->getData(self::TITLE);\n }",
"public function getTitle()\n {\n return $this->getData('title');\n }",
"public function getTitle() {\r\n\t\treturn $this->title;\r\n\t}",
"public function getTitle()\n {\n return $this->formattedData['title'];\n }",
"public function getTitle() {\n\t\treturn $this->title;\n\t}",
"public function getTitle() {\n\t\treturn $this->title;\n\t}",
"public function getTitle() {\n\t\treturn $this->title;\n\t}",
"public function getTitle() {\n\t\treturn $this->title;\n\t}",
"public function getTitle() {\n\t\treturn $this->title;\t\n\t}",
"public function get_title()\n\t{\n\t\treturn $this->title;\n\t}",
"public function gettitle()\n {\n return $this->title;\n }",
"public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}",
"public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}",
"public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}",
"public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}",
"public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}",
"public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}",
"public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}",
"public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}",
"public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}",
"public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}",
"public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}",
"public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}",
"public function getTitle() {\n\t\t\treturn $this->title;\n\t\t}",
"public function getTitle()\n {\n\t\treturn $this->title;\n\t}",
"public function getTitle()\r\n {\r\n return $this->title;\r\n }"
] |
[
"0.76372427",
"0.76220757",
"0.7604553",
"0.74747807",
"0.7451009",
"0.74169743",
"0.7414871",
"0.7412082",
"0.74031204",
"0.74031204",
"0.74031204",
"0.74031204",
"0.7400334",
"0.739913",
"0.73911476",
"0.737755",
"0.737755",
"0.737755",
"0.737755",
"0.737755",
"0.737755",
"0.737755",
"0.737755",
"0.737755",
"0.737755",
"0.737755",
"0.737755",
"0.7375059",
"0.73733497",
"0.7360399"
] |
0.8648546
|
0
|
Checks is Assessment Exist
|
public function isAssessmentExists() {
if ($this->as_refid) {
return true;
} else {
return false;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testAssessmentIsCreated()\n {\n $this->withoutExceptionHandling();\n $response = $this->post(route('assessments.store'), $this->getData());\n\n $response->assertStatus(200);\n\n $this->assertCount(1, Assessment::all());\n }",
"public function isUsedInAssessments(){\n return ($this->assessments == 1);\n }",
"public function checkIfEssentialConfigurationExists() {}",
"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 }",
"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 }",
"private function _exists() {\n // taky typ uz existuje ?\n $id = $this->equipment->getID();\n if ($id > 0) {\n $this->flash(\"Také vybavenie už existuje.<br/>Presmerované na jeho editáciu.\", \"error\");\n $this->redirect(\"ape/equipment/edit/$id\");\n }\n }",
"public function POS_it_checks_create_audits_testing_checkIfTypeExists() {\n\n $type = 'Bob';\n\n $taskType = new TaskType();\n $taskType->setType($type);\n $taskType->setDescription('was here');\n $taskType->created_at = Carbon::now();\n $taskType->updated_at = Carbon::now();\n $taskType->client_id = 1;\n\n $taskType->save();\n\n $result = $taskType->checkTaskTypeCreateAudits($taskType);\n\n $this->assertEquals($result, appGlobals()::TBL_TASK_TYPE_TYPE_ALREADY_EXISTS);\n }",
"private function checkEventExists(){\n $event = Event::find($this->id);\n\n return(!is_null($event));\n }",
"public function testExists()\n {\n $this->assertFalse($this->insight->accounts->exists(12345));\n $this->insight->accounts->addTrial(12345);\n $this->assertTrue($this->insight->accounts->exists(12345));\n }",
"public function exists()\n {\n }",
"public function exists()\n {\n }",
"function check_requirements()\n\t{\n\t\t$sql_obj\t\t= New sql_query;\n\t\t$sql_obj->string\t= \"SELECT id FROM account_ap WHERE id='\". $this->id .\"' LIMIT 1\";\n\t\t$sql_obj->execute();\n\n\t\tif (!$sql_obj->num_rows())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested invoice (\". $this->id .\") does not exist - possibly the invoice has been deleted.\");\n\t\t\treturn 0;\n\t\t}\n\n\t\tunset($sql_obj);\n\n\n\t\treturn 1;\n\t}",
"function valid()\n {\n if (isset($this->aid))\n return true;\n else\n return false;\n }",
"public function existAuthItem()\n {\n if ($this->type === Item::TYPE_PERMISSION) {\n $authItem = Yii::$app->authManager->getPermission($this->name);\n } else {\n $authItem = Yii::$app->authManager->getRole($this->name);\n }\n if ($this->getIsNewRecord()) {\n if (!empty($authItem)) {\n $this->addError('name', \"This name has already been taken.\");\n }\n } else {\n if (!empty($authItem) && $authItem->name !== $this->item->name) {\n $this->addError('name', \"This name has already been taken.\");\n }\n }\n }",
"public function exists()\r\n {\r\n }",
"public function exists()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$this->getModel();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcatch(ECash_Application_NotFoundException $e)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function exists($persistenceIdentifier);",
"public function exists()\n {\n return false;\n }",
"public function checkIntegrity();",
"function exist() {\n\t\t\t$exist = $this->db->prepare(\"SELECT 1 FROM REPORT WHERE titleFileVideo = ? AND idArt = ?\");\n\t\t\t$exist->execute(array($this->titleFileVideo, $this->idArt));\n\t\t\treturn count($exist->fetchAll()) >= 1;\n\t\t}",
"function exists() {\r\n\t\t$sql_inicio \t= \" select * from \".$this->table.\" where \";\r\n\t\t$sql_fim \t\t= \" \".($this->get($this->pk) ? \" and \".$this->pk.\" <> \".$this->get($this->pk) : \"\").\" limit 1 \";\r\n\t\t\r\n\t\t$sql \t= \"con_id = \".$this->get(\"con_id\").\" and exa_id = \".$this->get(\"exa_id\").\" \";\r\n\t\tif (mysql_num_rows(Db::sql($sql_inicio.$sql.$sql_fim))){\r\n\t\t\t$this->propertySetError (\"con_id\", \"Já existe no banco de dados.\");\r\n\t\t\t$this->propertySetError (\"exa_id\", \"Já existe no banco de dados.\");\r\n\t\t}\r\n\t}",
"function IfExists($EquipmentId) {\r\n $conn = conn();\r\n $stmt = $conn->prepare(\"SELECT * FROM account WHERE AccountId = '$AccountId' ;\");\r\n $stmt->execute();\r\n $result = $stmt->fetchAll();\r\n if (($result)) {\r\n return 1;\r\n }\r\n return 0;\r\n $conn = NULL;\r\n }",
"public static function checkOwnerExisting()\n {\n global $mainframe;\n $db = JFactory::getDbo();\n $db->setQuery(\"Select count(id) from #__osrs_agents where agent_type <> '0' and published = '1'\");\n $count = $db->loadResult();\n if ($count > 0) {\n return true;\n } else {\n return false;\n }\n }",
"public function check_exists(){\n\t\tif(!empty($this->data['Leave']['leave_from']) && !empty($this->data['Leave']['leave_to'])){\n\t\t\t$from = $this->format_date_save($this->data['Leave']['leave_from']);\n\t\t\t$to = $this->format_date_save($this->data['Leave']['leave_to']);\n\t\t\t$count = $this->find('count', array('conditions' => array('or' => array('leave_from between ? and ?' => array($from, $to),\n\t\t\t'leave_to between ? and ?' => array($from, $to)), 'Leave.users_id' => CakeSession::read('USER.Login.id'), \n\t\t\t'Leave.is_deleted'=> 'N', 'Leave.is_approve !=' => 'R')));\n\t\t\tif($count > 0){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public function check_exists(){ \n\t\tif(!empty($this->data['HrPermission']['per_from']) && !empty($this->data['HrPermission']['per_to'])){\n\t\t\t$from = $this->format_time_save($this->data['HrPermission']['per_from']);\n\t\t\t$to = $this->format_time_save($this->data['HrPermission']['per_to']);\n\t\t\t$this->unBindModel(array('hasOne' => array('HrPerStatus')));\n\t\t\t$count = $this->find('count', array('conditions' => array('or' => array('per_from between ? and ?' => \n\t\t\tarray($from, $to),'per_to between ? and ?' => array($from, $to)), 'HrPermission.is_deleted' => 'N', 'is_approve !=' => 'R', 'HrPermission.app_users_id' => $this->data['HrPermission']['user_id'],\n\t\t\t'per_date' => $this->format_date_save($this->data['HrPermission']['per_date']))));\n\t\t\tif($count > 0){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public function iscoursesExisting ($id_course){\n $sqlQuery = \"SELECT count (*) as isExisting \";\n $sqlQuery .= \"FROM courses \";\n $sqlQuery .= \"WHERE id_course= $id_course\";\n $result = $this -> getDbManager() -> executeSelectQuery ( $sqlQuery );\n if ( $result [0][ \" isExisting \"] == 1) return ( true );\n else return ( false );\n }",
"public function eventExists()\n {\n return $this->getTalk()->getSpeaker()->exists();\n }",
"function Exists($courseId)\r\n\t{\r\n try {\r\n $title = $this->courseApiClient->getCourseTitleByCourseId($courseId);\r\n }\r\n catch(Exception $ex){\r\n $title = \"\";\r\n }\r\n return $title !== \"\";\r\n\t}",
"private function _checkExist()\n {\n if (!($validation = IO::required($this->data, ['videoLink']))['valid']) {\n throw new InvalidParameterException($validation['message']);\n }\n\n $resource = new Resource($this->data);\n\n $sql = \"SELECT COUNT(*) FROM `resource` WHERE `video_link` = :video_link\";\n\n $stmt = $this->pdo->prepare($sql);\n\n $stmt->execute(['video_link' => $resource->getVideoLink()]);\n\n return $stmt->fetchColumn() != 0;\n }",
"public function authorize()\n {\n// $assistant=DB::select('select * from course_ta where course_id=? and section=? and student_id=?',array(Input::get('courseId'),Input::get('sectionId'),Input::get('taId')));\n// $count=count($assistant);\n// if($count>0){\n// return false;\n// }\n return true;\n }"
] |
[
"0.65705013",
"0.61213356",
"0.60958827",
"0.6047936",
"0.6020934",
"0.58932436",
"0.5878053",
"0.57236475",
"0.57141525",
"0.57109326",
"0.5709613",
"0.56833225",
"0.5651049",
"0.5632896",
"0.56248343",
"0.55193293",
"0.55176777",
"0.5490289",
"0.5486137",
"0.5482836",
"0.5476727",
"0.54683775",
"0.54627866",
"0.5452503",
"0.5442292",
"0.53858644",
"0.53765446",
"0.53742445",
"0.53730744",
"0.5370362"
] |
0.75955063
|
0
|
Prepares data for column with type DATE
|
private function prepareDateType($data) {
$m = array();
if (preg_match('@(\d{4})[-./](\d{1,2})[-./](\d{1,2})@', $data, $m) > 0) {
# pattern: yyyy-mm-dd
$date = substr('00' . $m[2], -2) . '/' . substr('00' . $m[3], -2) . '/' . $m[1];
} else if (preg_match('@(\d{1,2})[./-](\d{1,2})[./-](\d{4})@', $data, $m) > 0) {
# pattern: mm-dd-yyyy
$date = substr('00' . $m[1], -2) . '/' . substr('00' . $m[2], -2) . '/' . $m[3];
} else if (preg_match('@^(\d{7,15})$@', $data, $m) > 0) {
# timestamp
$date = date('m/d/Y', $data);
} else {
$date = $data;
}
return $date;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function afterFind(){\n // Format dates based on the locale\n foreach($this->metadata->tableSchema->columns as $columnName => $column){\n if ($column->dbType == 'date'){\n $aux= CDateTimeParser::parse($this->$columnName,\"yyyy-MM-dd\");\n $this->$columnName = ($aux != null )?date('d/m/Y',$aux ):null;\n }elseif ($column->dbType == 'datetime'){\n $aux= CDateTimeParser::parse($this->$columnName,\"yyyy-MM-dd HH:mm:ss\");\n $this->$columnName = ($aux != null )?date('d/m/Y H:i:s',$aux ):null;\n }\n }\n }",
"public static function prepareDateForStmt($date) {\n\n if($date == \"\")\n {\n return null;\n }\n\n $preparedDate = DateTime::createFromFormat('d/m/Y', $date);\n return $preparedDate -> format('Y-m-d');\n\n\n\n }",
"public function getDataWithTypeDate() {}",
"protected function set_date_column( $column, $value ) {\n\t\tif ( is_a( $value, 'DateTime' ) ) {\n\t\t\t// convert to UTC time\n\t\t\t$utc_date = new DateTime();\n\t\t\t$utc_date->setTimestamp( $value->getTimestamp() );\n\t\t\t$this->set_prop( $column, $utc_date->format( 'Y-m-d H:i:s' ) );\n\t\t}\n\t\telseif ( $value ) {\n\t\t\t$this->set_prop( $column, ES_Clean::string( $value ) );\n\t\t}\n\t}",
"public function stdWrap_dateDataProvider() {}",
"public function column_date($post)\n {\n }",
"public function column_date($post)\n {\n }",
"protected function beforeValidate ()\n {\n //$this->tglrevisimodul = date ('Y-m-d', strtotime($this->tglrevisimodul));\n $format = new MyFormatter();\n //$this->tglrevisimodul = $format->formatDateTimeForDb($this->tglrevisimodul);\n foreach($this->metadata->tableSchema->columns as $columnName => $column){\n if ($column->dbType == 'date')\n {\n $this->$columnName = $format->formatDateTimeForDb($this->$columnName);\n }\n else if ($column->dbType == 'timestamp without time zone')\n {\n $this->$columnName = $format->formatDateTimeForDb($this->$columnName);\n } \n }\n\n return parent::beforeValidate ();\n }",
"protected function beforeValidate ()\n {\n //$this->tglrevisimodul = date ('Y-m-d', strtotime($this->tglrevisimodul));\n $format = new MyFormatter();\n //$this->tglrevisimodul = $format->formatDateTimeForDb($this->tglrevisimodul);\n foreach($this->metadata->tableSchema->columns as $columnName => $column){\n if ($column->dbType == 'date')\n {\n $this->$columnName = $format->formatDateTimeForDb($this->$columnName);\n }\n else if ( $column->dbType == 'timestamp without time zone')\n {\n $this->$columnName = $format->formatDateTimeForDb($this->$columnName);\n }\n }\n\n return parent::beforeValidate ();\n }",
"function oa_date_views_data_alter(&$data) {\n foreach ($data as $table => $data_table) {\n foreach ($data_table as $field => $data_field) {\n if (!empty($data_field['field']['handler']) && $data_field['field']['handler'] === 'views_handler_field_date') {\n $data[$table][$field]['field']['handler'] = 'oa_date_handler_field_date';\n }\n }\n }\n}",
"protected function _convert_date($date)\n {\n }",
"public function beforeSave() {\n foreach ($this->dateFields as $item) {\n $this->data[$this->name][$item] = $this->_date4Db($this->data[$this->name][$item]);\n }\n return parent::beforeSave();\n }",
"public static function convert_date_field() {\n\n\t\t// Create a new Phone field.\n\t\tself::$field = new GF_Field_Date();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add Phone specific properties.\n\t\tself::$field->dateFormat = 'dd/mm/yyyy';\n\n\t}",
"protected function _convertDates (&$model, $data=array(), $to='mysql') {\r\n\t\t\r\n\t\tif (empty($data)) {\r\n\t\t\treturn $data;\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($data as $key => $value) {\r\n\t\t\tforeach ($value as $model_alias => $fields) {\r\n\t\t\t\tforeach ($fields as $field => $field_value) {\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!empty($model->_schema[$field]['type']) && \r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t$model->_schema[$field]['type'] == 'date' || \r\n\t\t\t\t\t\t\t$model->_schema[$field]['type'] == 'datetime'\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\t$date_format = ($model->_schema[$field]['type'] == 'date') ? 'Y-m-d' : 'Y-m-d H:i:s';\r\n\t\t\t\t\t\t$data[$key][$model_alias][$field] = ($to == 'mysql') ? date($date_format, $field_value) : strtotime($field_value);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $data;\r\n\t\t\r\n\t}",
"function PrepDate(&$str,$blnNullable = true,$delim=\"/\") {\n if(\n $this->strDriverType == XAO_DRIVER_RDBMS_TYPE_ORACLE \n && $str == \"SYSDATE\"\n ) return;\n if(\n $this->strDriverType == XAO_DRIVER_RDBMS_TYPE_POSTGRES \n && $str == \"CURRENT_TIMESTAMP\"\n ) return;\n \n if(strpos($str,$delim) && !strpos($str,\":\")) {\n if(!preg_match(\"/(0[1-9]|[12][0-9]|3[01])[- \\/.](0[1-9]|1[012])[- \\/.](19|20)[0-9]{2}/\", $str)) {\n $this->XaoThrow(\n \"The supplied date (\".$str.\") is not recognised as a \" .\n \"valid date format. Try DD/MM/YYYY. The developer should \" .\n \"considder using the form validation framework.\",\n debug_backtrace()\n );\n return;\n }\n $arr = explode($delim,$str);\n $arr = array_reverse($arr);\n if(strlen($arr[0]) == 2) {\n if($arr[0] > 50) $arr[0] = \"19\".$arr[0];\n else $arr[0] = \"20\".$arr[0];\n }\n elseif(strlen($arr[0]) == 4) {\n // do nothing\n }\n elseif(strpos($str,\":\")) {\n $this->XaoThrow(\n \"The PrepDate() method does not handle time data.\",\n debug_backtrace()\n );\n return;\n }\n else {\n $this->XaoThrow(\n \"The supplied date (\".$str.\") is not recognised as a \" .\n \"valid date format. Try DD/MM/YYYY. The developer should \" .\n \"considder using the form validation framework.\",\n debug_backtrace()\n );\n return;\n }\n $str = \"'\".sprintf(\"%04d-%02d-%02d\", $arr[0], $arr[1], $arr[2])\n .\" 00:00:00\".\"'\";\n }\n // if(strlen(trim($str))) $str = \"'$str'\";\n elseif($str == \"\") {\n if(!$blnNullable) {\n $this->XaoThrow(\n \"XaoDb::PrepDate() Unhandled NOT NULL Exception. \" .\n \"See stack trace for details.\",\n debug_backtrace()\n );\n return;\n }\n $str = \"NULL\";\n }\n else {\n $this->XaoThrow(\n \"The supplied date (\".$str\n .\") is not recognised as a valid date format. Try DD/MM/YYYY\",\n debug_backtrace()\n );\n }\n }",
"public static function prepareDate($value)\n {\n // @TODO: Implement the formatter to handle DateTime objects and strtotime strings to convert to MM/DD/YYYY automatically\n return $value;\n }",
"function ConvertToSqlDate($date)\n {\n if($date != \"\")\n return $this->app->String->Convert($date,\"%3.%2.%1\",\"%1-%2-%3\");\n }",
"private function _setDate(){\n\t\tif($this->_year>=1970&&$this->_year<=2038){\n\t\t\t$this->_day = date('d', $this->_timestamp);\n\t\t\t$this->_month = date('m', $this->_timestamp);\n\t\t\t$this->_year = date('Y', $this->_timestamp);\n\t\t} else {\n\t\t\t$dateParts = self::_getDateParts($this->_timestamp, true);\n\t\t\t$this->_day = sprintf('%02s', $dateParts['mday']);\n\t\t\t$this->_month = sprintf('%02s', $dateParts['mon']);\n\t\t\t$this->_year = $dateParts['year'];\n\t\t}\n\t\t$this->_date = $this->_year.'-'.$this->_month.'-'.$this->_day;\n\t}",
"protected function typeDate(Fluent $column)\n {\n return 'date';\n }",
"function utilDatesLocaleVersDB($data)\n {\n foreach ($data as $key => $value) {\n if (is_array($value)) {\n /*\n * Traitement recursif\n */\n $data[$key] = $this->utilDatesDBVersLocale($value);\n } else {\n if (($this->colonnes[$key][\"type\"] == 2 || $this->colonnes[$key][\"type\"] == 3) && strlen($value) > 0) {\n /*\n * Formatage de la date\n */\n $data[$key] = $this->formatDateLocaleVersDB($value, $this->colonnes[$key][\"type\"]);\n }\n }\n }\n\n return $data;\n }",
"protected function prepareDates(array $data): array\n {\n return $this->formatDateFields(['start_date', 'due_date'], $data);\n }",
"private function _consolideDate(){\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}",
"public function getCreationDateColumnName() {}",
"public function setDateAttribute($input)\n {\n if ($input != null && $input != '') {\n $this->attributes['date'] = Carbon::createFromFormat(config('app.date_format'), $input)->format('Y-m-d');\n } else {\n $this->attributes['date'] = null;\n }\n }",
"public function setDateAttribute($input)\n {\n if ($input != null && $input != '') {\n $this->attributes['date'] = Carbon::createFromFormat(config('app.date_format'), $input)->format('Y-m-d');\n } else {\n $this->attributes['date'] = null;\n }\n }",
"public function testDateFieldValidation()\n {\n $field = $this->table->getField('dateone');\n\n $testDate = 'July 4, 2016';\n\n $fldObj = $field->getPHPValue($testDate);\n\n $this->assertInstanceOf('DateTime', $fldObj);\n $this->assertEquals('2016-07-04', $fldObj->format('Y-m-d'));\n\n $fieldVal = $field->getSqlBoundValue($testDate);\n $key = $fieldVal->getValueMarker();\n\n $this->assertEquals(1, $fieldVal->getBindCount());\n $this->assertEquals('2016-07-04', $fieldVal->getBoundValues()[$key]);\n }",
"public function setDate($value){\n return $this->setParameter('date', $value);\n }",
"protected function prepareTable($table){\n $date = Factory::getDate();\n\t if(empty($table->id)){\n\t $table->created = $date->toSql();\n\t }\n\t}",
"private function returnDateField($key)\n {\n if (!isset($this->data[$key])) {\n return null;\n }\n\n if ($this->data[$key] instanceof DateTime) {\n return $this->data[$key];\n }\n\n return new DateTime($this->data[$key]);\n }",
"function uiToDBdate() {\r\n\r\n\t\t$month = (int) substr($this->date, -10, 2);\r\n\t\t$day = (int) substr($this->date, -7, 2);\r\n\t\t$year = (int) substr($this->date, -4, 4);\r\n\r\n\t\t$formattedDate = $year . \"-\" . $month . \"-\" . $day;\r\n\r\n\t\t$this->date = $formattedDate;\r\n\t}"
] |
[
"0.63660705",
"0.62625784",
"0.626124",
"0.6187657",
"0.5978847",
"0.59683204",
"0.5963638",
"0.59415776",
"0.5897085",
"0.58704185",
"0.5756855",
"0.57401145",
"0.5730976",
"0.57089454",
"0.56980675",
"0.56942",
"0.56506515",
"0.5618355",
"0.56133187",
"0.55898607",
"0.55680025",
"0.55561924",
"0.55540824",
"0.55281466",
"0.55281466",
"0.55186707",
"0.5517012",
"0.55138254",
"0.548053",
"0.5473861"
] |
0.631233
|
1
|
Register the exception handler extends the Dingo one
|
protected function registerExceptionHandler()
{
$this->app->singleton('api.exception', function ($app) {
return new ApiExceptionsHandler($app['Illuminate\Contracts\Debug\ExceptionHandler'], config('api.errorFormat'), config('api.debug'));
});
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function registerExceptionHandler()\n {\n set_exception_handler(function (\\Exception $exception) {\n $this->exception = $exception;\n $code = $this->exception->getCode();\n $statusCode = $this->response->getStatusCode();\n\n if (!is_int($code) || $code < 400 || $code > 599) {\n $code = 500;\n }\n\n // overwrite with user defined\n if ((int)$statusCode >= 400) {\n $code = $statusCode;\n }\n\n $this->response->withStatus($code);\n $this->resolve('errorHandler');\n });\n\n return $this;\n }",
"public function registerExceptionHandler() {\n\t\tif (!$this->_request()->is('api')) {\n\t\t\treturn;\n\t\t}\n\n\t\tApp::uses('CrudExceptionRenderer', 'Crud.Error');\n\t\tConfigure::write('Exception.renderer', 'Crud.CrudExceptionRenderer');\n\t}",
"protected function registerExceptionHandlers()\n\t{\n\t\t$this['exception'] = function() { return new ExceptionHandler; };\n\n\t\t$this['kernel.error'] = function() { return new ErrorHandler; };\n\n\t\t$this['kernel.exception'] = function() { return new KernelHandler; };\n\t}",
"protected function _register_exception_handler()\n {\n if (!class_exists('\\prggmr\\signal\\integer\\Range', false)){\n require_once 'signal/integer/range.php';\n }\n if (null === $this->_exception_handle_signal) {\n $this->_engine_handle_signal = new \\prggmr\\signal\\integer\\Range(\n 0xE002, 0xE014\n );\n } else {\n if ($this->_search_complex($this->_engine_handle_signal)[0] === self::SEARCH_FOUND) {\n return true;\n }\n }\n $this->handle(function(){\n $args = func_get_args();\n $type = end($args);\n $message = null;\n if ($args[0] instanceof \\Exception) {\n $message = $args[0]->getMessage();\n } else {\n $message = engine_code($type);\n }\n throw new EngineException($message, $type, $args);\n }, $this->_engine_handle_signal, 0, null);\n }",
"protected function setExceptionHandler()\n {\n new ExceptionHandler();\n }",
"protected function registerExceptionHandlers()\n {\n // We register the framework exception handler...\n $this->container->bind(\n \\Lib\\Contracts\\Exceptions\\Handler::class,\n \\App\\Exceptions\\Handler::class\n );\n\n // As well as the Whoops library for handling exceptions.\n $whoops = new Whoops\\Run;\n $whoops->pushHandler(new Whoops\\Handler\\PrettyPageHandler);\n $whoops->register();\n }",
"public function registerExceptionHandler()\n\t{\n\t\tset_exception_handler(function($e){\n\t\t\treturn View::handleError($e->getMessage(), 500);\n\t\t});\n\t}",
"public static function setExceptionHandler(){\n //Set the Pokelio exception handler\n set_exception_handler('Pokelio_Exception::PokelioExceptionHandler');\n }",
"static function register() {\n\n set_error_handler(array('Sabre_PHP_Exception','handleError'));\n\n }",
"protected function getExceptionHandler()\n {\n return Handler::getInstance();\n }",
"public static function register()\n\t{\n\t\tset_exception_handler('\\\\OpenFlame\\\\Framework\\\\Exception\\\\EncryptedHandler::catcher');\n\t}",
"protected function registerErrorHandling()\n {\n error_reporting(E_ALL);\n set_error_handler(function ($level, $message, $file = '', $line = 0) {\n if (error_reporting() & $level) {\n throw new \\ErrorException($message, 403, $level, $file, $line);\n }\n });\n\n set_exception_handler(function ($e) {\n echo($e);\n });\n\n register_shutdown_function(function () {\n echo(error_get_last());\n });\n }",
"protected function registerExtensionConfigurationErrorHandler() {}",
"protected function registerErrorHandling()\n {\n error_reporting(-1);\n\n set_error_handler(function ($level, $message, $file = '', $line = 0) {\n if (error_reporting() & $level) {\n throw new ErrorException($message, 0, $level, $file, $line);\n }\n });\n\n set_exception_handler(function ($e) {\n $this->handleUncaughtException($e);\n });\n\n register_shutdown_function(function () {\n $this->handleShutdown();\n });\n }",
"function handler($ex) {\n echo \"In exception handler\\n\";\n}",
"public function startExceptionHandling()\n\t{\n\t\t// By registering the error handler with a level of -1, we state that we want\n\t\t// all PHP errors converted to ErrorExceptions and thrown, which provides\n\t\t// a quite strict development environment, but prevents unseen errors.\n\t\t$this['kernel.error']->register(-1);\n\n\t\t$me = $this;\n\n\t\treturn $this->setExceptionHandler(function($exception) use ($me)\n\t\t{\n\t\t\t$handlers = $me->getErrorHandlers();\n\n\t\t\t$response = $me['exception']->handle($exception, $handlers);\n\n\t\t\t// If one of the custom error handlers returned a response, we will send that\n\t\t\t// response back to the client after preparing it. This allows a specific\n\t\t\t// type of exceptions to handled by a Closure giving great flexibility.\n\t\t\tif ( ! is_null($response))\n\t\t\t{\n\t\t\t\t$response = $me->prepareResponse($response, $me['request']);\n\n\t\t\t\t$response->send();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$me['kernel.exception']->handle($exception);\n\t\t\t}\n\t\t});\n\t}",
"public static function register() {\n\t\tset_error_handler(array(static::class, 'handleError'));\n\t\tset_exception_handler(array(static::class, 'handleException'));\n\t}",
"protected function disableExceptionHandling()\n {\n $this->oldExceptionHandler = $this->app->make(ExceptionHandler::class);\n $this->app->instance(ExceptionHandler::class, new class extends Handler {\n public function __construct() {}\n public function report(\\Exception $e) {}\n public function render($request, \\Exception $e) {\n throw $e;\n }\n });\n }",
"public function register()\n {\n set_error_handler([$this, 'handleError']);\n set_exception_handler([$this, 'handleException']);\n }",
"protected function withoutExceptionHandling()\n {\n $this->app->instance(ExceptionHandler::class, new class extends Handler {\n public function __construct() {}\n public function report(Exception $e) {}\n public function render($request, Exception $e) {\n throw $e;\n }\n });\n }",
"protected function disableExceptionHandling()\n {\n $this->app->instance(ExceptionHandler::class, new class extends Handler {\n public function __construct() {}\n public function report(Exception $e) {}\n public function render($request, Exception $e) {\n throw $e;\n }\n });\n }",
"private static function initErrorHandler() {\n\t\t\tset_exception_handler('ErrorHandler::handleExceptions');\n\t\t\tset_error_handler('ErrorHandler::handleErrors');\n\t\t}",
"protected function registerHandler()\n {\n if (!in_array($this->app->environment(), config('nodes.bugsnag.notify_release_stages', []))) {\n return;\n }\n\n if (!config('nodes.bugsnag.rebind_handler', true)) {\n return;\n }\n\n $this->app->singleton('Illuminate\\Contracts\\Debug\\ExceptionHandler', function ($app) {\n return app(BugsnagHandler::class);\n });\n }",
"public function getExceptionHandler()\n {\n return $this->container->make('Nova\\Foundation\\Exceptions\\HandlerInterface');\n }",
"protected function initializeErrorHandling() {}",
"abstract protected function registerHandlers();",
"protected function customErrorHandler()\n {\n /**\n * @var ErrorHandler $errorHandler\n */\n $errorHandler = \\container()->get(ErrorHandler::class);\n $errorHandler->init();\n }",
"protected function register() {\n\t\tset_error_handler(array($this, 'handleException'));\n\t\tset_exception_handler(array($this, 'handleError'));\n\t\tregister_shutdown_function(array($this, 'handleShutdown'));\n\t}",
"function default_exception_handler($ex) {\n $backtrace = $ex->getTrace();\n $place = array('file'=>$ex->getFile(), 'line'=>$ex->getLine(), 'exception'=>get_class($ex));\n array_unshift($backtrace, $place);\n\n if ($ex instanceof moodle_exception) {\n _print_normal_error($ex->errorcode, $ex->module, $ex->a, $ex->link, $backtrace, $ex->debuginfo);\n } else {\n _print_normal_error('generalexceptionmessage', 'error', $ex->getMessage(), '', $backtrace);\n }\n}",
"function as_exception_handler($e){\n\t\t$msg = 'Error('.$e->getCode().') '. $e->getMessage().' in '. $e->getFile().':'. $e->getLine();\n\t\t$this->catch_error($msg, 'clickgs plugin crashed');\n\t}"
] |
[
"0.7171188",
"0.715382",
"0.70514596",
"0.69743645",
"0.6957299",
"0.69474554",
"0.6918303",
"0.6619551",
"0.6550916",
"0.6526674",
"0.64979887",
"0.6453283",
"0.6451897",
"0.63858783",
"0.63695115",
"0.63131",
"0.6291597",
"0.6254337",
"0.6232337",
"0.6225232",
"0.61498106",
"0.6147759",
"0.61448365",
"0.6067546",
"0.60608447",
"0.6051701",
"0.6040995",
"0.60225004",
"0.602109",
"0.60077226"
] |
0.7172824
|
0
|
Test all precedence values, they must all be integers.
|
public function testPrecedenceIsInteger()
{
foreach ( $this->operators as $operator )
{
self::assertThat( $operator->precedence, self::isType( 'integer' ), "Precendence for operator <" . get_class( $operator ) . "> must be an integer." );
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testPrecedenceIsInValidRange()\n {\n foreach ( $this->operators as $operator )\n {\n self::assertThat( $operator->precedence, self::greaterThan( 0 ), \"Precendence for operator <\" . get_class( $operator ) . \"> must be 1 or higher.\" );\n }\n }",
"public function precedence() {\n\t\treturn 1;\n\t}",
"public function testAllPrecedencesHasNoGaps()\n {\n $levels = array();\n $min = false;\n $max = false;\n foreach ( $this->operators as $operator )\n {\n $levels[$operator->precedence] = true;\n if ( $max === false ||\n $operator->precedence > $max )\n $max = $operator->precedence;\n if ( $min === false ||\n $operator->precedence < $min )\n $min = $operator->precedence;\n }\n ksort( $levels );\n self::assertThat( count( $levels ), self::greaterThan( 1 ), \"Level list did not even fill two items\" );\n for ( $i = $min; $i <= $max; ++$i )\n {\n // We skip level 2 which is the ?: operator which is not supported\n if ( $i == 2 )\n {\n continue;\n }\n $this->assertArrayHasKey( $i, $levels );\n }\n }",
"public static function getPrecedence(): int\n {\n return static::precedence;\n }",
"public static function validate_integer_pure_valid_values($val) {\n\t//--\n\tif((self::validate_numeric_pure_valid_values($val)) AND ($val >= PHP_INT_MIN) AND ($val <= PHP_INT_MAX)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t} //end if\n\t//--\n}",
"public function validIntegers() {}",
"public static function validate_numeric_integer_or_decimal_values($val) { // {{{SYNC-DETECT-PURE-NUMERIC-INT-OR-DECIMAL-VALUES}}}\n\t//--\n\t$val = (string) $val; // do not use TRIM as it may strip out null or weird characters that may inject security issues if not trimmed outside (MUST VALIDATE THE REAL STRING !!!)\n\t//--\n\t$regex_decimal = (string) self::regex_stringvalidation_expression('number-decimal', 'full');\n\t//--\n\tif(((string)$val != '') AND (is_numeric($val)) AND (preg_match((string)$regex_decimal, (string)$val))) { // detect numbers: 0..9 - .\n\t\treturn true; // VALID\n\t} else {\n\t\treturn false; // NOT VALID\n\t} //end if else\n\t//--\n}",
"public static function isInteger($op1)\n {\n if(!is_numeric($op1)) {\n return false;\n }\n if(is_float($op1)) {\n return false;\n }\n if(strpos($op1, '.') !== false) {\n return false;\n }\n return true;\n }",
"function df_is_int($v):bool {return is_numeric($v) && ($v == (int)$v);}",
"public function testEvaluateTooManyOperators()\n {\n $calc = new ReversePolishCalculator();\n $retval = $calc->evaluate(\"3 2 1 + * /\");\n $this->assertEquals(9, $retval);\n }",
"public function isInt()\n {\n return (is_numeric($this->_value) || is_int($this->_value));\n }",
"function isInteger($v) {\n return is_int($v) || (is_string($v) && preg_match('/^[0-9]+$/', $v));\n}",
"public function testEvaluateTooManyOperands()\n {\n $calc = new ReversePolishCalculator();\n $retval = $calc->evaluate(\"4 3 2 1 + *\");\n $this->assertEquals(false, $retval);\n }",
"function o_isInt($value) {\n\t\t\treturn Obj::singleton()->isInt($value);\n\t\t}",
"function isInteger ($value)\r\n{\r\n\treturn is_int ($value);\r\n}",
"function testForInt($data)\r\n\t{\r\n\t\tif (!filter_var($data, FILTER_VALIDATE_INT) === false)\r\n\t\t{\r\n\t\t\treturn intval($data);\r\n\t\t} \r\n\t\telse \r\n\t\t{\r\n\t\t\techo(\"Integer is not valid<br>\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"function my_is_int($var) {\n\treturn (is_numeric($var)&&(intval($var)==floatval($var)));\n}",
"function is_int_val( string $str )\n {\n return is_numeric( $str ) && \\intval( $str ) == $str;\n }",
"public function invalidIntegers() {}",
"private function getBinaryOperators()\n\t{\n\t\t// http://php.net/manual/en/language.operators.precedence.php\n\n\t\t// operator => array(precedence, associativity, [cast])\n\t\treturn array(\n\t\t\t'^' => array(60, self::RIGHT_ASSOC),\n\t\t\t'**' => array(60, self::RIGHT_ASSOC),\n\n\t\t\t'*' => array(40, self::LEFT_ASSOC),\n\t\t\t'/' => array(40, self::LEFT_ASSOC),\n\t\t\t'%' => array(40, self::LEFT_ASSOC),\n\n\t\t\t'+' => array(30, self::LEFT_ASSOC),\n\t\t\t'-' => array(30, self::LEFT_ASSOC),\n\t\t\t'.' => array(30, self::LEFT_ASSOC),\n\n\t\t\t'<' => array(20, self::NON_ASSOC),\n\t\t\t'<=' => array(20, self::NON_ASSOC),\n\t\t\t'>' => array(20, self::NON_ASSOC),\n\t\t\t'>=' => array(20, self::NON_ASSOC),\n\n\t\t\t'^=' => array(20, self::NON_ASSOC),\n\t\t\t'*=' => array(20, self::NON_ASSOC),\n\t\t\t'$=' => array(20, self::NON_ASSOC),\n\t\t\t'~' => array(20, self::NON_ASSOC),\n\n\t\t\t'<>' => array(10, self::NON_ASSOC),\n\t\t\t'==' => array(10, self::NON_ASSOC),\n\t\t\t'!=' => array(10, self::NON_ASSOC),\n\n\t\t\t'&&' => array(6, self::NON_ASSOC),\n\t\t\t'||' => array(5, self::NON_ASSOC),\n\t\t\t'AND' => array(4, self::NON_ASSOC),\n\t\t\t'XOR' => array(3, self::NON_ASSOC),\n\t\t\t'OR' => array(2, self::NON_ASSOC),\n\t\t);\n\t}",
"public function isInt()\n {\n return \\is_int($this->value);\n }",
"final protected function shouldHaveNumericalKeys ($value) {\n\t\t$arguments = func_get_args();\n\t\tforeach ($arguments as $argument) {\n\t\t\tif (!is_array($argument)) {\n\t\t\t\treturn $this->fail();\n\t\t\t} else {\n\n\t\t\t\t// Fail if incorrect key found\n\t\t\t\tforeach (array_keys($argument) as $key) {\n\t\t\t\t\tif (!is_int($key)) {\n\t\t\t\t\t\treturn $this->fail();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn $this->pass();\n\t}",
"function is_integer_val($value) {\n\treturn (!preg_match(\"/\\D/\", $value)) ? true : false;\n}",
"public function getPrecedence(): int\n {\n return $this->precedenceStack[\\count($this->precedenceStack) - 1] ?? -1;\n }",
"function validaOpcion($opcionSeleccionada) {\n if (is_numeric($opcionSeleccionada))\n return true;\n else\n return false;\n}",
"public function testInteger() {\n $this->assertEquals(1292932, Sanitize::integer('129sdja2932'));\n $this->assertEquals(-1275452, Sanitize::integer('-12,754.52'));\n $this->assertEquals(18840, Sanitize::integer('+18#840'));\n }",
"private function numeric($map)\n\t{\n\t\tif(is_array($map[\"values\"]))\n\t\t{\n\t\t\t$valid = true;\n\t\t\t$filter_vals = array_filter($map[\"values\"], \"is_numeric\");\n\t\t\t$valid = (count($filter_vals) == count($map[\"values\"]));\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$valid = is_numeric($map[\"values\"]);\n\t\t}\n\t\t\n\t\tif(!$valid)\n\t\t{\n\t\t\t$this->errors[$map[\"id\"]] = $map[\"error\"];\n\t\t}\n\t\treturn $valid;\n\t}",
"function isInteger ($s) {\r\n return is_integer($s);\r\n }",
"public static function validate_numeric_pure_valid_values($val) {\n\t//--\n\tif((self::validate_numeric_integer_or_decimal_values($val)) AND (!is_nan($val)) AND (!is_infinite($val)) AND ((string)$val == (string)(float)$val)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t} //end if\n\t//--\n}",
"public function testGetChoicesForValuesDealsWithNumericValues()\r\n {\r\n $values = array('0', '1');\r\n $this->assertSame(array(0, 1), $this->list->getChoicesForValues($values));\r\n }"
] |
[
"0.7075552",
"0.632323",
"0.5865539",
"0.5755287",
"0.57165086",
"0.5529373",
"0.54717535",
"0.53753513",
"0.5348181",
"0.5251282",
"0.52230185",
"0.5163125",
"0.5099674",
"0.508786",
"0.508619",
"0.5044223",
"0.4998249",
"0.49849802",
"0.49801737",
"0.49611604",
"0.49166933",
"0.4886325",
"0.48854348",
"0.48589012",
"0.4854569",
"0.48389348",
"0.48255417",
"0.4809502",
"0.4799123",
"0.47920462"
] |
0.7895533
|
0
|
Test all predence values for gaps, this means an operator is missing or a precedence has been wrongfully modified.
|
public function testAllPrecedencesHasNoGaps()
{
$levels = array();
$min = false;
$max = false;
foreach ( $this->operators as $operator )
{
$levels[$operator->precedence] = true;
if ( $max === false ||
$operator->precedence > $max )
$max = $operator->precedence;
if ( $min === false ||
$operator->precedence < $min )
$min = $operator->precedence;
}
ksort( $levels );
self::assertThat( count( $levels ), self::greaterThan( 1 ), "Level list did not even fill two items" );
for ( $i = $min; $i <= $max; ++$i )
{
// We skip level 2 which is the ?: operator which is not supported
if ( $i == 2 )
{
continue;
}
$this->assertArrayHasKey( $i, $levels );
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testPrecedenceIsInValidRange()\n {\n foreach ( $this->operators as $operator )\n {\n self::assertThat( $operator->precedence, self::greaterThan( 0 ), \"Precendence for operator <\" . get_class( $operator ) . \"> must be 1 or higher.\" );\n }\n }",
"function remove_gaps()\n\t{\n\t\t$ret = false;\n\t\twhile($this->remove_first_gap() !== false)\n\t\t{\n\t\t\t$ret = true;\n\t\t}\n\t\treturn $ret;\n\t}",
"public function testUnknownOperator(): void\n {\n $this->expectException(UnexpectedValueException::class);\n\n (new NumberCompare())->validate(1, '!', 1);\n }",
"function calculateMissed(){\n\t\treturn count(self::$groundTruth) - count(self::$rating);\n\t}",
"public function testEvaluateTooManyOperators()\n {\n $calc = new ReversePolishCalculator();\n $retval = $calc->evaluate(\"3 2 1 + * /\");\n $this->assertEquals(9, $retval);\n }",
"public function inequalityWithCustomOperatorsPrecedenceProvider(): array\n {\n // https://www.postgresql.org/message-id/12603.1424360914%40sss.pgh.pa.us\n return [\n [\n \"j->>'space' <= j->>'node'\",\n new OperatorExpression(\n '<=',\n new OperatorExpression(\n '->>',\n new ColumnReference(new Identifier('j')),\n new StringConstant('space')\n ),\n new OperatorExpression(\n '->>',\n new ColumnReference(new Identifier('j')),\n new StringConstant('node')\n )\n )\n ]\n ];\n }",
"public function skipUntil($operator) {}",
"public function precedence() {\n\t\treturn 1;\n\t}",
"private function postfixExprNeedsParentheses(\n /*UnaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (expr) == (a ? b : c)\n // (a ? b : c) op != a ? b : c op in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (x) == (a bop b)\n // (a bop b) op != a bop b op if\n if (UnaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if a bop (b) op == a bop b op\n return $this->postfixExprNeedsParentheses($op, $expr->getExpression2());\n }\n if ($expr instanceof UnaryOpExpression) {\n switch ($expr->getOperation()) {\n case UnaryOperators::PHP_ARRAY_APPEND_POINT_OP:\n case UnaryOperators::PHP_POST_DECREMENT_OP:\n case UnaryOperators::PHP_POST_INCREMENT_OP:\n // let (expr) == (a uop)\n // (a uop) op == a uop op in all cases\n return false;\n }\n // let (expr) == (uop a)\n // check if uop (a) op == uop a op\n return $this->postfixExprNeedsParentheses($op, $expr->getExpression());\n }\n return false;\n }",
"public function testPrecedenceIsInteger()\n {\n foreach ( $this->operators as $operator )\n {\n self::assertThat( $operator->precedence, self::isType( 'integer' ), \"Precendence for operator <\" . get_class( $operator ) . \"> must be an integer.\" );\n }\n }",
"function remove_first_gap()\n\t{\n\t\t$ret = $this->get_first_gap();\n\t\tif($ret !== false)\n\t\t{\n\t\t\tee()->db->query('UPDATE '.$this->tree_table.\n\t\t\t\t' SET lft = lft - '.$ret['size'].\n\t\t\t\t' WHERE lft > '. $ret['start']);\n\n\t\t\tee()->db->query('UPDATE '.$this->tree_table.\n\t\t\t\t' SET rgt = rgt - '.$ret['size'].\n\t\t\t\t' WHERE rgt > '. $ret['start']);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function gaps(): self\n {\n $sequence = new self();\n $interval = null;\n foreach ($this->sorted($this->sortByStartDate(...)) as $period) {\n if (null === $interval) {\n $interval = $period;\n continue;\n }\n\n if (!$interval->overlaps($period) && !$interval->meets($period)) {\n $sequence->push($interval->gap($period));\n }\n\n if (!$interval->contains($period)) {\n $interval = $period;\n }\n }\n\n return $sequence;\n }",
"private function leftExprNeedsParentheses(\n /*BinaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (x) == (a ? b : c)\n // (a ? b : c) op y != a ? b : c op y in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (x) == (a op1 b)\n // (a op1 b) op y != a op1 b op y if\n if (BinaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if a op1 (b) op y == a op1 b op y\n return $this->leftExprNeedsParentheses($op, $expr->getExpression2());\n }\n if ($expr instanceof UnaryOpExpression) {\n // let (x) == (!a)\n // (!a) op y != !a op y if\n if ($expr->getOperation() == UnaryOperators::PHP_NOT_OP &&\n BinaryOperators::hasPriority(\n $op, BinaryOperators::PHP_MULTIPLY)) {\n return true;\n }\n // check if !(a) op y == !a op y\n return $this->leftExprNeedsParentheses($op, $expr->getExpression());\n }\n return false;\n }",
"public function cases_higher()\n\t{\n\t\treturn array(\n\t\t\tarray(2, 7, false, true, 9, null, true),\n\t\t\tarray(2, 7, false, true, 2, 3, false),\n\t\t\tarray(2, 7, false, true, 1, 3, false),\n\t\t\tarray(2, 7, true, true, 9, null, true),\n\t\t\tarray(2, 7, true, true, 7, null, true),\n\t\t\tarray(2, 7, true, true, 6, 7, false),\n\t\t\tarray(2, 7, true, true, 3, 4, false),\n\t\t\tarray(2, 7, true, true, 2, 3, false),\n\t\t\tarray(2, 7, true, true, 1, 2, false),\n\t\t\tarray(2, 7, true, true, 0, 2, false),\n\t\t\tarray(2, 7, false, false, 9, null, true),\n\t\t\tarray(2, 7, false, false, 7, null, true),\n\t\t\tarray(2, 7, false, false, 6, null, true),\n\t\t\tarray(2, 7, false, false, 5, 6, false),\n\t\t\tarray(2, 7, false, false, 3, 4, false),\n\t\t\tarray(2, 7, false, false, 2, 3, false),\n\t\t\tarray(2, 7, false, false, 1, 3, false),\n\t\t\tarray(2, null, true, null, 10, null, true),\n\t\t\tarray(2, null, true, null, 9, null, true),\n\t\t\tarray(2, null, true, null, 8, 9, false),\n\t\t\tarray(2, null, true, null, 2, 3, false),\n\t\t\tarray(2, null, true, null, 1, 2, false),\n\t\t\tarray(2, null, false, null, 2, 3, false),\n\t\t\tarray(2, null, false, null, 1, 3, false),\n\t\t\tarray(9, -1, true, false, 0, null, true),\n\t\t\tarray(9, -1, true, false, 6, null, true),\n\t\t);\n\t}",
"public function testMixed()\n {\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [];\n $after = [\n new TestModel(-11), new TestModel(-10),\n new TestModel(-9), new TestModel(-8),\n new TestModel(-7), new TestModel(-6),\n new TestModel(-5), new TestModel(-4),\n new TestModel(-3), new TestModel(-2),\n new TestModel(-1), new TestModel(0),\n ];\n\n $this->assertEquals(-11, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertEquals(-10, $after[0]->priority);\n $this->assertEquals(-8, $after[1]->priority);\n $this->assertEquals(-7, $after[2]->priority);\n $this->assertEquals(-6, $after[3]->priority);\n $this->assertEquals(-5, $after[4]->priority);\n $this->assertEquals(-4, $after[5]->priority);\n $this->assertEquals(-3, $after[6]->priority);\n $this->assertEquals(-2, $after[7]->priority);\n $this->assertEquals(-1, $after[8]->priority);\n $this->assertEquals(0, $after[9]->priority);\n $this->assertEquals(2, $after[10]->priority);\n $this->assertEquals(5, $after[11]->priority);\n $this->assertTrue($after[0]->saved);\n $this->assertTrue($after[1]->saved);\n $this->assertTrue($after[2]->saved);\n $this->assertTrue($after[3]->saved);\n $this->assertTrue($after[4]->saved);\n $this->assertTrue($after[5]->saved);\n $this->assertTrue($after[6]->saved);\n $this->assertTrue($after[7]->saved);\n $this->assertTrue($after[8]->saved);\n $this->assertTrue($after[9]->saved);\n $this->assertTrue($after[10]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [];\n $after = [\n new TestModel(-11), new TestModel(-9),\n new TestModel(-8), new TestModel(-7),\n new TestModel(-6), new TestModel(-5),\n new TestModel(-4), new TestModel(-3),\n new TestModel(-2), new TestModel(-1),\n new TestModel(0), new TestModel(1),\n ];\n\n $this->assertEquals(-11, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertEquals(-10, $after[0]->priority);\n $this->assertEquals(-9, $after[1]->priority);\n $this->assertEquals(-8, $after[2]->priority);\n $this->assertEquals(-7, $after[3]->priority);\n $this->assertEquals(-6, $after[4]->priority);\n $this->assertEquals(-5, $after[5]->priority);\n $this->assertEquals(-4, $after[6]->priority);\n $this->assertEquals(-3, $after[7]->priority);\n $this->assertEquals(-2, $after[8]->priority);\n $this->assertEquals(-1, $after[9]->priority);\n $this->assertEquals(0, $after[10]->priority);\n $this->assertEquals(1, $after[11]->priority);\n $this->assertTrue($after[0]->saved);\n $this->assertFalse($after[1]->saved);\n $this->assertFalse($after[2]->saved);\n $this->assertFalse($after[3]->saved);\n $this->assertFalse($after[4]->saved);\n $this->assertFalse($after[5]->saved);\n $this->assertFalse($after[6]->saved);\n $this->assertFalse($after[7]->saved);\n $this->assertFalse($after[8]->saved);\n $this->assertFalse($after[9]->saved);\n $this->assertFalse($after[10]->saved);\n }",
"public function reagregateRequired()\r\n {\r\n $intervals = array();\r\n if (($from = $this->_from) && ($to = $this->_to)) {\r\n $exists = array();\r\n if ($this->getSize()) {\r\n foreach ($this as $aPeriod) {\r\n $exists[] = array('to' => $aPeriod->getTo(),\r\n 'from' => $aPeriod->getFrom(),\r\n );\r\n }\r\n $exists = $this->_cutLimitations($exists, $from, $to);\r\n $intervals = $this->_getBetweenIntervals($exists, $from, $to);\r\n }\r\n }\r\n return $intervals;\r\n }",
"public function testEmpty()\n {\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [];\n $after = [];\n\n $this->assertEquals(0, getPriority($before, $after, $priorityMin, $priorityMax));\n }",
"private function exprNeedsParentheses(\n /*UnaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n switch ($op) {\n case UnaryOperators::PHP_ARRAY_APPEND_POINT_OP:\n case UnaryOperators::PHP_POST_DECREMENT_OP:\n case UnaryOperators::PHP_POST_INCREMENT_OP:\n return $this->postfixExprNeedsParentheses($op, $expr);\n }\n return $this->prefixExprNeedsParentheses($op, $expr);\n }",
"public function testEvaluateTooManyOperands()\n {\n $calc = new ReversePolishCalculator();\n $retval = $calc->evaluate(\"4 3 2 1 + *\");\n $this->assertEquals(false, $retval);\n }",
"public function testWithOneElement()\n {\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(0)];\n $after = [];\n\n $this->assertEquals(5, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($before[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [];\n $after = [new TestModel(0)];\n\n $this->assertEquals(-6, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($after[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(-10)];\n $after = [];\n\n $this->assertEquals(0, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($before[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [];\n $after = [new TestModel(-5)];\n\n $this->assertEquals(-8, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($after[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(9)];\n $after = [];\n\n $this->assertEquals(10, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($before[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [];\n $after = [new TestModel(-10)];\n\n $this->assertEquals(-11, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($after[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(-5)];\n $after = [];\n\n $this->assertEquals(3, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($before[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [];\n $after = [new TestModel(-11)];\n\n $this->assertEquals(-11, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertEquals(0, $after[0]->priority);\n $this->assertTrue($after[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(10)];\n $after = [];\n\n $this->assertEquals(10, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertEquals(0, $before[0]->priority);\n $this->assertTrue($before[0]->saved);\n }",
"function find_gaps()\n\t{\n\t\t// Get all lfts and rgts and sort them in a list\n\t\tee()->db->select('lft, rgt');\n\t\tee()->db->order_by('lft','asc');\n\t\t$table = ee()->db->get( $this->tree_table );\n\n\t\t$nums = array();\n\n\t\tforeach($table->result() as $row)\n\t\t{\n\t\t\t$nums[] = $row->{'lft'};\n\t\t\t$nums[] = $row->{'rgt'};\n\t\t}\n\t\t\n\t\tsort($nums);\n\t\t\n\t\t// Init vars for looping\n\t\t$old = array();\n\t\t$current = 1;\n\t\t$foundgap = 0;\n\t\t$gaps = array();\n\t\t$current = 1;\n\t\t$i = 0;\n\t\t$max = max($nums);\n\t\twhile($max >= $current)\n\t\t{\n\t\t\t$val = $nums[$i];\n\t\t\tif($val == $current)\n\t\t\t{\n\t\t\t\t$old[] = $val;\n\t\t\t\t$foundgap = 0;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// have gap or duplicate\n\t\t\t\tif($val > $current)\n\t\t\t\t{\n\t\t\t\t\tif(!$foundgap)$gaps[] = array('start'=>$current,'size'=>1);\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$gaps[count($gaps) - 1]['size']++;\n\t\t\t\t\t}\n\t\t\t\t\t$foundgap = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$current++;\n\t\t}\n\t\treturn count($gaps) > 0 ? $gaps : false;\n\t}",
"protected function invalidOperatorAndValue(?string $operator, $value): bool\n\t{\n\t\treturn is_null($value) && in_array($operator, self::OPERATORS) && !in_array($operator, ['=', '!=', '<>']);\n\t}",
"function get_first_gap()\n\t{\n\t\t$ret = $this->find_gaps();\n\t\treturn $ret === false ? false : $ret[0];\n\t}",
"private function prefixExprNeedsParentheses(\n /*UnaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (expr) == (a ? b : c)\n // op (a ? b : c) != op a ? b : c in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (expr) == (a bop b)\n // op (a bop b) != op a bop b if\n if (UnaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if op (a) bop b == op a bop b\n return $this->prefixExprNeedsParentheses($op, $expr->getExpression1());\n }\n if ($expr instanceof UnaryOpExpression) {\n switch ($expr->getOperation()) {\n case UnaryOperators::PHP_ARRAY_APPEND_POINT_OP:\n case UnaryOperators::PHP_POST_DECREMENT_OP:\n case UnaryOperators::PHP_POST_INCREMENT_OP:\n // let (expr) == (a uop)\n // op (a uop) op != op a uop if\n return $op == UnaryOperators::PHP_CLONE_OP;\n }\n // let (expr) == (uop a)\n // op (uop a) == op uop a in all cases\n return false;\n }\n return false;\n }",
"public function testWithTwoElements()\n {\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(0), new TestModel(9)];\n $after = [];\n\n $this->assertEquals(10, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($before[0]->saved);\n $this->assertFalse($before[1]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(-3)];\n $after = [new TestModel(0)];\n\n $this->assertEquals(-1, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($before[0]->saved);\n $this->assertFalse($after[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(-5)];\n $after = [new TestModel(0)];\n\n $this->assertEquals(-2, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($before[0]->saved);\n $this->assertFalse($after[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(-10)];\n $after = [new TestModel(10)];\n\n $this->assertEquals(0, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($before[0]->saved);\n $this->assertFalse($after[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(-11)];\n $after = [new TestModel(-5)];\n\n $this->assertEquals(-8, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertFalse($before[0]->saved);\n $this->assertFalse($after[0]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [];\n $after = [new TestModel(-11), new TestModel(-10)];\n\n $this->assertEquals(-11, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertEquals(-6, $after[0]->priority);\n $this->assertEquals(0, $after[1]->priority);\n $this->assertTrue($after[0]->saved);\n $this->assertTrue($after[1]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(9), new TestModel(10)];\n $after = [];\n\n $this->assertEquals(10, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertEquals(-1, $before[0]->priority);\n $this->assertEquals(5, $before[1]->priority);\n $this->assertTrue($before[0]->saved);\n $this->assertTrue($before[1]->saved);\n\n $priorityMin = -11;\n $priorityMax = 10;\n $before = [new TestModel(9)];\n $after = [new TestModel(10)];\n\n $this->assertEquals(9, getPriority($before, $after, $priorityMin, $priorityMax));\n $this->assertEquals(-1, $before[0]->priority);\n $this->assertTrue($before[0]->saved);\n $this->assertFalse($after[0]->saved);\n }",
"private function isValidUnaryOperator($value)\n\t{\n\t\treturn array_key_exists($value, $this->unary_operators);\n\t}",
"function setNoWin($col, $precedence){\n $this->setRecord(1, $col, $precedence);\n }",
"public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}",
"public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}",
"function breakingRecords($score) {\n \n//the counter for broken records\n $posCount = 0;\n $negCount = 0;\n\t\n//Initialise the first record \n $posRec = $score[0];\n $negRec = $score[0];\n \n for ($i = 0; $i < sizeof($score); $i++) {\n\n if ($score[$i] > $posRec) {\n $posCount++;\n $posRec = $score[$i];\n \n } elseif ($score[$i] < $negRec) {\n $negCount++;\n $negRec = $score[$i];\n }\n } echo $posCount . \" \" . $negCount;\n}"
] |
[
"0.6379637",
"0.56336284",
"0.51174766",
"0.5007275",
"0.49857444",
"0.49801564",
"0.49569586",
"0.49240762",
"0.4922912",
"0.48888075",
"0.48658195",
"0.4832642",
"0.4772272",
"0.47330707",
"0.47065735",
"0.4695936",
"0.4689286",
"0.46803674",
"0.45767927",
"0.4572918",
"0.45598495",
"0.45012328",
"0.44986746",
"0.4450999",
"0.4436133",
"0.4425997",
"0.44237283",
"0.44221482",
"0.44211194",
"0.4411903"
] |
0.71597886
|
0
|
Renders a single resource to a serializable array
|
public function renderOne($resource)
{
$transformer = new $this->transformerClass;
$item = new Item($resource, $transformer);
return $this->manager->createData($item)->toArray();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function cGetAction()\n {\n $resources = $this->resource->getModel()::find();\n\n return $this->renderSerialized($resources);\n }",
"protected function renderArray() {}",
"public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"protected abstract function renderOne(array $data);",
"public function __toString()\n {\n if (is_object($this->resource) and method_exists($this->resource, '__toString')) {\n\n return $this->resource->__toString();\n }\n\n return json_encode($this->resource);\n }",
"public function render()\n {\n return $this->toJson();\n }",
"public function render(): void\n {\n $this->prepare_items();\n $this->handleFormAction();\n $this->loadAssets();\n\n $action = $_REQUEST['action'] ?? null;\n $primaryKey = $this->model->getPrimaryColumn();\n $resourceId = $_REQUEST[$this->singular]\n ?? $this->model->{$primaryKey}\n ?? null;\n\n echo $action && in_array($action, ['edit', 'create'])\n ? $this->getFormView($resourceId)\n : $this->getDefaultView();\n\n do_action('print_resource_page_assets');\n }",
"public function renderData();",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}"
] |
[
"0.64948726",
"0.64408505",
"0.6003251",
"0.5975949",
"0.5896915",
"0.58702433",
"0.5840932",
"0.58246005",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417",
"0.5748417"
] |
0.669011
|
0
|
Replaces the .sticky class for sticky posts with the .wpsticky class instead
|
function start_replace_sticky_class( array $classes ) {
if ( in_array( 'sticky', $classes, true ) ) {
$classes = array_diff( $classes, array( 'sticky' ) );
$classes[] = 'wp-sticky';
}
return $classes;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function remove_sticky_class( $classes ){\n\tif( in_array( 'sticky', $classes ) ){\n\t\t$classes = array_diff( $classes, array( \"sticky\" ) );\n\t\t$classes[] = 'wp-sticky';\n\t}\n\t\n\treturn $classes;\n}",
"function flexfour_remove_sticky_class($classes) {\n$classes = array_diff($classes, array(\"sticky\"));\nreturn $classes;\n}",
"function sticky_class($post_id = \\null)\n {\n }",
"public function post_class_filter( $classes = array() ) {\n\n\t\tif( !empty($classes) ) {\n\n\t\t\t// Change 'sticky' class to 'sticky-post', avoid conflict with .sticky used by zurb topbar\n\t\t\t// to make nav bars stick to the top of the page\n\t\t\tforeach( $classes as $key => $class ) {\n\t\t\t\tif( $class === 'sticky' ) {\n\t\t\t\t\t$classes[$key] = 'sticky-post';\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn $classes;\n\t}",
"function wpb_latest_sticky() { \n\n/* Get all sticky posts */\n$sticky = get_option( 'sticky_posts' );\n\n/* Sort the stickies with the newest ones at the top */\nrsort( $sticky );\n\n/* Get the 5 newest stickies (change 5 for a different number) */\n$sticky = array_slice( $sticky, 0, 5 );\n\n/* Query sticky posts */\n$the_query = new WP_Query( array( 'post__in' => $sticky, 'ignore_sticky_posts' => 2 ) );\n// The Loop\nif ( $the_query->have_posts() ) {\n\t$return = '<ul>';\n\twhile ( $the_query->have_posts() ) {\n\t\t$the_query->the_post();\n\t\t$return .= '<li><a href=\"' .get_permalink(). '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</a><br />' . get_the_excerpt(). '</li>';\n\t\t\n\t}\n\t$return .= '</ul>';\n\t\n} else {\n\t// no posts found\n}\n/* Restore original Post Data */\nwp_reset_postdata();\n\nreturn $return; \n\n}",
"function thememove_body_classes( $classes ) {\n\t// Adds a class of group-blog to blogs with more than 1 published author.\n\tif ( is_multi_author() ) {\n\t\t$classes[] = 'group-blog';\n\t}\n\n\tglobal $thememove_header_preset;\n\tif ( $thememove_header_preset == 'default' || $thememove_header_preset == '' ) {\n\t\t$classes[] = get_theme_mod( 'header_preset', header_preset );\n\t} elseif ( $thememove_header_preset != 'default' ) {\n\t\t$classes[] = $thememove_header_preset;\n\t} else {\n\t\t$classes[] = get_theme_mod( 'header_preset', header_preset );\n\t};\n\n\tif ( get_theme_mod( 'box_mode_enable' ) ) {\n\t\t$classes[] = 'boxed';\n\t}\n\n\tglobal $thememove_uncover_enable, $wc_thememove_uncover_enable;\n\tif ( ( get_theme_mod( 'footer_uncovering_enable', footer_uncovering_enable ) || $thememove_uncover_enable == 'enable' || $wc_thememove_uncover_enable == 'enable' ) && $thememove_uncover_enable != 'disable' && $wc_thememove_uncover_enable != 'disable' ) {\n\t\t$classes[] = 'uncover';\n\t}\n\n\tglobal $thememove_disable_title;\n\tif ( $thememove_disable_title == 'on' ) {\n\t\t$classes[] = 'disable-title';\n\t}\n\n\tglobal $thememove_bread_crumb_enable;\n\tif ( $thememove_bread_crumb_enable == 'disable' ) {\n\t\t$classes[] = 'disable-breadcrumb';\n\t}\n\n\tif ( get_post_meta( get_the_ID(), \"thememove_contact_address\", true ) && is_page_template() ) {\n\t\t$classes[] = 'map-enable';\n\t}\n\n\tglobal $thememove_sticky_header, $wc_thememove_sticky_header;\n\tif ( ( get_theme_mod( 'header_sticky_enable', header_sticky_enable ) || $thememove_sticky_header == 'enable' || $wc_thememove_sticky_header == 'enable' ) && $thememove_sticky_header != 'disable' && $wc_thememove_sticky_header != 'disable' ) {\n\t\t$classes[] = 'header-sticky';\n\t}\n\n\tglobal $thememove_header_top, $wc_thememove_header_top;\n\tif ( ( get_theme_mod( 'header_top_enable', header_top_enable ) || $thememove_header_top == 'enable' || $wc_thememove_header_top == 'enable' ) && $thememove_header_top != 'disable' && $wc_thememove_header_top != 'disable' ) {\n\t\t$classes[] = 'top-area-enable';\n\t}\n\n\tglobal $thememove_enable_page_layout_private, $thememove_page_layout_private;\n\tif ( get_theme_mod( 'site_layout', site_layout ) == 'full-width' || $thememove_page_layout_private == 'full-width' ) {\n\t\t$classes[] = 'full-width';\n\t} elseif ( get_theme_mod( 'site_layout', site_layout ) == 'content-sidebar' || $thememove_page_layout_private == 'content-sidebar' ) {\n\t\t$classes[] = 'content-sidebar';\n\t} elseif ( get_theme_mod( 'site_layout', site_layout ) == 'sidebar-content' || $thememove_page_layout_private == 'sidebar-content' ) {\n\t\t$classes[] = 'sidebar-content';\n\t}\n\n\tglobal $thememove_custom_class;\n\tif ( $thememove_custom_class ) {\n\t\t$classes[] = $thememove_custom_class;\n\t}\n\n\t$classes[] = 'scheme';\n\n\tif ( defined( 'TM_CORE_VERSION' ) ) {\n\t\t$classes[] = 'core_' . str_replace( \".\", \"\", TM_CORE_VERSION );\n\t}\n\n\treturn $classes;\n}",
"function onlyStickyPosts()\r\n{\r\n\t$sticky = get_option('sticky_posts');\r\n\t// check if there are any\r\n\tif (!empty($sticky)) {\r\n\t\t// optional: sort the newest IDs first\r\n\t\trsort($sticky);\r\n\t\t// override the query\r\n\t\t$args = array(\r\n\t\t\t'post__in' => $sticky\r\n\t\t);\r\n\t\tquery_posts($args);\r\n\t\t// the loop\r\n\t\twhile (have_posts()) {\r\n\t\t\tthe_post();\r\n\t\t\t// your code\r\n\t\t\tget_template_part('article');\r\n\t\t}\r\n\t}\r\n\twp_reset_query();\r\n}",
"function thinkup_input_sticky() {\n\tprintf( '<span class=\"sticky\"><a href=\"%1$s\" title=\"%2$s\">' . esc_html__( 'Sticky', 'ESTSB' ) . '</a></span>',\n\t\tesc_url( get_permalink() ),\n\t\tesc_attr( get_the_title() )\n\t);\n}",
"function newsroom_elated_get_sticky_main_menu($additional_class = 'eltd-default-nav') {\n newsroom_elated_get_module_template_part('templates/parts/sticky-navigation', 'header', '', array('additional_class' => $additional_class));\n }",
"function farmhouse_post_class( $classes ) {\n global $wp_query;\n\n $childthemesettings = genesis_get_config( 'child-theme-settings' )[ GENESIS_SETTINGS_FIELD ];\n\n if ( is_front_page() || is_singular() ) {\n return $classes;\n }\n\n if ( class_exists( 'woocommerce' ) ) {\n\n $shop = get_option( 'woocommerce_shop_page_id' );\n\n if ( is_post_type_archive( 'product' ) || is_product_category() || is_page( $shop ) ) {\n return $classes;\n }\n }\n\n $grid = get_theme_mod( 'farmhouse_archive_grid', $childthemesettings['content_archive_grid'] );\n\n $class = farmhouse_column_class( $grid );\n\n $classes[] = $class;\n\n if ( 0 === $wp_query->current_post % $grid ) {\n $classes[] = 'first';\n }\n\n return $classes;\n}",
"function newsroom_elated_sticky_header_styles() {\n\n if(newsroom_elated_options()->getOptionValue('sticky_header_background_color') !== '') {\n\n $sticky_header_background_color = newsroom_elated_options()->getOptionValue('sticky_header_background_color');\n $sticky_header_background_color_transparency = 1;\n\n if(newsroom_elated_options()->getOptionValue('sticky_header_transparency') !== '') {\n $sticky_header_background_color_transparency = newsroom_elated_options()->getOptionValue('sticky_header_transparency');\n }\n\n echo newsroom_elated_dynamic_css('.eltd-page-header .eltd-sticky-header .eltd-sticky-holder', array('background-color' => newsroom_elated_rgba_color($sticky_header_background_color, $sticky_header_background_color_transparency)));\n }\n\n if(newsroom_elated_options()->getOptionValue('sticky_header_height') !== '') {\n $sticky_header_height = newsroom_elated_filter_px(newsroom_elated_options()->getOptionValue('sticky_header_height'));\n $max_height = intval($sticky_header_height * 0.9).'px';\n\n echo newsroom_elated_dynamic_css('.eltd-page-header .eltd-sticky-header', array('height' => $sticky_header_height.'px'));\n echo newsroom_elated_dynamic_css('.eltd-page-header .eltd-sticky-header .eltd-sticky-holder .eltd-logo-wrapper a', array('max-height' => $max_height));\n }\n\n $sticky_menu_item_styles = array();\n if(newsroom_elated_options()->getOptionValue('sticky_color') !== '') {\n $sticky_menu_item_styles['color'] = newsroom_elated_options()->getOptionValue('sticky_color');\n }\n if(newsroom_elated_options()->getOptionValue('sticky_google_fonts') !== '-1') {\n $sticky_menu_item_styles['font-family'] = newsroom_elated_get_formatted_font_family(newsroom_elated_options()->getOptionValue('sticky_google_fonts'));\n }\n if(newsroom_elated_options()->getOptionValue('sticky_fontsize') !== '') {\n $sticky_menu_item_styles['font-size'] = newsroom_elated_options()->getOptionValue('sticky_fontsize').'px';\n }\n if(newsroom_elated_options()->getOptionValue('sticky_lineheight') !== '') {\n $sticky_menu_item_styles['line-height'] = newsroom_elated_options()->getOptionValue('sticky_lineheight').'px';\n }\n if(newsroom_elated_options()->getOptionValue('sticky_texttransform') !== '') {\n $sticky_menu_item_styles['text-transform'] = newsroom_elated_options()->getOptionValue('sticky_texttransform');\n }\n if(newsroom_elated_options()->getOptionValue('sticky_fontstyle') !== '') {\n $sticky_menu_item_styles['font-style'] = newsroom_elated_options()->getOptionValue('sticky_fontstyle');\n }\n if(newsroom_elated_options()->getOptionValue('sticky_fontweight') !== '') {\n $sticky_menu_item_styles['font-weight'] = newsroom_elated_options()->getOptionValue('sticky_fontweight');\n }\n if(newsroom_elated_options()->getOptionValue('sticky_letterspacing') !== '') {\n $sticky_menu_item_styles['letter-spacing'] = newsroom_elated_options()->getOptionValue('sticky_letterspacing').'px';\n }\n\n $sticky_menu_item_selector = array(\n '.eltd-page-header .eltd-sticky-header .eltd-main-menu.eltd-sticky-nav > ul > li > a'\n );\n\n echo newsroom_elated_dynamic_css($sticky_menu_item_selector, $sticky_menu_item_styles);\n\n $sticky_menu_item_hover_styles = array();\n if(newsroom_elated_options()->getOptionValue('sticky_hovercolor') !== '') {\n $sticky_menu_item_hover_styles['color'] = newsroom_elated_options()->getOptionValue('sticky_hovercolor');\n }\n\n $sticky_menu_item_hover_selector = array(\n '.eltd-page-header .eltd-sticky-header .eltd-main-menu.eltd-sticky-nav > ul > li:hover > a',\n '.eltd-page-header .eltd-sticky-header .eltd-main-menu.eltd-sticky-nav > ul > li.eltd-active-item:hover > a'\n );\n\n echo newsroom_elated_dynamic_css($sticky_menu_item_hover_selector, $sticky_menu_item_hover_styles);\n }",
"public function homepage_ignore_sticky( $query ) {\n\t\t\tif ( $query->is_front_page() && $query->is_main_query() ) {\n\t\t\t\t$query->set( 'ignore_sticky_posts', 1 );\n\t\t\t}\n\t\t}",
"function flux_add_post_class( $wp_classes = array(), $class = '', $post_id = 0 ) {\n\n\t// The special flux body classes\n\t$flux_classes = array();\n\n\t// Add special flux classes\n\t$flux_classes[] = 'flux';\n\t$flux_classes[] = 'flux-timestamp-' . get_the_time( 'U', $post_id );\n\n\t// Merge WP classes with Flux classes and remove duplicates\n\t$classes = array_unique( array_merge( (array) $flux_classes, (array) $wp_classes ) );\n\n\treturn apply_filters( 'flux_add_post_class', $classes, $flux_classes, $wp_classes, $class, $post_id );\n}",
"function twentyfourteen_body_classes( $classes ) {\n\tif ( is_multi_author() ) {\n\t\t$classes[] = 'group-blog';\n\t}\n\n\tif ( get_header_image() ) {\n\t\t$classes[] = 'header-image';\n\t} elseif ( ! in_array( $GLOBALS['pagenow'], array( 'wp-activate.php', 'wp-signup.php' ) ) ) {\n\t\t$classes[] = 'masthead-fixed';\n\t}\n\n\tif ( is_archive() || is_search() || is_home() ) {\n\t\t$classes[] = 'list-view';\n\t}\n\n\tif ( ( ! is_active_sidebar( 'sidebar-2' ) )\n\t\t|| is_page_template( 'page-templates/full-width.php' )\n\t\t|| is_page_template( 'page-templates/contributors.php' )\n\t\t|| is_attachment() ) {\n\t\t$classes[] = 'full-width';\n\t}\n\n\tif ( is_active_sidebar( 'sidebar-footer-1' ) && is_active_sidebar( 'sidebar-footer-2' ) && is_active_sidebar( 'sidebar-footer-3' ) && is_active_sidebar( 'sidebar-footer-4' ) ) {\n\t\t$classes[] = 'footer-widgets';\n\t}\n\n\tif ( is_singular() && ! is_front_page() ) {\n\t\t$classes[] = 'singular';\n\t}\n\tif ( is_single() ) {\n\t\t$classes[] = 'page';\n\t}\n\n\t//if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) {\n//\t\t$classes[] = 'slider';\n//\t} elseif ( is_front_page() ) {\n//\t\t$classes[] = 'grid';\n//\t}\n\n\treturn $classes;\n}",
"function simpleTheme_blog_loop() {\n\n $loop = new WP_Query( array( 'post__in' => get_option('sticky_posts') ) );\n echo '<ul class=\"stick-posts\">';\n while ( $loop->have_posts() ) : $loop->the_post();\n echo '<li class=\"simple-theme-sticky\"><a href=\"' . get_the_permalink() . '\">' . get_the_title() . '</a>';\n simpleTheme_date();\n echo '</li>';\n endwhile;\n echo '</ul>';\n\n}",
"function wpex_header_classes() {\n\n\t// Vars\n\t$post_id = wpex_get_current_post_id();\n\t$header_style = wpex_header_style( $post_id );\n\n\t// Setup classes array\n\t$classes = array();\n\n\t// Main header style\n\t$classes['header_style'] = 'header-'. $header_style;\n\n\t// Full width header\n\tif ( 'full-width' == wpex_site_layout() && wpex_get_mod( 'full_width_header' ) ) {\n\t\t$classes[] = 'wpex-full-width';\n\t}\n\n\t// Sticky Header\n\tif ( wpex_has_sticky_header() ) {\n\n\t\t// Fixed header style\n\t\t$fixed_header_style = wpex_sticky_header_style();\n\n\t\t// Main fixed class\n\t\t$classes['fixed_scroll'] = 'fixed-scroll'; // @todo rename this at some point?\n\t\tif ( wpex_has_shrink_sticky_header() ) {\n\t\t\t$classes['shrink-sticky-header'] = 'shrink-sticky-header';\n\t\t\tif ( 'shrink_animated' == $fixed_header_style ) {\n\t\t\t\t$classes['anim-shrink-header'] = 'anim-shrink-header';\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// Reposition cart and search dropdowns\n\tif ( 'three' == $header_style\n\t\t|| 'four' == $header_style\n\t\t|| 'five' == $header_style\n\t\t|| ( 'two' == $header_style && wpex_get_mod( 'header_menu_center', false ) )\n\t) {\n\t\t$classes[] = 'wpex-reposition-cart-search-drops';\n\t}\n\n\t// Dropdown style (must be added here so we can target shop/search dropdowns)\n\t$dropdown_style = wpex_get_mod( 'menu_dropdown_style' );\n\tif ( $dropdown_style && 'default' != $dropdown_style ) {\n\t\t$classes['wpex-dropdown-style-'. $dropdown_style] = 'wpex-dropdown-style-'. $dropdown_style;\n\t}\n\n\t// Dropdown shadows\n\tif ( $shadow = wpex_get_mod( 'menu_dropdown_dropshadow' ) ) {\n\t\t$classes[] = 'wpex-dropdowns-shadow-'. $shadow;\n\t}\n\n\t// Header Overlay Style\n\tif ( wpex_has_overlay_header() ) {\n\n\t\t// Get header style\n\t\t$overlay_style = wpex_overlay_header_style();\n\t\t$overlay_style = $overlay_style ? $overlay_style : 'light';\n\n\t\t// Dark dropdowns for overlay header\n\t\tif ( 'core' != $overlay_style ) {\n\t\t\tif ( $post_id && $dropdown_style_meta = get_post_meta( $post_id, 'wpex_overlay_header_dropdown_style', true ) ) {\n\t\t\t\tif ( 'default' != $dropdown_style_meta ) {\n\t\t\t\t\t$classes[] = 'wpex-dropdown-style-'. $dropdown_style_meta;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tunset( $classes['wpex-dropdown-style-'. $dropdown_style] );\n\t\t\t\t$classes[] = 'wpex-dropdown-style-black';\n\t\t\t}\n\t\t}\n\n\t\t// Add overlay header class\n\t\t$classes[] = 'overlay-header';\n\n\t\t// Add overlay header style class\n\t\t$classes[] = $overlay_style .'-style';\n\n\t}\n\n\t// Dynamic style class\n\t$classes[] = 'dyn-styles';\n\n\t// Clearfix class\n\t$classes[] = 'clr';\n\n\t// Set keys equal to vals\n\t$classes = array_combine( $classes, $classes );\n\n\t// Apply filters for child theming\n\t$classes = apply_filters( 'wpex_header_classes', $classes );\n\n\t// Turn classes into space seperated string\n\t$classes = implode( ' ', $classes );\n\n\t// return classes\n\treturn $classes;\n\n}",
"function post_name_in_body_class( $classes ){\n\tif( is_singular() )\n\t{\n\t\tglobal $post;\n\t\tarray_push( $classes, \"{$post->post_name}\" );\n\t}\n\tif(!preg_match('/(?i)msie [5-9]/',$_SERVER['HTTP_USER_AGENT'])) {\n\t\tarray_push( $classes, \"animsition\");\n\t}\n\treturn $classes;\n}",
"function wpex_sticky_header_style() {\n\n\t// Get default style from customizer\n\t$style = wpex_get_mod( 'fixed_header_style', 'standard' );\n\n\t// If disabled in Customizer but enabled in meta set to \"standard\" style\n\tif ( 'disabled' == $style && 'enable' == get_post_meta( wpex_get_current_post_id(), 'wpex_sticky_header', true ) ) {\n\t\t$style = 'standard';\n\t}\n\n\t// Sanitize\n\t$style = $style ? $style : 'standard';\n\n\t// Return style\n\treturn $style;\n\n}",
"function hybrid_theme_body_class( $classes ) {\n\tglobal $wp_query, $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome;\n\n\t/* Singular post classes (deprecated). */\n\tif ( is_singular() ) {\n\n\t\tif ( is_page() )\n\t\t\t$classes[] = \"page-{$wp_query->post->ID}\"; // Use singular-page-ID\n\n\t\telseif ( is_singular( 'post' ) )\n\t\t\t$classes[] = \"single-{$wp_query->post->ID}\"; // Use singular-post-ID\n\t}\n\n\t/* Browser detection. */\n\t$browsers = array( 'gecko' => $is_gecko, 'opera' => $is_opera, 'lynx' => $is_lynx, 'ns4' => $is_NS4, 'safari' => $is_safari, 'chrome' => $is_chrome, 'msie' => $is_IE );\n\tforeach ( $browsers as $key => $value ) {\n\t\tif ( $value ) {\n\t\t\t$classes[] = $key;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* Hybrid theme widgets detection. */\n\tforeach ( array( 'primary', 'secondary', 'subsidiary' ) as $sidebar )\n\t\t$classes[] = ( is_active_sidebar( $sidebar ) ) ? \"{$sidebar}-active\" : \"{$sidebar}-inactive\";\n\n\tif ( in_array( 'primary-inactive', $classes ) && in_array( 'secondary-inactive', $classes ) && in_array( 'subsidiary-inactive', $classes ) )\n\t\t$classes[] = 'no-widgets';\n\n\t/* Return the array of classes. */\n\treturn $classes;\n}",
"function twentyfourteen_body_classes( $classes ) {\n\tif ( is_multi_author() ) {\n\t\t$classes[] = 'group-blog';\n\t}\n\n\tif ( get_header_image() ) {\n\t\t$classes[] = 'header-image';\n\t} else {\n\t\t$classes[] = 'masthead-fixed';\n\t}\n\n\tif ( is_archive() || is_search() || is_home() ) {\n\t\t$classes[] = 'list-view';\n\t}\n\n\tif ( ( ! is_active_sidebar( 'sidebar-2' ) )\n\t\t|| is_page_template( 'page-templates/full-width.php' )\n\t\t|| is_page_template( 'page-templates/contributors.php' )\n\t\t|| is_attachment() ) {\n\t\t$classes[] = 'full-width';\n\t}\n\n\tif ( is_active_sidebar( 'sidebar-3' ) ) {\n\t\t$classes[] = 'footer-widgets';\n\t}\n\n\tif ( is_singular() && ! is_front_page() ) {\n\t\t$classes[] = 'singular';\n\t}\n\n\tif ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) {\n\t\t$classes[] = 'slider';\n\t} elseif ( is_front_page() ) {\n\t\t$classes[] = 'grid';\n\t}\n\n\treturn $classes;\n}",
"function custom_archive_post_class( $classes ) {\n\n\t$classes[] = 'one-third';\n\tglobal $wp_query;\n\tif( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 3 )\n\t\t$classes[] = 'first';\n\treturn $classes;\n}",
"function pluton_body_classes( $classes ) {\n\n\t// Save some vars\n\t$main_layout = pluton_global_obj( 'main_layout' );\n\t$post_layout = pluton_global_obj( 'post_layout' );\n\t$post_id = pluton_global_obj( 'post_id' );\n\n\t// RTL\n\tif ( is_RTL() ) {\n\t\t$classes[] = 'rtl';\n\t}\n\t\n\t// Main class\n\t$classes[] = 'pluton-theme';\n\n\t// Layout Style\n\t$classes[] = $main_layout .'-main-layout';\n\n\t// Top menu header style to control the responsive\n\tif ( 'top' == pluton_global_obj( 'header_style' ) ) {\n\t\t$classes[] = 'top-header-style';\n\t}\n\n\t// Centered header style to control the responsive\n\tif ( 'centered' == pluton_global_obj( 'header_style' ) ) {\n\t\t$classes[] = 'centered-header-style';\n\t}\n\n\t// Boxed layout dropshadow\n\tif ( 'boxed' == $main_layout\n\t\t&& get_theme_mod( 'boxed_dropdshadow' )\n\t) {\n\t\t$classes[] = 'wrap-boxshadow';\n\t}\n\n\t// Sidebar enabled\n\tif ( 'left-sidebar' == $post_layout || 'right-sidebar' == $post_layout ) {\n\t\t$classes[] = 'has-sidebar';\n\t}\n\n\t// Content layout\n\tif ( $post_layout ) {\n\t\t$classes[] = 'content-'. $post_layout;\n\t}\n\n\t// If media above content\n\tif ( 'above' == get_post_meta( get_the_ID(), 'pluton_post_media_position', true ) ) {\n\t\t$classes[] = 'media-above-content';\n\t}\n\n\t// Single Post cagegories\n\tif ( is_singular( 'post' ) ) {\n\t\t$cats = get_the_category( $post_id );\n\t\tforeach ( $cats as $cat ) {\n\t\t\t$classes[] = 'post-in-category-'. $cat->category_nicename;\n\t\t}\n\t}\n\n\t// If landing page template\n\tif ( is_page_template( 'templates/landing.php' ) ) {\n\t\t$classes[] = 'landing-page';\n\t}\n\n\t// Breadcrumbs\n\tif ( pluton_global_obj( 'has_breadcrumbs' ) ) {\n\t\t$classes[] = 'has-breadcrumbs';\n\t}\n\n\t// Topbar\n\tif ( pluton_global_obj( 'has_top_bar' ) ) {\n\t\t$classes[] = 'has-topbar';\n\t}\n\n\t// Transparent header style\n\tif ( 'transparent' == pluton_global_obj( 'header_style' ) ) {\n\t\t$classes[] = 'has-transparent-header';\n\t}\n\n\t// If no header border bottom\n\tif ( false == get_theme_mod( 'has_header_border_bottom', true ) ) {\n\t\t$classes[] = 'no-header-border';\n\t}\n\n\t// Widget Icons\n\tif ( get_theme_mod( 'has_widget_icons', true ) ) {\n\t\t$classes[] = 'sidebar-widget-icons';\n\t}\n\n\t// Title with Background Image\n\tif ( 'background-image' == pluton_global_obj( 'page_header_style' ) ) {\n\t\t$classes[] = 'page-with-background-title';\n\t}\n\n\t// Disabled header\n\tif ( ! pluton_global_obj( 'has_page_header' ) ) {\n\t\t$classes[] = 'page-header-disabled';\n\t}\n\n\t// Disabled margins\n\tif ( ! pluton_global_obj( 'has_margins' ) ) {\n\t\t$classes[] = 'no-margins';\n\t}\n\n\t// Add class if footer parallax\n\tif ( 'true' == get_theme_mod( 'footer_parallax_effect' ) ) {\n\t\t$classes[] = 'has-footer-parallax';\n\t}\n\t\n\t// Return classes\n\treturn $classes;\n\n}",
"function ridizain_body_classes( $classes ) {\r\nglobal $content_width;\r\n\r\n\tif ( is_multi_author() ) {\r\n\t\t$classes[] = 'group-blog';\r\n\t}\r\n\r\n\tif ( get_header_image() ) {\r\n\t\t$classes[] = 'header-image';\r\n\t} else {\r\n\t\t$classes[] = 'masthead-fixed';\r\n\t}\r\n\r\n\tif ( is_post_type_archive( 'post' ) || is_search() || is_home() ) {\r\n\t\t$classes[] = 'list-view';\r\n\t}\r\n\r\n\tif ( !is_active_sidebar( 'sidebar-2' ) \r\n\t || is_page_template( 'page-templates/full-width.php' )\r\n || is_page_template( 'page-templates/full-width-blank.php' ) \t \r\n\t || is_page_template( 'page-templates/contributors.php' ) \r\n\t || is_attachment() ) {\r\n\t $classes[] = 'full-width';\r\n\t}\r\n\t\r\n\tif ( class_exists( 'bbPress' ) ) {\r\n\t if ( is_bbpress() ) {\r\n\t $classes[] = 'full-width';\r\n\t }\r\n\t}\r\n\t\r\n\tif (is_home() ) : \r\n if (get_theme_mod( 'ridizain_fullwidth_blog_feed' ) != 0 ) {\r\n\t $classes[] = 'full-width';\r\n\t} endif;\r\n\t\r\n\tif (is_singular() && !is_page() ) : \r\n if (get_theme_mod( 'ridizain_fullwidth_single_post' ) != 0 ) {\r\n $classes[] = 'full-width';\r\n } endif;\r\n\t\r\n\tif ( is_active_sidebar( 'sidebar-3' ) ) {\r\n\t\t$classes[] = 'footer-widgets';\r\n\t}\r\n\r\n\tif ( is_singular() && ! is_front_page() ) {\r\n\t\t$classes[] = 'singular';\r\n\t}\r\n\r\n\tif ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) {\r\n\t\t$classes[] = 'slider';\r\n\t} elseif ( is_front_page() ) {\r\n\t\t$classes[] = 'grid';\r\n\t}\r\n\r\n\treturn $classes;\r\n}",
"function twentytwelve_body_class( $classes ) {\n\t$background_color = get_background_color();\n\t$background_image = get_background_image();\n\tif ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) )\n\t\t$classes[] = 'full-width';\n\tif ( is_page_template( 'page-templates/front-page.php' ) ) {\n\t\t$classes[] = 'template-front-page';\n\t\tif ( has_post_thumbnail() )\n\t\t\t$classes[] = 'has-post-thumbnail';\n\t\tif ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) )\n\t\t\t$classes[] = 'two-sidebars';\n\t}\n\tif ( empty( $background_image ) ) {\n\t\tif ( empty( $background_color ) )\n\t\t\t$classes[] = 'custom-background-empty';\n\t\telseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) )\n\t\t\t$classes[] = 'custom-background-white';\n\t}\n\t// Enable custom font class only if the font CSS is queued to load.\n\tif ( wp_style_is( 'twentytwelve-fonts', 'queue' ) )\n\t\t$classes[] = 'custom-font-enabled';\n\tif ( ! is_multi_author() )\n\t\t$classes[] = 'single-author';\n\treturn $classes;\n}",
"function be_archive_post_class($classes)\n{\n\n // Don't run on single posts or pages\n if (is_singular())\n return $classes;\n\n $classes[] = 'one-half';\n global $wp_query;\n if (0 == $wp_query->current_post || 0 == $wp_query->current_post % 3)\n $classes[] = 'first';\n return $classes;\n}",
"function twentytwelve_body_class( $classes ) {\n\t$background_color = get_background_color();\n\t$background_image = get_background_image();\n\n\tif ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) ) {\n\t\t$classes[] = 'full-width';\n\t}\n\n\tif ( is_page_template( 'page-templates/front-page.php' ) ) {\n\t\t$classes[] = 'template-front-page';\n\t\tif ( has_post_thumbnail() ) {\n\t\t\t$classes[] = 'has-post-thumbnail';\n\t\t}\n\t\tif ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) ) {\n\t\t\t$classes[] = 'two-sidebars';\n\t\t}\n\t}\n\n\tif ( empty( $background_image ) ) {\n\t\tif ( empty( $background_color ) ) {\n\t\t\t$classes[] = 'custom-background-empty';\n\t\t} elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) ) {\n\t\t\t$classes[] = 'custom-background-white';\n\t\t}\n\t}\n\n\t// Enable custom font class only if the font CSS is queued to load.\n\tif ( wp_style_is( 'twentytwelve-fonts', 'queue' ) ) {\n\t\t$classes[] = 'custom-font-enabled';\n\t}\n\n\tif ( ! is_multi_author() ) {\n\t\t$classes[] = 'single-author';\n\t}\n\n\treturn $classes;\n}",
"private function unsetStickyArticle()\n {\n\t\t$articles = $this->model->getArticles()->where('sticky', TRUE);\n\t\tforeach ($articles as $article) {\n\t\t\t$this->model->getArticles()->find($article->id)->update(array('sticky' => 0));\n\t\t}\n }",
"function oddeven_post_class ( $classes ) {\n global $current_class;\n $classes[] = $current_class;\n $current_class = ($current_class == 'odd') ? 'even' : 'odd';\n return $classes;\n}",
"function superultra_body_classes( $classes ) {\n\t// Adds a class of hfeed to non-singular pages.\n\tif ( ! is_singular() ) {\n\t\t$classes[] = 'hfeed';\n\t}\n\n\t// Adds a class of no-sidebar when there is no sidebar present.\n\tif ( ! is_active_sidebar( 'sidebar-1' ) ) {\n\t\t$classes[] = 'no-sidebar';\n\t}\n\n\treturn $classes;\n}",
"function be_display_only_sticky_posts( $args, $atts ) {\n\t$sticky_variations = array( 'sticky_posts', 'sticky-posts', 'sticky posts' );\n\tif( !empty( $atts['id'] ) && in_array( $atts['id'], $sticky_variations ) ) {\n\t\t$sticky_posts = get_option( 'sticky_posts' );\n\t\t$args['post__in'] = $sticky_posts;\n\t}\n\tif( !empty( $atts['exclude'] ) && in_array( $atts['exclude'], $sticky_variations ) ) {\n\t\t$sticky_posts = get_option( 'sticky_posts' );\n\t\t$args['post__not_in'] = $sticky_posts;\n\t}\n\t\n\treturn $args;\n}"
] |
[
"0.7756317",
"0.71812886",
"0.6845037",
"0.6556652",
"0.60805976",
"0.590301",
"0.5792777",
"0.5709917",
"0.5681128",
"0.5642611",
"0.56261206",
"0.5624841",
"0.56036395",
"0.55902153",
"0.5577572",
"0.5424552",
"0.541745",
"0.5398366",
"0.5383074",
"0.53828233",
"0.53704786",
"0.53582263",
"0.5328205",
"0.53040963",
"0.5297962",
"0.52927035",
"0.52741694",
"0.5262838",
"0.5241097",
"0.52352434"
] |
0.7968001
|
0
|
Register the asset publisher service and command.
|
protected function registerAssetPublisher()
{
$this->app->singleton('asset.publisher', function ($app) {
$publicPath = $app->make('path.public');
$publisher = new AssetPublisher($app->make('files'), $publicPath);
$publisher->setPackagePath($app->make('path.base') . '/src');
return $publisher;
});
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function registerAssetPublishCommand()\n {\n $this->app->singleton('command.asset.publish', function ($app) {\n return new AssetPublishCommand($app->make('asset.publisher'));\n });\n }",
"protected function registerAssetCommand()\n {\n $this->app['command.torann.assets'] = $this->app->share(function($app)\n {\n return new AssetsCommand($app['torann.assets'], $app['files'], $app['torann.manifest']);\n });\n }",
"protected function registerPublisher()\n {\n $this->app->singleton('antares.publisher', function ($app) {\n $memory = $app->make('antares.platform.memory');\n\n return (new PublisherManager($app))->attach($memory);\n });\n }",
"protected function defineAssetPublishing()\n {\n if (!$this->app['config']->get('laratrust.panel.register')) {\n return;\n }\n\n $this->publishes([\n __DIR__.'/../public' => public_path('vendor/laratrust'),\n ], 'laratrust-assets');\n }",
"private function publishAssets()\n {\n $this->call('vendor:publish', [\n '--provider' => 'A17\\Twill\\TwillServiceProvider',\n '--tag' => 'assets',\n '--force' => true,\n ]);\n }",
"public function register_assets() {\n\t}",
"protected function registerPublishers()\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n /*\n // Register additional css assets with mrcore Layout\n Layout::css('css/wiki-bundle.css');\n\n // App base path\n $path = realpath(__DIR__.'/../');\n\n // Config publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.configs\"\n $this->publishes([\n \"$path/Config\" => base_path('/config/mrcore'),\n ], 'mrcore.parser.configs');\n\n // Migration publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.migrations\"\n $this->publishes([\n \"$path/Database/Migrations\" => base_path('/database/migrations'),\n ], 'mrcore.parser.migrations');\n\n // Seed publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.seeds\"\n $this->publishes([\n \"$path/Database/Seeds\" => base_path('/database/seeds'),\n ], 'mrcore.parser.seeds');\n */\n }",
"private function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/telescope-error-service-client.php' => config_path('telescope-error-service-client.php'),\n ], 'telescope-error-service-client-config');\n }\n }",
"protected function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../../config/knet.php' => $this->app->configPath('knet.php'),\n ], 'knet-config');\n\n $this->publishes([\n __DIR__ . '/../../database/migrations' => $this->app->databasePath('migrations'),\n ], 'knet-migrations');\n\n $this->publishes([\n __DIR__ . '/../../resources/views' => $this->app->resourcePath('views/vendor/knet'),\n ], 'knet-views');\n\n $this->publishes([\n __DIR__ . '/../../public' => public_path('vendor/knet'),\n ], 'knet-assets');\n\n $this->publishes([\n __DIR__ . '/../../stubs/KnetServiceProvider.stub' => app_path('Providers/KnetServiceProvider.php'),\n ], 'knet-provider');\n }\n }",
"public function registerAssets () {\n }",
"public function register() {\n\t\tadd_action( 'plugins_loaded', [ $this, 'register_services' ] );\n\t\tadd_action( 'init', [ $this, 'register_assets_handler' ] );\n\t}",
"public function register() {\n\t\t$this->container['assets'] = $assets = plugins_url( '/assets', $this->container['root-file'] );\n\t\t$this->container['node-modules'] = $nodeModules = plugins_url( '/node_modules', $this->container['root-file'] );\n\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'registerScripts' ) );\n\t}",
"private function registerPublishing(): void\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/ethereum.php' => config_path('ethereum.php'),\n ], 'ethereum-config');\n }\n }",
"protected function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/twilio-verify.php' => $this->app->configPath('twilio-verify.php'),\n ], 'config');\n\n $this->publishes([\n __DIR__.'/../database/migrations' => $this->app->databasePath('migrations'),\n ], 'migrations');\n\n $this->publishes([\n __DIR__ . '/../resources/lang' => resource_path('lang/vendor/twilio-verify'),\n ], 'translations');\n }\n }",
"protected function registerAssets()\n {\n $this->app->singleton('torann.assets', function($app)\n {\n // Read settings from config file\n $config = $app->config->get('assets::config', array());\n $config['public_dir'] = public_path();\n\n // In production?\n $inProduction = in_array($app['env'], (array) $config['production']);\n\n // Create instance\n return new Manager($config, $app['files'], $app['torann.manifest'], $inProduction);\n });\n }",
"protected function registerServiceProvider()\n {\n $this->app->singleton(\n 'streams.asset',\n function () {\n return new Asset(new Filesystem(), app('streams.application'));\n }\n );\n }",
"protected function registerPublishables()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/config/algorand.php' => config_path('algorand.php'),\n ], 'config');\n }\n }",
"protected function registerPublishing()\n {\n $this->publishes([\n __DIR__ . '/../config/kustomer.php' => config_path('kustomer.php'),\n ], 'kustomer-config');\n\n $this->publishes([\n __DIR__ . '/../public' => public_path('vendor/kustomer'),\n ], 'kustomer-assets');\n\n $this->publishes([\n __DIR__ . '/../resources/js/components' => resource_path('js/components/Kustomer'),\n ], 'kustomer-vue-component');\n\n $this->publishes([\n __DIR__ . '/../resources/sass' => resource_path('sass'),\n ], 'kustomer-sass-component');\n\n $this->publishes([\n __DIR__ . '/../resources/lang' => resource_path('lang/vendor/kustomer'),\n ], 'kustomer-locales');\n\n $this->publishes(\n [__DIR__ . '/../resources/views' => resource_path('views/vendor/kustomer')],\n 'kustomer-views'\n );\n }",
"public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }",
"public function register(){\n\t\t$this->registerOptimusAsAlias();\n\t\t$this->registerCommand();\n\t}",
"public function defineAssetPublishing()\n {\n $this->publishes([\n DOCS_PATH . '/public' => public_path('vendor/documentation'),\n ], 'documentation-assets');\n }",
"protected function registerConfigPublishCommand()\n {\n $this->app->singleton('command.config.publish', function ($app) {\n return new ConfigPublishCommand($app->make('config.publisher'));\n });\n }",
"public function register()\n {\n parent::register();\n\n $this->commands([\n \\Luissobrinho\\LCrud\\Console\\Publish::class,\n ]);\n }",
"public function register()\n {\n require_once __DIR__ . '/../Helpers/MainHelper.php';\n require_once __DIR__ . '/../Helpers/InputHelper.php';\n\n /*\n * Register the service provider for the dependency.\n */\n $imageProvider = new \\Intervention\\Image\\ImageServiceProvider($this->app);\n $imageProvider->register();\n /*\n * Create aliases for the dependency.\n */\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n $loader->alias('Image', 'Intervention\\Image\\Facades\\Image');\n\n $this->app['backend::install'] = $this->app->share(function()\n {\n return new \\Nhiepphong\\Backend\\Commands\\BackendCommand();\n });\n\n $this->commands('backend::install');\n\n }",
"public function register()\n {\n $this->registerAssetPublisher();\n\n $this->registerConfigPublisher();\n\n $this->registerViewPublisher();\n\n parent::register();\n }",
"public function registerCommands()\n\t{\n\t\t/*$this->app['command.assets'] = $this->app->share(function($app)\n\t\t{\n\t\t\treturn new Commands\\AssetsCommand;\n\t\t});\n\n\t\t$this->app['command.assets.compile'] = $this->app->share(function($app)\n\t\t{\n\t\t\treturn new Commands\\CompileCommand($app['assets'], $app['assets.compiler']);\n\t\t});\n\n\t\t$this->commands('command.assets', 'command.assets.cache');*/\n\t}",
"protected function assetHandle()\n {\n $packageAssetsPath = __DIR__.'/resources/assets';\n\n $this->publishes([\n $packageAssetsPath => public_path('/'),\n ], 'tm-public');\n }",
"public function registerAssetBundle()\n {\n CosAsset::register($this->getView());\n }",
"public function register()\n\t{\n $this->app['tencdn.publish'] = $this->app->share(function($app)\n {\n return new Publish();\n });\n\n $this->commands('tencdn.publish');\n\t}",
"protected function registerBuildCommand()\n {\n $this->app['command.torann.assets.build'] = $this->app->share(function($app)\n {\n return new BuildCommand($app['torann.assets'], $app['files'], $app['torann.manifest']);\n });\n }"
] |
[
"0.76091707",
"0.7074273",
"0.6711218",
"0.63871044",
"0.6210069",
"0.61624044",
"0.6148373",
"0.61289746",
"0.60630095",
"0.60428363",
"0.6037875",
"0.59565187",
"0.59517854",
"0.5918937",
"0.58736014",
"0.5862636",
"0.58559716",
"0.58556795",
"0.5850961",
"0.5850676",
"0.58150506",
"0.5806377",
"0.57990146",
"0.5767481",
"0.5759193",
"0.57351756",
"0.569489",
"0.56941134",
"0.56599575",
"0.56580347"
] |
0.7613915
|
0
|
Register the configuration publisher class and command.
|
protected function registerConfigPublisher()
{
$this->app->singleton('config.publisher', function ($app) {
$path = $app->make('path.config');
$publisher = new ConfigPublisher($app->make('files'), $path);
$publisher->setPackagePath($app->make('path.base') . '/src');
return $publisher;
});
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function registerConfigPublishCommand()\n {\n $this->app->singleton('command.config.publish', function ($app) {\n return new ConfigPublishCommand($app->make('config.publisher'));\n });\n }",
"private function registerPublishing(): void\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/ethereum.php' => config_path('ethereum.php'),\n ], 'ethereum-config');\n }\n }",
"private function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/telescope-error-service-client.php' => config_path('telescope-error-service-client.php'),\n ], 'telescope-error-service-client-config');\n }\n }",
"protected function registerConfigurations()\n {\n $this->mergeConfigFrom(\n $this->packagePath('config/line.php'), 'ferdhika31.linebot'\n );\n $this->publishes([\n $this->packagePath('config/line.php') => config_path('ferdhika31/linebot.php'),\n ], 'config');\n }",
"protected function registerConfigurations()\n {\n $this->mergeConfigFrom($this->packagePath('config/tarpit.php'), 'tarpit');\n $this->publishes([$this->packagePath('config/config.php') => config_path('tarpit.php')], 'tarpit');\n }",
"protected function registerConfigurations()\n {\n $this->mergeConfigFrom(\n $this->packagePath('config/config.php'), 'password'\n );\n $this->publishes([\n $this->packagePath('config/config.php') => config_path('password.php'),\n ], 'config');\n }",
"protected function registerConfigCommand()\n {\n $this->app->singleton('command.setting.config', function () {\n return new \\Setting\\Commands\\ConfigCommand;\n });\n }",
"private function registerConfiguration()\n {\n $configPath = __DIR__ . '/../config/themify.php';\n $this->mergeConfigFrom($configPath, 'themify');\n $this->publishes([$configPath => config_path('themify.php')]);\n }",
"protected function registerPublisher()\n {\n $this->app->singleton('antares.publisher', function ($app) {\n $memory = $app->make('antares.platform.memory');\n\n return (new PublisherManager($app))->attach($memory);\n });\n }",
"protected function registerConfigurations()\n {\n $this->mergeConfigFrom(\n $this->packagePath('config/laravel-deploy-helper.php'), 'laravel-deploy-helper'\n );\n $this->publishes([\n $this->packagePath('config/laravel-deploy-helper.php') => config_path('laravel-deploy-helper.php'),\n ], 'ldh-config');\n }",
"protected function registerPublishables()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/config/algorand.php' => config_path('algorand.php'),\n ], 'config');\n }\n }",
"public\n function register()\n {\n // Register the config publish path\n $configPath = __DIR__ . '/../config/' . self::PACKAGE . '.php';\n $this->mergeConfigFrom($configPath, self::PACKAGE);\n $this->publishes([$configPath => config_path(self::PACKAGE . '.php')], 'config');\n\n $this->app->singleton($command = 'command.generate.controller', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\ControllerGenerator($app['files'], $cache);\n\n return new Commands\\ControllerGeneratorCommand($generator);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.form', function ($app) {\n $gen = new Generators\\FormDumperGenerator($app['files'], new \\Mustache_Engine);\n\n return new Commands\\FormDumperCommand($gen);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.migration', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\MigrationGenerator($app['files'], $cache);\n\n return new Commands\\MigrationGeneratorCommand($generator);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.model', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\ModelGenerator($app['files'], $cache);\n\n return new Commands\\ModelGeneratorCommand($generator);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.pivot', function ($app) {\n return new Commands\\PivotGeneratorCommand;\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.resource', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\ResourceGenerator($app['files'], $cache);\n\n return new Commands\\ResourceGeneratorCommand($generator, $cache);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.scaffold', function ($app) {\n $generator = new Generators\\ResourceGenerator($app['files']);\n $cache = new Cache($app['files']);\n\n return new Commands\\ScaffoldGeneratorCommand($generator, $cache);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.seed', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\SeedGenerator($app['files'], $cache);\n\n return new Commands\\SeedGeneratorCommand($generator);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.test', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\TestGenerator($app['files'], $cache);\n\n return new Commands\\TestGeneratorCommand($generator);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.translations', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\TranslationsGenerator($app['files'], $cache);\n\n return new Commands\\TranslationsGeneratorCommand($generator);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.view', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\ViewGenerator($app['files'], $cache);\n\n return new Commands\\ViewGeneratorCommand($generator);\n });\n $this->commands($command);\n }",
"protected function registerPublishing() : void\n {\n $this->publishes([\n __DIR__ . '/../config/dejavu.php' => config_path('dejavu.php')\n ], 'dejavu-config');\n }",
"protected function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../../config/knet.php' => $this->app->configPath('knet.php'),\n ], 'knet-config');\n\n $this->publishes([\n __DIR__ . '/../../database/migrations' => $this->app->databasePath('migrations'),\n ], 'knet-migrations');\n\n $this->publishes([\n __DIR__ . '/../../resources/views' => $this->app->resourcePath('views/vendor/knet'),\n ], 'knet-views');\n\n $this->publishes([\n __DIR__ . '/../../public' => public_path('vendor/knet'),\n ], 'knet-assets');\n\n $this->publishes([\n __DIR__ . '/../../stubs/KnetServiceProvider.stub' => app_path('Providers/KnetServiceProvider.php'),\n ], 'knet-provider');\n }\n }",
"public function register()\n {\n $this->configure();\n $this->offerPublishing();\n $this->registerCommands();\n }",
"public function register()\n {\n $this->configure();\n $this->offerPublishing();\n $this->registerLaratrust();\n $this->registerCommands();\n }",
"protected function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/twilio-verify.php' => $this->app->configPath('twilio-verify.php'),\n ], 'config');\n\n $this->publishes([\n __DIR__.'/../database/migrations' => $this->app->databasePath('migrations'),\n ], 'migrations');\n\n $this->publishes([\n __DIR__ . '/../resources/lang' => resource_path('lang/vendor/twilio-verify'),\n ], 'translations');\n }\n }",
"protected function configurePublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../stubs/fortify.php' => config_path('fortify.php'),\n ], 'fortify-config');\n\n $this->publishes([\n __DIR__.'/../stubs/CreateNewUser.php' => app_path('Actions/Fortify/CreateNewUser.php'),\n __DIR__.'/../stubs/FortifyServiceProvider.php' => app_path('Providers/FortifyServiceProvider.php'),\n __DIR__.'/../stubs/PasswordValidationRules.php' => app_path('Actions/Fortify/PasswordValidationRules.php'),\n __DIR__.'/../stubs/ResetUserPassword.php' => app_path('Actions/Fortify/ResetUserPassword.php'),\n __DIR__.'/../stubs/UpdateUserProfileInformation.php' => app_path('Actions/Fortify/UpdateUserProfileInformation.php'),\n __DIR__.'/../stubs/UpdateUserPassword.php' => app_path('Actions/Fortify/UpdateUserPassword.php'),\n ], 'fortify-support');\n\n $this->publishes([\n __DIR__.'/../database/migrations' => database_path('migrations'),\n ], 'fortify-migrations');\n }\n }",
"public function register()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/kustomer.php',\n 'kustomer'\n );\n\n $this->commands([\n Console\\PublishCommand::class,\n ]);\n }",
"protected function registerPublishing()\n {\n $this->publishes([\n __DIR__.'/../config/ziggeo.php' => config_path('ziggeo.php'),\n ], 'ziggeo-config');\n }",
"public function register()\n {\n $this->commands([\n \\Antares\\Audit\\Console\\CreateConfigCommand::class,\n ]);\n }",
"private function setupConfig()\n {\n $this->publishes([\n __DIR__ . '/config' => config_path(),\n ], 'config');\n\n $this->mergeConfigFrom(__DIR__ . '/../config/package-blueprint.php', 'package-blueprint');\n }",
"protected function registerPublishers()\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n /*\n // Register additional css assets with mrcore Layout\n Layout::css('css/wiki-bundle.css');\n\n // App base path\n $path = realpath(__DIR__.'/../');\n\n // Config publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.configs\"\n $this->publishes([\n \"$path/Config\" => base_path('/config/mrcore'),\n ], 'mrcore.parser.configs');\n\n // Migration publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.migrations\"\n $this->publishes([\n \"$path/Database/Migrations\" => base_path('/database/migrations'),\n ], 'mrcore.parser.migrations');\n\n // Seed publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.seeds\"\n $this->publishes([\n \"$path/Database/Seeds\" => base_path('/database/seeds'),\n ], 'mrcore.parser.seeds');\n */\n }",
"public function register()\n {\n $this->publishes([\n __DIR__.'/../config/jantung.php' => config_path('jantung.php'),\n ], 'jantung-config');\n\n $this->mergeConfigFrom(\n __DIR__.'/../config/jantung.php', 'jantung'\n );\n\n if ($this->app->runningInConsole()) {\n $this->commands([\n InstallCommand::class,\n TestCommand::class,\n VerifyCommand::class,\n ]);\n }\n\n if (! config('jantung.enabled')) {\n return;\n }\n\n app()->singleton('jantung', function () {\n return \\Crypt4\\JantungLaravel\\Transporter::make();\n });\n\n foreach (config('jantung.observe') as $event => $listeners) {\n foreach ($listeners as $listener) {\n app()['events']->listen($event, $listener);\n }\n }\n\n }",
"protected function publishConfig()\n {\n $this->publishes([\n $this->packagePath('config/config.php') => config_path($this->package . '.php')\n ], 'config');\n }",
"private function registerLangPublisher(): void\n {\n $this->singleton(TransPublisherContract::class, function (Application $app) {\n return new TransPublisher(\n $app['files'],\n $app[TransManagerContract::class],\n $app->langPath()\n );\n });\n }",
"protected function registerPublishing()\n {\n $this->publishes([\n __DIR__ . '/../config/shop.php' => config_path('shop.php')\n ], 'shop-config');\n /* Views File Publish */\n $this->publishes([\n __DIR__ . '/../resources/views' => resource_path('views/vendor/shop'),\n ], 'shop-views');\n /* Migration File Publish */\n $this->publishes([\n __DIR__ . '/../database/migartions' => database_path('migrations')\n ], 'shop-migrations');\n /* Seed File Publish */\n $this->publishes([\n __DIR__ . '/../database/seeds' => database_path('seeds')\n ], 'shop-seeds');\n }",
"protected function configHandle()\n {\n $packageConfigPath = __DIR__.'/config/config.php';\n $appConfigPath = config_path('task-management.php');\n\n $this->mergeConfigFrom($packageConfigPath, 'task-management');\n\n $this->publishes([\n $packageConfigPath => $appConfigPath,\n ], 'config');\n }",
"private function publishesConfig(): void\n {\n $this->publishes([\n __DIR__.'/../config/invite-codes.php' => config_path('invite-codes.php'),\n ], 'invite-codes-config');\n }",
"public function register()\n\t{\n\t\t// merge & publihs config\n $configPath = __DIR__ . '/../../../config/config.php';\n $this->mergeConfigFrom($configPath, 'uploader');\n $this->publishes([$configPath => config_path('uploader.php')]);\n\n\n $this->app['uploader'] = $this->app->share(\n function ($app) {\n\t $path = $app['config']->get('uploader.path');\n\t $scheme = $app['config']->get('uploader.scheme');\n $hash_levels = $app['config']->get('uploader.hash_levels');\n return new Uploader($path, $scheme, $hash_levels);\n }\n );\n\t}"
] |
[
"0.7533107",
"0.6977734",
"0.6898431",
"0.68263304",
"0.6804958",
"0.6765623",
"0.67649174",
"0.672658",
"0.67022777",
"0.660483",
"0.6563478",
"0.6479851",
"0.6471296",
"0.6408069",
"0.63914245",
"0.6355667",
"0.6343765",
"0.6339492",
"0.63377696",
"0.63138705",
"0.6282653",
"0.6261417",
"0.62339306",
"0.6217688",
"0.6205157",
"0.61991906",
"0.6185194",
"0.61720884",
"0.6171202",
"0.6169542"
] |
0.77412665
|
0
|
Register the view publisher class and command.
|
protected function registerViewPublisher()
{
$this->app->singleton('view.publisher', function ($app) {
$viewPath = $app->make('path.base') . '/resources/views';
$publisher = new ViewPublisher($app->make('files'), $viewPath);
$publisher->setPackagePath($app->make('path.base') . '/src');
return $publisher;
});
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function registerViewPublishCommand()\n {\n $this->app->singleton('command.view.publish', function ($app) {\n return new ViewPublishCommand($app->make('view.publisher'));\n });\n }",
"protected function registerViews()\n {\n // register views within the application with the set namespace\n $this->loadViewsFrom(realpath(__DIR__ . '/../resources/views'), 'ui');\n\n // allow views to be published to the storage directory\n $this->publishes(\n [realpath(__DIR__ . '/../resources/views') => base_path('resources/views/vendor/ui')],\n 'views'\n );\n }",
"private function registerViews()\n {\n $viewsPath = $this->getBasePath() . '/resources/views';\n\n $this->loadViewsFrom($viewsPath, $this->package);\n $this->publishes([\n $viewsPath => base_path(\"resources/views/arcanedev/{$this->package}\"),\n ], 'views');\n }",
"protected function registerViews()\n {\n // register views within the application with the set namespace\n $this->loadViewsFrom($this->packagePath('resources/views'), 'password');\n // allow views to be published to the storage directory\n $this->publishes([\n $this->packagePath('resources/views') => base_path('resources/views/laravolt/password'),\n ], 'views');\n }",
"protected function registerRegisterCommand()\n {\n $this->app->singleton('command.presenter.register', function ($app) {\n return new PresenterRegisterCommand(\n $app['datamapper.classfinder'],\n $app['datamapper.presenter.scanner'],\n $app['datamapper.presenter.repository'],\n $app['config']['datamapper']\n );\n });\n }",
"public function registerViewLoader()\n {\n $this->app->singleton('view', function ($app) {\n return new Tintin($app['view.finder']);\n });\n }",
"public function register()\n {\n parent::register();\n\n $this->commands([\n \\Luissobrinho\\LCrud\\Console\\Publish::class,\n ]);\n }",
"protected function registerPublisher()\n {\n $this->app->singleton('antares.publisher', function ($app) {\n $memory = $app->make('antares.platform.memory');\n\n return (new PublisherManager($app))->attach($memory);\n });\n }",
"protected function publishViews()\n {\n $this->loadViewsFrom($this->basePath('resources/views'), 'flare');\n $this->publishes([\n $this->basePath('resources/views') => base_path('resources/views/vendor/flare'),\n ]);\n }",
"public function register()\n\t{\n $this->app['tencdn.publish'] = $this->app->share(function($app)\n {\n return new Publish();\n });\n\n $this->commands('tencdn.publish');\n\t}",
"public function registerViews()\n {\n $this->loadViewsFrom(__DIR__ . '/../resources/views', 'kustomer');\n }",
"public function registerView(View $view)\r\n\t{\r\n\t $this->m_View = $view; \r\n\t}",
"public function register()\n {\n $this->registerPluginViews(__DIR__ . DIRECTORY_SEPARATOR . 'views');\n }",
"public function register() {\n\n $this->app->singleton('command.codezero.view.make', function ($app) {\n return $app[GenerateViewMigrationCommand::class];\n });\n\n $this->commands('command.codezero.view.make');\n\n $this->app->singleton('command.codezero.view.migrate', function ($app) {\n return $app[MigrateViewsCommand::class];\n });\n\n $this->commands('command.codezero.view.migrate');\n\n }",
"public function register()\n {\n $this->registerAssetPublisher();\n\n $this->registerConfigPublisher();\n\n $this->registerViewPublisher();\n\n parent::register();\n }",
"private function registerViews()\n {\n $diskName = config(self::CONFIG_FILE . '.disk_name');\n $this->loadViewsFrom(config(\"filesystems.disks.{$diskName}.root\"), self::VIEWS_NAMESPACE_ACCESSOR);\n }",
"protected function registerPublishers()\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n /*\n // Register additional css assets with mrcore Layout\n Layout::css('css/wiki-bundle.css');\n\n // App base path\n $path = realpath(__DIR__.'/../');\n\n // Config publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.configs\"\n $this->publishes([\n \"$path/Config\" => base_path('/config/mrcore'),\n ], 'mrcore.parser.configs');\n\n // Migration publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.migrations\"\n $this->publishes([\n \"$path/Database/Migrations\" => base_path('/database/migrations'),\n ], 'mrcore.parser.migrations');\n\n // Seed publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.seeds\"\n $this->publishes([\n \"$path/Database/Seeds\" => base_path('/database/seeds'),\n ], 'mrcore.parser.seeds');\n */\n }",
"protected function registerViews() {\n\t\t\n\t\telgg_extend_view('river/filter', 'thewire_tools/activity_post', 400);\n\t\telgg_extend_view('css/elgg', 'css/thewire_tools.css');\n\t\telgg_extend_view('js/elgg', 'js/thewire_tools.js');\n\t\telgg_extend_view('notifications/settings/other', 'thewire_tools/notifications/settings');\n\t\telgg_extend_view('page/layouts/elements/filter', 'thewire_tools/group_activity', 400);\n\t\telgg_extend_view('thewire/sidebar', 'thewire_tools/extends/thewire/sidebar', 400);\n\t\t\n\t\telgg_register_ajax_view('thewire_tools/reshare');\n\t\telgg_register_ajax_view('thewire_tools/reshare_list');\n\t\telgg_register_ajax_view('thewire_tools/thread');\n\t}",
"protected function viewHandle()\n {\n $packageViewsPath = __DIR__.'/resources/views';\n\n $this->loadViewsFrom($packageViewsPath, 'task-management');\n\n $this->publishes([\n $packageViewsPath => resource_path('views'),\n ], 'tm-views');\n }",
"protected function registerAssetPublishCommand()\n {\n $this->app->singleton('command.asset.publish', function ($app) {\n return new AssetPublishCommand($app->make('asset.publisher'));\n });\n }",
"public function register()\n {\n if (!defined('DOCS_PATH')) {\n define('DOCS_PATH', realpath(__DIR__ . '/../'));\n }\n\n $paths = config('view.paths');\n $paths[] = resource_path('docs');\n config()->set('view.paths', $paths);\n\n $this->configure();\n $this->offerPublishing();\n }",
"public function register ()\n {\n\n $this->registerViews ();\n }",
"public function views()\n {\n $this->loadViewsFrom(__DIR__.'/Views', $this->packageName);\n\n $this->publishes([\n __DIR__.'/Views' => resource_path('views/vendor/'.$this->packageName),\n ], $this->packageName.'-views');\n }",
"function registerMvcGenerator()\n {\n $this->app->singleton('command.kanok.mvc.generate', function ($app) {\n return $app[get_class(new GenerateMvcConsole())];\n });\n $this->commands('command.kanok.mvc.generate');\n\n $this->app->singleton('command.kanok.view.generate', function ($app) {\n return $app[get_class(new generateViewConsole())];\n });\n $this->commands('command.kanok.view.generate');\n }",
"public function register(): void\n {\n parent::register();\n\n $this->singleton(RouteViewerContract::class, RouteViewer::class);\n }",
"protected function registerConfigPublishCommand()\n {\n $this->app->singleton('command.config.publish', function ($app) {\n return new ConfigPublishCommand($app->make('config.publisher'));\n });\n }",
"protected function registerViewComposer()\n {\n View::composer('a-review::admin.review.tab', ProductReviewComposer::class);\n }",
"public function registerViewFinder()\n {\n $this->app->bind('view.finder', function () {\n return new FileViewFinder([\n $this->path,\n ]);\n });\n }",
"public function register()\n {\n $this->app->singleton('jecar-media', function($app) {\n return new MediaFileService;\n });\n $this->app->singleton('jecar', function($app) {\n return new JecarService;\n });\n\n $this->loadViewsFrom(\n $this->viewGroups(), 'jecar'\n );\n\n $this->publishables();\n\n $this->commands([\n PublishMigrations::class,\n PublishViews::class,\n ]);\n\n }",
"public function register()\n {\n $agent = new Agent();\n if(empty($agent->isDesktop())){\n View::addLocation(base_path().'/resources/views/mobile/');\n }\n View::addLocation(base_path().'/resources/views/desktop/');\n }"
] |
[
"0.8091441",
"0.6931096",
"0.67781615",
"0.66738975",
"0.63080335",
"0.6249045",
"0.6240803",
"0.62341213",
"0.62149566",
"0.61898816",
"0.6171216",
"0.6167375",
"0.61211175",
"0.611675",
"0.6089748",
"0.60874707",
"0.6066112",
"0.6051356",
"0.6033764",
"0.5985035",
"0.59818095",
"0.5960482",
"0.5920942",
"0.5905138",
"0.5902193",
"0.5897926",
"0.5889957",
"0.5887641",
"0.5862194",
"0.58525616"
] |
0.8166424
|
0
|
Register the asset publish console command.
|
protected function registerAssetPublishCommand()
{
$this->app->singleton('command.asset.publish', function ($app) {
return new AssetPublishCommand($app->make('asset.publisher'));
});
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function registerAssetCommand()\n {\n $this->app['command.torann.assets'] = $this->app->share(function($app)\n {\n return new AssetsCommand($app['torann.assets'], $app['files'], $app['torann.manifest']);\n });\n }",
"protected function registerConfigPublishCommand()\n {\n $this->app->singleton('command.config.publish', function ($app) {\n return new ConfigPublishCommand($app->make('config.publisher'));\n });\n }",
"protected function registerViewPublishCommand()\n {\n $this->app->singleton('command.view.publish', function ($app) {\n return new ViewPublishCommand($app->make('view.publisher'));\n });\n }",
"public function register()\n {\n parent::register();\n\n $this->commands([\n \\Luissobrinho\\LCrud\\Console\\Publish::class,\n ]);\n }",
"public function registerArtisanCommand()\n\t{\n\t\t$this->app->bindShared('optimus-prime.transformer.make', function($app)\n\t\t{\n\t\t\treturn $app->make('Mosaiqo\\OptimusPrime\\Console\\TransformerGenerate');\n\t\t});\n\n\t\t$this->commands('optimus-prime.transformer.make');\n\t}",
"protected function registerPackagingCommand()\n {\n $this->app->singleton('command.core.packaging', function () {\n return new \\Pw\\Core\\Console\\Commands\\CorePackagingCommand();\n });\n\n $this->commands('command.core.packaging');\n }",
"private function publishAssets()\n {\n $this->call('vendor:publish', [\n '--provider' => 'A17\\Twill\\TwillServiceProvider',\n '--tag' => 'assets',\n '--force' => true,\n ]);\n }",
"protected function registerBuildCommand()\n {\n $this->app['command.torann.assets.build'] = $this->app->share(function($app)\n {\n return new BuildCommand($app['torann.assets'], $app['files'], $app['torann.manifest']);\n });\n }",
"protected function defineAssetPublishing()\n {\n if (!$this->app['config']->get('laratrust.panel.register')) {\n return;\n }\n\n $this->publishes([\n __DIR__.'/../public' => public_path('vendor/laratrust'),\n ], 'laratrust-assets');\n }",
"protected function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../../config/knet.php' => $this->app->configPath('knet.php'),\n ], 'knet-config');\n\n $this->publishes([\n __DIR__ . '/../../database/migrations' => $this->app->databasePath('migrations'),\n ], 'knet-migrations');\n\n $this->publishes([\n __DIR__ . '/../../resources/views' => $this->app->resourcePath('views/vendor/knet'),\n ], 'knet-views');\n\n $this->publishes([\n __DIR__ . '/../../public' => public_path('vendor/knet'),\n ], 'knet-assets');\n\n $this->publishes([\n __DIR__ . '/../../stubs/KnetServiceProvider.stub' => app_path('Providers/KnetServiceProvider.php'),\n ], 'knet-provider');\n }\n }",
"protected function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/twilio-verify.php' => $this->app->configPath('twilio-verify.php'),\n ], 'config');\n\n $this->publishes([\n __DIR__.'/../database/migrations' => $this->app->databasePath('migrations'),\n ], 'migrations');\n\n $this->publishes([\n __DIR__ . '/../resources/lang' => resource_path('lang/vendor/twilio-verify'),\n ], 'translations');\n }\n }",
"private function registerPublishing(): void\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/ethereum.php' => config_path('ethereum.php'),\n ], 'ethereum-config');\n }\n }",
"protected function registerAssetPublisher()\n {\n $this->app->singleton('asset.publisher', function ($app) {\n $publicPath = $app->make('path.public');\n $publisher = new AssetPublisher($app->make('files'), $publicPath);\n $publisher->setPackagePath($app->make('path.base') . '/src');\n\n return $publisher;\n });\n }",
"private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }",
"public function defineAssetPublishing()\n {\n $this->publishes([\n DOCS_PATH . '/public' => public_path('vendor/documentation'),\n ], 'documentation-assets');\n }",
"protected function offerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/dashkit.php' => config_path('dashkit.php'),\n ], 'dashkit-config');\n\n $this->publishes([\n __DIR__ . '/../resources/views/dashkit.blade.php' => resource_path('views/' . config('dashkit.view') . '.blade.php'),\n ], 'dashkit-view');\n }\n }",
"private function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/telescope-error-service-client.php' => config_path('telescope-error-service-client.php'),\n ], 'telescope-error-service-client-config');\n }\n }",
"protected function registerPublishers()\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n /*\n // Register additional css assets with mrcore Layout\n Layout::css('css/wiki-bundle.css');\n\n // App base path\n $path = realpath(__DIR__.'/../');\n\n // Config publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.configs\"\n $this->publishes([\n \"$path/Config\" => base_path('/config/mrcore'),\n ], 'mrcore.parser.configs');\n\n // Migration publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.migrations\"\n $this->publishes([\n \"$path/Database/Migrations\" => base_path('/database/migrations'),\n ], 'mrcore.parser.migrations');\n\n // Seed publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.seeds\"\n $this->publishes([\n \"$path/Database/Seeds\" => base_path('/database/seeds'),\n ], 'mrcore.parser.seeds');\n */\n }",
"public function publishFiles()\n {\n $this->call('vendor:publish', [\n '--provider' => OxyNovaServiceProvider::class,\n '--tag' => ['config', 'translations', 'views', 'database'],\n ]);\n }",
"public function register()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/kustomer.php',\n 'kustomer'\n );\n\n $this->commands([\n Console\\PublishCommand::class,\n ]);\n }",
"public function handle()\n {\n $this->call('vendor:publish', [\n '--tag' => 'vapor-ui-assets',\n '--force' => true,\n ]);\n }",
"public function handle()\n {\n $this->call('vendor:publish');\n }",
"public function register()\n {\n $this->commands([\n \\Antares\\Audit\\Console\\CreateConfigCommand::class,\n ]);\n }",
"public function registerCommands(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands([GeneratePhaseRouter::class]);\n }\n }",
"public function publish($bundles)\n\t{\n\t\t// If no bundles are passed to the command, we'll just gather all\n\t\t// of the installed bundle names and publish the assets for each\n\t\t// of the bundles to the public directory.\n\t\tif (count($bundles) == 0) $bundles = Bundle::names();\n\n\t\t$publisher = IoC::resolve('bundle.publisher');\n\n\t\tforeach ($bundles as $bundle)\n\t\t{\n\t\t\t$publisher->publish($bundle);\n\t\t}\n\t}",
"public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \\Arcanesoft\\Pages\\PagesServiceProvider::class,\n ]);\n }",
"private function registerPluginMakeCommand()\n {\n $this->app->bindShared('command.make.plugin', function ($app)\n {\n return new PluginMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin');\n }",
"public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }",
"protected function defineAssetPublishing()\n {\n $this->publishes([\n __DIR__.'/../config/firefly.php' => config_path('firefly.php'),\n ], 'firefly-config');\n\n $this->publishes([\n __DIR__.'/../database/migrations/' => database_path('migrations'),\n ], 'firefly-migrations');\n\n $this->publishes([\n __DIR__.'/../public/' => public_path('vendor/firefly'),\n ], 'firefly-assets');\n }",
"protected function offerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/laratrust.php' => config_path('laratrust.php'),\n ], 'laratrust');\n\n $this->publishes([\n __DIR__. '/../config/laratrust_seeder.php' => config_path('laratrust_seeder.php'),\n ], 'laratrust-seeder');\n \n $this->publishes([\n __DIR__. '/../resources/views/panel' => resource_path('views/vendor/laratrust/panel'),\n ], 'laratrust-views');\n }\n }"
] |
[
"0.70786035",
"0.70358616",
"0.7035108",
"0.6459416",
"0.6260962",
"0.6225648",
"0.6215848",
"0.61656946",
"0.6007495",
"0.59275293",
"0.5926825",
"0.5917424",
"0.59150237",
"0.58893615",
"0.582482",
"0.58227324",
"0.5794735",
"0.5768603",
"0.5757896",
"0.57516736",
"0.5673871",
"0.5661266",
"0.5657459",
"0.56400734",
"0.56103885",
"0.5553009",
"0.55445796",
"0.5532139",
"0.5530277",
"0.5524502"
] |
0.86078393
|
0
|
Register the configuration publish console command.
|
protected function registerConfigPublishCommand()
{
$this->app->singleton('command.config.publish', function ($app) {
return new ConfigPublishCommand($app->make('config.publisher'));
});
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function registerAssetPublishCommand()\n {\n $this->app->singleton('command.asset.publish', function ($app) {\n return new AssetPublishCommand($app->make('asset.publisher'));\n });\n }",
"private function registerPublishing(): void\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/ethereum.php' => config_path('ethereum.php'),\n ], 'ethereum-config');\n }\n }",
"protected function registerConfigCommand()\n {\n $this->app->singleton('command.setting.config', function () {\n return new \\Setting\\Commands\\ConfigCommand;\n });\n }",
"private function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/telescope-error-service-client.php' => config_path('telescope-error-service-client.php'),\n ], 'telescope-error-service-client-config');\n }\n }",
"protected function registerViewPublishCommand()\n {\n $this->app->singleton('command.view.publish', function ($app) {\n return new ViewPublishCommand($app->make('view.publisher'));\n });\n }",
"public function register()\n {\n parent::register();\n\n $this->commands([\n \\Luissobrinho\\LCrud\\Console\\Publish::class,\n ]);\n }",
"protected function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/twilio-verify.php' => $this->app->configPath('twilio-verify.php'),\n ], 'config');\n\n $this->publishes([\n __DIR__.'/../database/migrations' => $this->app->databasePath('migrations'),\n ], 'migrations');\n\n $this->publishes([\n __DIR__ . '/../resources/lang' => resource_path('lang/vendor/twilio-verify'),\n ], 'translations');\n }\n }",
"protected function offerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/documentation.php' => config_path('documentation.php'),\n ], 'documentation-config');\n }\n }",
"protected function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../../config/knet.php' => $this->app->configPath('knet.php'),\n ], 'knet-config');\n\n $this->publishes([\n __DIR__ . '/../../database/migrations' => $this->app->databasePath('migrations'),\n ], 'knet-migrations');\n\n $this->publishes([\n __DIR__ . '/../../resources/views' => $this->app->resourcePath('views/vendor/knet'),\n ], 'knet-views');\n\n $this->publishes([\n __DIR__ . '/../../public' => public_path('vendor/knet'),\n ], 'knet-assets');\n\n $this->publishes([\n __DIR__ . '/../../stubs/KnetServiceProvider.stub' => app_path('Providers/KnetServiceProvider.php'),\n ], 'knet-provider');\n }\n }",
"private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }",
"public function register()\n {\n $this->commands([\n \\Antares\\Audit\\Console\\CreateConfigCommand::class,\n ]);\n }",
"public function register()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/kustomer.php',\n 'kustomer'\n );\n\n $this->commands([\n Console\\PublishCommand::class,\n ]);\n }",
"protected function registerPublishables()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/config/algorand.php' => config_path('algorand.php'),\n ], 'config');\n }\n }",
"protected function registerPublishing() : void\n {\n $this->publishes([\n __DIR__ . '/../config/dejavu.php' => config_path('dejavu.php')\n ], 'dejavu-config');\n }",
"protected function registerPublishing(): void\n {\n $this->publishes([\n __DIR__.'/config/permissions_makr.php' => config_path('permissions_makr.php'),\n ]);\n\n $this->publishes([\n __DIR__ . '/database/migrations/' => database_path('migrations')\n ], 'migrations');\n }",
"protected function offerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/dashkit.php' => config_path('dashkit.php'),\n ], 'dashkit-config');\n\n $this->publishes([\n __DIR__ . '/../resources/views/dashkit.blade.php' => resource_path('views/' . config('dashkit.view') . '.blade.php'),\n ], 'dashkit-view');\n }\n }",
"protected function registerSetupCommand()\n {\n $this->app->singleton('command.setting.setup', function () {\n return new \\Setting\\Commands\\SetupCommand;\n });\n }",
"public\n function register()\n {\n // Register the config publish path\n $configPath = __DIR__ . '/../config/' . self::PACKAGE . '.php';\n $this->mergeConfigFrom($configPath, self::PACKAGE);\n $this->publishes([$configPath => config_path(self::PACKAGE . '.php')], 'config');\n\n $this->app->singleton($command = 'command.generate.controller', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\ControllerGenerator($app['files'], $cache);\n\n return new Commands\\ControllerGeneratorCommand($generator);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.form', function ($app) {\n $gen = new Generators\\FormDumperGenerator($app['files'], new \\Mustache_Engine);\n\n return new Commands\\FormDumperCommand($gen);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.migration', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\MigrationGenerator($app['files'], $cache);\n\n return new Commands\\MigrationGeneratorCommand($generator);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.model', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\ModelGenerator($app['files'], $cache);\n\n return new Commands\\ModelGeneratorCommand($generator);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.pivot', function ($app) {\n return new Commands\\PivotGeneratorCommand;\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.resource', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\ResourceGenerator($app['files'], $cache);\n\n return new Commands\\ResourceGeneratorCommand($generator, $cache);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.scaffold', function ($app) {\n $generator = new Generators\\ResourceGenerator($app['files']);\n $cache = new Cache($app['files']);\n\n return new Commands\\ScaffoldGeneratorCommand($generator, $cache);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.seed', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\SeedGenerator($app['files'], $cache);\n\n return new Commands\\SeedGeneratorCommand($generator);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.test', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\TestGenerator($app['files'], $cache);\n\n return new Commands\\TestGeneratorCommand($generator);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.translations', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\TranslationsGenerator($app['files'], $cache);\n\n return new Commands\\TranslationsGeneratorCommand($generator);\n });\n $this->commands($command);\n\n $this->app->singleton($command = 'command.generate.view', function ($app) {\n $cache = new Cache($app['files']);\n $generator = new Generators\\ViewGenerator($app['files'], $cache);\n\n return new Commands\\ViewGeneratorCommand($generator);\n });\n $this->commands($command);\n }",
"public function registerArtisanCommand()\n\t{\n\t\t$this->app->bindShared('optimus-prime.transformer.make', function($app)\n\t\t{\n\t\t\treturn $app->make('Mosaiqo\\OptimusPrime\\Console\\TransformerGenerate');\n\t\t});\n\n\t\t$this->commands('optimus-prime.transformer.make');\n\t}",
"public function registerCommands(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands([GeneratePhaseRouter::class]);\n }\n }",
"protected function configurePublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../stubs/fortify.php' => config_path('fortify.php'),\n ], 'fortify-config');\n\n $this->publishes([\n __DIR__.'/../stubs/CreateNewUser.php' => app_path('Actions/Fortify/CreateNewUser.php'),\n __DIR__.'/../stubs/FortifyServiceProvider.php' => app_path('Providers/FortifyServiceProvider.php'),\n __DIR__.'/../stubs/PasswordValidationRules.php' => app_path('Actions/Fortify/PasswordValidationRules.php'),\n __DIR__.'/../stubs/ResetUserPassword.php' => app_path('Actions/Fortify/ResetUserPassword.php'),\n __DIR__.'/../stubs/UpdateUserProfileInformation.php' => app_path('Actions/Fortify/UpdateUserProfileInformation.php'),\n __DIR__.'/../stubs/UpdateUserPassword.php' => app_path('Actions/Fortify/UpdateUserPassword.php'),\n ], 'fortify-support');\n\n $this->publishes([\n __DIR__.'/../database/migrations' => database_path('migrations'),\n ], 'fortify-migrations');\n }\n }",
"protected function registerPublishing()\n {\n $this->publishes([\n __DIR__.'/../config/ziggeo.php' => config_path('ziggeo.php'),\n ], 'ziggeo-config');\n }",
"protected function registerPublishers()\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n /*\n // Register additional css assets with mrcore Layout\n Layout::css('css/wiki-bundle.css');\n\n // App base path\n $path = realpath(__DIR__.'/../');\n\n // Config publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.configs\"\n $this->publishes([\n \"$path/Config\" => base_path('/config/mrcore'),\n ], 'mrcore.parser.configs');\n\n // Migration publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.migrations\"\n $this->publishes([\n \"$path/Database/Migrations\" => base_path('/database/migrations'),\n ], 'mrcore.parser.migrations');\n\n // Seed publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.seeds\"\n $this->publishes([\n \"$path/Database/Seeds\" => base_path('/database/seeds'),\n ], 'mrcore.parser.seeds');\n */\n }",
"protected function registerPublishing()\n {\n $this->publishes([\n __DIR__ . '/../config/shop.php' => config_path('shop.php')\n ], 'shop-config');\n /* Views File Publish */\n $this->publishes([\n __DIR__ . '/../resources/views' => resource_path('views/vendor/shop'),\n ], 'shop-views');\n /* Migration File Publish */\n $this->publishes([\n __DIR__ . '/../database/migartions' => database_path('migrations')\n ], 'shop-migrations');\n /* Seed File Publish */\n $this->publishes([\n __DIR__ . '/../database/seeds' => database_path('seeds')\n ], 'shop-seeds');\n }",
"protected function offerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/laratrust.php' => config_path('laratrust.php'),\n ], 'laratrust');\n\n $this->publishes([\n __DIR__. '/../config/laratrust_seeder.php' => config_path('laratrust_seeder.php'),\n ], 'laratrust-seeder');\n \n $this->publishes([\n __DIR__. '/../resources/views/panel' => resource_path('views/vendor/laratrust/panel'),\n ], 'laratrust-views');\n }\n }",
"protected function offerPublishing(): void\n {\n if ($this->app->runningInConsole()) {\n $providerName = 'RabbitEventsServiceProvider';\n\n $this->publishes([\n __DIR__ . \"/../stubs/{$providerName}.stub\" => $this->app->path(\"Providers/{$providerName}.php\"),\n ], 'rabbitevents-provider');\n $this->publishes([\n __DIR__ . '/../config/rabbitevents.php' => $this->app->configPath('rabbitevents.php'),\n ], 'rabbitevents-config');\n }\n }",
"protected function registerPublishes()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../../database/migrations' => database_path('migrations'),\n ], 'migrations');\n }\n }",
"protected function registerConfigPublisher()\n {\n $this->app->singleton('config.publisher', function ($app) {\n $path = $app->make('path.config');\n\n $publisher = new ConfigPublisher($app->make('files'), $path);\n\n $publisher->setPackagePath($app->make('path.base') . '/src');\n\n return $publisher;\n });\n }",
"protected function registerPublishing(): void\n {\n $this->publishes([\n __DIR__.'/../config/url_rewrite.php' => config_path('url_rewrite.php'),\n ], 'nova-url-rewrite-config');\n\n $this->publishes([\n __DIR__.'/../database/migrations' => database_path('migrations'),\n ], 'nova-url-rewrite-migrations');\n\n $this->publishes([\n __DIR__.'/../resources/lang/' => resource_path('lang/vendor/nova_url_rewrite'),\n ], 'nova-url-rewrite-translations');\n }",
"protected function registerRegisterCommand()\n {\n $this->app->singleton('command.presenter.register', function ($app) {\n return new PresenterRegisterCommand(\n $app['datamapper.classfinder'],\n $app['datamapper.presenter.scanner'],\n $app['datamapper.presenter.repository'],\n $app['config']['datamapper']\n );\n });\n }"
] |
[
"0.7236059",
"0.7189161",
"0.7064842",
"0.70468676",
"0.69670457",
"0.6842619",
"0.67028034",
"0.6639502",
"0.6625327",
"0.6571785",
"0.6567898",
"0.6566074",
"0.6464756",
"0.6406616",
"0.6351922",
"0.6318691",
"0.6235793",
"0.6196045",
"0.61731714",
"0.6154795",
"0.6134027",
"0.6132165",
"0.61272913",
"0.60878485",
"0.60811543",
"0.6062407",
"0.60564876",
"0.6013685",
"0.6006418",
"0.6005957"
] |
0.8651696
|
0
|
Register the view publish console command.
|
protected function registerViewPublishCommand()
{
$this->app->singleton('command.view.publish', function ($app) {
return new ViewPublishCommand($app->make('view.publisher'));
});
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function registerAssetPublishCommand()\n {\n $this->app->singleton('command.asset.publish', function ($app) {\n return new AssetPublishCommand($app->make('asset.publisher'));\n });\n }",
"protected function registerConfigPublishCommand()\n {\n $this->app->singleton('command.config.publish', function ($app) {\n return new ConfigPublishCommand($app->make('config.publisher'));\n });\n }",
"public function register()\n {\n parent::register();\n\n $this->commands([\n \\Luissobrinho\\LCrud\\Console\\Publish::class,\n ]);\n }",
"public function registerArtisanCommand()\n\t{\n\t\t$this->app->bindShared('optimus-prime.transformer.make', function($app)\n\t\t{\n\t\t\treturn $app->make('Mosaiqo\\OptimusPrime\\Console\\TransformerGenerate');\n\t\t});\n\n\t\t$this->commands('optimus-prime.transformer.make');\n\t}",
"protected function registerViewPublisher()\n {\n $this->app->singleton('view.publisher', function ($app) {\n $viewPath = $app->make('path.base') . '/resources/views';\n $publisher = new ViewPublisher($app->make('files'), $viewPath);\n $publisher->setPackagePath($app->make('path.base') . '/src');\n\n return $publisher;\n });\n }",
"private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }",
"public function register()\n\t{\n $this->app['tencdn.publish'] = $this->app->share(function($app)\n {\n return new Publish();\n });\n\n $this->commands('tencdn.publish');\n\t}",
"public function registerCommands(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands([GeneratePhaseRouter::class]);\n }\n }",
"protected function registerRegisterCommand()\n {\n $this->app->singleton('command.presenter.register', function ($app) {\n return new PresenterRegisterCommand(\n $app['datamapper.classfinder'],\n $app['datamapper.presenter.scanner'],\n $app['datamapper.presenter.repository'],\n $app['config']['datamapper']\n );\n });\n }",
"protected function offerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/dashkit.php' => config_path('dashkit.php'),\n ], 'dashkit-config');\n\n $this->publishes([\n __DIR__ . '/../resources/views/dashkit.blade.php' => resource_path('views/' . config('dashkit.view') . '.blade.php'),\n ], 'dashkit-view');\n }\n }",
"protected function registerBuildCommand()\n {\n $this->app['command.torann.assets.build'] = $this->app->share(function($app)\n {\n return new BuildCommand($app['torann.assets'], $app['files'], $app['torann.manifest']);\n });\n }",
"protected function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../../config/knet.php' => $this->app->configPath('knet.php'),\n ], 'knet-config');\n\n $this->publishes([\n __DIR__ . '/../../database/migrations' => $this->app->databasePath('migrations'),\n ], 'knet-migrations');\n\n $this->publishes([\n __DIR__ . '/../../resources/views' => $this->app->resourcePath('views/vendor/knet'),\n ], 'knet-views');\n\n $this->publishes([\n __DIR__ . '/../../public' => public_path('vendor/knet'),\n ], 'knet-assets');\n\n $this->publishes([\n __DIR__ . '/../../stubs/KnetServiceProvider.stub' => app_path('Providers/KnetServiceProvider.php'),\n ], 'knet-provider');\n }\n }",
"protected function registerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/twilio-verify.php' => $this->app->configPath('twilio-verify.php'),\n ], 'config');\n\n $this->publishes([\n __DIR__.'/../database/migrations' => $this->app->databasePath('migrations'),\n ], 'migrations');\n\n $this->publishes([\n __DIR__ . '/../resources/lang' => resource_path('lang/vendor/twilio-verify'),\n ], 'translations');\n }\n }",
"protected function registerSetupCommand()\n {\n $this->app->singleton('command.setting.setup', function () {\n return new \\Setting\\Commands\\SetupCommand;\n });\n }",
"public function register()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/kustomer.php',\n 'kustomer'\n );\n\n $this->commands([\n Console\\PublishCommand::class,\n ]);\n }",
"protected function registerPackagingCommand()\n {\n $this->app->singleton('command.core.packaging', function () {\n return new \\Pw\\Core\\Console\\Commands\\CorePackagingCommand();\n });\n\n $this->commands('command.core.packaging');\n }",
"public function register() {\n\n $this->app->singleton('command.codezero.view.make', function ($app) {\n return $app[GenerateViewMigrationCommand::class];\n });\n\n $this->commands('command.codezero.view.make');\n\n $this->app->singleton('command.codezero.view.migrate', function ($app) {\n return $app[MigrateViewsCommand::class];\n });\n\n $this->commands('command.codezero.view.migrate');\n\n }",
"private function registerImportCommand()\n\t{\n\t\t$this->app->singleton('glottos.command.import', function($app) {\n\t\t\treturn new ImportCommand;\n\t\t});\n\t}",
"protected function registerPluginSeedCommand()\n {\n $this->app->singleton('command.plugin.seed', function ($app) {\n return new PluginSeedCommand($app['plugins']);\n });\n\n $this->commands('command.plugin.seed');\n }",
"public function register()\n {\n $this->commands(['Serbinario\\L5scaffold\\Console\\Commands\\CrudGeneratorCommand']);\n\n //\n }",
"protected function offerPublishing()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/laratrust.php' => config_path('laratrust.php'),\n ], 'laratrust');\n\n $this->publishes([\n __DIR__. '/../config/laratrust_seeder.php' => config_path('laratrust_seeder.php'),\n ], 'laratrust-seeder');\n \n $this->publishes([\n __DIR__. '/../resources/views/panel' => resource_path('views/vendor/laratrust/panel'),\n ], 'laratrust-views');\n }\n }",
"protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}",
"private function registerReportCommand()\n {\n $this->app->singleton('firewall.list.command', function () {\n return new ReportCommand();\n });\n\n $this->commands('firewall.list.command');\n }",
"public function register()\n {\n $this->registerConsoleCommand('Gency.Slack.Bot', Console\\SlackBot::class);\n }",
"protected function publishViews()\n {\n $this->loadViewsFrom($this->basePath('resources/views'), 'flare');\n $this->publishes([\n $this->basePath('resources/views') => base_path('resources/views/vendor/flare'),\n ]);\n }",
"function registerMvcGenerator()\n {\n $this->app->singleton('command.kanok.mvc.generate', function ($app) {\n return $app[get_class(new GenerateMvcConsole())];\n });\n $this->commands('command.kanok.mvc.generate');\n\n $this->app->singleton('command.kanok.view.generate', function ($app) {\n return $app[get_class(new generateViewConsole())];\n });\n $this->commands('command.kanok.view.generate');\n }",
"private function registerViews()\n {\n $viewsPath = $this->getBasePath() . '/resources/views';\n\n $this->loadViewsFrom($viewsPath, $this->package);\n $this->publishes([\n $viewsPath => base_path(\"resources/views/arcanedev/{$this->package}\"),\n ], 'views');\n }",
"protected function registerPublishers()\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n /*\n // Register additional css assets with mrcore Layout\n Layout::css('css/wiki-bundle.css');\n\n // App base path\n $path = realpath(__DIR__.'/../');\n\n // Config publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.configs\"\n $this->publishes([\n \"$path/Config\" => base_path('/config/mrcore'),\n ], 'mrcore.parser.configs');\n\n // Migration publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.migrations\"\n $this->publishes([\n \"$path/Database/Migrations\" => base_path('/database/migrations'),\n ], 'mrcore.parser.migrations');\n\n // Seed publishing rules\n // ./artisan vendor:publish --tag=\"mrcore.parser.seeds\"\n $this->publishes([\n \"$path/Database/Seeds\" => base_path('/database/seeds'),\n ], 'mrcore.parser.seeds');\n */\n }",
"private function registerCommands() {\n\t\t$this->app->singleton('command.lemon.upload_migration', function ($app) {\n\t\t\treturn new MigrationCommand();\n\t\t});\n\t}",
"public function register()\n {\n $this->commands([\n \\Antares\\Audit\\Console\\CreateConfigCommand::class,\n ]);\n }"
] |
[
"0.7374922",
"0.7167881",
"0.6830514",
"0.6297671",
"0.60726947",
"0.5994038",
"0.5969645",
"0.59458375",
"0.59344745",
"0.58903354",
"0.5803197",
"0.57845926",
"0.57784367",
"0.57687956",
"0.57505804",
"0.57501477",
"0.5736252",
"0.567907",
"0.56723124",
"0.56692946",
"0.56530726",
"0.56453",
"0.56429386",
"0.5629851",
"0.56254756",
"0.56138873",
"0.56078565",
"0.55944574",
"0.5590085",
"0.5587825"
] |
0.8769914
|
0
|
From the initial `findThreadsWithPostsByUser` finder, filter out threads from forums that are not included in the thread log, apply user filter, and limit by page.
|
private function filterThreads(\XF\Finder\Thread $finder, $user_id, $page, $perPage)
{
$filters = $this->getThreadLogFilterInput($user_id);
$finder->where('Forum.shinka_thread_log', true);
$this->applyFilters($finder, $filters);
$finder->limitByPage($page, $perPage, $perPage * 2);
$threads = $finder->fetch()
->filter(function(Thread $thread)
{
return $thread->canView();
})
->slice(0, $perPage, true);
return $threads;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function show_posts(\n $thread, $forum, $start, $postid, $sort_style, $filter, $logged_in_user\n) {\n $n = 1;\n\n $num_to_show = 20;\n if ($logged_in_user && $logged_in_user->prefs->display_wrap_postcount > 0) {\n $num_to_show = $logged_in_user->prefs->display_wrap_postcount;\n }\n\n // let moderators see all posts, including hidden ones\n //\n if (is_moderator($logged_in_user, $forum)) {\n $show_hidden = true;\n } else {\n $show_hidden = false;\n }\n\n $posts = get_thread_posts($thread->id, $sort_style, $show_hidden);\n\n $latest_viewed = 0;\n $forum_log = null;\n if ($logged_in_user) {\n $forum_log = BoincForumLogging::lookup($logged_in_user->id, $thread->id);\n if ($forum_log) {\n $latest_viewed = $forum_log->timestamp;\n }\n }\n\n if ($sort_style == CREATE_TIME_OLD) {\n // show the last page\n //\n $nposts = sizeof($posts);\n if ($nposts) $nposts -= 1;\n $page = (int)($nposts/$num_to_show);\n $default_start = $page*$num_to_show;\n } else {\n $default_start = 0;\n }\n\n // jump to a specific post if needed\n //\n $jump_to_post = null;\n if ($start === null) {\n if ($postid) {\n // jump to a specific post\n //\n $i = 0;\n foreach ($posts as $post) {\n if ($post->id == $postid) {\n $start = $i - ($i % $num_to_show);\n $jump_to_post = $post;\n break;\n }\n $i++;\n }\n if ($start === null) {\n echo \"Post $postid not found.\";\n return;\n }\n } else if ($logged_in_user && $logged_in_user->prefs->jump_to_unread) {\n // jump to the first unread post\n //\n $i = 0;\n $ibest = 0;\n foreach ($posts as $post) {\n if ($post->timestamp > $latest_viewed) {\n if (!$jump_to_post || ($post->timestamp < $jump_to_post->timestamp)) {\n $jump_to_post = $post;\n $ibest = $i;\n }\n }\n $i++;\n }\n if ($jump_to_post) {\n $start = $ibest - ($ibest % $num_to_show);\n } else {\n $start = $default_start;\n }\n } else {\n $start = $default_start;\n }\n }\n\n $page_nav = page_links(\n \"forum_thread.php?id=$thread->id&sort_style=$sort_style\",\n sizeof($posts),\n $num_to_show,\n $start\n );\n\n echo $page_nav;\n\n $num_shown = 0;\n $num_skipped = 0;\n $headings = array(array(tra(\"Author\"),\"authorcol\"), array(tra(\"Message\"),\"\"));\n start_forum_table($headings, \"id=\\\"thread\\\" cellspacing=0\");\n\n $latest_shown_timestamp = 0;\n foreach ($posts as $post) {\n if ($num_skipped < $start) {\n $num_skipped++;\n continue;\n }\n if ($num_shown == $num_to_show) {\n break;\n }\n show_post(\n $post, $thread, $forum, $logged_in_user, $latest_viewed, $n,\n FORUM_CONTROLS, $filter\n );\n $n = ($n+1)%2;\n \n if ($post->timestamp > $latest_shown_timestamp) {\n $latest_shown_timestamp = $post->timestamp;\n }\n $num_shown++;\n }\n end_table();\n echo $page_nav;\n\n if ($jump_to_post) {\n echo \"<script>function jumpToUnread(){location.href='#\".$jump_to_post->id.\"';}</script>\";\n } else {\n echo \"<script>function jumpToUnread(){};</script>\";\n }\n\n if ($logged_in_user) {\n if (!$forum_log || $latest_shown_timestamp > $forum_log->timestamp) {\n BoincForumLogging::replace(\n $logged_in_user->id, $thread->id, $latest_shown_timestamp\n );\n }\n }\n}",
"private function getFilteredForums() {\r\n \r\n $timer = Debug::GetTimer(); \r\n \r\n if (!isset($this->User->Guest) || !$this->User->Guest instanceof User) {\r\n return \"\";\r\n }\r\n \r\n $mckey = sprintf(\"forum.post.filter.user:%d\", $this->User->Guest->id);\r\n \r\n if ($forum_post_filter = $this->Redis->fetch($mckey)) {\r\n return $forum_post_filter;\r\n }\r\n \r\n $Forums = new Forums;\r\n $Index = new Index;\r\n \r\n $acl = $Forums->setUser($this->User->Guest)->getACL();\r\n \r\n $allowed_forums = array(); \r\n \r\n foreach ($Index->forums() as $row) {\r\n $Forum = new Forum($row['forum_id']);\r\n \r\n if ($Forum->setUser($this->User->Guest)->isAllowed(Forums::AUTH_READ)) {\r\n $allowed_forums[] = $Forum->id;\r\n }\r\n }\r\n \r\n $forum_filter = \"AND p.forum_id IN (\" . implode(\",\", $allowed_forums) . \")\";\r\n \r\n if (count($allowed_forums) === 0) {\r\n $this->Redis->save($mckey, \"\", strtotime(\"+1 week\"));\r\n return \"\";\r\n }\r\n \r\n $forum_post_filter = \"AND id NOT IN (SELECT l.id AS log_id\r\n FROM log_general AS l \r\n LEFT JOIN nuke_bbposts AS p ON p.post_id = l.value\r\n WHERE l.key = 'post_id' \r\n \" . $forum_filter . \")\";\r\n \r\n $this->Redis->save($mckey, $forum_post_filter, strtotime(\"+1 week\"));\r\n \r\n Debug::LogEvent(__METHOD__, $timer);\r\n \r\n return $forum_post_filter;\r\n }",
"function manynewposts_thread() {\n global $thread, $templates, $db, $mybb, $settings;\n\n $query = $db->query(\"\n SELECT\n dateline, pid\n FROM \" . TABLE_PREFIX . \"posts\n WHERE\n tid='\".$db->escape_string($thread['tid']).\"'\n \");\n\n $lastpost = array();\n $lastpost_pid = array();\n\n while($result=$db->fetch_array($query))\n {\n $lastpost[] = $result['dateline'];\n $lastpost_pid[$result['dateline']] = $result['pid'];\n }\n\n $query = $db->query(\"\n SELECT\n tr.dateline AS `tr_dateline`,\n fr.dateline AS `fr_dateline`\n FROM \" . TABLE_PREFIX . \"posts p\n LEFT JOIN\n \" . TABLE_PREFIX . \"threadsread tr\n ON\n tr.tid = p.tid\n LEFT JOIN\n \" . TABLE_PREFIX . \"forumsread fr\n ON\n fr.fid = p.fid\n WHERE\n tr.uid='\".$db->escape_string($mybb->user['uid']).\"' and\n fr.uid='\".$db->escape_string($mybb->user['uid']).\"'\n \");\n\n $userlastview = array();\n $userlastview_forum = array();\n\n while($result=$db->fetch_array($query))\n {\n $userlastview[] = $result['tr_dateline'];\n $userlastview_forum[] = $result['fr_dateline'];\n }\n\n $userlastview = (count($userlastview) > 0) ? max($userlastview) : 0;\n $userlastview_forum = (count($userlastview_forum) > 0) ? max($userlastview_forum) : 0;\n\n $timelimit = $userlastview + ($settings['threadreadcut'] * 24 * 60 * 60);\n $newlastpost = array();\n\n if($userlastview && $timelimit > TIME_NOW) {\n foreach ($lastpost as $lastpost_number) {\n if($lastpost_number > $userlastview_forum && $lastpost_number > $userlastview) {\n $newlastpost[] = $lastpost_number;\n }\n }\n }\n\n $count = count($newlastpost);\n\n if($count == 0) return;\n\n $posts = $count == 1 ? 'post':'posts';\n\n $lastseenpost_pid = $lastpost_pid[min($newlastpost)];\n $manynewposts = \"\";\n\n if($mybb->user['uid']) {\n if($count > 0) {\n $manynewposts = $templates->get('manynewposts');\n $manynewposts = str_replace(\"{newposts_link}\", \"./showthread.php?tid=\".$thread['tid'].\"&pid=\".$lastseenpost_pid.\"#pid\".$lastseenpost_pid, $manynewposts);\n $manynewposts = str_replace(\"{newposts}\", $count, $manynewposts);\n $manynewposts = str_replace(\"{posts}\", $posts, $manynewposts);\n }\n }\n $thread['manynewposts'] = $manynewposts;\n}",
"public function actionIndex()\n\t{\n\t\t$forumId = $this->_input->filterSingle('node_id', XenForo_Input::UINT);\n\t\tif (empty($forumId))\n\t\t{\n\t\t\treturn parent::actionIndex();\n\t\t}\n\t\t\n\t\t\n\t\t$options = XenForo_Application::get('options');\n\t\tif (($forumId && $forumId != $options->cmfUserBlogsNode) || $this->_routeMatch->getResponseType() == 'rss' || $this->_input->filterSingle('user_id', XenForo_Input::UINT))\n\t\t{\n\t\t\treturn parent::actionIndex();\n\t\t}\n\t\t\n\t\t/** @var $ftpHelper XenForo_ControllerHelper_ForumThreadPost */\n\t\t$ftpHelper = $this->getHelper('ForumThreadPost');\n\t\t$forum = $ftpHelper->assertForumValidAndViewable(\n\t\t\t$forumId,\n\t\t\t$this->_getForumFetchOptions()\n\t\t);\n\t\t$forumId = $forum['node_id'];\n\n\t\t$visitor = XenForo_Visitor::getInstance();\n\t\t$userBlogModel = $this->_getUserBlogModel();\n\t\t$forumModel = $this->_getForumModel();\n\n\t\t$page = max(1, $this->_input->filterSingle('page', XenForo_Input::UINT));\n\t\t$usersPerPage = $options->cmfUserBlogsPerPage;\n\n\t\t$this->canonicalizeRequestUrl(\n\t\t\tXenForo_Link::buildPublicLink('forums', $forum, array('page' => $page))\n\t\t);\n\n\t\tlist($defaultOrder, $defaultOrderDirection) = $this->_getDefaultThreadSort($forum);\n\n\t\t// only default sort by last_post_date desc\n\t\t$order = $defaultOrder;\n\t\t$orderDirection = $defaultOrderDirection;\n\n\t\t//all threads and fake value for disabling \"mark read\"\n\t\t$displayConditions = array();\n\n\t\t$fetchElements = $this->_getThreadFetchElements(\n\t\t\t$forum, $displayConditions,\n\t\t\t$usersPerPage, $page, $order, $orderDirection\n\t\t);\n\t\t$threadFetchConditions = $fetchElements['conditions'];\n\t\t$threadFetchOptions = $fetchElements['options'] + array(\n\t\t\t'perPage' => $usersPerPage,\n\t\t\t'page' => $page,\n\t\t\t'order' => $order,\n\t\t\t'orderDirection' => $orderDirection\n\t\t);\n\t\tunset($fetchElements);\n\n\n\t\t$totalUserBlogs = $userBlogModel->countUserBlogs($threadFetchConditions);\n\t\t$this->canonicalizePageNumber($page, $usersPerPage, $totalUserBlogs, 'forums', $forum);\n\n\t\t$permissions = $visitor->getNodePermissions($forumId);\n\n\t\t// get the ordering params set for the header links\n\t\t$orderParams = array();\n\t\t$pageNavParams = $displayConditions;\n//\t\t$pageNavParams['order'] = ($order != $defaultOrder ? $order : false);\n//\t\t$pageNavParams['direction'] = ($orderDirection != $defaultOrderDirection ? $orderDirection : false);\n\t\t$pageNavParams['order'] = false;\n\t\t$pageNavParams['direction'] = false;\n\n\t\t$userBlogs = $userBlogModel->getNodeUserDataForListDisplay($forum, $threadFetchConditions, $threadFetchOptions, $permissions);\n\t\t$viewParams = array(\n\t\t\t'nodeList' => $userBlogs,\n\t\t\t'forum' => $forum,\n\t\t\t'nodeBreadCrumbs' => $ftpHelper->getNodeBreadCrumbs($forum, false),\n\n\t\t\t'canPostThread' => $forumModel->canPostThreadInForum($forum),\n\t\t\t'canSearch' => $visitor->canSearch(),\n\n\t\t\t//TODO Ignore List\n\t\t\t'ignoredNames' => array(), //$this->_getIgnoredContentUserNames($threads) + $this->_getIgnoredContentUserNames($stickyThreads),\n\n\t\t\t'order' => $order,\n\t\t\t'orderDirection' => $orderDirection,\n\t\t\t'orderParams' => $orderParams,\n\t\t\t'displayConditions' => $displayConditions,\n\n\t\t\t'pageNavParams' => $pageNavParams,\n\t\t\t'page' => $page,\n\t\t\t'blogsStartOffset' => ($page - 1) * $usersPerPage + 1,\n\t\t\t'blogsEndOffset' => ($page - 1) * $usersPerPage + count($userBlogs['nodesGrouped'][$forumId]),\n\t\t\t'blogsPerPage' => $usersPerPage,\n\t\t\t'totalBlogs' => $totalUserBlogs,\n\n\t\t\t'showPostedNotice' => $this->_input->filterSingle('posted', XenForo_Input::UINT)\n\t\t);\n\n\t\treturn $this->responseView('XenForo_ViewPublic_Forum_View', 'cmf_user_blog_view', $viewParams);\n\t}",
"function fetch_thread_move_prune_sql($thread)\n{\n\tglobal $DB_site, $vbphrase;\n\n\t$query = '1=1';\n\n\t// original post\n\tif (intval($thread['originaldaysolder']))\n\t{\n\t\t$query .= ' AND thread.dateline <= ' . (TIMENOW - ($thread['originaldaysolder'] * 86400));\n\t}\n\tif (intval($thread['originaldaysnewer']))\n\t{\n\t\t$query .= ' AND thread.dateline >= ' . (TIMENOW - ($thread['originaldaysnewer'] * 86400));\n\t}\n\n\t// last post\n\tif (intval($thread['lastdaysolder']))\n\t{\n\t\t$query .= ' AND thread.lastpost <= ' . (TIMENOW - ($thread['lastdaysolder'] * 86400));\n\t}\n\tif (intval($thread['lastdaysnewer']))\n\t{\n\t\t$query .= ' AND thread.lastpost >= ' . (TIMENOW - ($thread['lastdaysnewer'] * 86400));\n\t}\n\n\t// replies\n\tif (intval($thread['repliesleast']) > 0)\n\t{\n\t\t$query .= ' AND thread.replycount >= ' . intval($thread['repliesleast']);\n\t}\n\tif (intval($thread['repliesmost']) > -1)\n\t{\n\t\t$query .= ' AND thread.replycount <= ' . intval($thread['repliesmost']);\n\t}\n\n\t// views\n\tif (intval($thread['viewsleast']) > 0)\n\t{\n\t\t$query .= ' AND thread.views >= ' . intval($thread['viewsleast']);\n\t}\n\tif (intval($thread['viewsmost']) > -1)\n\t{\n\t\t$query .= ' AND thread.views <= ' . intval($thread['viewsmost']);\n\t}\n\n\t// sticky\n\tif ($thread['issticky'] == 1)\n\t{\n\t\t$query .= ' AND thread.sticky = 1';\n\t}\n\telse if ($thread['issticky'] == 0)\n\n\t{\n\t\t$query .= ' AND thread.sticky = 0';\n\t}\n\n\t// deleted\n\tif ($thread['isdeleted'] == 1)\n\t{\n\t\t$query .= ' AND deletionlog.primaryid IS NOT NULL';\n\t}\n\telse if ($thread['isdeleted'] == 0)\n\t{\n\t\t$query .= ' AND deletionlog.primaryid IS NULL';\n\t}\n\n\t// open\n\tif ($thread['isopen'] == 1)\n\t{\n\t\t$query .= ' AND thread.open = 1';\n\t}\n\telse if ($thread['isopen'] == 0)\n\t{\n\t\t$query .= ' AND thread.open = 0';\n\t}\n\n\t// visible\n\tif ($thread['isvisible'] == 1)\n\t{\n\t\t$query .= ' AND thread.visible = 1';\n\t}\n\telse if ($thread['isvisible'] == 0)\n\t{\n\t\t$query .= ' AND thread.visible = 0';\n\t}\n\n\t// redirect\n\tif ($thread['isredirect'] == 1)\n\t{\n\t\t$query .= ' AND thread.open = 10';\n\t}\n\telse if ($thread['isredirect'] == 0)\n\t{\n\t\t$query .= ' AND thread.open <> 10';\n\t}\n\n\t// posted by\n\tif ($thread['posteduser'])\n\t{\n\t\t$user = $DB_site->query_first(\"\n\t\t\tSELECT userid\n\t\t\tFROM \" . TABLE_PREFIX . \"user\n\t\t\tWHERE username = '\" . addslashes(htmlspecialchars_uni($thread['posteduser'])) . \"'\n\t\t\");\n\t\tif (!$user)\n\t\t{\n\t\t\tprint_stop_message('invalid_user_specified');\n\t\t}\n\t\t$query .= \" AND thread.postuserid = $user[userid]\";\n\t}\n\n\t// title contains\n\tif ($thread['titlecontains'])\n\t{\n\t\t$query .= \" AND thread.title LIKE '%\" . addslashes_like(htmlspecialchars_uni($thread['titlecontains'])) . \"%'\";\n\t}\n\n\t// forum\n\tif ($thread['subforums'])\n\t{\n\t\t$query .= \" AND (thread.forumid = $thread[forumid] OR forum.parentlist LIKE '%,$thread[forumid],%')\";\n\t}\n\telse\n\t{\n\t\t$query .= \" AND thread.forumid = $thread[forumid]\";\n\t}\n\n\treturn $query;\n}",
"public function limit_our_posts( $query ){\n\n\t\t// make sure you write you pre_get_posts stuff to remove any post with a key set (where you saved your user_id)\n\t\t// then my filter below should include them back in for a user_id if it matches the current user_id\n\n\t\tif ( is_user_logged_in() ) {\n\t\t\tadd_filter( 'posts_where', array( $this, 'custom_where' ) );\n\t\t}\n\n\t}",
"function get_user_forum_posts($id, $limit = 5)\r\n\t{\r\n\t\t$this->db->select(\"forum_reply.id as reply_id, forum_reply.reply_date, forum_reply.topic_id, forum_topic.topic, forum_categories_descriptions_language.title\");\r\n\t\t$this->db->from(\"forum_reply\");\r\n\t\t$this->db->join(\"forum_topic\", \"forum_reply.topic_id = forum_topic.id\", \"\");\r\n\t\t$this->db->join(\"forum_categories_descriptions_language\", \"forum_topic.cat_id = forum_categories_descriptions_language.cat_id\", \"\");\r\n\t\t$this->db->where(\"forum_reply.user_id\", $id);\r\n\t\t$this->db->order_by(\"reply_date\", \"desc\");\r\n\t\t$this->db->limit($limit);\r\n\r\n\t\t$query = $this->db->get();\r\n\r\n\t\treturn $query->result();\r\n\t}",
"function show_post(\n $post, $thread, $forum, $logged_in_user, $latest_viewed, $n,\n $controls=FORUM_CONTROLS, $filter=true\n) {\n global $country_to_iso3166_2;\n\n $user = BoincUser::lookup_id($post->user);\n BoincForumPrefs::lookup($user);\n if (is_banished($user) && !is_moderator($logged_in_user, $forum)) {\n return;\n }\n\n // If the user no longer exists, skip the post\n //\n if (!$user){\n return;\n }\n\n $config = get_config();\n $no_forum_rating = parse_bool($config, \"no_forum_rating\");\n\n $tokens = \"\";\n $options = get_output_options($logged_in_user);\n\n // check whether the poster is on the list of people to ignore\n //\n $ignore_poster = false;\n if ($logged_in_user){\n $tokens = url_tokens($logged_in_user->authenticator);\n if (is_ignoring($logged_in_user, $user)){\n $ignore_poster = true;\n }\n }\n\n // The creator can edit the post, but only in a specified amount of time\n // (exception: a moderator can edit his/her posts at any time)\n //\n $can_edit = false;\n if ($logged_in_user) {\n if ($user->id == $logged_in_user->id) {\n if (is_moderator($logged_in_user, $forum)) {\n $can_edit = true;\n } else if (can_reply($thread, $forum, $logged_in_user)) {\n $time_limit = $post->timestamp+MAXIMUM_EDIT_TIME;\n $can_edit = time()<$time_limit;\n } else {\n $can_edit = false;\n }\n }\n }\n\n\n // Print the special user lines, if any\n //\n global $special_user_bitfield;\n $fstatus=\"\";\n $keys = array_keys($special_user_bitfield);\n $is_posted_by_special = false;\n for ($i=0; $i<sizeof($special_user_bitfield);$i++) {\n if ($user->prefs && $user->prefs->privilege($keys[$i])) {\n $fstatus.=$special_user_bitfield[$keys[$i]].\"<br>\";\n $is_posted_by_special = true;\n }\n }\n \n // Highlight special users if set in prefs;\n //\n if ($logged_in_user && $logged_in_user->prefs){\n $highlight = $logged_in_user->prefs->highlight_special && $is_posted_by_special;\n } else {\n $highlight = $is_posted_by_special;\n }\n echo \"\n <tr>\n <td class=\\\"leftcol \".($highlight?\"highlighted_\":\"\").\"row$n\\\" rowspan=\\\"3\\\">\n <a name=\\\"$post->id\\\"></a>\n <div class=\\\"authorcol\\\">\n \";\n\n echo user_links($user);\n echo \"<br>\";\n if ($user->create_time > time()-ST_NEW_TIME) $fstatus.=ST_NEW.\"<br>\";\n if ($fstatus) echo \"<font size=\\\"-2\\\">$fstatus</font>\";\n\n echo \"<span class=\\\"authorinfo\\\">\";\n if (!$filter || !$ignore_poster){\n if ($user->prefs && $user->prefs->avatar!=\"\" && (!$logged_in_user || ($logged_in_user->prefs->hide_avatars==false))) {\n echo \"<img class=authorinfo width=\\\"\".AVATAR_WIDTH.\"\\\" height=\\\"\".AVATAR_HEIGHT.\"\\\" src=\\\"\".$user->prefs->avatar.\"\\\" alt=\\\"Avatar\\\"><br>\";\n }\n }\n \n $url = \"pm.php?action=new&userid=\".$user->id;\n $name = $user->name;\n show_button($url, tra(\"Send message\"), tra(\"Send %1 a private message\",$name));\n echo \"<br>\".tra(\"Joined: %1\", gmdate('j M y', $user->create_time)), \"<br>\";\n\n if (!isset($user->nposts)) {\n $user->nposts = BoincPost::count(\"user=$user->id\");\n }\n \n if (function_exists('project_forum_user_info')){\n project_forum_user_info($user);\n } else {\n echo tra(\"Posts: %1\", $user->nposts).\"<br>\";\n // circumvent various forms of identity spoofing\n // by displaying the user id of the poster.\n //\n //echo \"ID: \".$user->id.\"<br>\";\n if (!no_computing()) {\n echo tra(\"Credit: %1\", number_format($user->total_credit)) .\"<br>\";\n echo tra(\"RAC: %1\", number_format($user->expavg_credit)).\"<br>\";\n }\n // to use this feature:\n // - get flags from http://www.famfamfam.com/lab/icons/flags/famfamfam_flag_icons.zip\n // - put the .png's in html/user/flags/\n // - put define(COUNTRY_FLAGS, 1) in your html/project/project.inc\n //\n if (defined(\"COUNTRY_FLAGS\")) {\n if (array_key_exists($user->country, $country_to_iso3166_2)) {\n $code = $country_to_iso3166_2[$user->country];\n echo \"<img class=flag alt=\\\"$user->country\\\" title=\\\"$user->country\\\" src=flags/$code.png><br>\\n\";\n }\n }\n }\n echo \"</span></div></td>\";\n\n echo \"<td class=\\\"postheader\\\">\";\n if ($controls == FORUM_CONTROLS) {\n echo \"<form action=\\\"forum_rate.php?post=\", $post->id, \"\\\" method=\\\"post\\\">\";\n }\n\n if ($logged_in_user && $post->timestamp>$latest_viewed){\n //show_image(NEW_IMAGE, tra(\"You haven't read this message yet\"), tra(\"Unread\"), NEW_IMAGE_HEIGHT);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<i class=\"icon-comment\"></i>\n\t\t\t\t\t\t<?\n\n }\n\n echo \" <a href=\\\"forum_thread.php?id=\".$thread->id.\"&postid=$post->id\\\">\".tra(\"Message %1\", $post->id).\"</a> - \";\n if ($post->hidden) echo \"<font color=red>[\".tra(\"hidden\").\"] </font>\";\n echo tra(\"Posted: %1\", pretty_time_str($post->timestamp)), \" \";\n\n if ($post->parent_post) {\n echo tra(\" - in response to \").\"<a href=\\\"forum_thread.php?id=\".$thread->id.\"&postid=\".$post->parent_post.\"\\\">\".tra(\"Message %1\", $post->parent_post).\"</a>.\";\n }\n if ($can_edit && $controls != NO_CONTROLS) {\n show_button(\"forum_edit.php?id=\".$post->id.\"$tokens\", tra(\"Edit\"), tra(\"Edit this message\"),\"btn btn\");\n }\n if (is_moderator($logged_in_user, $forum)) {\n show_post_moderation_links($config, $logged_in_user, $post, $forum, $tokens);\n }\n if ($post->modified) {\n echo \"<br>\".tra(\"Last modified: %1\", pretty_time_Str($post->modified));\n }\n if ($ignore_poster && $filter){\n echo \"<br>\".tra(\"This post is not shown because the sender is on your 'ignore' list. Click %1here%2 to view this post\",\"<a href=\\\"?id=\".$thread->id.\"&filter=false#\".$post->id.\"\\\">\",\"</a>\");\n }\n if ($controls == FORUM_CONTROLS) {\n echo \"</form>\\n\";\n }\n echo \"</td>\n </tr>\n <tr class=\\\"\".($highlight?\"highlighted_\":\"\").\"row$n\\\">\n <td class=\\\"postbody\\\">\n \";\n\n if (!$filter || !$ignore_poster){\n $posttext = $post->content;\n\n // If the creator of this post has a signature and\n // wants it to be shown for this post AND the logged in\n // user has signatures enabled: show it\n //\n if ($post->signature && (!$logged_in_user || !$logged_in_user->prefs->hide_signatures)){\n $posttext.=\"\\n____________\\n\".$user->prefs->signature;\n }\n\n $posttext = output_transform($posttext, $options);\n \n echo \"<p>\", $posttext, \"</p>\";\n echo \"</td></tr><tr><td class=\\\"postfooter\\\">ID: \", $post->id;\n if ($no_forum_rating) {\n echo \" | <a href=\\\"forum_report_post.php?post=\".$post->id.\"\\\">\";\n show_image(REPORT_POST_IMAGE, tra(\"Report this post as offensive\"), tra(\"Report as offensive\"), REPORT_POST_IMAGE_HEIGHT);\n echo \"</a>\";\n } else {\n $rating = $post->rating();\n echo \" | \".tra(\"Rating: %1\", $rating).\" | \".tra(\"rate: \").\"\n <a href=\\\"forum_rate.php?post=\".$post->id.\"&choice=p$tokens\\\">\n \";\n //show_image(RATE_POSITIVE_IMAGE, tra(\"Click if you like this message\"), tra(\"Rate +\"), RATE_POSITIVE_IMAGE_HEIGHT);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<i class=\"icon-thumbs-up\"></i>\n\t\t\t\t\t\t<?\n echo \"</a> / <a href=\\\"forum_rate.php?post=\".$post->id.\"&choice=n$tokens\\\">\";\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<i class=\"icon-thumbs-down\"></i>\n\t\t\t\t\t\t<?\n //show_image(RATE_NEGATIVE_IMAGE, tra(\"Click if you don't like this message\"), tra(\"Rate -\"), RATE_NEGATIVE_IMAGE_HEIGHT);\n echo \"</a> <a href=\\\"forum_report_post.php?post=\".$post->id.\"\\\">\";\n //show_image(REPORT_POST_IMAGE, tra(\"Report this post as offensive\"), tra(\"Report as offensive\"), REPORT_POST_IMAGE_HEIGHT);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<i class=\"icon-warning-sign\"></i>\n\t\t\t\t\t\t<?\n echo \"</a>\";\n }\n if (($controls == FORUM_CONTROLS) && (can_reply($thread, $forum, $logged_in_user))) {\n echo \" <div class=\\\"btn-group\\\">\";\n $url = \"forum_reply.php?thread=\" . $thread->id . \"&post=\" . $post->id . \"&no_quote=1#input\";\n show_button($url, tra(\"Reply\"), tra(\"Post a reply to this message\"));\n $url = \"forum_reply.php?thread=\" . $thread->id . \"&post=\" . $post->id . \"#input\";\n show_button($url, tra(\"Quote\"), tra(\"Post a reply by quoting this message\"));\n\t\t\t\t\t\techo \"</div>\";\n }\n echo \"</td></tr>\";\n } else {\n echo \"</td></tr><tr><td class=\\\"postfooter\\\">\";\n }\n //echo \"<tr class=\\\"postseparator\\\"><td colspan=2></td></tr>\";\n}",
"public function loadProfilePosts($data,$limit)//this $data k ander page ki request aye gi $limit k ander k kitni pic ya post reload honi hain\n\t{\n $page = $data['page'];\n $profileUser = $data['profileUsername'];\n $userLoggedIn = $this->user_obj->getUsername();\n\n if($page == 1)\n \t$start = 0;\n else\n \t$start = ($page -1) * $limit;//agr page ki request dusi bar ai to yah us mein is tarah value add kry ga 2-1*10=10 or yah thus mazeed page reload krny ka order jry kry ga\n\n\n\t\t$str = \"\";\n\t\t$data = mysqli_query($this->con,\"SELECT * FROM posts WHERE deleted='no' AND((added_by='$profileUser' AND user_to='none') OR user_to='$profileUser') ORDER BY id DESC\");\n\t\t\n $data_query = $data;\n if(mysqli_num_rows($data_query)){\n\n\n $num_iterations = 0;\n $count = 1;\n\n\n\t\twhile($row = mysqli_fetch_array($data))\n\t\t{\n\t\t\t$id = $row['id'];\n\t\t\t$body = $row['body'];\n\t\t\t$added_by = $row['added_by'];\n $user_to = $row['user_to'];\n\t\t\t$date_time = $row['date_added'];\n\t\t\t$imagePath = $row['image'];\n\n\t\t\t//prepare user_to string so it can be included even if\n\t\t\t//not posted to a user\n\t\t\t \n\t\t\t \n \n/*\n//first if e ka matlab hy k jb hum shuru mein page reload krein gy to tab page sirf aik bar reload ho jaye ga\n//or jb reload kr dy ga to 10 post pey ja k rk jaye ga q k hm ney limit 10 ki set ki hy or page sirf first reload mein 10 post reload kry ga or ruk jaye ga or mazeed reload krny\n//start variable ki value brha dy ga while loop 0 sy jis sy yah ho ga k mazeed 10 posts reload ho jain gi\n//jesy he reload ho gi 10 posts jo second if hy wo loop ko break kry ga or mazeed reload hony sy bachaye ga\n//or second if k bad else hy wo tab execute hota rhy ga jb tk count 10 ko nhi phnch jata \t*/\t\t\n\n if($num_iterations++ < $start)\n \tcontinue;\n \n if($count > $limit)\n \tbreak;\n else\n \t$count++;\n \n if($userLoggedIn == $added_by)\n {\n \n $delete_button = \"<button class='delete_button btn-danger' id='post$id' >X</button>\";\n }\n else\n \t$delete_button = \"\";\n\n\n\t\t\t$user_details_query = mysqli_query($this->con,\"SELECT first_name,last_name,profile_pic FROM users WHERE username='$added_by'\");\n\t\t\t$user_row = mysqli_fetch_array($user_details_query);\n $first_name = $user_row['first_name'];\n $last_name = $user_row['last_name'];\n $profile_pic= $user_row['profile_pic'];\n \n?>\n \n <script > \n\t\t\t\t\t\tfunction toggle<?php echo$id; ?>() {\n\t\t\t\t\t\t\t var target = $(event.target);\n\t\t\t\t if(!target.is(\"a\"))\n\t\t\t\t {\n\t\t\t\t var element = document.getElementById(\"toggleComment<?php echo $id; ?>\");\n\n\t\t\t if(element.style.display == \"block\") \n\t\t\t element.style.display = \"none\";\n\t\t\t else \n\t\t\t element.style.display = \"block\";\n\n\t\t\t\t\t\t\t \n\t\t\t }\n\n\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t }\n\n\t\t\t\t\t</script>\n\n \n<?php\n\n$comments_check = mysqli_query($this->con,\"SELECT * FROM comments WHERE post_id='$id'\");\n$comments_check_num = mysqli_num_rows($comments_check);\n\n\t\t\t//timeframe\n\t\t\t$date_time_now = date('Y-m-d H:i:s');\n\t\t\t$start_date = new DateTime($date_time);\n\t\t\t$end_date = new DateTime($date_time_now);\n\t\t\t$interval = $start_date->diff($end_date);\n\t\t\tif($interval->y >= 1)\n\t\t\t{\n\t\t\t\tif($interval == 1)\n\t\t\t\t{\n\t\t\t\t\t$time_message = $interval->y .\" year ago\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$time_message = $interval->y .\" years ago\";\n\t\t\t}\n\n\t\t\telse if($interval-> m >= 1)\n\t\t\t{\n\t\t\t\t if($interval->d == 0)\n\t\t\t\t {\n\t\t\t\t \t$days = \" ago\";\n\t\t\t\t }\n\t\t\t\t else if($interval->d == 1)\n\t\t\t\t \t$days = $interval->d.\" day ago\";\n\t\t\t\t else\n\t\t\t\t \t\t$days = $interval->d.\" days ago\";\n if($interval->m == 1)\n\t\t\t\t{\n\t\t\t\t\t$time_message = $interval->m .\" month \".$days;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$time_message = $interval->m .\" month \".$days;\n\t\t\t\n\n\n\n\t\t\t}\n\t\t\telse if($interval->d >= 1)\n\t\t\t{\n\t\t\t\tif($interval->d == 1)\n\t\t\t\t \t $time_message = \" Yesterday\";\n\t\t\t\t else\n\t\t\t\t \t\t$time_message = $interval->d.\" days ago\";\n\t\t\t}\n\t\t\telse if($interval->h >= 1)\n\t\t\t{\n\t\t\t\tif($interval->h == 1)\n\t\t\t\t \t $time_message = $interval->h .\" hour ago\";\n\t\t\t\t else\n\t\t\t\t \t\t$time_message = $interval->h.\" hours ago\";\n\t\t\t\n\n\t\t\t}\n\n\t\t\t\telse if($interval->i >= 1)\n\t\t\t{\n\t\t\t\tif($interval->i == 1)\n\t\t\t\t \t $time_message = $interval->i .\" minute ago\";\n\t\t\t\t else\n\t\t\t\t \t\t$time_message = $interval->i.\" minutes ago\";\n\t\t\t\n\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($interval->s <= 30)\n\t\t\t\t \t $time_message = \" Just now\";\n\t\t\t\t else\n\t\t\t\t \t\t$time_message = $interval->s.\" seconds ago\";\n\t\t\t\n\n\t\t\t\n\t\t\t}//float:left;margin-right:7px;\n\t\t\t/*\n //status post\n\n style='width: 96%;\n\tfont-size: 15px;\n\tpadding: 0px 5px;\n\tmin-height: 75px;' \n\n\n\t//post_profile_pic\n\tstyle='\tfloat: left;margin-right: 17px;'\n\n\t//posted by\n\tstyle='color:#ACACAC;'\n\n\t//\n\n\t//it occur first status post onClick='javascript:toggle$id()' //twitor paste it with status post but i post it with comments\n\n\t\t\t\n $delete_button;*/\n\n\n if($imagePath != \"\"){\n $imageDiv = \"<div class='postedImage'>\n <img src='$imagePath'>\n </div>\";\n }\n else{\n\t\t$imageDiv = \"\";\n}\n\nif($added_by == $userLoggedIn || $userLoggedIn == $user_to)\n {\n $button=\"<a href='deletepost.php?id=\".$id.\"' style='text-decoration:none;'>X</a>\";\n } else\n {\n $button = \"\";\n }\n\n\t\t\t$str .= \"\n\n\t\t\t<div class='status_post' \n\t\t\t >\n <div class='post_profile_pic' >\n <img src='$profile_pic' width=50 >\n </div>\n <div class='posted_by' >\n <a href='$added_by'>$first_name $last_name</a> $time_message\n \n\n\n </div>\n\n <div id='post_body'>\n $body<b style='float:right'>\".$button.\"</b>\n <br>\n $imageDiv\n <br>\n <br>\n </div>\n \n<div class='newsfeedPostOptions' >\n<b class='bold_comment' onClick='javascript:toggle$id()'>Comments($comments_check_num) </b>\n\n<iframe class='like_frame' src='like.php?post_id=$id' scrolling='no'></iframe>\n\n</div>\n\n\n </div>\n <div class='post_comment' id='toggleComment$id' style='display:none;' >\n\t\t\t\t\t\t\t\t<iframe src='comment_frame.php?post_id=$id' class='comment_iframe' id='comment_iframe' frameborder='0'></iframe>\n\t\t\t\t\t\t\t</div>\n\n <hr>\";//\n \n\t?>\n<script >\n/*$(document).ready(function(){\n $('#post<?php echo $id;?>').on('click',function(){\nbootbox.confirm(\"Do you want to delete this post?>\",function(result){\n\n$.post(\"includes/form_handlers/delete_post.php?post_id<?php echo $id; ?>\",{result:result});\nif(result)\n{\n\tlocation.reload();\n\n}\n\n\n});\n });\n\n});*/\n\n\n</script>\n\t<?php\t\t \n\t\n\n//the div after newsfeedPostOption it make me own that comments only show when click on it comments div\n\t\t\t\n\t\t}//ends while loop\n\n\t\tif($count > $limit)//es ka mtlb hy k agr count mean posts br gai hain to yah mazeed us sy aik or page ki request bhajy ga jquery ajax ko\n\t\t{\n\t\t\t$str .=\"<input type='hidden' class='nextPage' value='\".($page + 1).\"'>\n\t\t\t<input type='hidden' class='noMorePosts' value='false'>\";\n\n\t\t}\n\t\telse//or agr nhi bachi to to yah request nhi bhajy ga js loop b execute nhi ho ga or na kch or ho js sy sy darj zail text show ho jaye ga\n\t\t{\n\t\t\t$str .=\"<input type='hidden' class='noMorePosts' value='true'><p style='text-align:center;'>no\n\t\t\tmore posts to show !</p>\";\n\n\t\t}\n\t}\n\n\t\techo $str;\n\t}",
"private function fetchThreads() {\n\t\t\t$query = '';\n\t\t\t$boards = listBoards(true);\n\n\t\t\tforeach ($boards as $b) {\n\t\t\t\tif (in_array($b, $this->settings['exclude']))\n\t\t\t\t\tcontinue;\n\t\t\t\t// Threads are those posts that have no parent thread\n\t\t\t\t$query .= \"SELECT *, '$b' AS `board` FROM ``posts_$b`` \" .\n\t\t\t\t\t\"WHERE `thread` IS NULL UNION ALL \";\n\t\t\t}\n\n\t\t\t$query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query);\n\t\t\t$result = query($query) or error(db_error());\n\n\t\t\treturn $result->fetchAll(PDO::FETCH_ASSOC);\n\t\t}",
"function messageThreadTree( $threadID, $showUnApprived = false, $offset = 0, $limit = 100 )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n if ( !isSet( $showUnApproved ) || !$showUnApproved )\r\n $showUnApproved = \" AND IsApproved='1' \";\r\n else\r\n $showUnApproved = \" AND IsApproved='0' \";\r\n\r\n $db->array_query( $message_array, \"SELECT ID, TreeID FROM eZForum_Message\r\n WHERE ForumID='$this->ID'\r\n AND ThreadID='$threadID'\r\n AND IsTemporary='0'\r\n $showUnApproved\r\n ORDER BY TreeID DESC\",\r\n array( \"Limit\" => $limit, \"Offset\" => $offset ) );\r\n\r\n $ret = array();\r\n\r\n foreach ( $message_array as $message )\r\n {\r\n $ret[] = new eZForumMessage( $message[$db->fieldName(\"ID\")] );\r\n }\r\n\r\n return $ret;\r\n }",
"function forum_get_discussions_fast($forum_id) {\n global $CFG, $USER;\n \n $timelimit='';\n if (!empty($CFG->forum_enabletimedposts)) {\n if (!((isadmin() and !empty($CFG->admineditalways)) || isteacher(get_field('forum', 'course', 'id', $forum_id)))) {\n $now = time();\n $timelimit = \" AND ((d.timestart = 0 OR d.timestart <= '$now') AND (d.timeend = 0 OR d.timeend > '$now')\";\n if (!empty($USER->id)) {\n $timelimit .= \" OR d.userid = '$USER->id'\";\n }\n $timelimit .= ')';\n }\n }\n \n $query = \"\n SELECT \n p.id, \n p.subject, \n p.discussion, \n p.message,\n p.created,\n d.groupid,\n p.userid, \n u.firstname, \n u.lastname\n FROM \n {$CFG->prefix}forum_discussions d\n JOIN \n {$CFG->prefix}forum_posts p \n ON \n p.discussion = d.id\n JOIN \n {$CFG->prefix}user u \n ON \n p.userid = u.id\n WHERE \n d.forum = '{$forum_id}' AND \n p.parent = 0\n $timelimit\n ORDER BY \n d.timemodified DESC\n \";\n return get_records_sql($query);\n}",
"function threads_get()\n\t{\n\t\t$this->check_board();\n\n\t\tif ($this->get('page'))\n\t\t{\n\t\t\tif (!is_natural($this->get('page')))\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"Invalid value for 'page'.\")), 404);\n\t\t\t}\n\t\t\telse if ($this->get('page') > 500)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __('Unable to return more than 500 pages.')), 404);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$page = intval($this->get('page'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$page = 1;\n\t\t}\n\n\n\t\tif ($this->get('per_page'))\n\t\t{\n\t\t\tif (!is_natural($this->get('per_page')))\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"Invalid value for 'per_page'.\")), 404);\n\t\t\t}\n\t\t\telse if ($this->get('per_page') > 50)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __('Unable to return more than 50 threads per page.')),\n\t\t\t\t\t404);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$per_page = intval($this->get('per_page'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$per_page = 25;\n\t\t}\n\n\n\n\t\t$posts = $this->post->get_latest(get_selected_radix(), $page, array('per_page' => $per_page));\n\t\tif (count($posts) > 0)\n\t\t{\n\t\t\t$this->response($posts, 200); // 200 being the HTTP response code\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response(array('error' => __('Unable to locate any threads.')), 404);\n\t\t}\n\t}",
"public function getTopThreads()\n {\n $db = DB::conn();\n $threads = array();\n \n $rows = $db->rows('SELECT t.id, t.user_id, t.title, u.username, t.created, t.last_modified, u.usertype, \n COUNT(c.id) AS thread_count FROM comment c \n INNER JOIN thread t ON c.thread_id=t.id \n INNER JOIN user u ON t.user_id=u.id \n GROUP BY t.id ORDER BY COUNT(c.id) DESC, t.last_modified DESC');\n\n foreach ($rows as $row) {\n $threads[] = new Thread($row);\n }\n\n return $threads;\n }",
"public static function getLatestThreadsByUserId($id, $limit = 4, $offset = 0)\n\t{\n\t\t$threads = (array) FrontendModel::getDB()->getRecords(\n\t\t\t'SELECT pt.id, pm.text, pm.created_on, IF(pts.status = \"read\", 1, 0) AS status\n\t\t\t FROM profiles_thread AS pt\n\t\t\t INNER JOIN profiles_message AS pm ON pt.latest_message_id = pm.id\n\t\t\t INNER JOIN profiles_thread_status AS pts ON pt.id = pts.thread_id\n\t\t\t WHERE pts.receiver_id = ? and pts.status != \"deleted\"\n\t\t\t GROUP BY pt.id\n\t\t\t ORDER BY pm.created_on DESC\n\t\t\t LIMIT ?,?',\n\t\t\tarray((int) $id, (int) $offset, (int) $limit)\n\t\t);\n\n\t\t// get participating users for each thread\n\t\tforeach($threads as &$thread)\n\t\t{\n\t\t\t$thread['receivers'] = FrontendProfilesModel::getProfilesInThread($thread['id'], $id);\n\t\t\t$thread['status'] = (int) $thread['status'];\n\t\t}\n\n\t\treturn $threads;\n\t}",
"function Forum_showThread(&$PAGEDATA, &$id) {\n\trequire_once SCRIPTBASE.'ww.incs/bb2html.php';\n\tWW_addCSS('/ww.plugins/forum/frontend/forum.css');\n\t$script='$(function(){$(\".ratings\").ratings();});';\n\tWW_addScript('ratings/ratings.js');\n\tWW_addInlineScript($script);\n\t$thread=dbRow('select * from forums_threads where id='.$id);\n\t$forum_id=$thread['forum_id'];\n\tif (!$thread || !count($thread)) {\n\t\treturn '<em class=\"error\">Error: this thread does not exist!</em>';\n\t}\n\t$c=Forum_getForumBreadcrumbs($PAGEDATA, $thread['forum_id'])\n\t\t.' » <a href=\"'.$PAGEDATA->getRelativeUrl().'?forum-f='.$forum_id\n\t\t.'&forum-t='.$id.'\">'.htmlspecialchars($thread['name']).'</a>';\n\t$c.='<table id=\"forum-posts\"><tr><th>Author</th><th>Post</th></tr>';\n\t$posts=dbAll(\n\t\t'select * from forums_posts where thread_id='\n\t\t.$id.' and moderated = 1 order by created_date'\n\t);\n\tforeach ($posts as $post) {\n\t\t$user=User::getInstance($post['author_id']);\n\t\tif ($user) {\n\t\t\t$user_name=$user->get('name');\n\t\t\t$user_id=$post['author_id'];\n\t\t\t$user_email=$user->get('email');\n\t\t}\n\t\telse {\n\t\t\t$user_name='unknown';\n\t\t\t$user_id=0;\n\t\t\t$user_email='';\n\t\t}\n\t\t$c.='<tr p-data=\\'({\"id\":'.$post['id']\n\t\t\t.',\"cdate\":\"'.$post['created_date'].'\"'\n\t\t\t.',\"uid\":'.$post['author_id'].'})\\'>'\n\t\t\t.'<td class=\"user-details\"><a name=\"forum-c-'.$post['id']\n\t\t\t.'\"></a>'.htmlspecialchars($user_name).'</td>'\n\t\t\t.'<td><div class=\"post-header\">Posted: '\n\t\t\t.Core_dateM2H($post['created_date'], 'datetime')\n\t\t\t.'</div></td></tr>';\n\t\t$count_posts=$user_id\n\t\t\t?dbOne(\n\t\t\t\t'select count(id) from forums_posts where author_id='.$user->get('id'),\n\t\t\t\t'count(id)'\n\t\t\t)\n\t\t\t:0;\n\t\t$emailHash=md5(trim(strtolower($user_email)));\n\t\t\n\t\t$c.='<tr><td><img class=\"avatar\" data-uid=\"'.$user_id.'\" />'\n\t\t\t. '<span>Posts: '.$count_posts.'</span>'\n\t\t\t. '<p>Helpfulness:'\n\t\t\t. '<span class=\"ratings\" id=\"forum_user_'.$user_email.'\"'\n\t\t\t. ' type=\"forum_user\">rating</span></p>';\t\t\t\t\n\n\t\t$c.='</td><td class=\"post\">'.bb2html($post['body'])\n\t\t\t.'</td></tr>';\n\t}\n\t$c.='</table>';\n\t// { post form\n\tif (isset($_SESSION['userdata']) && $_SESSION['userdata']['id']) {\n\t\t$c.='<div id=\"forum-post-submission-form\"><script defer=\"defer\">var forum_id='\n\t\t\t.$forum_id.',forum_thread_id='.$id.';</script></div>';\n\t\tWW_addScript('//cdn.ckeditor.com/4.4.3/standard/ckeditor.js');\n\t\tWW_addScript('//cdn.ckeditor.com/4.4.3/standard/adapters/jquery.js');\n\t\tWW_addScript('forum/frontend/forum.js');\n\t}\n\telse {\n\t\t$c.='<div class=\"forum-not-logged-in\">In order to post to this thread,'\n\t\t\t.' you must <a href=\"/_r?type=loginpage\">login'\n\t\t\t.'</a> first.</div>';\n\t}\n\t// }\n\treturn $c;\n}",
"function xthreads_admin_forumcommit() {\r\n\tglobal $fid, $db, $cache, $mybb;\r\n\tif(!$fid) {\r\n\t\t// bad MyPlaza Turbo! (or any other plugin which does the same thing)\r\n\t\t$fid = (int)$mybb->input['fid'];\r\n\t}\r\n\t\r\n\t/*\r\n\t// handle additional filters\r\n\t$afefields = array(\r\n\t\t'uid',\r\n\t\t'lastposteruid',\r\n\t\t'prefix',\r\n\t\t'icon',\r\n\t);\r\n\t$addfiltenable = '';\r\n\tforeach($afefields as &$afe)\r\n\t\tif($db->field_exists($afe, 'threads') && isset($mybb->input['xthreads_afe_'.$afe])) {\r\n\t\t\t$addfiltenable .= ($addfiltenable?',':'').$afe;\r\n\t\t\tif($afe != 'uid') {\r\n\t\t\t\t// try to add key - if it already exists, MySQL will fail for us :P\r\n\t\t\t\t$db->write_query('ALTER TABLE `'.$db->table_prefix.'threads` ADD KEY `xthreads_'.$afe.'` (`'.$afe.'`)', true);\r\n\t\t\t}\r\n\t\t} elseif($afe != 'uid') {\r\n\t\t\t// check if any other forum is using this field\r\n\t\t\tif(!isset($afe_usage_cache)) {\r\n\t\t\t\t$afe_usage_cache = array();\r\n\t\t\t\t$query = $db->simple_select('forums', 'DISTINCT xthreads_addfiltenable', 'xthreads_addfiltenable != \"\" AND fid != '.$fid);\r\n\t\t\t\twhile($fafelist = $db->fetch_field($query, 'xthreads_addfiltenable')) {\r\n\t\t\t\t\tforeach(explode(',', $fafelist) as $fafe)\r\n\t\t\t\t\t\t$afe_usage_cache[$fafe] = 1;\r\n\t\t\t\t}\r\n\t\t\t\t$db->free_result($query);\r\n\t\t\t\tunset($fafelist, $fafe);\r\n\t\t\t}\r\n\t\t\tif(!$afe_usage_cache[$afe]) {\r\n\t\t\t\t// this filter isn't being used anywhere - try to drop the key\r\n\t\t\t\t$db->write_query('ALTER TABLE `'.$db->table_prefix.'threads` DROP KEY `xthreads_'.$afe.'`', true);\r\n\t\t\t}\r\n\t\t}\r\n\t*/\r\n\t\r\n\t$update_array = array();\r\n\tforeach(array(\r\n\t\t'xthreads_tplprefix' => 1,\r\n\t\t'xthreads_langprefix' => 1,\r\n\t\t'xthreads_grouping' => 0,\r\n\t\t'xthreads_firstpostattop' => 0,\r\n\t\t'xthreads_allow_blankmsg' => 0,\r\n\t\t'xthreads_nostatcount' => 0,\r\n\t\t'xthreads_inlinesearch' => 0,\r\n\t\t'xthreads_fdcolspan_offset' => 0,\r\n\t\t'xthreads_settingoverrides' => 1,\r\n\t\t'xthreads_postsperpage' => 0,\r\n\t\t'xthreads_hideforum' => 0,\r\n\t\t'xthreads_hidebreadcrumb' => 0,\r\n\t\t'xthreads_defaultfilter' => 1,\r\n\t\t//'xthreads_addfiltenable' => $db->escape_string($addfiltenable),\r\n//\t\t'xthreads_deffilter' => $db->escape_string($deffilter),\r\n\t\t'xthreads_wol_announcements' => 2,\r\n\t\t'xthreads_wol_forumdisplay' => 2,\r\n\t\t'xthreads_wol_newthread' => 2,\r\n\t\t'xthreads_wol_attachment' => 2,\r\n\t\t'xthreads_wol_newreply' => 2,\r\n\t\t'xthreads_wol_showthread' => 2,\r\n\t) as $k => $is_str) {\r\n\t\tif(isset($mybb->input[$k])) {\r\n\t\t\tif($is_str) {\r\n\t\t\t\t$update_array[$k] = $db->escape_string($is_str == 2 ? trim($mybb->input[$k]) : $mybb->input[$k]);\r\n\t\t\t} else\r\n\t\t\t\t$update_array[$k] = (int)trim($mybb->input[$k]);\r\n\t\t} else {\r\n\t\t\t$update_array[$k] = $is_str ? '' : 0;\r\n\t\t}\r\n\t}\r\n\t$db->update_query('forums', $update_array, 'fid='.$fid);\r\n\t\r\n\t$cache->update_forums();\r\n\txthreads_buildtfcache();\r\n}",
"function getPosts($dbparams, $existingthread, $start, $limit, $sort)\n\t{\n\t\ttry {\n\t\t\t$db = JFusionFactory::getDatabase($this->getJname());\n\n\t\t\t//set the query\n\t\t\t$query = $db->getQuery(true)\n\t\t\t\t->select('p.post_id , CASE WHEN p.poster_id = 1 THEN 1 ELSE 0 END AS guest, CASE WHEN p.poster_id = 1 AND p.post_username != \\'\\' THEN p.post_username ELSE u.username END AS name, CASE WHEN p.poster_id = 1 AND p.post_username != \\'\\' THEN p.post_username ELSE u.username_clean END AS username, u.user_id, p.post_subject, p.post_time, p.post_text, p.topic_id')\n\t\t\t\t->from('#__posts as p')\n\t\t\t\t->innerJoin('#__users as u ON p.poster_id = u.user_id')\n\t\t\t\t->where('p.topic_id = ' . $existingthread->threadid)\n\t\t\t\t->where('p.post_id != ' . $existingthread->postid)\n\t\t\t\t->where('p.post_visibility = 1')\n\t\t\t\t->order('p.post_time ' . $sort);\n\n\t\t\t$db->setQuery($query, $start, $limit);\n\n\t\t\t$posts = $db->loadObjectList();\n\t\t} catch (Exception $e) {\n\t\t\tJFusionFunction::raiseError($e, $this->getJname());\n\t\t\t$posts = array();\n\t\t}\n\t\treturn $posts;\n\t}",
"public function getPostsByUserId($uid=NULL, $offset=0, $limit=10){\r\n\t\t$XMLObject = $this->getXMLObject();\r\n\t\tif(isset($uid)){\r\n\t\t\t$limit = max(0,min(50,(int)$limit));\r\n\t\t\t$result = DB::query('SELECT post_id, post_title, post_status, post_publication_date, blog_posts.category_id, category_name, comment_count FROM blog_posts \r\n\t\t\tINNER JOIN blog_categories ON blog_posts.category_id = blog_categories.category_id\r\n\t\t\tWHERE user_id = '.(int)$uid.' \r\n\t\t\tORDER BY post_publication_date DESC, post_id DESC LIMIT '.max(0,(int)$offset).','.$limit.';');\r\n\t\t\tif($result && DB::numRows($result) > 0){\r\n\t\t\t\twhile($row = DB::fetchAssoc($result)){\r\n\t\t\t\t\t$post = $XMLObject->addChild('post');\r\n\t\t\t\t\t$post->addChild('id', $row['post_id']);\r\n\t\t\t\t\t$post->addChild('category_id', $row['category_id']);\r\n\t\t\t\t\t$post->addChild('category_name', htmlspecialchars($row['category_name'], ENT_QUOTES, 'UTF-8'));\r\n\t\t\t\t\t$post->addChild('status', $row['post_status']);\r\n\t\t\t\t\t$post->addChild('title', htmlspecialchars($row['post_title'], ENT_QUOTES, 'UTF-8'));\r\n\t\t\t\t\t$post->addChild('publication_date', $row['post_publication_date']);\r\n\t\t\t\t\t$post->addChild('comment_count', $row['comment_count']);\r\n\t\t\t\t}\r\n\t\t\t\t$result_count = DB::query('SELECT count(0) FROM blog_posts WHERE user_id = '.(int)$uid.';');\r\n\t\t\t\tif($result_count) $XMLObject['total_posts'] = DB::result($result_count, 0);\r\n\t\t\t}else $this->throwError(2);\r\n\t\t}else $this->throwError(10);\r\n\t\treturn $XMLObject;\r\n\t}",
"function show_thread_and_context($thread, $user, $i) {\n $thread_forum = BoincForum::lookup_id($thread->forum);\n if (!$thread_forum) return;\n if (!is_forum_visible_to_user($thread_forum, $user)) return;\n $owner = BoincUser::lookup_id($thread->owner);\n $j = $i % 2;\n echo \"<tr class=row$j><td>\\n\";\n switch($thread_forum->parent_type) {\n case 0:\n $category = BoincCategory::lookup_id($thread_forum->category);\n show_forum_title($category, $thread_forum, $thread, true);\n break;\n case 1:\n show_team_forum_title($thread_forum, $thread);\n break;\n }\n echo '\n </td><td class=\"numbers\">'.($thread->replies+1).'</td>\n <td>'.user_links($owner).'</td>\n <td class=\"numbers\">'.$thread->views.'</td>\n <td class=\"lastpost\">'.time_diff_str($thread->timestamp, time()).'</td>\n </tr>\n ';\n}",
"public function authenticated_user_may_participate_in_forum_threads()\n {\n \t// Given we have an authenticated user.\n \t$user = factory('App\\User')->create();\n \t$this->be($user);\n \t// Given we have a thread.\n \t$thread = factory('App\\Thread')->create();\n \t// Given we have a reply.\n \t$reply = factory('App\\Reply')->make();\n \t// The user submits a reply.\n \t// $this->post('threads/'.$thread->id.'/replies', $reply->toArray()); also works\n \t$this->post($thread->path().'/replies', $reply->toArray());\n \t$this->get($thread->path())->assertSee($reply->body);\n }",
"public function latest_topics_main()\n \t{\n \t\t//-----------------------------------------\n \t\t// INIT\n \t\t//-----------------------------------------\n\n \t\t$attach_pids\t= array();\n \t\t$attach_posts\t= array();\n \t\t$forums\t\t\t= array();\n \t\t$rows\t\t\t= array();\n \t\t$output\t\t\t= array();\n\t\t$where_clause\t= array();\n \t\t$limit\t\t\t= $this->settings['latest_topics_main'] ? $this->settings['latest_topics_main'] : 3;\n \t\t$posts\t\t\t= intval($this->memberData['posts']);\n\n \t\t//-----------------------------------------\n \t// Grab articles new/recent in 1 bad ass query\n \t//-----------------------------------------\n\n \t\tforeach( explode( ',', $this->settings['portal_latest_topics_forums'] ) as $forum_id )\n \t\t{\n \t\t\tif( !$forum_id )\n \t\t\t{\n \t\t\t\tcontinue;\n \t\t\t}\n\n \t\t\t$forums[] = intval($forum_id);\n \t\t}\n \t\t\n \t\tif( !count($forums) )\n \t\t{\n \t\t\treturn;\n \t\t}\n\t\t\n\t\t/* Loop through the forums and build a list of forums we're allowed access to */\n\t\t$forumIdsOk = array();\n\t\n\t\tforeach( $this->registry->class_forums->forum_by_id as $id => $data )\n\t\t{\n\t\t\t/* Allowing this forum? */\n\t\t\tif ( ! in_array( $id, $forums ) )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t/* Can we read? */\n\t\t\tif ( ! $this->registry->permissions->check( 'read', $data ) )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/* Can read, but is it password protected, etc? */\n\t\t\tif ( ! $this->registry->class_forums->forumsCheckAccess( $id, 0, 'forum', array(), true ) )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! $data['can_view_others'] )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif ( $data['min_posts_view'] > $posts )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$forumIdsOk[] = $id;\n\t\t}\n\n\t\tif( !count($forumIdsOk) )\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t/* Add allowed forums */\n\t\t$where_clause[] = \"t.forum_id IN (\" . implode( \",\", $forumIdsOk ) . \")\";\n\n\t\t//-----------------------------------------\n\t\t// Will we need to parse attachments?\n\t\t//-----------------------------------------\n\t\t\n\t\t$parseAttachments\t= false;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Run query\n\t\t//-----------------------------------------\n\t\t\n\t\t$pinned = array();\n\t\t$unpinned = array();\n\t\t$all\t = array();\n\t\t$data = array();\n\t\t$count = 0;\n\t\t\n\t\tif( !$this->settings['portal_exclude_pinned'] )\n\t\t{\n\t\t\t/* Fetch all pinned topics to avoid filesort */\n\t\t\t$this->DB->build( array( 'select' => 't.tid, t.start_date',\n\t\t\t\t\t\t\t\t\t 'from' => 'topics t',\n\t\t\t\t\t\t\t\t\t 'where' => \"t.pinned=1 AND t.approved=1 AND t.state != 'link' AND \" . implode( ' AND ', $where_clause ),\n\t\t\t\t\t\t\t\t\t //'order' => 't.tid DESC',\n\t\t\t\t\t\t\t\t\t 'limit' => array ( $limit ) ) );\n\t\t\t\t\t\t\t\t\t\n\t\t\t$this->DB->execute();\n\t\t\t\n\t\t\twhile( $row = $this->DB->fetch() )\n\t\t\t{\n\t\t\t\t$pinned[ $row['start_date'] ] = $row['tid'];\n\t\t\t\t$all[ $row['start_date'] ] = $row['tid'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Still need more? */\n\t\t\n\t\tif ( count( $pinned ) < $limit )\n\t\t{\n\t\t\t$pinnedWhere\t= $this->settings['portal_exclude_pinned'] ? \"\" : \"t.pinned=0 AND \";\n\t\t\t\n\t\t\t$this->DB->build( array( 'select' => 't.tid, t.start_date, t.last_post',\n\t\t\t\t\t\t\t\t\t 'from' => 'topics t',\n\t\t\t\t\t\t\t\t\t 'where' => $pinnedWhere . \"t.approved=1 AND t.state != 'link' AND \" . implode( ' AND ', $where_clause ),\n\t\t\t\t\t\t\t\t\t 'order' => 'tid DESC',\n\t\t\t\t\t\t\t\t\t 'limit' => array ( $limit - count( $pinned ) ) ) );\n\t\t\t\t\t\t\t\t\t\n\t\t\t$this->DB->execute();\n\t\t\t\n\t\t\twhile( $row = $this->DB->fetch() )\n\t\t\t{\n\t\t\t\t$unpinned[ $row['last_post'] ] = $row['tid'];\n\t\t\t\t$all[ $row['last_post'] ] = $row['tid'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* got anything? */\n\t\tif ( ! count( $all ) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$this->DB->build( array( \n\t\t\t\t\t\t\t\t'select'\t=> 't.*',\n\t\t\t\t\t\t\t\t'from'\t\t=> array( 'topics' => 't' ),\n\t\t\t\t\t\t\t\t'where'\t\t=> \"t.tid IN (\" . implode( \",\", array_values( $all ) ) . \")\",\n\t\t\t\t\t\t\t\t'add_join'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'select'\t=> 'p.*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'from'\t=> array( 'posts' => 'p' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'where'\t=> 'p.pid=t.topic_firstpost',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type'\t=> 'left'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'select'\t=> 'f.id, f.name, f.name_seo, f.use_html',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'from'\t\t=> array( 'forums' => 'f' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'where'\t\t=> \"f.id=t.forum_id\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type'\t\t=> 'left',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'select'\t=> 'm.member_id, m.members_display_name, m.member_group_id, m.members_seo_name, m.mgroup_others, m.login_anonymous, m.last_visit, m.last_activity',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'from'\t\t=> array( 'members' => 'm' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'where'\t\t=> 'm.member_id=p.author_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type'\t\t=> 'left'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'select'\t=> 'pp.*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'from'\t\t=> array( 'profile_portal' => 'pp' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'where'\t\t=> 'pp.pp_member_id=m.member_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type'\t\t=> 'left'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t)\t\t);\n\t\t\n\t\t$outer = $this->DB->execute();\n\t\t\n \t\t//-----------------------------------------\n \t\t// Loop through..\n \t\t//-----------------------------------------\n \t\t\n \t\twhile( $row = $this->DB->fetch($outer) )\n \t\t{\n\t\t\t$data[ $row['tid'] ] = $row;\n\t\t}\n\t\t\n\t\tkrsort( $unpinned );\n\t\tkrsort( $pinned );\n\t\t\n\t\tforeach( $unpinned as $date => $tid )\n\t\t{\n\t\t\tif ( count( $pinned ) < $limit )\n\t\t\t{\n\t\t\t\t$pinned[ $date ] = $tid;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$count++;\n\t\t}\n\t\t\n\t\t/* Now put it altogether */\n\t\tforeach( $pinned as $date => $tid )\n\t\t{\n \t\t\t//-----------------------------------------\n \t\t\t// INIT\n \t\t\t//-----------------------------------------\n \t\t\t\n\t\t\t$entry = $data[ $tid ];\n \t\t\t$bottom_string\t\t= \"\";\n \t\t\t$read_more\t\t\t= \"\";\n \t\t\t$top_string\t\t\t= \"\";\n \t\t\t$got_these_attach\t= 0;\n \t\t\t\n\t\t\tif( $entry['topic_hasattach'] )\n\t\t\t{\n\t\t\t\t$parseAttachments\t= true;\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\t\t\t// Parse the post\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tIPSText::getTextClass( 'bbcode' )->parse_smilies\t\t\t= $entry['use_emo'];\n\t\t\tIPSText::getTextClass( 'bbcode' )->parse_html\t\t\t\t= ( $entry['use_html'] and $entry['post_htmlstate'] ) ? 1 : 0;\n\t\t\tIPSText::getTextClass( 'bbcode' )->parse_nl2br\t\t\t\t= $entry['post_htmlstate'] == 2 ? 1 : 0;\n\t\t\tIPSText::getTextClass( 'bbcode' )->parse_bbcode\t\t\t\t= 1;\n\t\t\tIPSText::getTextClass( 'bbcode' )->parsing_section\t\t\t= 'topics';\n\t\t\tIPSText::getTextClass( 'bbcode' )->parsing_mgroup\t\t\t= $entry['member_group_id'];\n\t\t\tIPSText::getTextClass( 'bbcode' )->parsing_mgroup_others\t= $entry['mgroup_others'];\n\t\t\t$entry['post']\t= IPSText::getTextClass( 'bbcode' )->preDisplayParse( $entry['post'] );\n \t\t\t\n \t\t\t//-----------------------------------------\n \t\t\t// BASIC INFO\n \t\t\t//-----------------------------------------\n \t\t\t\n \t\t\t$real_posts\t\t\t= $entry['posts'];\n \t\t\t$entry['posts']\t\t= ipsRegistry::getClass('class_localization')->formatNumber(intval($entry['posts']));\n\n $entry\t= IPSMember::buildDisplayData( $entry );\n \n \t\t\t//-----------------------------------------\n\t\t\t// Attachments?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif( $entry['pid'] )\n\t\t\t{\n\t\t\t\t$attach_pids[ $entry['pid'] ] = $entry['pid'];\n\t\t\t} \t\t\t\n\n\t\t\tif ( IPSMember::checkPermissions('download', $entry['forum_id'] ) === FALSE )\n\t\t\t{\n\t\t\t\t$this->settings[ 'show_img_upload'] = 0 ;\n\t\t\t} \n \n $entry['share_links'] = IPSLib::shareLinks( $entry['title'], array( 'url' => $this->registry->output->buildSEOUrl( 'showtopic=' . $entry['tid'], 'publicNoSession', $entry['title_seo'], 'showtopic' ) ) );\n \t\t\t\n\t\t\t$rows[] = $entry;\n \t\t}\n \t\t\n \t\t$output = $this->registry->getClass('output')->getTemplate('portal')->articles( $rows );\n \t\t\n \t\t//-----------------------------------------\n \t\t// Process Attachments\n \t\t//-----------------------------------------\n \t\t\n \t\tif ( $parseAttachments AND count( $attach_pids ) )\n \t\t{\n\t\t\tif ( ! is_object( $this->class_attach ) )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Grab render attach class\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'core' ) . '/sources/classes/attach/class_attach.php', 'class_attach' );\n\t\t\t\t$this->class_attach = new $classToLoad( $this->registry );\n\t\t\t\t\n\t\t\t\t$this->class_attach->attach_post_key = '';\n\n\t\t\t\tipsRegistry::getClass( 'class_localization' )->loadLanguageFile( array( 'public_topic' ), 'forums' );\n\t\t\t}\n\t\t\t\n\t\t\t$this->class_attach->attach_post_key\t= '';\n\t\t\t$this->class_attach->type\t\t\t\t= 'post';\n\t\t\t$this->class_attach->init();\n\t\t\n\t\t\t$output = $this->class_attach->renderAttachments( $output, $attach_pids );\n\t\t\t$output\t= $output[0]['html'];\n \t\t}\n \t\t\n \t\treturn $output;\n \t}",
"function bpb_extended_filter_user_blogs( $args = array() ) {\n\tif ( ! bp_is_blogs_component() || ! bpb_extended()->is_debug ) {\n\t\treturn $args;\n\t}\n\n\tif ( ! empty( $args['user_id'] ) || bpb_extended_is_single_item() ) {\n\n\t\t$filter = false;\n\n\t\t$current_blog = bpb_extended_current_blog();\n\t\t$user_blogs = bpb_extended_get_user_blog_ids( $args['user_id'] );\n\t\t$user_blogs = wp_list_pluck( $user_blogs, 'blog_id' );\n\n\t\tif ( ! empty( $current_blog ) && empty( $current_blog->is_public ) ) {\n\t\t\t// user is not a member\n\t\t\tif ( ! $current_blog->is_member ) {\n\t\t\t\treturn $args;\n\t\t\t} else {\n\t\t\t\t$filter = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $args['user_id'] ) && bp_loggedin_user_id() == $args['user_id'] && ! bp_current_user_can( 'bp_moderate' ) ) {\n\t\t\t$filter = true;\n\t\t}\n\n\t\tif ( empty( $current_blog ) ) {\n\t\t\t$args['include_blog_ids'] = $user_blogs;\n\t\t\t$args['user_id'] = 0;\n\t\t}\n\n\t\tif ( ! empty( $filter ) ) {\n\t\t\t// Ouch! Danger zone, but it's the only way i've found\n\t\t\t// Don't worry the other filter will make this very temporary\n\t\t\tadd_filter( 'bp_current_user_can', '__return_true' );\n\n\t\t\t// Remove the above filter asap!\n\t\t\tadd_filter( 'bp_has_blogs', 'bpb_extended_filter_user_blogs_remove_filter' );\n\t\t}\n\t}\n\n\treturn $args;\n}",
"function loadThreads($user_id)\n\t\t{\n\t\t\t$query=sqlite_query($this->connection, \"SELECT member1_id, member2_id, date_created FROM thread WHERE '$user_id' in (member1_id, member2_id) AND valid='yes' ORDER BY thread_id DESC\");\n\t\t\twhile ($row = sqlite_fetch_array($query))\n\t\t\t{\n\t\t\t\t$row[0]=$this->loadUser($row[0]);\n\t\t\t\t$row[1]=$this->loadUser($row[1]);\n\t\t\t}\n\t\t\treturn $row;\n\t\t}",
"function get_thread_posts($threadid, $sort_style, $show_hidden) {\n $sql = \"thread=$threadid\";\n if (!$show_hidden) {\n $sql .= ' AND hidden = 0';\n }\n switch($sort_style) {\n case CREATE_TIME_NEW:\n $sql .= ' ORDER BY timestamp desc';\n break;\n case CREATE_TIME_OLD:\n $sql .= ' ORDER BY timestamp asc';\n break;\n case POST_SCORE:\n $sql .= ' ORDER BY score DESC';\n break;\n default:\n $sql .= ' ORDER BY timestamp asc';\n break;\n }\n return BoincPost::enum($sql);\n}",
"function xthreads_admin_forumcommit() {\r\n\tglobal $fid, $db, $cache, $mybb;\r\n\tif(!$fid) {\r\n\t\t// bad MyPlaza Turbo! (or any other plugin which does the same thing)\r\n\t\t$fid = intval($mybb->input['fid']);\r\n\t}\r\n\t\r\n\t// handle additional filters\r\n\t$afefields = array(\r\n\t\t'uid',\r\n\t\t'lastposteruid',\r\n\t\t'prefix',\r\n\t\t'icon',\r\n\t);\r\n\t$addfiltenable = '';\r\n\tforeach($afefields as &$afe)\r\n\t\tif($db->field_exists($afe, 'threads') && $mybb->input['xthreads_afe_'.$afe]) {\r\n\t\t\t$addfiltenable .= ($addfiltenable?',':'').$afe;\r\n\t\t\tif($afe != 'uid') {\r\n\t\t\t\t// try to add key - if it already exists, MySQL will fail for us :P\r\n\t\t\t\t$db->write_query('ALTER TABLE `'.$db->table_prefix.'threads` ADD KEY `xthreads_'.$afe.'` (`'.$afe.'`)', true);\r\n\t\t\t}\r\n\t\t} elseif($afe != 'uid') {\r\n\t\t\t// check if any other forum is using this field\r\n\t\t\tif(!isset($afe_usage_cache)) {\r\n\t\t\t\t$afe_usage_cache = array();\r\n\t\t\t\t$query = $db->simple_select('forums', 'DISTINCT xthreads_addfiltenable', 'xthreads_addfiltenable != \"\" AND fid != '.$fid);\r\n\t\t\t\twhile($fafelist = $db->fetch_field($query, 'xthreads_addfiltenable')) {\r\n\t\t\t\t\tforeach(explode(',', $fafelist) as $fafe)\r\n\t\t\t\t\t\t$afe_usage_cache[$fafe] = 1;\r\n\t\t\t\t}\r\n\t\t\t\t$db->free_result($query);\r\n\t\t\t\tunset($fafelist, $fafe);\r\n\t\t\t}\r\n\t\t\tif(!$afe_usage_cache[$afe]) {\r\n\t\t\t\t// this filter isn't being used anywhere - try to drop the key\r\n\t\t\t\t$db->write_query('ALTER TABLE `'.$db->table_prefix.'threads` DROP KEY `xthreads_'.$afe.'`', true);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\r\n\t$db->update_query('forums', array(\r\n\t\t'xthreads_tplprefix' => $db->escape_string(implode(',', array_map('trim', explode(',', $mybb->input['xthreads_tplprefix'])))),\r\n\t\t'xthreads_grouping' => intval(trim($mybb->input['xthreads_grouping'])),\r\n\t\t'xthreads_firstpostattop' => intval(trim($mybb->input['xthreads_firstpostattop'])),\r\n\t\t'xthreads_allow_blankmsg' => intval(trim($mybb->input['xthreads_allow_blankmsg'])),\r\n\t\t'xthreads_nostatcount' => intval(trim($mybb->input['xthreads_nostatcount'])),\r\n\t\t'xthreads_inlinesearch' => intval(trim($mybb->input['xthreads_inlinesearch'])),\r\n\t\t'xthreads_threadsperpage' => intval(trim($mybb->input['xthreads_threadsperpage'])),\r\n\t\t'xthreads_postsperpage' => intval(trim($mybb->input['xthreads_postsperpage'])),\r\n\t\t'xthreads_force_postlayout' => trim($mybb->input['xthreads_force_postlayout']),\r\n\t\t'xthreads_hideforum' => intval($mybb->input['xthreads_hideforum']),\r\n\t\t'xthreads_hidebreadcrumb' => intval($mybb->input['xthreads_hidebreadcrumb']),\r\n\t\t'xthreads_addfiltenable' => $db->escape_string($addfiltenable),\r\n//\t\t'xthreads_deffilter' => $db->escape_string($deffilter),\r\n\t\t'xthreads_wol_announcements' => $db->escape_string(trim($mybb->input['xthreads_wol_announcements'])),\r\n\t\t'xthreads_wol_forumdisplay' => $db->escape_string(trim($mybb->input['xthreads_wol_forumdisplay'])),\r\n\t\t'xthreads_wol_newthread' => $db->escape_string(trim($mybb->input['xthreads_wol_newthread'])),\r\n\t\t'xthreads_wol_attachment' => $db->escape_string(trim($mybb->input['xthreads_wol_attachment'])),\r\n\t\t'xthreads_wol_newreply' => $db->escape_string(trim($mybb->input['xthreads_wol_newreply'])),\r\n\t\t'xthreads_wol_showthread' => $db->escape_string(trim($mybb->input['xthreads_wol_showthread'])),\r\n\t\t'xthreads_wol_xtattachment' => $db->escape_string(trim($mybb->input['xthreads_wol_xtattachment'])),\r\n\t), 'fid='.$fid);\r\n\t\r\n\t$cache->update_forums();\r\n}",
"function userPostsView($results, $pagination, $total, $member, $limited=0, $wasLimited=false, $beginTime=0, $sortIn=null, $sortDropDown=array()) {\r\n$IPBHTML = \"\";\r\n//--starthtml--//\r\n$IPBHTML .= <<<EOF\r\n<php>\n\t$datecut\t\t= ( $this->settings['search_ucontent_days'] ) ? $this->registry->class_localization->getDate( time() - ( 86400 * intval( $this->settings['search_ucontent_days'] ) ), 'joined' ) : 0;\n</php>\n<h2 class='ipsType_pagetitle'>{parse expression=\"sprintf( $this->lang->words['s_participation_title'], $member['members_display_name'] )\"}</h2>\n<input type='hidden' name=\"usedInJsLater\" id=\"urlString\" value=\"{parse expression=\"base64_encode( $this->registry->output->buildUrl( \"app=core&module=search&do=user_activity&search_app={$this->request['search_app']}&mid={$this->request['mid']}&userMode={$this->request['userMode']}&sid={$this->request['_sid']}\", \"public\" ) )\"}\" />\n<if test=\"NPhasResults:|:$total\">\n\t\t<p class='ipsType_pagedesc'>\n\t\t\t{parse expression=\"sprintf( $this->lang->words['s_participation_msg'], $total, $member['members_display_name'] )\"}\n\t\t\t<if test=\"$datecut\">\n\t\t\t\t<span class='desc lighter'>{parse expression=\"sprintf( $this->lang->words['s_participation_range'], $datecut )\"}</span>\n\t\t\t</if>\n\t\t</p>\n\t<br />\n</if>\n<div class='ipsLayout ipsLayout_withleft clearfix'>\n\t<div class='ipsLayout_left'>\n\t\t<div class='ipsBox'>\n\t\t\t<div class='ipsBox_container ipsSideMenu'>\n\t\t\t\t<h4>{$this->lang->words['filter_by_app']}</h4>\n\t\t\t\t<ul>\n\t\t\t\t\t<if test=\"IPSLib::appIsSearchable( 'forums', 'usercontent' )\">\n\t\t\t\t\t\t<li <if test=\"forumsTab:|:$this->request['search_app'] == 'forums'\">class='active'</if>><a href='{parse url=\"app=core&module=search&do=user_activity&search_app=forums&mid={$this->request['mid']}&userMode={$this->request['userMode']}&sid={$this->request['_sid']}\" base=\"public\"}'>{IPSLib::getAppTitle( 'forums' )}</a></li>\n\t\t\t\t\t</if>\n\t\t\t\t\t<if test=\"IPSLib::appIsSearchable( 'members', 'usercontent' )\">\n\t\t\t\t\t\t<li <if test=\"membersTab:|:$this->request['search_app'] == 'members'\">class='active'</if>><a href='{parse url=\"app=core&module=search&do=user_activity&search_app=members&mid={$this->request['mid']}&userMode={$this->request['userMode']}&sid={$this->request['_sid']}\" base=\"public\"}'>{IPSLib::getAppTitle( 'members' )}</a></li>\n\t\t\t\t\t</if>\n\t\t\t\t\t<if test=\"IPSLib::appIsSearchable( 'core', 'usercontent' )\">\n\t\t\t\t\t\t<li <if test=\"helpTab:|:$this->request['search_app'] == 'core'\">class='active'</if>><a href='{parse url=\"app=core&module=search&do=user_activity&search_app=core&mid={$this->request['mid']}&userMode={$this->request['userMode']}&sid={$this->request['_sid']}\" base=\"public\"}'>{IPSLib::getAppTitle( 'core' )}</a></li>\n\t\t\t\t\t</if>\n\t\t\t\t\t<foreach loop=\"apps:$this->registry->getApplications() as $app\">\n\t\t\t\t\t\t<if test=\"appIsSearchable:|:IPSLib::appIsSearchable( $app['app_directory'], 'usercontent' ) AND !in_array( $app['app_directory'], array('core','forums','members') )\">\n\t\t\t\t\t\t\t<li <if test=\"appIsSearched:|:$this->request['search_app'] == $app['app_directory']\">class='active'</if>><a href='{parse url=\"app=core&module=search&do=user_activity&search_app={$app['app_directory']}&mid={$this->request['mid']}&userMode={$this->request['userMode']}&sid={$this->request['_sid']}\" base=\"public\"}'>{IPSLib::getAppTitle( $app['app_directory'] )}</a></li>\n\t\t\t\t \t\t</if>\n\t\t\t\t\t</foreach>\n\t\t\t\t</ul>\n\t\t\t\t\n\t\t\t\t<if test=\"$this->request['search_app'] == 'forums'\">\n\t\t\t\t\t<h4>{$this->lang->words['userposts_morefilters']}</h4>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li <if test=\"$this->request['userMode'] == 'all'\">class='active'</if>><a href='{parse url=\"app=core&module=search&do=user_activity&search_app={$this->request['search_app']}&mid={$this->request['mid']}&sid={$this->request['_sid']}&search_app_filters[{$this->request['search_app']}][searchInKey]={$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}&userMode=all\" base=\"public\"}'>{$this->lang->words['viewall_opt_dd']}</a></li>\n\t\t\t\t\t\t<li <if test=\"$this->request['userMode'] == 'title'\">class='active'</if>><a href='{parse url=\"app=core&module=search&do=user_activity&search_app={$this->request['search_app']}&mid={$this->request['mid']}&sid={$this->request['_sid']}&search_app_filters[{$this->request['search_app']}][searchInKey]={$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}&userMode=title\" base=\"public\"}'>{$this->lang->words['viewallt_opt_dd']}</a></li>\n\t\t\t\t\t\t<li <if test=\"$this->request['userMode'] == 'content'\">class='active'</if>><a href='{parse url=\"app=core&module=search&do=user_activity&search_app={$this->request['search_app']}&mid={$this->request['mid']}&sid={$this->request['_sid']}&search_app_filters[{$this->request['search_app']}][searchInKey]={$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}&userMode=content\" base=\"public\"}'>{$this->lang->words['viewallp_opt_dd']}</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t</if>\n\t\t\t\t\n\t\t\t\t<if test=\"is_array($sortIn) AND count( $sortIn )\">\n\t\t\t\t\t<h4>{$this->lang->words['filter_by_type']}</h4>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<foreach loop=\"$sortIn as $id => $_data\">\n\t\t\t\t\t\t\t<li <if test=\"$this->request['search_app_filters'][$this->request['search_app']]['searchInKey'] == $_data[0]\">class='active'</if>>\n\t\t\t\t\t\t\t\t<a href='{parse url=\"app=core&module=search&do=user_activity&search_app={$this->request['search_app']}&mid={$this->request['mid']}&userMode={$this->request['userMode']}&sid={$this->request['_sid']}&search_app_filters[{$this->request['search_app']}][searchInKey]={$_data[0]}\" base=\"public\"}'>{$_data[1]}</a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</foreach>\n\t\t\t\t\t</ul>\n\t\t\t\t</if>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class='ipsLayout_content'>\n\t\t<if test=\"$pagination\">\n\t\t\t<div class='topic_controls'>\n\t\t\t\t{$pagination}\n\t\t\t</div>\n\t\t\t<br />\n\t\t</if>\n\t\t<div class='maintitle ipsFilterbar'>\n\t\t\t<if test=\"IPSSearchRegistry::get('config.contentTypes') AND is_array( IPSSearchRegistry::get('config.contentTypes') )\">\n\t\t\t\t<if test=\"count($sortDropDown)\">\n\t\t\t\t<span class='ipsType_small'>{$this->lang->words['sort_by']}</span> \n\t\t\t\t\t<if test=\"count($sortDropDown) <= 4\">\n\t\t\t\t\t\t<ul class='ipsList_inline ipsType_smaller' style='display: inline'>\n\t\t\t\t\t\t\t<foreach loop=\"$sortDropDown as $k => $l\">\n\t\t\t\t\t\t\t\t<li <if test=\"$this->request['search_app_filters'][$this->request['search_app']][$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']]['sortKey'] == $k\">class='active'</if>>\n\t\t\t\t\t\t\t\t\t<a href='{parse url=\"app=core&module=search&do=user_activity&sid={$this->request['_sid']}&mid={$this->request['mid']}&search_app={$this->request['search_app']}&userMode={$this->request['userMode']}&search_app_filters[{$this->request['search_app']}][searchInKey]={$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}&search_app_filters[{$this->request['search_app']}][{$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}][sortKey]={$k}&search_app_filters[{$this->request['search_app']}][{$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}][sortDir]={$this->request['search_app_filters'][$this->request['search_app']][$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']]['sortDir']}\" base=\"public\"}'>{$l}</a>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t</foreach>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t \n\t\t\t\t\t<else />\n\t\t\t\t\t\t<ul class='ipsList_inline ipsType_smaller' style='display: inline'>\n\t\t\t\t\t\t\t<li class='active'>\n\t\t\t\t\t\t\t\t<a href='#' id='search_sort' class='ipbmenu'>{$sortDropDown[ $this->request['search_app_filters'][$this->request['search_app']][$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']]['sortKey'] ]} <span class='submenu_indicator'></span> </a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t \n\t\t\t\t\t</if>\n\t\t\t\t</if>\n\t\t\t\t<span class='ipsType_small'>{$this->lang->words['order']}</span> \n\t\t\t\t<ul class='ipsList_inline ipsType_smaller' style='display: inline'>\n\t\t\t\t\t<li <if test=\"$this->request['search_app_filters'][$this->request['search_app']][$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']]['sortDir'] == 0\">class='active'</if>>\n\t\t\t\t\t\t<a href='{parse url=\"app=core&module=search&do=user_activity&sid={$this->request['_sid']}&mid={$this->request['mid']}&userMode={$this->request['userMode']}&search_app={$this->request['search_app']}&search_app_filters[{$this->request['search_app']}][searchInKey]={$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}&search_app_filters[{$this->request['search_app']}][{$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}][sortKey]={$this->request['search_app_filters'][$this->request['search_app']][$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']]['sortKey']}&search_app_filters[{$this->request['search_app']}][{$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}][sortDir]=0\" base=\"public\"}'>{$this->lang->words['s_search_type_o_0']}</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li <if test=\"$this->request['search_app_filters'][$this->request['search_app']][$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']]['sortDir'] == 1\">class='active'</if>>\n\t\t\t\t\t\t<a href='{parse url=\"app=core&module=search&do=user_activity&sid={$this->request['_sid']}&mid={$this->request['mid']}&userMode={$this->request['userMode']}&search_app={$this->request['search_app']}&search_app_filters[{$this->request['search_app']}][searchInKey]={$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}&search_app_filters[{$this->request['search_app']}][{$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}][sortKey]={$this->request['search_app_filters'][$this->request['search_app']][$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']]['sortKey']}&search_app_filters[{$this->request['search_app']}][{$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}][sortDir]=1\" base=\"public\"}'>{$this->lang->words['s_search_type_o_1']}</a>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t<else />\n\t\t\t\t<if test=\"count($sortDropDown)\">\n\t\t\t\t\t<span class='ipsType_small'>{$this->lang->words['sort_by']}</span> \n\t\t\t\t\t<if test=\"count($sortDropDown) <= 4\">\n\t\t\t\t\t\t<ul class='ipsList_inline ipsType_smaller' style='display: inline'>\n\t\t\t\t\t\t\t<foreach loop=\"$sortDropDown as $k => $l\">\n\t\t\t\t\t\t\t\t<li <if test=\"$this->request['search_app_filters'][$this->request['search_app']]['sortKey'] == $k\">class='active'</if>>\n\t\t\t\t\t\t\t\t\t<a href='{parse url=\"app=core&module=search&do=user_activity&sid={$this->request['_sid']}&mid={$this->request['mid']}&userMode={$this->request['userMode']}&search_app={$this->request['search_app']}&search_app_filters[{$this->request['search_app']}][searchInKey]={$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}&search_app_filters[{$this->request['search_app']}][sortKey]={$k}&search_app_filters[{$this->request['search_app']}][sortDir]={$this->request['search_app_filters'][$this->request['search_app']]['sortDir']}\" base=\"public\"}'>{$l}</a>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t</foreach>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t \n\t\t\t\t\t<else />\n\t\t\t\t\t\t<ul class='ipsList_inline ipsType_smaller' style='display: inline'>\n\t\t\t\t\t\t\t<li class='active'>\n\t\t\t\t\t\t\t\t<a href='#' id='search_sort' class='ipbmenu'>{$sortDropDown[ $this->request['search_app_filters'][$this->request['search_app']]['sortKey'] ]} <span class='submenu_indicator'></span> </a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t \n\t\t\t\t\t</if>\n\t\t\t\t</if>\n\t\t\t\t<span class='ipsType_small'>{$this->lang->words['order']}</span> \n\t\t\t\t<ul class='ipsList_inline ipsType_smaller' style='display: inline'>\n\t\t\t\t\t<li <if test=\"$this->request['search_app_filters'][$this->request['search_app']]['sortDir'] == 0\">class='active'</if>>\n\t\t\t\t\t\t<a href='{parse url=\"app=core&module=search&do=user_activity&sid={$this->request['_sid']}&mid={$this->request['mid']}&userMode={$this->request['userMode']}&search_app={$this->request['search_app']}&search_app_filters[{$this->request['search_app']}][searchInKey]={$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}&search_app_filters[{$this->request['search_app']}][sortKey]={$this->request['search_app_filters'][$this->request['search_app']]['sortKey']}&search_app_filters[{$this->request['search_app']}][sortDir]=0\" base=\"public\"}'>{$this->lang->words['s_search_type_o_0']}</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li <if test=\"$this->request['search_app_filters'][$this->request['search_app']]['sortDir'] == 1\">class='active'</if>>\n\t\t\t\t\t\t<a href='{parse url=\"app=core&module=search&do=user_activity&sid={$this->request['_sid']}&mid={$this->request['mid']}&userMode={$this->request['userMode']}&search_app={$this->request['search_app']}&search_app_filters[{$this->request['search_app']}][searchInKey]={$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}&search_app_filters[{$this->request['search_app']}][sortKey]={$this->request['search_app_filters'][$this->request['search_app']]['sortKey']}&search_app_filters[{$this->request['search_app']}][sortDir]=1\" base=\"public\"}'>{$this->lang->words['s_search_type_o_1']}</a>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</if>\n\t\t</div>\n\t\t<if test=\"count($sortDropDown) && count($sortDropDown) >= 5\">\n\t\t\t<!-- The menu for changing the sort field -->\n\t\t\t<ul id='search_sort_menucontent' class='ipbmenu_content with_checks' style='display: none'>\n\t\t\t\t<if test=\"IPSSearchRegistry::get('config.contentTypes') AND is_array( IPSSearchRegistry::get('config.contentTypes') )\">\n\t\t\t\t\t<foreach loop=\"$sortDropDown as $k => $l\">\n\t\t\t\t\t\t<li <if test=\"$this->request['search_app_filters'][$this->request['search_app']][$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']]['sortKey'] == $k\">class='selected'</if>>\n\t\t\t\t\t\t\t<a href='{parse url=\"app=core&module=search&do=user_activity&sid={$this->request['_sid']}&mid={$this->request['mid']}&search_app={$this->request['search_app']}&userMode={$this->request['userMode']}&search_app_filters[{$this->request['search_app']}][searchInKey]={$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}&search_app_filters[{$this->request['search_app']}][{$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}][sortKey]={$k}&search_app_filters[{$this->request['search_app']}][{$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}][sortDir]={$this->request['search_app_filters'][$this->request['search_app']][$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']]['sortDir']}\" base=\"public\"}'>{$l}</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</foreach>\n\t\t\t\t<else />\n\t\t\t\t\t<foreach loop=\"$sortDropDown as $k => $l\">\n\t\t\t\t\t\t<li <if test=\"$this->request['search_app_filters'][$this->request['search_app']]['sortKey'] == $k\">class='selected'</if>>\n\t\t\t\t\t\t\t<a href='{parse url=\"app=core&module=search&do=user_activity&sid={$this->request['_sid']}&mid={$this->request['mid']}&userMode={$this->request['userMode']}&search_app={$this->request['search_app']}&search_app_filters[{$this->request['search_app']}][searchInKey]={$this->request['search_app_filters'][$this->request['search_app']]['searchInKey']}&search_app_filters[{$this->request['search_app']}][sortKey]={$k}&search_app_filters[{$this->request['search_app']}][sortDir]={$this->request['search_app_filters'][$this->request['search_app']]['sortDir']}\" base=\"public\"}'>{$l}</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</foreach>\n\t\t\t\t</if>\n\t\t\t</ul>\n\t\t</if>\n\t\t<div>\n\t\t\t<if test=\"NPTotal:|:$total\">\n\t\t\t\t{$results}\n\t\t\t\t<br />\n\t\t\t\t{$pagination}\n\t\t\t<else />\n\t\t\t\t<p class='no_messages'>{$this->lang->words['user_posts_none']}</p>\n\t\t\t</if>\n\t\t</div>\n\t</div>\n</div>\r\nEOF;\r\n//--endhtml--//\r\nreturn $IPBHTML;\r\n}",
"public function fetchPostsAndReplies() {\n $id = $this->instance->network_user_id;\n $network = $this->instance->network;\n\n // fetch user's friends\n $this->storeFriends();\n\n $fetch_next_page = true;\n $current_page_number = 1;\n $posts = InstagramGraphAPIAccessor::apiRequest('media', $id, $this->access_token, array('count' => 20));\n\n //Cap crawl time for very busy pages with thousands of likes/comments\n $fetch_stop_time = time() + $this->max_crawl_time;\n\n //Determine 'since', datetime of oldest post in datastore\n $post_dao = DAOFactory::getDAO('PostDAO');\n $since_post = $post_dao->getAllPosts($id, $network, 1, 1, true, 'pub_date', 'ASC');\n $since = isset($since_post[0])?$since_post[0]->pub_date:0;\n $since = strtotime($since) - (60 * 60 * 24); // last post minus one day, just to be safe\n ($since < 0)?$since=0:$since=$since;\n\n while ($fetch_next_page) {\n if ($posts->count() > 0) {\n $this->logger->logInfo(sizeof($stream->data).\" instagram posts found on page \".$current_page_number,\n __METHOD__.','.__LINE__);\n\n $this->processPosts($posts, $network, $current_page_number);\n\n if ($posts->getNext() != null) {\n $posts = InstagramGraphAPIAccessor::apiRequest('media', $id, $this->access_token, array('count' => 20, 'max_id' => $posts->getNext()));\n $current_page_number++;\n } else {\n $fetch_next_page = false;\n }\n } else {\n $this->logger->logInfo(\"No instagram posts found for ID $id\", __METHOD__.','.__LINE__);\n $fetch_next_page = false;\n }\n if (time() > $fetch_stop_time) {\n $fetch_next_page = false;\n $this->logger->logUserInfo(\"Stopping this service user's crawl because it has exceeded max time of \".\n ($this->max_crawl_time/60).\" minute(s). \",__METHOD__.','.__LINE__);\n }\n }\n }",
"public function forum_recent_posts(){\n self::$db = Database::get();\n\t\t$data = self::$db->select(\"\n SELECT sub.*\n FROM\n (SELECT\n fp.forum_post_id as forum_post_id, fp.forum_id as forum_id,\n fp.forum_user_id as forum_user_id, fp.forum_title as forum_title,\n fp.forum_content as forum_content, fp.forum_edit_date as forum_edit_date,\n fp.forum_timestamp as forum_timestamp, fpr.id as id,\n fpr.fpr_post_id as fpr_post_id, fpr.fpr_id as fpr_id,\n fpr.fpr_user_id as fpr_user_id, fpr.fpr_title as fpr_title,\n fpr.fpr_content as fpr_content, fpr.fpr_edit_date as fpr_edit_date,\n fpr.fpr_timestamp as fpr_timestamp,\n GREATEST(fp.forum_timestamp, COALESCE(fpr.fpr_timestamp, '00-00-00 00:00:00')) AS tstamp\n FROM \".PREFIX.\"forum_posts fp\n LEFT JOIN \".PREFIX.\"forum_posts_replys fpr\n ON fp.forum_post_id = fpr.fpr_post_id\n WHERE fp.allow = 'TRUE'\n ORDER BY fpr.fpr_timestamp DESC\n ) sub\n GROUP BY forum_post_id\n ORDER BY tstamp DESC\n LIMIT 10\n \");\n return $data;\n }",
"protected function readPosts() {\n\t\t// accessible boards\n\t\t$accessibleBoardIDArray = Board::getAccessibleBoardIDArray(array('canViewBoard', 'canEnterBoard', 'canReadThread'));\n\t\tif (!count($accessibleBoardIDArray)) {\n\t\t\tthrow new PermissionDeniedException();\n\t\t}\n\t\t\n\t\t// get posts\n\t\t$attachmentPostIDArray = array();\n\t\t$sql = \"SELECT\t\tpost.*\n\t\t\tFROM\t\twbb\".WBB_N.\"_post post\n\t\t\tWHERE\t\tpost.threadID IN (\".implode(',', $this->threadIDArray).\")\n\t\t\t\t\tAND post.threadID IN (SELECT threadID FROM wbb\".WBB_N.\"_thread WHERE boardID IN (\".implode(',', $accessibleBoardIDArray).\"))\n\t\t\t\t\tAND post.isDeleted = 0\n\t\t\t\t\tAND post.isDisabled = 0\n\t\t\t\t\t\".($this->hours ? \"AND post.time > \".(TIME_NOW - $this->hours * 3600) : '').\"\n\t\t\tORDER BY\tpost.time DESC\";\n\t\t$result = WCF::getDB()->sendQuery($sql, $this->limit);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$this->posts[] = new FeedPost(null, $row);\n\t\t\t\n\t\t\t// attachments\n\t\t\tif ($row['attachments'] != 0) {\n\t\t\t\t$attachmentPostIDArray[] = $row['postID'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t// read attachments\n\t\tif (MODULE_ATTACHMENT == 1 && count($attachmentPostIDArray) > 0 && (WCF::getUser()->getPermission('user.board.canViewAttachmentPreview') || WCF::getUser()->getPermission('user.board.canDownloadAttachment'))) {\n\t\t\trequire_once(WCF_DIR.'lib/data/attachment/MessageAttachmentList.class.php');\n\t\t\t$attachmentList = new MessageAttachmentList($attachmentPostIDArray, 'post');\n\t\t\t$attachmentList->readObjects();\n\t\t\t$attachments = $attachmentList->getSortedAttachments();\n\t\t\t\n\t\t\t// set embedded attachments\n\t\t\trequire_once(WCF_DIR.'lib/data/message/bbcode/AttachmentBBCode.class.php');\n\t\t\tAttachmentBBCode::setAttachments($attachments);\n\t\t}\n\t}"
] |
[
"0.6656536",
"0.5983574",
"0.5934919",
"0.5919858",
"0.58324146",
"0.57394373",
"0.55821437",
"0.5551505",
"0.5464989",
"0.5445464",
"0.5347117",
"0.53345406",
"0.5313853",
"0.52342385",
"0.5220709",
"0.5203336",
"0.5177966",
"0.51611906",
"0.5143298",
"0.5106124",
"0.5103809",
"0.5095697",
"0.50896466",
"0.5085279",
"0.508159",
"0.5074072",
"0.50526243",
"0.50525606",
"0.5041552",
"0.5036783"
] |
0.6999035
|
0
|
Simply returns an aggregate count of pages currently in database
|
public function pagecount()
{
// Pretty easy: Return number of pages in this wiki
return Page::all()->count();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function countPages(){\n return $this->db->count_all('page_attributes');\n }",
"public function count()\n {\n return Page::count();\n }",
"public function totalPage();",
"public function total_pages()\n {\n if(isset($this->total_pages)) return $this->total_pages;\n $this->total_pages = 0;\n \n $result = $this->mysqli_slave->query(\"SELECT COUNT(*) count FROM taxon_concepts tc WHERE tc.published=1 AND tc.supercedure_id=0\");\n if($result && $row=$result->fetch_assoc()) $this->total_pages = $row['count'];\n return $this->total_pages;\n }",
"public function count()\n {\n return count($this->pages);\n }",
"public function numOfPages(): int\n {\n return count($this->repository);\n }",
"public function pageCount()\n {\n return ($this->dbConnection->query('SELECT * FROM todos')->rowCount()/$this->numRecords);\n\n }",
"public function count()\n\t{\n\t\treturn count($this->_pages);\n\t}",
"public function getPagesCount()\n {\n \treturn count($this->_pages);\n }",
"public function getPageCount() \r\n { \r\n }",
"function getTotalPages()\n{\n include('connecter.php');\n if($con)\n {\n $nbr = $con->query('SELECT COUNT(*) AS nbre_total FROM invite');\n $resultat = $nbr->fetch();\n return $resultat['nbre_total'];\n }\n return -1;\n \n}",
"public function pageCount() {\r\n\t\tif ($this->__pageItems > 0) {\r\n\t\t\t$intReturn = ceil(count($this->collection) / $this->__pageItems);\r\n\t\t} else {\r\n\t\t\t$intReturn = 1;\r\n\t\t}\r\n\r\n\t\treturn $intReturn;\r\n\t}",
"function page_total(){\r\n $num_users = $this->reg->db->getRow('SELECT COUNT(id)\r\n FROM system__content\r\n WHERE user_id = ?', array($_SESSION['SYSTEM']['USER_ID']));\r\n\r\n // calculate total pages\r\n $pages = floor($num_users[0]/30);\r\n if($num_users[0]%30)\r\n $pages++;\r\n\r\n return $pages;\r\n }",
"function get_page_count() {\n global $connexion, $config;\n $nb_images = $connexion->query('SELECT COUNT(id) FROM image')->fetchColumn();\n $nb_pages = ceil($nb_images / $config['nb_pictures_page']);\n return $nb_pages;\n}",
"function getPageCount() {\n return $this->helper->getPageCount();\n }",
"function getPageCount() {\n return $this->helper->getPageCount();\n }",
"function getPageCount() { return $this->m_pageCount; }",
"public function numOfPages(): int;",
"public function count(){\n return $this->db->query('SELECT COUNT(*) FROM marque_page')->fetchColumn();\n }",
"public function getPageCount()\n\t{\n\t\tif($this->pageCount === null)\n\t\t{\n\t\t\t$this->pageCount = $this->getCounts()[$this->getFolderId()] / $this->itemsPerPage;\n\t\t}\n\t\t\n\t\treturn $this->pageCount;\n\t}",
"public function getSumPages()\n {\n if (USE_ONE_TABLE) {\n $sql = \"SELECT COUNT(*) as sum FROM $this->table WHERE `deleted` is null\";\n } else {\n $sql = \"SELECT COUNT(DISTINCT book_id) as sum\n FROM relations\n JOIN books ON books.id = relations.book_id\n WHERE deleted is null\";\n }\n\n $sum = $this->findBySql($sql)[0]['sum'];\n return ceil($sum / $this->limit);\n }",
"public function getTotalCount();",
"public function getTotalCount();",
"public function getTotalCount();",
"public function totalCount();",
"public function totalCount();",
"public function pages()\n\t{\n\t\treturn ceil($this->_count_total / $this->config['total_items']);\n\t}",
"public function count()\n {\n return $this->pager->count();\n }",
"function totalpages(){\n \tglobal $numofVideos;\n \treturn ceil(countallvideos() / $numofVideos);\n }",
"private function getNumPages() {\n\n return $this->rowCount / $this->limit;\n }"
] |
[
"0.77080774",
"0.7557297",
"0.75109154",
"0.7499286",
"0.7474292",
"0.73961926",
"0.73505265",
"0.7345236",
"0.7323424",
"0.7321206",
"0.73006356",
"0.7250944",
"0.7208718",
"0.7195943",
"0.71595097",
"0.71595097",
"0.7157435",
"0.7139136",
"0.712983",
"0.71265095",
"0.70867807",
"0.7075481",
"0.7075481",
"0.7075481",
"0.70673436",
"0.70673436",
"0.70571905",
"0.7013664",
"0.70117694",
"0.700936"
] |
0.75686157
|
1
|
Adds a table to the dataset The table will be given the passed name. $csvFile should be a path to a valid csv file (based on the arguments passed to the constructor.)
|
public function addTable($tableName, $csvFile): void
{
if (!\is_file($csvFile)) {
throw new InvalidArgumentException("Could not find csv file: {$csvFile}");
}
if (!\is_readable($csvFile)) {
throw new InvalidArgumentException("Could not read csv file: {$csvFile}");
}
$fh = \fopen($csvFile, 'rb');
fseek($fh, 2); // after BOM
// TODO streaming
$tmpFp = fopen('php://temp', 'w+b');
fwrite($tmpFp, mb_convert_encoding(stream_get_contents($fh), 'UTF-8', 'UTF-16LE'));
rewind($tmpFp);
$columns = $this->getCsvRow($tmpFp);
if ($columns === false) {
throw new InvalidArgumentException("Could not determine the headers from the given file {$csvFile}");
}
$metaData = new \PHPUnit\DbUnit\DataSet\DefaultTableMetadata($tableName, $columns);
$table = new \PHPUnit\DbUnit\DataSet\DefaultTable($metaData);
while (($row = $this->getCsvRow($tmpFp)) !== false) {
$table->addRow(\array_combine($columns, $row));
}
$this->tables[$tableName] = $table;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function createTable($table, $file){\n if ($result = $this->query(\"SHOW TABLES LIKE '\".$table.\"'\")) {\n if($result->num_rows == 1) {\n // echo \"Table exists. Skipping Creating table. Moving on to insertion\";\n return true;\n }\n }\n\n $file = fopen($file,'r');\n $column = fgetcsv($file);\n for($i=0;$i<sizeof($column);$i++){\n $this->columnName = implode(\" varchar(20),\",$column);\n }\n $createTable = \"CREATE TABLE \".$table.\"(id INT(11) NOT NULL AUTO_INCREMENT ,\".$this->columnName.\" varchar(20), PRIMARY KEY (`id`))\";\n echo $createTable;\n if($this->query($createTable)){\n // echo \"Created \";\n return true;\n } else {\n // echo \"Not Created\".$this->error;\n return false;\n }\n }",
"public function addToDB($csv) {\r\n unset($csv['headers']);\r\n\r\n foreach($csv as $row) {\r\n\r\n $sql_fields = implode(', ',array_keys($row));\r\n $values = array();\r\n foreach($row as $value) {\r\n $values[] = \"'\" . $this->mysqli->real_escape_string($value) . \"'\";\r\n }\r\n $sql_values = implode(', ', $values);\r\n $sql_query = \"INSERT INTO $this->tableName ($sql_fields) VALUES ($sql_values)\";\r\n $result = $this->mysqli->query($sql_query);\r\n if (!$result) {\r\n return array('error' => 'The sql query \"' . $sql_query . '\" failed');\r\n }\r\n }\r\n }",
"public static function addTableEntry\r\n\t(\r\n\t\t$tableName\t\t\t\t// <str> The name of a Skydata table to update data on.\r\n\t,\t$submittedID\t\t\t// <str> The ID of the data to submit.\r\n\t,\t$submittedData\t\t\t// <array> The submitted data to enter.\r\n\t,\t$guestEntry = false\t\t// <bool> TRUE if you want to pull the guest data for it.\r\n\t)\t\t\t\t\t\t\t// RETURNS <bool> TRUE on success, FALSE on failure.\r\n\t\r\n\t// Skydata::addTableEntry($tableName, $submittedID, $submittedData, $guestEntry);\r\n\t{\r\n\t\t// Get the existing table data, as is:\r\n\t\tif(!$data = File::read( self::$path . \"/tables/\" . $tableName . \".json\" )) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$data = json_decode( $data, true );\r\n\t\t\r\n\t\tif( json_last_error() ) {\r\n\t\t\tthrow new Exception( json_last_error_msg() );\r\n\t\t}\r\n\t\t\r\n\t\t// For standard entries, update or insert the new entry\r\n\t\tif(!$guestEntry) {\r\n\t\t\t$data['data'][$submittedID] = $submittedData;\r\n\t\t}\r\n\t\t\r\n\t\t// If this is a guest entry, update the entry as unapprovedData\r\n\t\telse {\r\n\t\t\t$data['unapprovedData'][$submittedID] = $submittedData;\r\n\t\t}\r\n\t\t\r\n\t\t// Update the file with the appropriate JSON\r\n\t\t$newJSON = json_encode($data, JSON_PRETTY_PRINT);\r\n\t\t\r\n\t\tFile::write(self::$path . \"/tables/\" . $tableName . \".json\", $newJSON);\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"public function loadWFData($table, $filename){\n //$filename = \"/Users/aprateek/Desktop/sms_cat_healthcare_speciality.csv\";\n error_log(\"Filenaem=\".$filename);\n $pd = array_map('str_getcsv', file($filename));\n $headers=array();\n foreach ($pd[0] as $head){\n $headers[]=trim($head);\n }\n if (count($headers) == 0){\n throw new Exception(\"The csv file has missing or malformed header\");\n }\n error_log(\"Head=\".SmsWfUtils::flatten($headers));\n \n try {\n $this->t_crtinsupd(\"DROP TABLE IF EXISTS \".$table.\";\");\n $create_stmt = \"CREATE TABLE IF NOT EXISTS \".$table.\" (\";\n foreach($headers as $head){\n $create_stmt .= self::esc($head).\" TEXT ,\";\n }\n $create_stmt = substr($create_stmt, 0, strlen($create_stmt) -1);\n $create_stmt .= \");\";\n error_log(\"create stmt=\".$create_stmt);\n $this->t_crtinsupd($create_stmt);\n }\n catch(Exception $e){\n throw new Exception(\"Error encountered while creating schema \".$e->getMessage());\n }\n \n try {\n foreach(array_splice($pd, 1) as $row){\n $insert_stmt=\"insert into \".$table.\" values (\";\n $data = array();\n for ($i=0; $i<count($pd[0]);$i++){\n $header = self::esc(trim($pd[0][$i]));\n $data[$header] = self::esc(trim($row[$i]));\n $insert_stmt .= \"'\".self::esc(trim($row[$i])).\"',\";\n }\n $insert_stmt = substr($insert_stmt, 0, strlen($insert_stmt) -1);\n $insert_stmt .= \");\";\n error_log(\"insert_stmt=\".$insert_stmt);\n $this->t_crtinsupd($insert_stmt);\n }\n }\n catch(Exception $e){\n throw new Exception(\"Error encountered while saving data \".$e->getMessage());\n }\n }",
"function add($table_name, $data_array)\n\t{\n\n\t}",
"public static function parse( $csvFile, $separator=\"\\t\", $delimiter = '\"' ){\n\t\tsetlocale(LC_ALL, 'fr_FR.UTF8', 'fr.UTF8', 'fr_FR.UTF-8', 'fr.UTF-8');\n\t\t\n\t\t$header = null;\n\t\t$table = null;\n\t\t\n\t\tif ( ($handle = fopen( $csvFile, \"r\" ) ) !== FALSE) {\n\t\t\twhile (($data = fgetcsv( $handle, 0, $separator, $delimiter)) !== FALSE) { \n\t\t\t\t$data = self::clean( $data );\n\n\n\t\t\t\t// first line: headers\n\t\t\t\tif( $header == null ){\n\t\t\t\t\t$header = new Anta_Csv_Header( $data );\n\t\t\t\t\t$table = new Anta_Csv_Table( $header );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$table->addRow(\n\t\t\t\t\tAnta_Csv_Row::create( $header, $data )\n\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\tfclose($handle);\n\t\t}\n\t\t\n\t\treturn $table;\n\t}",
"function Import_FileImportLibrary_CSV($table,$data){\n $this->db->insert($table, $data);\n }",
"public function addTable(PHPUnit_Extensions_Database_DataSet_ITable $table)\n {\n $this->tables[] = $table;\n }",
"public function __construct( $tableName ) {\n\t\t$this->tableName = $tableName;\n\t}",
"public function csvToTable($csvHandle, $tableId, $hasHeaders = true)\n {\n // accessing the import service we will be callin the the process\n $uploadService = new GoogleFusiontablesUploadService($this->client);\n $uploadServiceResource = $uploadService->import;\n // default upload parameters for that service\n $importParams = array(\n GoogleFusionTablesUploadService::PARAM_ENCODING => GoogleFusionTablesUploadService::PARAM_ENCODING_AUTODETECT\n );\n\n // rewinding to the beginning of the imported CSV\n fseek($csvHandle, 0);\n\n $csvContent = '';\n if (!$hasHeaders) {\n // first line would be discarded by Fusion Tables so we need to start with a non-meaningful line\n // can't be just an empty line (even isStrict=false) seem still require the right number of headers\n $csvContent .= implode(',', self::getColumnTitles()) . PHP_EOL;\n }\n\n gc_enable();\n\n // processing the CSV in maybe an unnecessarily sophisticated way, but that should allow to handling long CSVs\n $rowCount = 0;\n // reading CSV line by line\n while (($csvRow = fgets($csvHandle)) !== false) {\n if (\n ((strlen($csvContent) + strlen($csvRow)) >= GoogleTableUploadServiceResource::MAX_IMPORT_SIZE) or\n self::isCloseToMemoryLimit()\n ) {\n // if we add current line on top, it'll be too much, so let's send what we have accumulated\n $response = $uploadServiceResource->import($tableId, $csvContent, $importParams);\n $rowCount += $response[GoogleTableImportResult::RESULT_NUMROWS];\n\n unset($csvContent); // couldn't harm (http://php.net/manual/en/features.gc.php)\n $csvContent = '';\n\n gc_collect_cycles();\n }\n\n $csvContent .= $csvRow;\n unset($csvRow);\n }\n\n if (strlen($csvContent)) {\n // upload the last remaining chunk\n $response = $uploadServiceResource->import($tableId, $csvContent, $importParams);\n $rowCount += $response[GoogleTableImportResult::RESULT_NUMROWS];\n }\n\n gc_disable();\n\n if (!$hasHeaders and ($rowCount > 0)) {\n $rowCount--;\n }\n\n return $rowCount;\n }",
"function importData($tabName, $filePath) \n{\n\tglobal $mysqli;\n\tif (!file_exists($filePath)) {\n\t\tdie(\"Error: El archivo \".$filePath.\" No existe!\");\n\t}\n\t$data = array();\n\tif (($gestor = fopen($filePath, \"r\")) !== FALSE) {\n\t\twhile ($datos = fgetcsv($gestor, 1000, \";\")) {\n\t\t\t$data[]=$datos;\n\t\t}\n\t \n\t fclose($gestor);\n\t}\t\n\t$create=\"CREATE TABLE IF NOT EXISTS `$tabName` (\n\t `id` int(8) NOT NULL AUTO_INCREMENT,\n\t `name` varchar(100) NOT NULL,\n\t `author` varchar(30) NOT NULL,\n\t `isbn` varchar(30) NOT NULL,\n\t PRIMARY KEY (`id`)\n\t) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1\";\n\n\t$insert = \"INSERT INTO $tabName (\";\n\n\t$create=\"CREATE TABLE IF NOT EXISTS `$tabName` (\";\n\tfor ($i=0; $i < count($data[0]) ; $i++) { \n\t\tif ($i==count($data[0])-1) {\n\t\t\t$insert.=strtolower($data[0][$i].\" )\");\n\t\t\t$create.=\" `\".$data[0][$i].\"` varchar(200)\";\n\t\t}else{\n\t\t\t$insert.=strtolower($data[0][$i].\",\");\n\n\t\t\t$create.=\" `\".$data[0][$i].\"` varchar(200),\";\n\t\t}\n\t}\n\t$create.=\") ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;\";\n\n\t$insert.=\" VALUES \";\n\tfor ($j=1; $j < count($data); $j++) { \n\t\tif ($j != 1) {\n\t\t\t# code...\n\t\t\t$insert.=\", ( \";\n\n\t\t}else{\n\n\t\t\t$insert.=\" ( \";\n\t\t}\n\t\tfor ($i=0; $i < count($data[$j]) ; $i++) { \n\t\t\tif ($i==count($data[$j])-1) {\n\t\t\t\t$insert.=\"\n\t\t\t\t'\".strtolower($data[$j][$i].\"' )\");\n\t\t\t\t//$create.=\" `\".$data[$j][$i].\"` varchar(200)\";\n\t\t\t}else{\n\t\t\t\t$insert.=\"\n\t\t\t\t'\".strtolower($data[$j][$i].\"',\");\n\n\t\t\t\t//$create.=\" `\".$data[$j][$i].\"` varchar(200),\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (!$mysqli->query($create)) {\n\t\tshowErrors();\n\t}\n\n\n\t\n\tif (!($mysqli->query($insert))) {\n\t echo \"\\nQuery execute failed: ERRNO: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t die;\n\t};\n\n\treturn true;\n}",
"function addRow($tabName, $tabData) {\n\tglobal $mysqli;\n\t$keys = \"(\".implode(\", \",array_keys($tabData)).\")\";\n\t$values = \"'\".implode(\"','\",array_values($tabData)).\"'\";\n\t\n\t$sql = \"INSERT INTO $tabName $keys VALUES ($values)\";\n\tif (!$mysqli->query($sql)) {\n\t\tshowErrors();\n\t}\n return true;\n}",
"public function __construct($new_csv){\t\n\t\t\t//Sets the private csv file variable with the file that was passed in\n\t\t\t$this->csv_file = $new_csv;\n\t\t}",
"function Quick_CSV_import($file_name=\"\")\r\n {\r\n $this->file_name = $file_name;\r\n\t\t$this->source = '';\r\n $this->arr_csv_columns = array();\r\n $this->use_csv_header = true;\r\n $this->field_separate_char = \",\";\r\n $this->field_enclose_char = \"\\\"\";\r\n $this->field_escape_char = \"\\\\\";\r\n $this->table_exists = false;\r\n }",
"public function __construct(Csv $csv)\n {\n $this->csv = $csv;\n }",
"protected function add(Table $table) {\n $this->tables[] = $table;\n }",
"public function __construct(string $csvPath)\n {\n $this->csvPath = $csvPath;\n }",
"public function addRow($row, $file)\n { }",
"public function actionImportFromCsv()\n {\n HBackup::importDbFromCsv($this->csvFile);\n }",
"public function addTable(Table $table)\n {\n $this->tables[(string) $table] = $table;\n }",
"public function createTable($tableName, $schemaName, $definition){ }",
"public function createTable(Source $source, AbstractTable $table);",
"protected function insertTable(DataTable $table, string $recordName)\n {\n $maxRows = Config::getInstance()->General['datatable_archiving_maximum_rows_actions'];\n $maximumRowsInSubDataTable = Config::getInstance()->General['datatable_archiving_maximum_rows_subtable_actions'];\n\n $report = $table->getSerialized($maxRows, $maximumRowsInSubDataTable, (new Median())->getName());\n $this->getProcessor()->insertBlobRecord($recordName, $report);\n }",
"public function createTable()\n {\n // Create out table\n // First line of the file.\n $fh = $this->getInputFileHandle();\n rewind($fh);\n $fl = fgets($fh);\n // Trim and htmlentities the first line of the file to make column names\n $cols = array_map('trim', array_map('htmlentities', str_getcsv($fl, $this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar'])));\n // array to hold definitions\n $defs = array();\n // if our table *doesn't* have headers, give generic names\n if (!$this->vars['hh']) {\n $oc = $cols;\n $c = count($cols);\n $cols = array();\n for ($i = 0; $i < $c; $i++) {\n $col = \" `Column_\" . $i . \"` \";\n $col .= is_numeric($oc[$i]) ? \"DECIMAL(12,6) DEFAULT NULL\" :\n \"VARCHAR(512) CHARACTER SET \" . $this->vars['characterSet'] . \" COLLATE \" . $this->vars['collation'] . \" DEFAULT NULL\";\n $cols[] = $col;\n }\n } else {\n // if our table *does* have headers\n $file = new SplFileObject($this->vars['ifn']);\n $headers = $file->fgetcsv($this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar']);\n\n // number of columns to get for guessing types\n $n = min(10, $this->numLines());\n $firstNCols = array();\n for($i = 0; $i < $n; $i++){\n $firstNCols[$i] = $file->fgetcsv($this->vars['delimiter'], $this->vars['quotechar'], $this->vars['escapechar']);\n }\n $sl = $firstNCols[0];\n if(count($sl) !== count($cols)){\n $baseurl = explode('?', $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])[0];\n trigger_error(\"Number of columns inconsistent throughout file. For more information, see the error documentation.\");\n exit(1);\n }\n\n // guess the column types from the first n rows of info\n $colTypes = array_fill(0,count($cols),null);\n for($i = 0; $i < $n; $i++){\n foreach ($cols as $j => $col) {\n if(!isset($firstNCols[$i])){\n trigger_error('Why don\\'t we have row ' . $i . '??');\n }\n if(!isset($firstNCols[$i][$j])){\n if(count($firstNCols[$i]) !== count($cols)){\n trigger_error('Column count is inconsistent throughout the file. If you\\'re sure you have the right amount of columns, please check the delimiter options.');\n }\n trigger_error('Why don\\'t we have column ' . $j . '??');\n }\n $colTypes[$j] = $this->guessType(\n $firstNCols[$i][$j],\n $colTypes[$j]\n );\n }\n }\n\n foreach($colTypes as $i => &$type){\n $type = (is_null($type)) ? 'VARCHAR(512) CHARACTER SET ' . $this->vars['characterSet'] . ' COLLATE ' . $this->vars['collation'] . '' : $type;\n }\n\n /*echo \"<pre>\";\n print_r(array_combine($cols,$colTypes));\n echo \"</pre>\";\n exit();*/\n\n // We can pretty much only guess two data types from one row of information\n foreach ($cols as $i => &$col) {\n $cname = $col;\n $col = ' `' . $cname . '` ';\n $col .= $colTypes[$i];\n $col .= \" COMMENT '$cname'\";\n }\n }\n // Always have an id column!\n array_unshift($cols, ' `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT \\'id\\'');\n $SQL = \"CREATE TABLE IF NOT EXISTS `{$this->vars['db']['db']}`.`{$this->vars['db']['table']}` (\\n\";\n $SQL .= implode(\",\\n\", $cols);\n $SQL .= \"\\n) ENGINE=InnoDB DEFAULT CHARSET=\".$this->vars['characterSet'].\" CHARSET=\".$this->vars['characterSet'].\" COLLATE \".$this->vars['collation'].\";\";\n $this->executeSql($SQL);\n\n return $this;\n }",
"public static function add($team_set_id, $table_name){\n\t\tif(empty(self::$_setHash[$team_set_id]) || empty(self::$_setHash[$team_set_id][$table_name])){\n\t\t\tself::$_setHash[$team_set_id][] = $table_name;\n\t\t}\n\t}",
"protected function load_csv_data() {\n $dataset = $this->createCsvDataSet(array(\n usermoodle::TABLE => elispm::file('tests/fixtures/user_moodle.csv')\n ));\n $this->loadDataSet($dataset);\n }",
"function createTable($name, $rows);",
"public function insert($tableName, $data);",
"public function add(ClosureTableData $obj, $idEntry = 0);",
"public function __construct(string $tableName) {\n $this->from($tableName);\n }"
] |
[
"0.61105",
"0.5763686",
"0.5407869",
"0.5393118",
"0.53849506",
"0.5264936",
"0.52604556",
"0.5244347",
"0.523495",
"0.5215974",
"0.5159306",
"0.5148162",
"0.5137392",
"0.51245236",
"0.5119747",
"0.51144564",
"0.5111923",
"0.51069486",
"0.5099487",
"0.5073846",
"0.50418913",
"0.50254315",
"0.50183487",
"0.50100017",
"0.49836788",
"0.49811873",
"0.49798653",
"0.4968696",
"0.49578235",
"0.49478087"
] |
0.8111279
|
0
|
Check if glide preset is enabled.
|
protected function isGlidePresetEnabled($preset)
{
$server = app(\League\Glide\Server::class);
return collect($server->getPresets())->has($preset);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function should_load() {\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$theme_support = get_theme_support( 'themeisle-demo-import' );\n\n\t\tif ( empty( $theme_support ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"function should_load() {\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\n\t\treturn is_plugin_active( 'revslider/revslider.php' );\n\t}",
"function GDEnabled()\n\t{\n\t\tstatic $gd_enabled = null;\n\n\t\tif (is_null($gd_enabled)) {\n\t\t\t$gd_enabled =\tfunction_exists('imagecreate')\n\t\t\t\t\t\t\t&& (\tfunction_exists('imagegif')\n\t\t\t\t\t\t\t\t\t|| function_exists('imagepng')\n\t\t\t\t\t\t\t\t\t|| function_exists('imagejpeg'));\n\t\t}\n\n\t\treturn $gd_enabled;\n\t}",
"public function isFallbackEnabled(): bool\n {\n return config('theme-system.fallback_enable', true) ?? true;\n }",
"public static function is_enabled() {\n\t\treturn ! empty( get_option( static::ENABLE_FONTS_OPTIMIZATION, 0 ) );\n\t}",
"public static function gdAvailable()\n {\n return extension_loaded('gd');\n }",
"protected function photon_is_available() {\n\t\t$available = ! function_exists( 'jetpack_photon_url' )\n\t\t\t|| (\n\t\t\t\ttrue === defined( 'JETPACK_DEV_DEBUG' )\n\t\t\t\t&& true === constant( 'JETPACK_DEV_DEBUG' )\n\t\t\t);\n\n\t\treturn apply_filters(\n\t\t\t'wpcom_thumbnail_editor_photon_is_available',\n\t\t\t$available\n\t\t);\n\t}",
"public function is_enabled_global() {\n\t\t$enabled = get_option( 'rg_gforms_enable_akismet' );\n\n\t\treturn $enabled === false ? true : $enabled === '1';\n\t}",
"function url_monikers_enabled()\n{\n if (!function_exists('get_option')) {\n return false;\n }\n if (get_param_integer('keep_urlmonikers', null) === 0) {\n return false;\n }\n if (get_option('url_monikers_enabled') !== '1') {\n return false;\n }\n return true;\n}",
"public function is_enabled() {\n $enabled = file_exists(ABSPATH . '!sak4wp.php');\n return $enabled;\n }",
"public function isEnabled(): bool\n {\n return config('theme-system.enable', true) ?? true;\n }",
"public static function GDSupported() {\n\t\treturn \\function_exists('gd_info');\n\t}",
"protected function enabled() {\n\t\treturn class_exists( 'nProjects' );\n\t}",
"public function isAssetsEnabled(): bool\n {\n return config('theme-system.assets', true) ?? true;\n }",
"public static function hasGitlabSupport()\n {\n return static::enabled(static::gitlab());\n }",
"function ppom_is_api_enable() {\n \n $api_enable = get_option( 'ppom_api_enable' );\n $api_key = get_option( 'ppom_rest_secret_key' );\n \n $return = false;\n \n if( $api_enable == 'yes' && $api_key != '' ) {\n $return = true;\n }\n \n return $return;\n}",
"function amap_ma_check_if_photosmap_gm_enabled() {\n \n if (!elgg_is_active_plugin(\"photosmap\") || !elgg_is_active_plugin(\"tidypics\")) {\n error_log('lalala 2');\n return false;\n }\n \n $gm_photosmap = trim(elgg_get_plugin_setting('gm_photosmap', AMAP_MA_PLUGIN_ID));\n \n if ($gm_photosmap == AMAP_MA_GENERAL_YES) {\n return true;\n }\n\n return false;\n}",
"function plugin_satisfactionsmiley_check_config() {\n return true;\n}",
"protected function isImageMagickEnabledAndConfigured() {}",
"public static function isAvailable()\n {\n return Image::isAvailable('gd');\n }",
"public function getImportGallery()\n {\n $value = $this->_config->get('dataprocessing/images/import_gallery');\n\n if ($value === null) {\n $value = true;\n }\n\n return (bool)$value;\n }",
"public static function hasGoogleSupport()\n {\n return static::enabled(static::google());\n }",
"public function isDefaultCropperEnabled()\n {\n return $this->defaultCropperEnabled;\n }",
"function gdInstalled() {\r\n return function_exists( 'gd_info' );\r\n}",
"function plugin_is_active() {\n\t\treturn class_exists( 'Marketpress' );\n\t}",
"public static function imagickAvailable()\n {\n return extension_loaded('imagick');\n }",
"private static function _isTwigTweakEnabled() {\n $module = 'twig_tweak';\n $output = trim(shell_exec('drush pml --field=\"status\" --filter=\"' . $module . '\"'));\n if ($output == 'Enabled') {\n return TRUE;\n }\n return FALSE;\n }",
"function isEnabled()\n{\n global $avahips_config;\n\n // Load Avahi-PS configuration file\n $aps_cfg = load_conffile($avahips_config);\n\n // Check for IPFS as a backend database for publication\n if (isset($aps_cfg['DATABASE']) && strpos($aps_cfg['DATABASE'], 'ipfs') !== false) {\n return true;\n }\n return false;\n}",
"function fiorello_mikado_revolution_slider_installed() {\n\t\treturn class_exists( 'RevSliderFront' );\n\t}",
"private function checkGDLibrary(){\n\t//Check for GD support\n\t\treturn extension_loaded('gd');\n\t}"
] |
[
"0.63394535",
"0.6324525",
"0.6232219",
"0.61391056",
"0.6119177",
"0.6069085",
"0.6046129",
"0.5997027",
"0.597379",
"0.5957952",
"0.59296614",
"0.59158504",
"0.59107226",
"0.5892097",
"0.5869552",
"0.5856647",
"0.58182955",
"0.5804189",
"0.5780981",
"0.5751892",
"0.5729786",
"0.57250464",
"0.5719398",
"0.5662811",
"0.56284726",
"0.5628237",
"0.56242746",
"0.5591671",
"0.55881375",
"0.55763566"
] |
0.70595974
|
0
|
The class constructor. By default, decorate an empty Agel_Payment_Gateway_RedirectContainer
|
public function __construct() {
$this->_gatewayRedirect = new Agel_Payment_Gateway_RedirectContainer ();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function __construct()\n {\n $guard = backpack_guard_name();\n \n $this->middleware(\"guest:$guard\", ['except' => 'logout']);\n // ----------------------------------\n // Use the admin prefix in all routes\n // ----------------------------------\n\n // If not logged in redirect here.\n $this->loginPath = property_exists($this, 'loginPath') ? $this->loginPath\n : backpack_url('login');\n\n // Redirect here after successful login.\n $this->redirectTo = property_exists($this, 'redirectTo') ? $this->redirectTo\n : backpack_url('dashboard');\n\n // Redirect here after logout.\n $this->redirectAfterLogout = property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout\n : backpack_url();\n // $this->loginPath = \"/users/login\";\n // $this->redirectTo = '/users/login';\n // $this->redirectAfterLogout = '/users/login';\n \n }",
"public function __construct()\n {\n $this->middleware('guest');\n // $this->middleware('signed')->only('verify');\n // $this->middleware('throttle:6,1')->only('verify', 'resend');\n $this->redirectTo = config('app.frontend_url');\n }",
"public function __construct()\n {\n // Após login, redirecionar para admin\n $base_route = config('layout-ui.base_route');\n $this->redirectTo = route($base_route);\n\n $this->middleware('auth');\n $this->middleware('signed')->only('verify');\n $this->middleware('throttle:6,1')->only('verify', 'resend');\n }",
"public function __construct() {\n $this->redirectTo = config('lyra.routes.web.prefix');\n parent::__construct();\n }",
"public function __construct()\n {\n $this->corals_middleware = ['guest'];\n parent::__construct();\n }",
"public function __construct()\n {\n $this->middleware(function($request, $next){\n if($this->guard()->check()){\n return redirect($this->redirectPath());\n }\n return $next($request);\n })->except('logout');\n }",
"public function __construct()\n {\n $this->middleware('referer');\n if (App::getLocale() == \"it\") {\n Moment::setLocale('it_IT');\n }\n\n\n $this->_apiContext = PayPal::ApiContext(\n config('services.paypal.client_id'),\n config('services.paypal.secret'));\n\n\n $this->_apiContext->setConfig(array(\n 'mode' => (getenv('APP_ENV') == \"local\") ? 'sandbox' : 'live',\n 'service.EndPoint' => (getenv('APP_ENV') == \"local\") ? 'https://api.sandbox.paypal.com' : 'https://api.paypal.com',\n 'http.ConnectionTimeOut' => 30,\n 'log.LogEnabled' => false,\n 'log.FileName' => storage_path('logs/paypal.log'),\n 'log.LogLevel' => 'FINE'\n ));\n\n\n }",
"public function __construct()\r\n\t{\r\n\t\tif(!Role::is('admin'))\r\n\t\t{\r\n\t\t\tRedirect::to('/login');\r\n\r\n\t\t\texit();\r\n\t\t}\r\n\r\n\t\t// Inject Pagination container\r\n\t\tnew Pagination;\r\n\r\n\t}",
"public function __construct()\n {\n $this->middleware('guest');\n $this->redirectTo = route('apps');\n }",
"public function __construct()\n {\n $this->rota = new url;\n $this->last_module = '';\n $container = new \\vendor\\container;\n $container = (object)$container->container;\n $this->container= $container;\n }",
"public function initializeRedirectUrlHandlers() {}",
"public function __construct()\n {\n $this->middleware(backpack_middleware());\n }",
"public function __construct(Container $container, Gate $gate, PolicyTransformer $policyTransformer)\n {\n parent::__construct();\n $this->container = $container;\n $this->gate = $gate;\n $this->policyTransformer = $policyTransformer;\n }",
"public function __construct()\n { \n // language change\n $this->middleware('common');\n $this->middleware('guest')->except('logout');\n $this->redirectTo = !empty(config('eventmie.route.prefix')) ? config('eventmie.route.prefix') : '/';\n }",
"public function __construct()\n {\n $this->middleware(RedirectIfAuthenticated::class);\n }",
"public function __construct()\n {\n parent::__construct();\n\n /** Comprobamos que tenga hecho el login */\n $url='entrar';\n $this->redirect = $this->input->server(\"REQUEST_URI\");\n if (($this->redirect != '/') && ($this->redirect != '')) {\n $url .= '?redirect='.$this->redirect;\n }\n\n if ($this->is_logged == false) {\n redirect(base_url($url));\n }\n }",
"function __construct()\n {\n parent::__construct();\n $this->CLIENT_ID = GOOGLE_CLIENT_ID;\n $this->CLIENT_SECRET = GOOGLE_CLIENT_SECRET;\n $this->REDIRECT_URI = base_url().\"social/google/authorize/\";\n }",
"public function __construct()\n {\n $this->middleware(function ($request, $next) {\n\n if(Gate::denies('checkIsAdmin', [Contact::class])) return redirect()->back();\n\n return $next($request);\n });\n }",
"public function __construct(ContainerInterface $container)\n {\n parent::__construct($container);\n $this->router->get($container->get(\"login.admin\"), LoginAdminControl::class, [\"name\"=>\"loginAdmin.get.index\", \"description\"=>\"Connexion administrateur\"]);\n $this->router->post($container->get(\"login.admin\").\"/action:connect\", LoginAdminControl::class, [\"name\"=>\"loginAdmin.post.connect\", \"description\"=>\"Connexion administrateur\"]);\n }",
"public function __construct()\n\t\t{\n\t\t\t$this->middleware('auth:client');\n\t\t}",
"public function __construct()\n {\n $this->middleware('auth');\n $this->redirectRoute = 'owner.index';\n }",
"public function __construct()\n {\n $this->redirectAfterLogout = url('/');\n// $this->redirectTo = route('frontend.dashboard');\n\n $this->middleware('guest', ['except' => 'getLogout']);\n }",
"public function __construct()\n {\n $this->controller = new LinkHookController();\n parent::__construct();\n }",
"public function __construct()\n {\n $this->protocol = api_get_setting('sso_authentication_protocol');\n // There can be multiple domains, so make sure to take only the first\n // This might be later extended with a decision process\n $domains = explode(',', api_get_setting('sso_authentication_domain'));\n $this->domain = trim($domains[0]);\n $this->auth_uri = api_get_setting('sso_authentication_auth_uri');\n $this->deauth_uri = api_get_setting('sso_authentication_unauth_uri');\n //cut the string to avoid recursive URL construction in case of failure\n $this->referer = $this->protocol.$_SERVER['HTTP_HOST'].substr($_SERVER['REQUEST_URI'],0,strpos($_SERVER['REQUEST_URI'],'sso'));\n $this->deauth_url = $this->protocol.$this->domain.$this->deauth_uri;\n $this->master_url = $this->protocol.$this->domain.$this->auth_uri;\n $this->referrer_uri = base64_encode($_SERVER['REQUEST_URI']);\n $this->target = api_get_path(WEB_PATH);\n }",
"function __construct()\n {\n if(!$this->isLoggedIn())\n return redirect('/login');\n\n }",
"public function __construct(SoapWrapper $soapWrapper)\n {\n $this->middleware('auth');\n $this->soapWrapper = $soapWrapper;\n }",
"protected function __construct() {\n\t\tadd_action( 'template_redirect', [ $this, 'setup' ] );\n\t}",
"public function __construct()\n {\n $this->middlewere('api.auth', ['except'=>['index','show']]);\n }",
"public function __construct()\n {\n $this->middleware('guest', ['except' => 'logout']);\n\n Session::put('preUrl', URL::previous());\n\n }",
"public function __construct(Client $client = null, $maxRedirects = 5)\n {\n parent::__construct($maxRedirects);\n\n if ($client === null) {\n $client = new Client();\n }\n\n $this->client = $client;\n }"
] |
[
"0.653589",
"0.64412445",
"0.6311232",
"0.61007833",
"0.60554343",
"0.5947758",
"0.59442717",
"0.5940703",
"0.59296876",
"0.5921553",
"0.5888206",
"0.5857725",
"0.5855698",
"0.58424526",
"0.5836232",
"0.5836098",
"0.5823608",
"0.5808905",
"0.57997644",
"0.57528985",
"0.57479864",
"0.5730483",
"0.57213604",
"0.57154185",
"0.5692866",
"0.5692577",
"0.5686746",
"0.56847435",
"0.5674303",
"0.5670751"
] |
0.86255103
|
0
|
Returns a url that was generated by the gateway redirect object
|
public function getUrl() {
return $this->_gatewayRedirect->getUrl ();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl(): string;",
"public function getRedirectUrl()\n {\n }",
"public function RedirectURL(){\n //echo Director::baseURL();exit(); \n return urlencode(Director::baseURL().$this->request->getURL(true));\n }",
"function getRedirectUrl()\r\n\t{\r\n\t\treturn $this->redirect_url;\r\n\t}",
"public function getRedirectUrl(): string\n {\n return $this->redirectUrl;\n }",
"protected function getRedirectUrl()\n {\n $sBaseUrl = Registry::getConfig()->getCurrentShopUrl().'index.php?cl=order&fnc=handleMollieReturn';\n\n return $sBaseUrl.$this->mollieGetAdditionalParameters();\n }",
"public function getRedirectUrl() {\n return (string) $this->getValue('redirect_url');\n }",
"abstract protected function getRedirectUrl(): Url;",
"public function getRedirectUrl()\r\n\t{\r\n\t\treturn $this->payment->links[1]->getHref();\r\n\t}",
"public function getRedirectUrl() : string\n {\n return '';\n }",
"public function getRedirectUrl()\r\n {\r\n return \"{$this->data['redirect_url']}?session={$this->data['session']}\";\r\n }",
"protected function getRedirectUrl()\n\t{\n if ($customURL = $this->input->getBase64('returnurl', ''))\n {\n $customURL = base64_decode($customURL);\n }\n\n $url = !empty($customURL) ? $customURL : 'index.php?option='\n . $this->container->componentName\n . '&view='\n . $this->container->inflector->pluralize($this->view)\n . $this->getItemidURLSuffix(); // e.g. '&Itemid=123' or an empty string if no Itemid\n\n return $url;\n }",
"public function getSiteRedirectUrl()\n {\n return $this->siteRedirectLink;\n }",
"private function getRedirectUrl()\n {\n return $this->getConfigData('url');\n }",
"public function getRedirectUrl() {\n return $this->redirectUrl;\n }",
"public function getRedirectUri(): string;",
"public function getRedirectUri();",
"public function getRedirectUri();",
"public function getRedirectUrl()\n {\n return $this->redirectUrl;\n }",
"public function getRedirectUrl()\n {\n return $this->redirectUrl;\n }",
"public function getRedirectUrl()\n {\n return $this->redirectUrl;\n }",
"public function getRedirectUrl()\n {\n return $this->request->getTestMode()\n ? 'https://sslpayment.cathaybkdev.com.tw/EPOSService/Payment/OrderInitial.aspx'\n : 'https://sslpayment.uwccb.com.tw/EPOSService/Payment/OrderInitial.aspx';\n }",
"public function getRedirectUrl()\n {\n\n if ($brandCode = $this->getBrandCode()) {\n return 'https://test.adyen.com/hpp/skipDetails.shtml';\n } else {\n return 'https://test.adyen.com/hpp/pay.shtml';\n }\n }",
"public function getRedirectURL()\n {\n return $this->redirectURL;\n }",
"public function get_gateway_redirect() {\n\t\t$gatewayRedirect = new gateway_redirect();\n\t\tif (! empty($this->_3dSecurePostParameters)) {\n\t\t\t$connParams = $this->_getConnectionParameters('payment');\n\t\t\t$gatewayRedirect->redirect = TRUE;\n\t\t\t$gatewayRedirect->encType = 'application/x-www-form-urlencoded';\n\t\t\t$gatewayRedirect->url = $connParams['uri'];\n\t\t\t$gatewayRedirect->postParameters = $this->_3dSecurePostParameters;\n\t\t}\n\t\t\n\t\treturn $gatewayRedirect;\n\t}"
] |
[
"0.81076735",
"0.81076735",
"0.81076735",
"0.81076735",
"0.81076735",
"0.797654",
"0.7920482",
"0.77887285",
"0.75986016",
"0.7576904",
"0.7555645",
"0.7545206",
"0.7531105",
"0.7470917",
"0.74618125",
"0.7449627",
"0.7403557",
"0.7403441",
"0.739261",
"0.7388854",
"0.7384485",
"0.73751575",
"0.73751575",
"0.73702043",
"0.73702043",
"0.7360092",
"0.729198",
"0.72831285",
"0.7274228",
"0.72584707"
] |
0.8555034
|
0
|
Inserts the post parameters into the session to later be consumed by the payment_gateway_redirect presentation class. Which will post and redirect the user to the bank's 3rd party website.
|
public function setPostInSession() {
$_SESSION ['gateway_redirect'] = array (
'url' => $this->getUrl (),
'enctype' => $this->encType,
'pageTitle' => $this->pageTitle,
'postParameters' => $this->postParameters );
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function submit() {\r\n\t\t$name_value_pairs = array();\r\n\t\tforeach ( $this->request_data as $key => $value ) {\r\n\t\t\t$name_value_pairs[] = $key . '=' . rawurlencode( $value );\r\n\t\t}\r\n\r\n\t\t$url = 'https://mms.paymentsensegateway.com/Pages/PublicPages/PaymentForm.aspx';\r\n\t\t$params = implode( '&', $name_value_pairs );\r\n\t\theader( 'Location: ' . $url . '?' . $params, false );\r\n\t\texit();\r\n\t}",
"public function processPaypal(){\r\n\t// and redirect to thransaction details page\r\n\t}",
"function redirect_form()\n{\n global $pxpay;\n \n $request = new PxPayRequest();\n \n $http_host = getenv(\"HTTP_HOST\");\n $request_uri = getenv(\"SCRIPT_NAME\");\n $server_url = \"http://$http_host\";\n #$script_url = \"$server_url/$request_uri\"; //using this code before PHP version 4.3.4\n #$script_url = \"$server_url$request_uri\"; //Using this code after PHP version 4.3.4\n $script_url = (version_compare(PHP_VERSION, \"4.3.4\", \">=\")) ?\"$server_url$request_uri\" : \"$server_url/$request_uri\";\n $EnableAddBillCard = 1;\n \n # the following variables are read from the form\n $Quantity = $_REQUEST[\"Quantity\"];\n $MerchantReference = sprintf('%04x%04x-%04x-%04x',mt_rand(0, 0xffff),mt_rand(0, 0xffff),mt_rand(0, 0xffff),mt_rand(0, 0x0fff) | 0x4000);\n $Address1 = $_REQUEST[\"Address1\"];\n $Address2 = $_REQUEST[\"Address2\"];\n $Address3 = $_REQUEST[\"Address3\"];\n \n #Calculate AmountInput\n $AmountInput = 21.50;\n \n #Generate a unique identifier for the transaction\n $TxnId = uniqid(\"ID\");\n \n #Set PxPay properties\n $request->setMerchantReference($MerchantReference);\n $request->setAmountInput($AmountInput);\n $request->setTxnData1($Address1);\n $request->setTxnData2($Address2);\n $request->setTxnData3($Address3);\n $request->setTxnType(\"Purchase\");\n $request->setCurrencyInput(\"NZD\");\n $request->setEmailAddress(\"[email protected]\");\n $request->setUrlFail($script_url);\t\t\t# can be a dedicated failure page\n $request->setUrlSuccess($script_url);\t\t\t# can be a dedicated success page\n $request->setTxnId($TxnId);\n $request->setRecurringMode(\"recurringinitial\");\n #The following properties are not used in this case\n $request->setEnableAddBillCard($EnableAddBillCard);\n # $request->setBillingId($BillingId);\n # $request->setOpt($Opt);\n\n \n #Call makeRequest function to obtain input XML\n $request_string = $pxpay->makeRequest($request);\n #Obtain output XML\n $response = new MifMessage($request_string);\n \n #Parse output XML\n $url = $response->get_element_text(\"URI\");\n $valid = $response->get_attribute(\"valid\");\n \n #Redirect to payment page\n header(\"Location: \".$url);\n}",
"static function pmpro_checkout_before_processing() {\n\t\t\tglobal $current_user, $gateway;\n\n\t\t\t//save user fields for PayPal Express\n\t\t\tif(!$current_user->ID) {\n\t\t\t\t//get values from post\n\t\t\t\tif(isset($_REQUEST['username']))\n\t\t\t\t\t$username = trim(sanitize_text_field($_REQUEST['username']));\n\t\t\t\telse\n\t\t\t\t\t$username = \"\";\n\t\t\t\tif(isset($_REQUEST['password']))\n\t\t\t\t\t$password = sanitize_text_field($_REQUEST['password']);\n\t\t\t\telse\n\t\t\t\t\t$password = \"\";\n\t\t\t\tif(isset($_REQUEST['bemail']))\n\t\t\t\t\t$bemail = sanitize_email($_REQUEST['bemail']);\n\t\t\t\telse\n\t\t\t\t\t$bemail = \"\";\n\n\t\t\t\t//save to session\n\t\t\t\t$_SESSION['pmpro_signup_username'] = $username;\n\t\t\t\t$_SESSION['pmpro_signup_password'] = $password;\n\t\t\t\t$_SESSION['pmpro_signup_email'] = $bemail;\n\t\t\t}\n\n\t\t\tif( !empty( $_REQUEST['tos'] ) ) {\n\t\t\t\t$tospost = get_post( pmpro_getOption( 'tospage' ) );\n\t\t\t\t$_SESSION['tos'] = array(\n\t\t\t\t\t'post_id' => $tospost->ID,\n\t\t\t\t\t'post_modified' => $tospost->post_modified,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t//can use this hook to save some other variables to the session\n\t\t\tdo_action(\"pmpro_paypalexpress_session_vars\");\n\t\t}",
"function spgateway_payment_response_func_theme()\n{\n // $status = 'success';\n // $orderId = 199;\n // $product_id = 197;\n // $message = 'Authenticated';\n\n// print \"<pre>\";\n// print \"post\";\n// print_r($_POST);\n// PRINT_R($_SESSION);\n// print \"cookie\";\n// PRINT_R($_COOKIE);\n// print \"</pre>\";\n// print \"session\";\n\n\n\n $product_id = $_SESSION['spgateway_args']['Pid1'];\n $status = strtolower($_POST['Status']);\n $orderId = $_POST['MerchantOrderNo'];\n $message = $_POST['Message'];\n\n\n /////////////////////////////////////////////////////////////////////////////////////////////\n ////////////////// save session and post to wp_postmeta /////////////////////////////////\n /////////////////////////////////////////////////////////////////////////////////////////////\n\n $key_1_value = get_post_meta( $orderId, '_order_spgateway_response_session', true );\n if ( empty( $key_1_value ) ) {\n add_post_meta( $orderId, '_order_spgateway_response_session', serialize($_SESSION) );\n } else {\n update_post_meta($orderId, '_order_spgateway_response_session', serialize($_SESSION) );\n }\n\n $key_1_value = get_post_meta( $orderId, '_order_spgateway_response_post', true );\n if ( empty( $key_1_value ) ) {\n add_post_meta( $orderId, '_order_spgateway_response_post', serialize($_POST) );\n }else {\n update_post_meta($orderId, '_order_spgateway_response_session', serialize($_SESSION) );\n }\n\n\n\n\n\n\n}",
"function index() {\n if (empty($_GET['action']))\n $_GET['action'] = 'process';\n// echo \"<pre>\";\n// var_dump($_REQUEST);\n// echo \"<pre>\";\n switch ($_GET['action']) {\n case 'process': // Process and order...\n // There should be no output at this point. To process the POST data,\n // the submit_paypal_post() function will output all the HTML tags which\n // contains a FORM which is submited instantaneously using the BODY onload\n // attribute. In other words, don't echo or printf anything when you're\n // going to be calling the submit_paypal_post() function.\n // This is where you would have your form validation and all that jazz.\n // You would take your POST vars and load them into the class like below,\n // only using the POST values instead of constant string expressions.\n // For example, after ensureing all the POST variables from your custom\n // order form are valid, you might have:\n //\n // $this->paypal->add_field('first_name', $_POST['first_name']);\n // $this->paypal->add_field('last_name', $_POST['last_name']);\n// echo \"<pre>\";\n// var_dump($_SESSION);\n// echo \"<pre>\";\n if (!$this->session->userdata('is_logged_in')) {\n $type = $this->session->userdata('type');\n redirect('http://www.streamact.com/', 'refresh');\n }\n try {\n $description = $_POST['description'];\n $payment = $_POST['payment'];\n $type_payment = $_POST['type_payment'];\n $rand = rand(1000, 9999);\n $id = date(\"Ymd\") . date(\"His\") . rand(1000, 9999) . $rand;\n// echo \"<pre>\";\n// var_dump($_POST);\n// echo \"<pre>\";\n //$key = \"track_\".md5(date(\"Y-m-d:\").rand());\n\n $this->paypal->add_field('business', '[email protected]');\n// $this->paypal->add_field('return', 'http://www.streamact.com/panel/user_purchase');\n $this->paypal->add_field('return', 'http://www.streamact.com/panel/paypal/success');\n $this->paypal->add_field('cancel_return', 'http://www.streamact.com/panel/store');\n $this->paypal->add_field('notify_url', 'http://www.streamact.com/panel/paypal/ipn');\n $this->paypal->add_field('item_name', $description);\n $this->paypal->add_field('amount', $payment);\n $this->paypal->add_field('key', $key);\n $this->paypal->add_field('item_number', $id);\n\n\n $paypal_transaction = new stream\\stream_paypal_transactions();\n $paypal_transaction->type_payment = $type_payment;\n $paypal_transaction->amount = $payment;\n $paypal_transaction->id_producto = $_POST['id'];\n $paypal_transaction->notes = isset($_POST['notes']) ? $_POST['notes'] : 0;\n $paypal_transaction->id_seguimiento = $id;\n $paypal_transaction->id_usuario = $_SESSION['user_id'];\n $paypal_transaction->type_user = ($_SESSION['type'] == \"User\") ? \"2\" : $_SESSION['type'] == \"Artist\" ? \"1\" : \"0\";\n $paypal_transaction->type_payment = $_POST['type_payment'];\n $paypal_transaction->fecha_hora = date(\"Y-m-d H:i:s\");\n \n\n $this->stream->persist($paypal_transaction);\n $this->stream->flush();\n // submit the fields to paypal\n $this->paypal->submit_paypal_post();\n } catch (Exception $exc) {\n echo \"<pre>\";\n echo $exc->getTraceAsString();\n echo \"<pre>\";\n }\n\n// $paypal_transaction->ipn_track_id=$myPost[''];\n // $this->paypal->dump_fields(); // for debugging, output a table of all the fields\n break;\n }\n }",
"public function redirectAction()\n {\n $redirectParams = $this->getRequest()->getParams();\n $params = array();\n if (!empty($redirectParams['success'])\n && isset($redirectParams['x_invoice_num'])\n && isset($redirectParams['controller_action_name'])\n ) {\n $params['redirect_parent'] = Mage::helper('authorizenet/admin')->getSuccessOrderUrl($redirectParams);\n $this->_getDirectPostSession()->unsetData('quote_id');\n //cancel old order\n $oldOrder = $this->_getOrderCreateModel()->getSession()->getOrder();\n if ($oldOrder->getId()) {\n /* @var $order Mage_Sales_Model_Order */\n $order = Mage::getModel('sales/order')->loadByIncrementId($redirectParams['x_invoice_num']);\n if ($order->getId()) {\n $oldOrder->cancel()\n ->save();\n $order->save();\n $this->_getOrderCreateModel()->getSession()->unsOrderId();\n }\n }\n //clear sessions\n $this->_getSession()->clear();\n $this->_getDirectPostSession()->removeCheckoutOrderIncrementId($redirectParams['x_invoice_num']);\n Mage::getSingleton('adminhtml/session')->clear();\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The order has been created.'));\n }\n\n if (!empty($redirectParams['error_msg'])) {\n $cancelOrder = empty($redirectParams['x_invoice_num']);\n $this->_returnQuote($cancelOrder, $redirectParams['error_msg']);\n }\n\n $block = $this->getLayout()\n ->createBlock('directpost/iframe')\n ->setParams(array_merge($params, $redirectParams));\n $this->getResponse()->setBody($block->toHtml());\n }",
"protected function _loginPostRedirect()\n {\n $session = $this->_getSession();\n if ($session->isLoggedIn()) {\n $redirectUrl = Mage::getUrl('/');\n } else {\n $redirectUrl = Mage::getUrl('customer/account/login');\n }\n $this->_redirectUrl($redirectUrl);\n }",
"public function savedestinationforredirectAction()\n {\n \t$url = $this->_request->getParam(1);\n \t$_SESSION['redirectOnLogin'] = urldecode($url);\n \t$this->_forward('login');\n }",
"function post () {\n //OU SALVA NO\n header(\"location: /\");\n }",
"function setSession() {\n $layout = $this->input->post('layout');\n $_SESSION['standingLayout'] = $layout;\n \n // gets value for order and stores in session variable\n $order = $this->input->post('order');\n $_SESSION['standingOrder'] = $order;\n \n // gets value for data source and stores in session variable\n $dataSource = $this->input->post('dataSource');\n $_SESSION['standingDataSource'] = $dataSource;\n \n redirect('/standing');\n }",
"public function execute()\r\n {\r\n \t\r\n\t\t$session = ObjectManager::getInstance()->get('Magento\\Checkout\\Model\\Session');\r\n\t\t\r\n $session->setPdcptbQuoteId($session->getQuoteId());\r\n //$this->_resultRawFactory->create()->setContents($this->_viewLayoutFactory->create()->createBlock('Asiapay\\Pdcptb\\Block\\Redirect')->toHtml());\r\n $session->unsQuoteId(); \r\n\r\n //get all parameters.. \r\n /*$param = [\r\n 'merchantid' => $this->getConfigData('merchant_id')\r\n \r\n ];*/\r\n //echo $this->_modelPdcptb->getUrl();\r\n $html = '<html><body>';\r\n $html.= 'You will be redirected to the payment gateway in a few seconds.';\r\n //$html.= $form->toHtml();\r\n $html.= '<script type=\"text/javascript\">\r\nrequire([\"jquery\", \"prototype\"], function(jQuery) {\r\ndocument.getElementById(\"pdcptb_checkout\").submit();\r\n});\r\n</script>';\r\n $html.= '</body></html>';\r\n echo $html;\r\n //$this->_modelPdcptb->getCheckoutFormFields();\r\n //$this->resultPageFactory->create();\r\n $params = $this->_modelPdcptb->getCheckoutFormFields();\r\n //return $resultPage;\r\n //sleep(25);\r\n //echo \"5 sec up. redirecting begin\";\r\n $result = $this->resultRedirectFactory->create();\r\n\t\t//$result = $this->resultRedirectFactory;\r\n \t$result->setPath($this->_modelPdcptb->getUrl().\"?\".http_build_query($params));\r\n \t//echo($this->_modelPdcptb->getUrl().http_build_query($params));\r\n \t//return $result;\r\n header('Refresh: 4; URL='.$this->_modelPdcptb->getUrl().\"?\".http_build_query($params));\r\n\t\t//$this->_redirect($this->_modelPdcptb->getUrl(),$params);\r\n\t\t//header('Refresh: 10; URL=https://test.paydollar.com/b2cDemo/eng/payment/payForm.jsp');\r\n \r\n}",
"function redirectPayment($baseUri, $amount_iUSD, $amount, $currencySymbol, $api_key, $redirect_url) {\n error_log(\"Entered into auto submit-form\");\n error_log(\"Url \".$baseUri . \"?api_key=\" . $api_key);\n // Using Auto-submit form to redirect user\n return \"<form id='form' method='post' action='\". $baseUri . \"?api_key=\" . $api_key.\"'>\".\n \"<input type='hidden' autocomplete='off' name='amount' value='\".$amount.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='amount_iUSD' value='\".$amount_iUSD.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='callBackUrl' value='\".$redirect_url.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='api_key' value='\".$api_key.\"'/>\".\n \"<input type='hidden' autocomplete='off' name='cur' value='\".$currencySymbol.\"'/>\".\n \"</form>\".\n \"<script type='text/javascript'>\".\n \"document.getElementById('form').submit();\".\n \"</script>\";\n}",
"public function redirectAction()\n\t\t{\n\t\t\t// Load /app/code/community/Mage/Idealcheckoutdirectebanking/Model/Idealcheckoutdirectebanking.php\n\t\t\t$oIdealcheckoutdirectebankingModel = Mage::getSingleton('idealcheckoutdirectebanking/idealcheckoutdirectebanking');\n\n\n\t\t\t// Create transaction record and get URL to /idealcheckoutdirectebanking/setup.php\n\t\t\t$sIdealcheckoutdirectebankingUrl = $oIdealcheckoutdirectebankingModel->setupPayment();\n\n\n\t\t\t// redirect\n\t\t\theader('Location: ' . $sIdealcheckoutdirectebankingUrl);\n\t\t\texit();\n\t\t}",
"private function _redirectToHostedPaymentForm()\n\t{\n\t\t$model = Mage::getModel('tpg/direct');\n\t\t$szActionURL = $model->getConfigData('hostedpaymentactionurl');\n\t\t$cookies = Mage::getSingleton('core/cookie')->get();\n\t\t$checkoutSession = Mage::getSingleton('checkout/session');\n\t\t$szServerResultURLCookieVariables = '';\n\t\t$szServerResultURLFormVariables = '';\n\t\t$szServerResultURLQueryStringVariables = '';\n\n\t\t// create a Magento form\n\t\t$form = new Varien_Data_Form();\n\t\t$form->setAction($szActionURL)\n\t\t\t->setId('HostedPaymentForm')\n\t\t\t->setName('HostedPaymentForm')\n\t\t\t->setMethod('POST')\n\t\t\t->setUseContainer(true);\n\n\t\t$form->addField(\"HashDigest\", 'hidden', array('name' => \"HashDigest\", 'value' => $checkoutSession->getHashdigest()));\n\t\t$form->addField(\"MerchantID\", 'hidden', array('name' => \"MerchantID\", 'value' => $checkoutSession->getMerchantid()));\n\t\t$form->addField(\"Amount\", 'hidden', array('name' => \"Amount\", 'value' => $checkoutSession->getAmount()));\n\t\t$form->addField(\"CurrencyCode\", 'hidden', array('name' => \"CurrencyCode\", 'value' => $checkoutSession->getCurrencycode()));\n\t\t$form->addField(\"EchoCardType\", 'hidden', array('name' => \"EchoCardType\", 'value' => $checkoutSession->getEchoCardType()));\n\t\t$form->addField(\"OrderID\", 'hidden', array('name' => \"OrderID\", 'value' => $checkoutSession->getOrderid()));\n\t\t$form->addField(\"TransactionType\", 'hidden', array('name' => \"TransactionType\", 'value' => $checkoutSession->getTransactiontype()));\n\t\t$form->addField(\"TransactionDateTime\", 'hidden', array('name' => \"TransactionDateTime\", 'value' => $checkoutSession->getTransactiondatetime()));\n\t\t$form->addField(\"CallbackURL\", 'hidden', array('name' => \"CallbackURL\", 'value' => $checkoutSession->getCallbackurl()));\n\t\t$form->addField(\"OrderDescription\", 'hidden', array('name' => \"OrderDescription\", 'value' => $checkoutSession->getOrderdescription()));\n\t\t$form->addField(\"CustomerName\", 'hidden', array('name' => \"CustomerName\", 'value' => $checkoutSession->getCustomername()));\n\t\t$form->addField(\"Address1\", 'hidden', array('name' => \"Address1\", 'value' => $checkoutSession->getAddress1()));\n\t\t$form->addField(\"Address2\", 'hidden', array('name' => \"Address2\", 'value' => $checkoutSession->getAddress2()));\n\t\t$form->addField(\"Address3\", 'hidden', array('name' => \"Address3\", 'value' => $checkoutSession->getAddress3()));\n\t\t$form->addField(\"Address4\", 'hidden', array('name' => \"Address4\", 'value' => $checkoutSession->getAddress4()));\n\t\t$form->addField(\"City\", 'hidden', array('name' => \"City\", 'value' => $checkoutSession->getCity()));\n\t\t$form->addField(\"State\", 'hidden', array('name' => \"State\", 'value' => $checkoutSession->getState()));\n\t\t$form->addField(\"PostCode\", 'hidden', array('name' => \"PostCode\", 'value' => $checkoutSession->getPostcode()));\n\t\t$form->addField(\"CountryCode\", 'hidden', array('name' => \"CountryCode\", 'value' => $checkoutSession->getCountrycode()));\n\t\t$form->addField(\"CV2Mandatory\", 'hidden', array('name' => \"CV2Mandatory\", 'value' => $checkoutSession->getCv2mandatory()));\n\t\t$form->addField(\"Address1Mandatory\", 'hidden', array('name' => \"Address1Mandatory\", 'value' => $checkoutSession->getAddress1mandatory()));\n\t\t$form->addField(\"CityMandatory\", 'hidden', array('name' => \"CityMandatory\", 'value' => $checkoutSession->getCitymandatory()));\n\t\t$form->addField(\"PostCodeMandatory\", 'hidden', array('name' => \"PostCodeMandatory\", 'value' => $checkoutSession->getPostcodemandatory()));\n\t\t$form->addField(\"StateMandatory\", 'hidden', array('name' => \"StateMandatory\", 'value' => $checkoutSession->getStatemandatory()));\n\t\t$form->addField(\"CountryMandatory\", 'hidden', array('name' => \"CountryMandatory\", 'value' => $checkoutSession->getCountrymandatory()));\n\t\t$form->addField(\"ResultDeliveryMethod\", 'hidden', array('name' => \"ResultDeliveryMethod\", 'value' => $checkoutSession->getResultdeliverymethod()));\n\t\t$form->addField(\"ServerResultURL\", 'hidden', array('name' => \"ServerResultURL\", 'value' => $checkoutSession->getServerresulturl()));\n\t\t$form->addField(\"PaymentFormDisplaysResult\", 'hidden', array('name' => \"PaymentFormDisplaysResult\", 'value' => $checkoutSession->getPaymentformdisplaysresult()));\n\t\t$form->addField(\"ServerResultURLCookieVariables\", 'hidden', array('name' => \"ServerResultURLCookieVariables\", 'value' => $checkoutSession->getServerresulturlcookievariables()));\n\t\t$form->addField(\"ServerResultURLFormVariables\", 'hidden', array('name' => \"ServerResultURLFormVariables\", 'value' => $checkoutSession->getServerresulturlformvariables()));\n\t\t$form->addField(\"ServerResultURLQueryStringVariables\", 'hidden', array('name' => \"ServerResultURLQueryStringVariables\", 'value' => $checkoutSession->getServerresulturlquerystringvariables()));\n\n\t\t// reset the session items\n\t\t$checkoutSession\n\t\t\t->setHashdigest(null)\n\t\t\t->setMerchantid(null)\n\t\t\t->setAmount(null)\n\t\t\t->setCurrencycode(null)\n\t\t\t->setEchoCardType(null)\n\t\t\t->setOrderid(null)\n\t\t\t->setTransactiontype(null)\n\t\t\t->setTransactiondatetime(null)\n\t\t\t->setCallbackurl(null)\n\t\t\t->setOrderdescription(null)\n\t\t\t->setCustomername(null)\n\t\t\t->setAddress1(null)\n\t\t\t->setAddress2(null)\n\t\t\t->setAddress3(null)\n\t\t\t->setAddress4(null)\n\t\t\t->setCity(null)\n\t\t\t->setState(null)\n\t\t\t->setPostcode(null)\n\t\t\t->setCountrycode(null)\n\t\t\t->setCv2mandatory(null)\n\t\t\t->setAddress1mandatory(null)\n\t\t\t->setCitymandatory(null)\n\t\t\t->setPostcodemandatory(null)\n\t\t\t->setStatemandatory(null)\n\t\t\t->setCountrymandatory(null)\n\t\t\t->setResultdeliverymethod(null)\n\t\t\t->setServerresulturl(null)\n\t\t\t->setPaymentformdisplaysresult(null)\n\t\t\t->setServerresulturlcookievariables(null)\n\t\t\t->setServerresulturlformvariables(null)\n\t\t\t->setServerresulturlquerystringvariables(null);\n\n\t\t$html = '<html><body>';\n\t\t$html .= $this->__('You will be redirected to a secure payment page in a few seconds.');\n\t\t$html .= $form->toHtml();\n\t\t$html .= '<script type=\"text/javascript\">document.getElementById(\"HostedPaymentForm\").submit();</script>';\n\t\t$html .= '</body></html>';\n\n\t\treturn $html;\n\t}",
"public function process_payment() {\n\n\n global $admin_settings;\n\n check_ajax_referer( 'kp-korapay-pay-nonce', 'kp_sec_code' );\n\n $tx_ref = $_POST['reference'];\n $status = $_POST['status'];\n $secret_key = $admin_settings->get_option_value( 'secret_key' );\n $amount=$_POST['amount'];\n $args = array(\n 'post_type' => 'payment_list',\n 'post_status' => 'publish',\n 'post_title' => $tx_ref,\n );\n\n $payment_record_id = wp_insert_post( $args, true );\n\n if ( ! is_wp_error( $payment_record_id )) {\n\n $post_meta = array(\n '_kp_korapay_payment_amount' => 'NGN'.' '.$_POST['amount'],\n '_kp_korapay_payment_fullname' => $_POST['first_name'].' '.$_POST['last_name'],\n '_kp_korapay_payment_customer' => $_POST['email'],\n '_kp_korapay_payment_status' => $status,\n '_kp_korapay_payment_tx_ref' => $tx_ref,\n );\n\n $this->_add_post_meta( $payment_record_id, $post_meta );\n\n }\n $redirect_url_key = $status === 'success' ? 'success_redirect_url' : 'failed_redirect_url';\n\n echo json_encode( array( 'status' => $status, 'redirect_url' => $admin_settings->get_option_value( $redirect_url_key ) ) );\n\n die();\n\n }",
"public function makePaymentAction()\n {\n if ($_SESSION['actionAvailable']) {\n try {\n $id = $_SESSION['id'];\n $account = new BankAccountModel(null, $id);\n $toAccountID = $_POST['accountTo'];\n\n\n $fromAccountID = $account->findID($_POST['accountFrom']);\n $transaction = new TransactionModel();\n $transaction->validateTransfer($toAccountID, $fromAccountID);\n $transaction->makeTransfer();\n $transaction->save();\n\n $view = new View('transactionComplete');\n echo $view->render();\n $_SESSION['actionAvailable'] = false;\n } catch (\\UnexpectedValueException $e) {\n $_SESSION['emptyField'] = true;\n $this->redirect('paymentPage');\n } catch (\\LogicException $e) {\n $_SESSION['validTransaction'] = false;\n $this->redirect('paymentPage');\n }\n }\n }",
"private function store()\n {\n $this->session->set('sergsxm_form_'.$this->formId, $this->parameters);\n }",
"function commerce_oz_eway_3p_redirect_form_submit($order, $payment_method) {\n \n// // dsm($payment_method, 'method');\n// \t// dsm($pane_form, 'pane');\n// \t// dsm($pane_values, 'values');\n// // dsm($order, 'order');\n// // dsm($charge, 'charge');\n \n // dsm($_POST, 'post'); \n // dsm($order, '$order'); \n // dsm($payment_method, '$payment_method'); \n \n if($_POST){\n// return;\n \n }\n \t \t \t\n // Get the order\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n $order_id = $order->order_id;\n \n /*\n \n $credit_card = $pane_values['commerce_oz_3p_head']['credit_card'];\n // // dsm($pane_values);\n \n // Get the settings and set some vars for same\n // $settings = $payment_method['settings'];\n $debugmode = 'debug'; //$settings['commerce_commweb_vpc_settings']['commerce_commweb_vpc_debug'];\n $livemode = 'test'; //$settings['commerce_commweb_vpc_settings']['commerce_commweb_vpc_mode'];\n \n\t// Transaction record\n\t// Prepare a transaction object to log the API response.\n $transaction = _commerce_oz_open_transaction($payment_method['base'], $order->order_id);\n \n module_load_include('php', 'commerce_oz', 'includes/api/EwayPayment');\n\n\t$eway = new EwayPayment( '87654321', 'https://www.eway.com.au/gateway_cvn/xmltest/testpage.asp' );\n\t\n\t// Card Details\n\t\n\t$eway->setCardNumber( $credit_card['number'] );\n\t$eway->setCardExpiryMonth( $credit_card['exp_month'] );\n\t$eway->setCardExpiryYear( substr($credit_card['exp_year'], -2) );\n//\t$eway->setTotalAmount( $charge['amount'] );\n\t$eway->setTotalAmount\t(1000);\n\n\t$eway->setCVN( $credit_card['code'] );\n\t\n\t// Invoice & Transaction Details\n\t\n\t$eway->setCustomerInvoiceDescription( 'Testing' );\n\t$eway->setCustomerInvoiceRef( $order_id );\n\t$eway->setTrxnNumber( $transaction->transaction_id );\n\n \n $request_map = array_filter((array)$eway);\n \n $error = $eway->doPayment();\n \n $response_map = array_filter((array)$eway);\n */\n \n// // dsm($request_map);\n// // dsm($response_map);\n \n // _commerce_oz_eway_3p_close_transaction($transaction, $request_map, $response_map);\n\t\n//\t_commerce_oz_debug_transaction($transaction, $request_map, $response_map, TRUE);\n\t\n\t// Fire completion Rule\n\t//rules_invoke_event('commerce_oz_transaction_complete', $transaction);\n\t\n\t// return _commerce_oz_handle_payment_response($transaction, $request_map, $response_map);\n \n}",
"public function postAction() {\n\t\t$db = Zend_Db_Table_Abstract::getDefaultAdapter();\n\t\t$postData = $this -> _request -> getParams();\n\t\t//Build insert data the easy new way\n\t\t$insertData = array();\n\t\tforeach ($postData as $key => $value) {\n\t\t\tif ($key != 'controller' && $key != 'module' && $key != 'action' && $key != 'submit') {\n\t\t\t\t$insertData[$key] = $value;\n\t\t\t}\n\t\t}\n\n\n\t\t//Build insert data the old way\n\t\t//\t$insertData = array(\n\t\t//'bibnumber' => $postData -> bibnumber,\n\t\t//'lastname' => $postData -> lastname,\n\t\t//'firstname' => $postData -> firstname,\n\t\t//'address1' => $postData -> address1,\n\t\t//'address2' => $postData -> address2,\n\t\t//'city' => $postData -> city,\n\t\t//'state' => $postData -> state,\n\t\t//'age' => $postData -> age,\n\t\t//'sex' => $postData -> sex,\n\t\t//'zipcode' => $postData -> zipcode,\n\t\t//'email' => $postData -> email,\n\t\t//'shirtsize' => $postData -> shirtsize,\n\t\t//'event' => $postData -> event,\n\t\t//'division' => $postData -> division,\n\t\t//'team' => $postData -> team,\n\t\t//'regtype' => $postData -> regtype );\n\n\t\tZend_Registry::get('session') -> postData[] = $insertData;\n\n\t\t// Insert the data and\n\t\t// Set the success/fail message $db -> insert('participant', $insertData)\n\t\t$valid = $this -> validate($insertData, 1);\n\n\t\tif ($this -> getRequest() -> getMethod() == 'POST' && $valid == \"valid\") {\n\t\t\t$db -> insert('participant', $insertData);\n\t\t\tZend_Registry::get('session') -> messages[] = array('type' => 'success', 'text' => 'Last Insert Was Successfull.');\n\t\t} else {\n\t\t\tZend_Registry::get('session') -> messages[] = array('type' => 'error', 'text' => 'Last Insert Failed: ' . $valid);\n\t\t}\n\n\t\t// Redirect back to page\n\t\t$this -> _redirect('/insert');\n\t}",
"function copyFormData()\n {\n $SessionPost = modApiFunc(\"Session\", \"get\", \"SessionPost\");\n $this->ViewState = $SessionPost[\"ViewState\"];\n\n //Remove some data, that should not be sent to action one more time, from ViewState.\n if(isset($this->ViewState[\"ErrorsArray\"]) &&\n count($this->ViewState[\"ErrorsArray\"]) > 0)\n {\n $this->ErrorsArray = $this->ViewState[\"ErrorsArray\"];\n unset($this->ViewState[\"ErrorsArray\"]);\n }\n $this->POST =\n array(\n \"Id\" => isset($SessionPost[\"Id\"])? $SessionPost[\"Id\"]:\"\"\n ,\"CountryId\" => isset($SessionPost[\"CountryId\"])? $SessionPost[\"CountryId\"]:\"0\"\n ,\"StateId\" => isset($SessionPost[\"StateId\"])? $SessionPost[\"StateId\"]:\"-1\"\n ,\"ProductTaxClassId\" => isset($SessionPost[\"ProductTaxClassId\"])? $SessionPost[\"ProductTaxClassId\"]:\"1\"\n ,\"ProductTaxClassName\" => isset($SessionPost[\"ProductTaxClassName\"])? $SessionPost[\"ProductTaxClassName\"]:\"\"\n ,\"TaxNameId\" => isset($SessionPost[\"TaxNameId\"])? $SessionPost[\"TaxNameId\"]:\"1\"\n ,\"Rate\" => isset($SessionPost[\"Rate\"])? $SessionPost[\"Rate\"]:\"\"\n ,\"FormulaView\" => isset($SessionPost[\"FormulaView\"])? $SessionPost[\"FormulaView\"]:\" \"\n ,\"Formula\" => isset($SessionPost[\"Formula\"])? $SessionPost[\"Formula\"]:\"\"\n ,\"Applicable\" => isset($SessionPost[\"NotApplicable\"])? \"false\":\"true\"\n ,\"TaxRateByZipSet\" => isset($SessionPost[\"TaxRateByZipSet\"]) ? $SessionPost[\"TaxRateByZipSet\"] : 0\n );\n }",
"function post_to_bank_api()\n\t{\n\t\tlog_message('debug', 'Account/post_to_bank_api');\n\t\t$data = filter_forwarded_data($this);\n\t\tlog_message('debug', 'Account/post_to_bank_api:: [1] !empty($data[\\'a\\'])='.!empty($data['a']));\n\t\t# Processing bank form POST\n\t\t# ------------------------------------------------------\n\t\t# a) API required extra information after login\n\t\tif(!empty($data['a']) && ($data['a'] == 'display_question' || $data['a'] == 'display_code'))\n\t\t{\n\t\t\t$credentials['mfa'] = $_POST['questionanswer'];\n\t\t\t$postData = array('bank_id'=>$this->native_session->get('login_institution_id'), 'email_address'=>$this->native_session->get('__email_address'));\n\t\t}\n\t\t# b) API requested to choose a delivery option for a code after login\n\t\telse if(!empty($data['a']) && $data['a'] == 'display_options')\n\t\t{\n\t\t\t$credentials['mfa'] = $_POST['questionanswer'];\n\t\t\t$credentials['send_method'] = $_POST['questionanswer'];\n\t\t\t$postData = array('bank_id'=>$this->native_session->get('login_institution_id'), 'email_address'=>$this->native_session->get('__email_address'));\n\n\t\t}\n\t\t# c) API returned an error after login or first time logging in\n\t\telse\n\t\t{\n\t\t\t$credentials['user_name'] = $_POST['username'];\n\t\t\t$credentials['password'] = $_POST['bankpassword'];\n\t\t\tif(!empty($_POST['bankpin'])) $credentials['bank_pin'] = $_POST['bankpin'];\n\t\t\t$postData = array('bank_id'=>$this->native_session->get('login_institution_id'), 'email_address'=>$this->native_session->get('__email_address'));\n\t\t}\n\n\t\t# Connect to bank with details\n\t\t$data['response'] = $this->_api->post('money/connect_to_bank', array('credentials'=>$credentials, 'postData'=>$postData ));\n\n\t\t# Was there a successful connection? Then get the user's current banks\n\t\tif(!empty($data['response']['accounts']))\n\t\t{\n\t\t\t$data['currentBanks'] = $this->_api->get('money/current_user_banks');\n\t\t}\n\n\t\t# Determine which area to show based on response\n\t\tif(!empty($data['a'])) unset($data['a']);\n\t\t$this->native_session->set('__data', $data);\n\t\techo base_url().'account/load_bank_form/a/'.$this->which_bank_view($data['response']);\n\t}",
"public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }",
"function submit_paypal_post() {\n // a form with hidden elements which is submitted to paypal via the \n // BODY element's onLoad attribute. We do this so that you can validate\n // any POST vars from you custom form before submitting to paypal. So \n // basically, you'll have your own form which is submitted to your script\n // to validate the data, which in turn calls this function to create\n // another hidden form and submit to paypal.\n \n // The user will briefly see a message on the screen that reads:\n // \"Please wait, your order is being processed...\" and then immediately\n // is redirected to paypal.\n\n echo \"<html>\\n\";\n echo \"<head><title>Inoltro Pagamento...</title></head>\\n\";\n echo \"<body onLoad=\\\"document.forms['paypal_form'].submit();\\\">\\n\";\n echo \"<center><h2>Attendere, l'ordine è in fase di inoltro a paypal\";\n echo \" e sarete reindirizzati a breve.</h2></center>\\n\";\n echo \"<form method=\\\"post\\\" name=\\\"paypal_form\\\" \";\n echo \"action=\\\"\".$this->paypal_url.\"\\\">\\n\";\n\n foreach ($this->fields as $name => $value) {\n echo \"<input type=\\\"hidden\\\" name=\\\"$name\\\" value=\\\"$value\\\"/>\\n\";\n }\n echo \"<center><br/><br/>Se non venite reindirizzati al sito \";\n echo \"paypal entro 5 secondi...<br/><br/>\\n\";\n echo \"<input type=\\\"submit\\\" value=\\\"Cliccare qui\\\"></center>\\n\";\n \n echo \"</form>\\n\";\n echo \"</body></html>\\n\";\n\t exit;\n\n }",
"protected function postProcess()\n {\n if (Tools::isSubmit('btnSubmit')) {\n Configuration::updateValue('ONEHOP_SEND_SMS_API', Tools::getValue('SEND_SMS_API'));\n Configuration::updateValue('ONEHOP_ADMIN_MOBILE', Tools::getValue('ADMIN_MOBILE'));\n }\n $token = Tools::getAdminTokenLite('AdminModules');\n $request_scheme = $_SERVER['REQUEST_SCHEME'] ? $_SERVER['REQUEST_SCHEME'] : 'http';\n $hostlink = $request_scheme . \"://\" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];\n $mainPara = \"controller=AdminModules&configure=onehopsmsservice\";\n $reDirectLink = $hostlink . \"?\" . $mainPara . \"&token=\" . $token . \"&smswelcome=yes\";\n Tools::redirect($reDirectLink);\n }",
"function setSession(){\n $_SESSION[\"id\"] = $_POST[\"id\"];\n $_SESSION[\"password\"] = $_POST[\"password\"];\n $_SESSION[\"address\"] = $_POST[\"address\"];\n $_SESSION[\"phone\"] = $_POST[\"phone\"];\n $_SESSION[\"state\"] = $_POST[\"state\"];\n $_SESSION[\"trn\"] = $_POST[\"trn\"];\n $_SESSION[\"fax\"] = $_POST[\"fax\"];\n $_SESSION[\"religion\"] = $_POST[\"religion\"];\n\n $_SESSION[\"cfield1\"] = $_POST[\"cfield1\"];\n $_SESSION[\"cfield2\"] = $_POST[\"cfield2\"];\n $_SESSION[\"cfield3\"] = $_POST[\"cfield3\"];\n $_SESSION[\"cfield4\"] = $_POST[\"cfield4\"];\n $_SESSION[\"cfield5\"] = $_POST[\"cfield5\"];\n $_SESSION[\"cfield6\"] = $_POST[\"cfield6\"];\n $_SESSION[\"cfield7\"] = $_POST[\"cfield7\"];\n $_SESSION[\"cfield8\"] = $_POST[\"cfield8\"];\n $_SESSION[\"cfield9\"] = $_POST[\"cfield9\"];\n $_SESSION[\"cfield10\"] = $_POST[\"cfield10\"];\n $_SESSION[\"cfield11\"] = $_POST[\"cfield11\"];\n $_SESSION[\"cfield12\"] = $_POST[\"cfield12\"];\n $bool = true;\n //Checks that all fields sent in the post request is set in the session\n foreach($_POST as $key => $val){\n if(!isset($_SESSION[$key])){\n $bool = false;\n break;\n }\n }\n if($bool){\n echo json_encode(array('response' => 1));\n } else{\n echo json_encode(array('response' => -1,'message' => 'Could not set all session fields'));\n }\n}",
"public function paymentAction()\n {\n try {\n $session = $this->_getCheckout();\n\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($session->getLastRealOrderId());\n if (!$order->getId()) {\n Mage::throwException('No order for processing found');\n }\n $order->setState(Paw_Payanyway_Model_Abstract::STATE_PAYANYWAY_PENDING, Paw_Payanyway_Model_Abstract::STATE_PAYANYWAY_PENDING,\n Mage::helper('payanyway')->__('The customer was redirected to Payanyway.')\n );\n $order->save();\n\n $session->setPayanywayQuoteId($session->getQuoteId());\n $session->setPayanywayRealOrderId($session->getLastRealOrderId());\n $session->getQuote()->setIsActive(false)->save();\n $session->clear();\n\n $this->loadLayout();\n $this->renderLayout();\n } catch (Exception $e){\n Mage::logException($e);\n parent::_redirect('checkout/cart');\n }\n }",
"public function finishAction()\n {\n // if the user has not logged in, login fristly\n if (!$this->session['sUserId']){\n return $this->forward('login', 'account', null, array(\n 'sTarget' => 'paymentpilipay',\n 'sTargetAction' => 'finish',\n 'sUseSSL' => true,\n ));\n }\n\n Shopware()->Modules()->Basket()->sRefreshBasket();\n\n $orderNo = intval($this->Request()->getParam('orderNo'));\n if (!$orderNo){\n return $this->redirect(array('action' => 'orders', 'controller' => 'account'));\n }\n\n if (!is_object($this->session['sOrderVariables'])){\n return $this->redirect(array('action' => 'orders', 'controller' => 'account'));\n }\n\n $view = $this->View();\n $view->assign($this->session['sOrderVariables']->getArrayCopy());\n if ($orderNo != $view->sOrderNumber){\n return $this->redirect(array('action' => 'orders', 'controller' => 'account'));\n }\n\n // fetch order data\n $repository = Shopware()->Models()->getRepository('Shopware\\Models\\Order\\Order');\n $builder = $repository->createQueryBuilder('orders');\n $builder->addFilter(array('number' => $orderNo));\n /**@var $order Shopware\\Models\\Order\\Order */\n $order = $builder->getQuery()->getOneOrNullResult();\n if (!$order){\n return $this->redirect(array('action' => 'orders', 'controller' => 'account'));\n }\n\n $view->sOrderNumber = $order->getNumber();\n $view->sTransactionnumber = $order->getTransactionId();\n $view->sPayment = array(\n 'description' => $order->getPayment()->getDescription() ?: $order->getPayment()->getName()\n );\n\n// $view->sDispatch = null;\n\n // fetch user data\n $userData = $view->sUserData;\n $userData['shippingaddress'] = array(\n 'company' => '',\n 'salutation' => 'mr',\n 'firstname' => $userData['shippingaddress']['firstname'],\n 'lastname' => $userData['shippingaddress']['lastname'],\n 'street' => '(最终的收货地址是您在霹雳爸爸上所填写的地址)',\n );\n $userData['additional'] = null;\n $view->sUserData = $userData;\n\n\n return $view->loadTemplate('frontend/checkout/finish.tpl');\n }",
"public function member_post_po(){\r\n\t $this->OuthModel->CSRFVerify();\r\n $data = $_REQUEST ;\r\n $res = $this->OrderModel->insertPOForUser( $data );\r\n\r\n\r\n }",
"public function process_post($redirect) {\n if (!$data = $this->get_data()) {\n return false;\n }\n // Generate params and send off.\n $api = new api();\n $result = $api->set_servicepaymentprofiles($data->paymentprofile);\n if ((bool)$result->status) {\n $string = implode('<br/>', $result->result->results);\n $message = get_string('setserviceprofiles:success', 'enrol_classicpay', $string);\n } else {\n $message = get_string('err:setserviceprofiles', 'enrol_classicpay', $result);\n }\n redirect($redirect, $message, 5);\n }"
] |
[
"0.64717096",
"0.6205274",
"0.61589575",
"0.61527824",
"0.60851216",
"0.6049729",
"0.6047134",
"0.5923853",
"0.59205854",
"0.59102684",
"0.5867411",
"0.5866419",
"0.582476",
"0.5819522",
"0.5814485",
"0.57883906",
"0.5737468",
"0.5713338",
"0.57086474",
"0.56913364",
"0.5690922",
"0.5671878",
"0.55866385",
"0.5571426",
"0.5556762",
"0.55417985",
"0.55261314",
"0.5509228",
"0.55023",
"0.5497578"
] |
0.81904566
|
0
|
Transform treecollections into lists of their entries
|
public function transform(TreeCollection $collection)
{
return array_map([$this, 'transformEntry'], $collection->getEntries());
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"static function to_list($tree)\n {\n global $hanghoa_arr;\n \n $rs = array();\n foreach($tree as $node)\n {\n $rs[] = $node;\n //if (!empty($node[\"children\"]))\n {\n $list = to_list($node[\"child\"]);\n foreach ($list as $nd)\n {\n $rs[] = $nd;\n //die(\"co den day\");\n }\n }\n }\n \n return $rs;\n }",
"public function svnTreeTransform($tree) {\r\n $transformedTree = array();\r\n foreach($tree as $leaf) {\r\n $children = $this->svnTreeTransform($leaf['children']);\r\n if(!empty($children)) {\r\n $transformedTree[$leaf['name']] = $children;\r\n } else {\r\n $transformedTree[] = $leaf['name'];\r\n }\r\n }\r\n return $transformedTree;\r\n }",
"function tree2List($tree, $buildString = '') {\r\n if (!is_array($tree)) { return array(); }\r\n $list = array();\r\n foreach ($tree as $key => $child) {\r\n if (is_array($child)) {\r\n $list = array_merge($list, Romaji::tree2List($child, $buildString.$key));\r\n } else {\r\n $list[] = $buildString.$key;\r\n }\r\n }\r\n return $list;\r\n }",
"function opensky_get_collection_tree () {\n $pid = 'opensky:root';\n $tree = array();\n foreach (opensky_get_subcollections_recursive('opensky:root') as $pid) {\n $tree[$pid] = opensky_get_pid_subcollections_pids($pid);\n }\n return $tree;\n}",
"function inflate($list){\n $r = array();\n $flat = array();\n foreach($list as $val)\n {\n $flat[$val['id']] = $val;\n }\n foreach($list as $val)\n {\n if(!isset($flat[$val['parent']])) {\n $r[$val['id']] = &$flat[$val['id']];\n }\n else {\n if(!isset($flat[$val['parent']]['children'])) $flat[$val['parent']]['children'] = array();\n $flat[$val['parent']]['children'][] = &$flat[$val['id']];\n }\n }\n return $r;\n}",
"private function iterate($results): array\n {\n $level = 1;\n while (true) {\n $merged = collect();\n foreach ($results[$level - 1] as $parent) {\n $temp = collect();\n if (is_array($results)) {\n $results[$level] = collect();\n }\n if ($parent->getChildren->isEmpty() != true) { // negation (!) at the start is easy to miss\n $temp = $parent->getChildren;\n }\n $merged = $merged->merge($temp);\n }\n $results[$level] = $merged;\n $merged = collect();//resets merged collection for next level\n if ($results[$level]->isEmpty()) {\n return $results;\n }\n $level++;\n }\n }",
"function getTreePart( $belongs_to ) {\n\t\t// WAAH! ueberfluessig haeufiger Aufruf...mir jetzt egal :)\n\t\t$cats = $this->out;\n\t\t$out = array();\n\n\t\tif (isset ($cats[ $belongs_to ]) and count( $cats[ $belongs_to ] ) > 0 ) {\n\t\t\tforeach ( $cats[ $belongs_to ] as $id => $entry ) {\n\t\t\t\t$out[$id] = $entry;\n\t\t\t}\n\t\t}\n\n\t\treturn $out;\n\t}",
"static public function parseTree($tree)\n\t{\n\t\t$rtree=array();\n\t\tforeach ($tree as $node)\n\t\t\t$rtree[$node['id']]=isset($node['children'])? self::parseTree($node['children']) : null;\n\t\treturn $rtree;\n\t}",
"function get_trees()\n\t{\n\n\t\tif(!isset($this->cache['trees']))\n\t\t{\n\n\t\t\tee()->db->order_by('label', 'asc');\n\t\t\t$trees = ee()->db->get_where('taxonomy_trees', array('site_id' => $this->site_id) )->result_array();\n\t\t\t// reindex with node ids as keys\n\t\t\t$data = array();\n\t\t\tforeach($trees as $tree)\n\t\t\t{\n\t\t\t\t$data[ $tree['id'] ] = $tree;\n\t\t\t\t$data[ $tree['id'] ]['templates'] = explode('|', $tree['templates']);\n\t\t\t\t$data[ $tree['id'] ]['channels'] = explode('|', $tree['channels']);\n\t\t\t\t$data[ $tree['id'] ]['member_groups'] = explode('|', $tree['member_groups']);\n\t\t\t\t$data[ $tree['id'] ]['fields'] = ($tree['fields']) ? json_decode($tree['fields'], TRUE) : array();\n\t\t\t\t$data[ $tree['id'] ]['taxonomy'] = ($tree['taxonomy']) ? json_decode($tree['taxonomy'], TRUE) : '';\n\t\t\t}\n\n\t\t\t$this->cache['trees'] = $data;\n\n\t\t}\n\n \treturn $this->cache['trees'];\n\t}",
"protected function convertChildrenToArray()\n {\n $data = array();\n foreach ($this->getChildren() as $name => $child) {\n $data = array_merge($data, $this->convertChildToArray($name, $child));\n }\n return $data;\n }",
"public function renderNodeCollection(TreeNodeCollection $collection, $recursive = true)\n {\n $treeItems = [];\n foreach ($collection as $node) {\n $allNodes = $this->renderNode($node, $recursive);\n if ($allNodes[0]) {\n $treeItems[] = $allNodes[0];\n }\n $nodeCount = count($allNodes);\n if ($nodeCount > 1) {\n for ($i = 1; $i < $nodeCount; $i++) {\n $treeItems[] = $allNodes[$i];\n }\n }\n }\n return $treeItems;\n }",
"function get_toc($toc_flat) {\n $result = array();\n $nodes = array();\n foreach ($toc_flat as & $item) {\n if (array_key_exists('directory', $item) && !empty($item['directory'])) {\n $item['items'] = array();\n $nodes[$item['directory']] = & $item;\n if (array_key_exists('parent', $item) && !empty($item['parent'])) {\n $nodes[$item['parent']]['items'][] = & $item;\n } else {\n $result[] = & $item;\n }\n }\n }\n return $result;\n}",
"public function getTrees() {}",
"function opensky_get_searchable_subcollections ($pid) {\n $descendants = opensky_get_subcollections_recursive($pid);\n $tree = array();\n foreach($descendants as $child) {\n if (!opensky_has_subcollections($child)) {\n $tree[] = $child;\n }\n }\n return $tree;\n}",
"protected function convertChildrenToArray(): array\n {\n return $this->children()->keys();\n }",
"public function toNestedArray()\n {\n $result = array();\n foreach ($this->lists as $list) {\n foreach ($list as $item) {\n if (is_object($item)) {\n if (method_exists($item, 'toMap')) {\n $result[] = $item->toMap();\n } else {\n $result[] = (array) $item;\n }\n } else {\n $result[] = $item;\n }\n }\n }\n return $result;\n }",
"protected function migrateEntryOrderToStructure()\n {\n $tree = collect($this->entryOrder)\n ->sortKeys()\n ->values()\n ->map(function ($id) {\n return ['entry' => $id];\n })\n ->all();\n\n return [\n 'max_depth' => 1,\n 'tree' => $tree,\n ];\n }",
"private function _createTree($data)\n {\n $results = $idMap = array();\n $ids = Set::extract(\"/{$this->name}/id\", $data);\n\n foreach($data as $item) {\n $item['children'] = array();\n $id = $item[$this->name]['id'];\n $parentId = $item[$this->name]['parent_id'];\n\n $idMap[$id] = array_merge($item[$this->name], array('children' => array()));\n\n if(!$parentId || !in_array($parentId, $ids)) {\n $idMap[$id]['level'] = 0;\n $results[] =& $idMap[$id];\n } else {\n $idMap[$id]['level'] = $idMap[$parentId]['level'] + 1;\n $idMap[$parentId]['children'][] =& $idMap[$id];\n }\n }\n\n return $results;\n }",
"public function structure() {\n $list = $this->newQuery()->where('parent_id', 0)->orderBy('order_id', 'asc')->get();\n $list->transform(function (PageCategory $category) {\n $children = $category->newQuery()->where('parent_id', $category->getAttribute('id'))->orderBy('order_id', 'asc')->get();\n $children->transform(function (PageCategory $category) {\n $children = $category->newQuery()->where('parent_id', $category->getAttribute('id'))->orderBy('order_id', 'asc')->get();\n $category->setAttribute('children', $children);\n\n return $category;\n });\n $category->setAttribute('children', $children);\n\n return $category;\n });\n\n return $list->toArray();\n }",
"function list_to_tree($category = array(),\n\t\t$idField = 'id',$parentField='parent_id'){\n\tif(!is_array($category)) exit(\"配列ではありません\");\n\n\t$index = array();\n\t$tree = array();\n\n\tforeach($category as $value){\n\t\t$id = $value[$idField];\n\t\t$parent = $value[$parentField];\n\n\t\tif(isset($index[$id])){\n\t\t\t$value['child'] = $index[$id]['child'];\n\t\t\t$index[$id] = $value;\n\n\t\t} else {\n\t\t\t$index[$id] = $value;\n\t\t}\n\n\t\tif($parent == 0){\n\t\t\t$tree[] =& $index[$id];\n\n\t\t} else {\n\t\t\t$index[$parent]['child'][] =& $index[$id];\n\t\t}\n\n\n\t}\n\treturn $tree;\n}",
"public function getTree() {\n\n $servers = Hash::extract($this->find('all', array(\n 'fields' => array(\n 'server_id', 'name', 'short_name', 'parent_id'\n )\n )), '{n}.Server');\n\n $tree = array();\n\n foreach ($servers as $server) {\n\n $parent_id = $server['parent_id'];\n\n if (empty($parent_id)) {\n\n $server_id = $server['server_id'];\n\n if (empty($tree[$server_id])) {\n $tree[$server_id] = $server;\n } else {\n $tree[$server_id] = array_merge($tree[$server_id], $server);\n }\n\n } else {\n\n if (empty($tree[$parent_id])) {\n $tree[$parent_id] = array(\n 'children' => array($server)\n );\n } else if (empty($tree[$parent_id]['children'])) {\n $tree[$parent_id]['children'] = array($server);\n } else {\n $tree[$parent_id]['children'][] = $server;\n }\n }\n }\n\n return $tree;\n }",
"public function getItemTree(): Collection\n {\n $tree = function ($items) use (&$tree) {\n $menuItems = [];\n\n /*\n * About menu 'active' class resolver\n * https://www.hieule.info/products/laravel-active-version-3-released\n */\n foreach ($items as $item) {\n //@TODO: submenu item resolvers for active class\n\n $menuItems[] = (object)[\n 'id' => $item->id,\n 'name' => $item->name,\n 'icon' => $item->icon,\n 'type' => $item->type,\n 'target' => $item->target,\n 'url' => $item->url,\n 'active' => $item->active,\n 'module' => $item->module,\n 'children' => $item->children->count() ? $tree($item->children) : [],\n ];\n }\n\n return $menuItems;\n };\n\n $itemTree = [];\n\n if ($this->items->count()) {\n $itemTree = $tree($this->items->toTree());\n }\n\n return collect($itemTree);\n }",
"function d_getCollectionData($collection) {\n\t$result = array();\n\tforeach($collection as $v) {\n\t\t$item = array();\n\t\tforeach($v as $k2 => $v2) {\n\t\t\t$item[ $k2 ] = $v2;\n\t\t}\n\t\tif (isset($v->fid)) $item['fid'] = $v->fid; \n\t\t$result[] = $item;\n\t}\n\treturn $result;\n}",
"function build_categories_collection_from_tree(Collection $tree, string|array $taxonomy, string $route, string $taxable_relation, bool $include_empty = false, array $params = [], array $attributes = [], bool $is_child = false): Collection\n{\n $temp = $params;\n $items = collect();\n\n $count = 1;\n foreach ($tree as $properties) {\n $params[] = $properties['slug'];\n\n $children = null;\n\n foreach ($properties as $value) {\n if ($value instanceof Collection) {\n $children = build_categories_collection_from_tree($value, $taxonomy, $route, $taxable_relation, $include_empty, $params, $attributes, true);\n break;\n }\n }\n\n $is_active = taxonomies_is_active_route($route, $params);\n\n $item = [\n 'uuid' => $properties['uuid'],\n 'taxonomy' => $properties['taxonomy'],\n 'title' => $properties['title'],\n 'slug' => $properties['slug'],\n 'content' => $properties['content'],\n 'lead' => $properties['lead'],\n 'meta_desc' => $properties['meta_desc'],\n 'visible' => $properties['visible'],\n 'searchable' => $properties['searchable'],\n 'route' => $route,\n 'params' => is_array($properties['alias-params']) ? get_term_link($route, $properties['alias-params']) : $params,\n 'link' => is_array($properties['alias-params']) ? get_term_link($route, $properties['alias-params']) : get_term_link($route, $params),\n 'children' => $children,\n 'count' => $properties['count'],\n 'count-cumulative' => $properties['count-cumulative'],\n 'active' => $is_active,\n 'active-branch' => $is_active ?: ($children && $children->where('active-branch', true)->count()),\n ];\n\n $params = [];\n if ($count !== count($tree))\n $params = $temp;\n\n $count++;\n\n if (! $include_empty && $properties['count-cumulative'] < 1) {\n continue;\n } else {\n $items->push($item);\n }\n }\n\n return $items;\n}",
"public function tree($sql) {\n $data_out = array();\n foreach ($this->lines($sql, true) AS $data)\n {\n $data_out[$data[0]][] = $data[1];\n }\n return $data_out;\n }",
"function get_nodes()\n {\n\n \tif( !isset($this->cache['trees'][$this->tree_id]['nodes']))\n \t{\n \t\tee()->db->select('*');\n\t\t\tee()->db->from( $this->tree_table );\n\t\t\tee()->db->join('channel_titles', 'channel_titles.entry_id = '.$this->tree_table.'.entry_id', 'left');\n\t\t\tee()->db->join('statuses', 'statuses.status = channel_titles.status', 'left');\n \t\t$nodes = ee()->db->get()->result_array();\n\n \t\t// map field names => type\n\t\t\t$cf_map = array();\n\t\t\tforeach( $this->cache['trees'][$this->tree_id]['fields'] as $cf)\n\t\t\t{\n\t\t\t $cf_map[$cf['name']] = $cf['type'];\n\t\t\t}\n\n \t\t// reindex with node ids as keys\n \t\t$node_data = $entry_data = array();\n \t\tforeach($nodes as $node)\n \t\t{\n \t\t\t// if the node is associated with an entry\n \t\t\t// create another index for those\n \t\t\tif($node['entry_id'])\n \t\t\t{\n \t\t\t\t$entry_data[ $node['entry_id'] ] = $node['node_id'];\n \t\t\t}\n\n \t\t\tif($node['type'] != '')\n \t\t\t{\n \t\t\t\t$node['type'] = explode('|', $node['type']);\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t$node['type'] = array();\n \t\t\t}\n\n \t\t\tif(!empty($node['field_data']))\n \t\t\t{\n \t\t\t\tee()->load->library('taxonomy_field_lib');\n \t\t\t\t$node['field_data'] = json_decode($node['field_data'], TRUE);\n \t\t\t\tforeach($node['field_data'] as $k => $v)\n \t\t\t\t{\n \t\t\t\t\t// this should apply to front end template parsing only \n \t\t\t\t\t$callers = debug_backtrace();\n \t\t\t\t\tif ( isset($callers[2]['function']) && $callers[2]['function'] == 'process_tags' && isset($cf_map[$k]))\n \t\t\t\t\t{\n \t\t\t\t\t\t\n \t\t\t\t\t\t$ft = ee()->taxonomy_field_lib->load($cf_map[$k]);\n \t\t\t\t\t\t// let the fieldtype change the final value\n \t\t\t$v = $ft->replace_value($v);\n \t\t\t// overwrite value\n \t\t\t$node['field_data'][$k] = $v;\n \t\t\t\t\t\t\n \t\t\t\t\t\t\n \t\t\t\t\t}\n \t\t\t\t\t$node[$k] = $v;\n \t\t\t\t}\n \t\t\t}\n\n \t\t\t$node_data[ $node['node_id'] ] = $node;\n \t\t\t$node_data[ $node['node_id'] ]['url'] = $this->build_url($node);\n \t\t\t\n \t\t}\n\n \t\t$this->cache['trees'][$this->tree_id]['nodes']['by_node_id'] = $node_data;\n \t\t$this->cache['trees'][$this->tree_id]['nodes']['by_entry_id'] = $entry_data;\n \t}\n\n \treturn $this->cache['trees'][$this->tree_id]['nodes'];\n\n }",
"function flatten_tree(&$tree, $start_level, &$items)\n {\n foreach($tree as $item)\n {\n if($item['level'] === (integer) $start_level)\n {\n $items[] = $item;\n }\n\n if(isset($item['children']))\n {\n $this->flatten_tree($item['children'], $start_level, $items);\n }\n }\n }",
"public function getDirectoryTreeList();",
"public function getTree($with_products = true): Collection\n {\n $categories = $this->realGetMany($this->query(), $with_products);\n $nodes = $categories->toTree();\n\n return $nodes;\n }",
"public function getTreeGridData()\n {\n $list = array();\n \n // Get all menusets\n $menusets = $this->getAllMenusets();\n \n if (count($menusets)) {\n $i = 0;\n foreach ($menusets as $key => $item) {\n // Case with <html> orginal folder\n if (empty($item['menuset'])) {\n $item['menuset'] = self::getDefaultMenuset();\n }\n \n $curMenuset = $item['menuset'];\n $htmlObj = new Application_Model_Html($curMenuset);\n $data = $htmlObj->getHtmlList(true);\n \n $list[$i] = array(\n 'id' => $curMenuset,\n 'name' => $this->getMenusetName($curMenuset),\n 'fullname' => $item[0],\n 'children' => $data['rows'],\n 'state' => 'closed',\n 'can_del' => $this->canDelete($curMenuset),\n 'is_menuset' => true\n );\n $i++;\n }\n\n // Sort list\n array_multisort($list);\n }\n\n return $list;\n }"
] |
[
"0.7021127",
"0.63418376",
"0.63340175",
"0.6230785",
"0.5985537",
"0.58273137",
"0.5798652",
"0.57283",
"0.5683028",
"0.568293",
"0.5681438",
"0.5665936",
"0.56396806",
"0.56235313",
"0.56211454",
"0.5608787",
"0.56028736",
"0.5590549",
"0.5557936",
"0.5513917",
"0.5506144",
"0.5477751",
"0.54714864",
"0.54364705",
"0.54226935",
"0.54110825",
"0.54071593",
"0.54044366",
"0.53901976",
"0.5361916"
] |
0.64363074
|
1
|
Generate an unique order reference
|
public function generateOrderReference(OrderEvent $event)
{
$order = $event->getOrder();
$letters = chr(rand(65, 90)) . chr(rand(65, 90)) . chr(rand(65, 90)) . chr(rand(65, 90));
$numbers = rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9);
$reference = strtoupper($letters) . $numbers;
$order->setReference($reference);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function regenerateOrderNumber()\n {\n \n }",
"public static function genRefNum()\n {\n $strvalue = self::shuffleString(\"abcdefghijklmnopqrstuvwxyz1234567890\");\n\n $str_alph = substr(uniqid($strvalue),0,8);\n\n $today = date(\"Ymd\");\n $rand = strtoupper(substr(uniqid(sha1(time())),0,4));\n $ref_number = strtoupper($today . $rand . $str_alph);\n //dd($ref_number);\n return $ref_number;\n }",
"function generateReferenceKey($key='')\n{\n return $key . \\Ramsey\\Uuid\\Uuid::uuid4()->toString();\n}",
"public\tfunction sp_build_order_no()\n\t{\n mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.\n $uuid = strtoupper(md5(uniqid(rand(), true)));\n // $uuid = substr($charid, 0, 8)\n // .substr($charid, 8, 4)\n // .substr($charid,12, 4)\n // .substr($charid,16, 4)\n // .substr($charid,20,12);\n return $uuid;\n\t}",
"public function generateOrder();",
"public function generateUniquePaymentRef()\r\n\t\t{\r\n\t\t\t$paymentRef = '';\r\n\t\t\tdo\r\n\t\t\t{\r\n\t\t\t\t$paymentRef = Account::generatePaymentRef();\r\n\r\n\t\t\t} while( $this->find('count', array( 'conditions' => array( 'Account.payment_ref' => $paymentRef) )) > 0 );\r\n\r\n\t\t\treturn $paymentRef;\r\n\t\t}",
"protected function generateUniqueId()\n\t{\n\t\t// generate unique numbers for order id\n\t\t$orderID = hexdec(bin2hex(openssl_random_pseudo_bytes(5)));\n\t\t$orderIdExist = Order::find($orderID);\n\t\t// if exist append the id of d existed copy to new one to make it unique\n\t\tif ($orderIdExist) {\n\t\t\t$orderID = $orderID . '' . $orderIdExist->id;\n\t\t}\n\t\treturn $orderID;\n\t}",
"public function generateOrderID() { global $db;\n // Generate Order ID\n $db->query(\"INSERT INTO `order_ids` (foo) VALUES(:foo)\", array('foo' => true));\n return $db->lastInsertId();\n }",
"public static function gen_order_str()\n {\n\n $str = session_id();\n $str .= (string)time();\n $checksum = crc32($str);\n $date = date('Y-m-d');\n $order_number = $date . $checksum;\n\n return substr($order_number, 0, 19);\n }",
"public function generateReference()\n {\n $reference = $this->getVoucherFormatter()->format($this->getSequenceStrategy()->nextVal($this->getSlug()));\n \n if(!$this->validateReference($reference)) {\n throw new LedgerException('Generated reference failed to validate, maybe sequence is broken');\n }\n \n return $reference;\n }",
"public function getOrderNumber()\n {\n if (null === $this->_orderNumber) {\n $this->_orderNumber = uniqid();\n }\n return $this->_orderNumber;\n }",
"private static function getRandomReferenceNumber()\n {\n return sprintf('%02X', mt_rand(0, 0xFF));\n }",
"public static function generatePaymentRef()\r\n\t {\r\n\t \t// Payment ref is a randomly generates string of 'safechars'\r\n\t\t\t// Stolen from London Hackspace code\r\n\t\t\t$safeChars = \"2346789BCDFGHJKMPQRTVWXY\";\r\n\r\n\t\t\t// We prefix the ref with a string that lets people know it's us\r\n\t\t\t$prefix = 'HSNOTTS';\r\n\r\n\t\t\t// Payment references can be up to 18 chars according to: http://www.bacs.co.uk/Bacs/Businesses/BacsDirectCredit/Receiving/Pages/PaymentReferenceInformation.aspx\r\n\t\t\t$maxRefLength = 16;\r\n\r\n\t\t\t$paymentRef = $prefix;\r\n\t\t\tfor($i = strlen($prefix); $i < $maxRefLength; $i++)\r\n\t\t\t{\r\n\t\t\t\t$paymentRef .= $safeChars[ rand(0, strlen($safeChars) - 1) ];\r\n\t\t\t}\r\n\r\n\t\t\treturn $paymentRef;\r\n\t }",
"function createQuoteID(){\n\treturn uniqid(\"Q\");\n}",
"public static function createOrderReferenceFixture()\n {\n PlacedOrderFixture::createOrderReferenceFixture();\n }",
"function create_order_id()\n{\n global $config, $db_prefix;\n switch ($config['cart']['order_id_format']) {\n case 1:\n $row = sql_qquery(\"SHOW TABLE STATUS LIKE '\".$db_prefix.\"order_summary'\");\n $now = $row['Auto_increment'] + 1;\n $l = strlen($now);\n for ($i = $l; $i < 6; $i++) {\n $now = '0'.$now;\n }\n return $config['cart']['order_id_prefix'].$now;\n break;\n\n\n case 2:\n $ok = false;\n while (!$ok) {\n $t = strtoupper(random_str(6));\n $res = sql_query(\"SELECT order_id FROM \".$db_prefix.\"order_summary WHERE order_id = '$t' LIMIT 1\");\n $row = sql_fetch_array($res);\n if (empty($row['order_id'])) {\n $ok = true;\n }\n }\n return $t;\n break;\n }\n}",
"function getUniqueId()\n {\n $a = count($this->_ref_store);\n while(in_array($a, $this->_ref_store)) {\n $a++;\n }\n return $a;\n }",
"public function testGenerateReferenceNumber ()\n\t{\n\t\trequire_once BUILD_ROOT.'/modules/checkout/bpay/module.bpay.php';\n\t\t$bpay = new CHECKOUT_BPAY();\n\n\t\t// Test padding with prefix.\n\t\t$res = $bpay->GenerateReferenceNumber(7, 10, 5);\n\t\t$this->assertEquals(5000000074, $res);\n\n\t\t$res = $bpay->GenerateReferenceNumber(2951);\n\t\t$this->assertEquals(29512, $res);\n\n\t\t// Example from BPAY Q&A..\n\t\t$res = $bpay->GenerateReferenceNumber(272573);\n\t\t$this->assertEquals(2725737, $res);\n\n\t\t// Test alphabet prefix, should ignore.\n\t\t$res = $bpay->GenerateReferenceNumber(272573, '', 'a');\n\t\t$this->assertEquals(2725737, $res);\n\n\t\t// Test leading zeros.\n\t\t$res = (string) $bpay->GenerateReferenceNumber(272573, 10);\n\t\t$this->assertEquals('0002725737', $res);\n\t}",
"public function generateAndSetInvoiceNumber();",
"public function test_generate_reference()\n\t{\n\t\t// reference generator\n\t\t$generator = new phpIso11649;\n\n\t\t// eg: input '5390 0754 7034' should give 'RF18539007547034'\n\t\t$reference = $generator->generateRfReference('5390 0754 7034', false);\n\t\t$this->assertEquals('RF18539007547034', $reference);\n\n\t\t// eg: input 'RF18000000000539007547034' should give 'RF18000000000539007547034'\n\t\t$reference = $generator->generateRfReference('000000000539007547034', false);\n\t\t$this->assertEquals('RF18000000000539007547034', $reference);\n\t}",
"function makeRef($ota){\n $ref = '';\n $ref = $ota->NPOSNR.'-'.$ota->NJOURNALNR.'-'.$ota->NSERIALNR.'-'.$ota->NPROJNR;\n return $ref;\n }",
"protected function generateId()\n {\n }",
"public function generateUniqueId(){\n //PHPs uniquid function is time based and therefor guessable\n //A stright random MD5 sum is too long for email and tends to line break causing usability problems\n //So we get unique through uniquid and we get random by prefixing it with a part of an MD5\n //hopefully this results in a URL friendly short, but unguessable string\n $prefix = substr(md5(mt_rand()*mt_rand()),rand(0,24), rand(6,8));\n $this->uniqueId = \\uniqid($prefix);\n }",
"public function tempId()\n {\n $this->id = uniqid('item');\n }",
"function GenerateUniqId($sName)\n{\n\tstatic $arPostfix = array();\n\n\t$sPostfix = rand();\n\twhile(isset($arPostfix[$sPostfix]))\n\t\t$sPostfix = rand();\n\n\t$arPostfix[$sPostfix] = 1;\n\n\treturn preg_replace(\"/\\\\W/\", \"_\", $sName).$sPostfix;\n}",
"public static function generate(): string\n {\n $possiblePath = RedisImitation::find('autogenerated_path');\n // avoiding situations when new autogenerated path replaces existing custom one\n do {\n $possiblePath['value'] = $possiblePath['value'] + 1;\n $url = Url::where('path', $possiblePath['value'])->first();\n } while ($url !== null);\n\n $possiblePath->save();\n return $possiblePath['value'];\n }",
"function gen_id() {\n\t\t$this->id = get_uid();\n\t\t$this->mk_paths($this->id);\n\t}",
"function celerity_generate_unique_node_id() {\n static $uniq = 0;\n $response = CelerityAPI::getStaticResourceResponse();\n $block = $response->getMetadataBlock();\n\n return 'UQ'.$block.'_'.($uniq++);\n}",
"function CriaCodigo() { //Gera numero aleatorio\r\n for ($i = 0; $i < 40; $i++) {\r\n $tempid = strtoupper(uniqid(rand(), true));\r\n $finalid = substr($tempid, -12);\r\n return $finalid;\r\n }\r\n }",
"protected static function generateTransactionId()\n {\n return uniqid(self::TRANSACTION_ID_PREFIX);\n }"
] |
[
"0.6774264",
"0.6735795",
"0.6725602",
"0.66480076",
"0.6592211",
"0.6578811",
"0.6553577",
"0.63587713",
"0.63472885",
"0.6286339",
"0.61868644",
"0.61661136",
"0.61502904",
"0.61220324",
"0.5944048",
"0.5915856",
"0.58892846",
"0.5889065",
"0.5872114",
"0.5855105",
"0.5846512",
"0.5824419",
"0.58171517",
"0.58030444",
"0.5793197",
"0.5788931",
"0.5780118",
"0.57168657",
"0.56785697",
"0.5674816"
] |
0.7232404
|
0
|
Add an order status update to the order
|
public function addOrderStatusUpdate(OrderEvent $event)
{
$order = $event->getOrder();
$statusUpdate = new OrderStatusUpdate();
$statusUpdate->setStatus($order->getStatus());
$statusUpdate->setOrigin($event->getOrigin());
$order->addStatusUpdate($statusUpdate);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function updateStatus()\n {\n $this->status = Cart::CART_STATUS_ORDERED;\n $this->save();\n }",
"public function updateStatus(Request $request, Order $order)\n {\n $oldOrder = $order->replicate();\n $this->validate($request, [\n 'status' => 'bail|required|string|in:' . implode(',', config('project.order_status', [])),\n ]);\n\n $order->status = $request->input('status');\n $order->save();\n\n event(new OrderStatusChanged($oldOrder, $order));\n alert()->success('Order status was updated successfully.');\n return back();\n }",
"public function updateOrderStatus($orders = 0, $order_id = 0, $order_status = 0)\n {\n $total = 1;\n if (empty($orders)) {\n $orders = array();\n\n $orderslist = vRequest::getVar('orders', array());\n $total = 0;\n // Get the list of orders in post to update\n foreach ($orderslist as $key => $order) {\n if ($orderslist[$key]['order_status'] !== $orderslist[$key]['current_order_status']) {\n $orders[$key] = $orderslist[$key];\n $total++;\n }\n }\n }\n\n if (!is_array($orders)) {\n $orders = array($orders);\n }\n\n /* Process the orders to update */\n $updated = 0;\n $error = 0;\n if ($orders) {\n // $notify = vRequest::getVar('customer_notified', array()); // ???\n // $comments = vRequest::getVar('comments', array()); // ???\n foreach ($orders as $virtuemart_order_id => $order) {\n if ($order_id > 0) $virtuemart_order_id = $order_id;\n $this->useDefaultEmailOrderStatus = false;\n if ($this->updateStatusForOneOrder($virtuemart_order_id, $order, true)) {\n $updated++;\n } else {\n $error++;\n }\n }\n }\n $result = array('updated' => $updated, 'error' => $error, 'total' => $total);\n return $result;\n }",
"public function updateStatus(Request $request, Order $order)\n {\n $this->authorize('update', $order);\n $input = $request->input();\n\n $status = $order->fulfillment_status;\n\n foreach (Order::FULFILLMENT_STATUS_ARRAY as $key => $value) {\n if ($value === $input['status']) {\n $status = $key;\n }\n }\n\n //$order->history()->create(['order_id' => $order->id, 'old_status' => $order->fulfillment_status, 'new_status' => $status]);\n $order->fulfillment_status = $status;\n\n $order->save();\n\n $order = $order->fresh(['user', 'history']);\n\n return $this->respond($order);\n }",
"public function change_order_status_post()\n {\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n $id = $data['order_id'];\n $status = $data['status'];\n $user_id = $data['user_id'];\n // $this->response($user_id);\n $data = array(\n 'status' => $status\n );\n \n $where = array(\n 'id' => $id\n );\n $this->model->update('orders', $data, $where);\n $message = \"Your Order is $status\";\n \n $resp = array('rccode' => 200,'message' => $message);\n $this->response($resp);\n //}\n \n \n }",
"public function update_status($_order)\n {\n $note = __('Status via reminder plugin automatisch geändert', 'bbb-bac-reminder');\n\n return $_order->update_status('cancelled', $note);\n }",
"public function testUpdateOrder()\n {\n // As we can't create order on the API for real functional test, We need to create\n // a new one from live plugin and then register the id inside the settings here.\n\n // This part works, but we need to develop the post\n if (!$this->settings->getOrderId()) {\n return;\n }\n\n $orderInfo = $this->orderApi->getOrder($this->settings->getOrderId());\n\n $this->assertTrue(is_array($orderInfo), $this->orderApi->getBody());\n\n $currentState = $orderInfo['current_status'];\n\n if ($currentState == AbstractOrderState::WAITING) {\n $nextStatus = AbstractOrderState::PENDING;\n } elseif ($currentState == AbstractOrderState::PENDING) {\n $nextStatus = AbstractOrderState::ACCEPTED;\n } elseif ($currentState == AbstractOrderState::ACCEPTED) {\n $nextStatus = AbstractOrderState::FINALIZED;\n } elseif ($currentState == AbstractOrderState::FINALIZED) {\n $nextStatus = AbstractOrderState::SHIPPED;\n } else {\n $nextStatus = AbstractOrderState::PENDING;\n }\n\n $result = $this->orderApi->updateStatus($this->settings->getOrderId(), $nextStatus);\n\n $this->assertEquals(200, $this->orderApi->getLastHttpCode(), $this->orderApi->getBody());\n $this->assertEquals($nextStatus, $result['order']['current_status'], $this->orderApi->getBody());\n }",
"public function updateOrder($order)\n { \n event(new UpdateOrderNotification([\n 'id' => $order->id,\n 'status' => $order->status,\n ]));\n }",
"public function updated(Order $order)\n {\n //\n }",
"public function updated(Order $order)\n {\n //\n }",
"public function update_status($order_id, $payment_status)\n\t{\n\t\t$new_status_id = static::get_status_id($payment_status);\n\n\t\t$order_updated = false;\n\t\t$check_status_query = tep_db_query(\"select customers_name, customers_email_address, orders_status, date_purchased from \" . TABLE_ORDERS . \" where orders_id = '\" . intval($order_id) . \"'\");\n\t\t$check_status = tep_db_fetch_array($check_status_query);\n\t\t$customer_notified = '0';\n\n\t\tif ( $new_status_id && $check_status['orders_status'] != $new_status_id ) \n\t\t{\n\t\t\tif ( $this->get_status_notify($payment_status) ) \n\t\t\t{\n\t\t\t\t$internal_status = $this->get_internal_status_name_from_id($new_status_id);\n\n\t\t\t\t$email = STORE_NAME . \"\\n\" .\n\t\t\t\t\t\"------------------------------------------------------\\n\" .\n\t\t\t\t\t'Order Number: ' . $order_id . \"\\n\" .\n\t\t\t\t\t'Detailed Invoice: ' . tep_href_link(\"account_history_info.php\", 'order_id=' . $order_id, 'SSL') . \"\\n\" .\n\t\t\t\t\t'Date Ordered: ' . tep_date_long($check_status['date_purchased']) . \"\\n\\n\" .\n\t\t\t\t\t'Your order has been updated to the following status.' . \"\\n\\n\" .\n\t\t\t\t\t'New status: ' . $internal_status . \"\\n\\n\" .\n\t\t\t\t\t'Please reply to this email if you have any questions.' . \"\\n\";\n\n\t\t\t\ttep_mail($check_status['customers_name'], $check_status['customers_email_address'], \"Order Update\", $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);\n\t\t\t\t$customer_notified = '1';\n\t\t\t}\n\n\t\t\t// Only update order status when order_status is different then the saved order_status\n\t\t\ttep_db_query(\"UPDATE orders SET orders_status = '\" . $new_status_id . \"', last_modified = now() WHERE orders_id = \" . intval($order_id));\n\t\t\t$this->add_order_history($order_id, $payment_status, $customer_notified);\n\t\t}\n\t}",
"public function add_status( $order, $status ) {\n\n\t\tif ( is_numeric( $order ) ) {\n\t\t\t$order = wc_get_order( $order );\n\t\t}\n\n\t\t// Add the status if it doesn't already exist\n\t\tif ( ! $this->order_has_status( $order, $status ) ) {\n\t\t\treturn add_post_meta( SV_WC_Order_Compatibility::get_prop( $order, 'id' ), '_wc_avatax_status', $status );\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function update(Request $request, OrderStatus $orderStatus)\n {\n //\n }",
"public function updating(Order $order): void\n\t{\n\t\tif ($order->status == 'pending') {\n\t\t\t$order->booster_id = null;\n\t\t}\n\t}",
"public function changeStatus($orderId=null,$status=null){\n $allowedStatuses = ShopCore::$orderStatuses;\n if(!$orderId){\n $orderId = (int)$_POST['id'];\n }\n if(!$status){\n $status = $_POST['status'];\n }\n $order = new DBObject('sr_shop_order',$orderId);\n\n if(!$order->id){\n $this->sendJSON(array('success'=>false,'message'=>'Product not found'));\n }\n if(!$allowedStatuses[$status]){\n $this->sendJSON(array('success'=>false,'message'=>'Product not found'));\n }\n if($order->get('status')==$status){\n $this->get($orderId);\n return;\n }\n switch ($order->get('status')){\n case 'new':\n case 'processing':\n switch($status){\n case 'shipped':\n case 'done':\n // -w\n //-r\n $this->updateWarehouse($orderId,-1,-1);\n if($status=='done' && $order->get('customer_id')!='0'){\n $this->updateDiscount($order->get('customer_id'),$order->get('total'));\n }\n break;\n case 'cancelled':\n //-r\n $this->updateWarehouse($orderId,0,-1);\n break;\n }\n break;\n case 'shipped':\n case 'done':\n if($order->get('status')=='done' && $order->get('customer_id')!='0'){\n $this->updateDiscount($order->get('customer_id'),$order->get('total'),true);\n }\n switch($status){\n case 'new':\n case 'processing':\n // +w\n // +r\n $this->updateWarehouse($orderId,1,1);\n break;\n case 'cancelled':\n //+w\n $this->updateWarehouse($orderId,1,0);\n break;\n }\n break;\n\n case 'cancelled':\n switch($status){\n case 'new':\n case 'processing':\n // +r\n $this->updateWarehouse($orderId,0,1);\n break;\n default:\n if(!$allowedStatuses[$status]){\n $this->sendJSON(array('success'=>false,'message'=>'Action denied'));\n }\n break;\n }\n break;\n }\n $order->set('status',$status);\n $order->save();\n $this->get($orderId);\n }",
"public function updated(Order $Order)\n {\n //code...\n }",
"public function _update_order_status( $order, $timeline ) {\n\t\t$prev_status = $order->get_meta( '_coinbase_status' );\n\n\t\t$last_update = end( $timeline );\n\t\t$status = $last_update['status'];\n\t\tif ( $status !== $prev_status ) {\n\t\t\t$order->update_meta_data( '_coinbase_status', $status );\n\n\t\t\tif ( 'EXPIRED' === $status && 'pending' == $order->get_status() ) {\n\t\t\t\t$order->update_status( 'cancelled', __( 'Coinbase payment expired.', 'coinbase' ) );\n\t\t\t} elseif ( 'CANCELED' === $status ) {\n\t\t\t\t$order->update_status( 'cancelled', __( 'Coinbase payment cancelled.', 'coinbase' ) );\n\t\t\t} elseif ( 'UNRESOLVED' === $status ) {\n\t\t\t\tif ('OVERPAID' === $last_update['context']) {\n\t\t\t\t\t$order->update_status( 'processing', __( 'Coinbase payment was successfully processed.', 'coinbase' ) );\n\t\t\t\t\t$order->payment_complete();\n\t\t\t\t} else {\n\t\t\t\t\t// translators: Coinbase error status for \"unresolved\" payment. Includes error status.\n\t\t\t\t\t$order->update_status( 'failed', sprintf( __( 'Coinbase payment unresolved, reason: %s.', 'coinbase' ), $last_update['context'] ) );\n\t\t\t\t}\n\t\t\t} elseif ( 'PENDING' === $status ) {\n\t\t\t\t$order->update_status( 'blockchainpending', __( 'Coinbase payment detected, but awaiting blockchain confirmation.', 'coinbase' ) );\n\t\t\t} elseif ( 'RESOLVED' === $status ) {\n\t\t\t\t// We don't know the resolution, so don't change order status.\n\t\t\t\t$order->add_order_note( __( 'Coinbase payment marked as resolved.', 'coinbase' ) );\n\t\t\t} elseif ( 'COMPLETED' === $status ) {\n\t\t\t\t$order->update_status( 'processing', __( 'Coinbase payment was successfully processed.', 'coinbase' ) );\n\t\t\t\t$order->payment_complete();\n\t\t\t}\n\t\t}\n\n\t\t// Archive if in a resolved state and idle more than timeout.\n\t\tif ( in_array( $status, array( 'EXPIRED', 'COMPLETED', 'RESOLVED' ), true ) &&\n\t\t\t$order->get_date_modified() < $this->timeout ) {\n\t\t\tself::log( 'Archiving order: ' . $order->get_order_number() );\n\t\t\t$order->update_meta_data( '_coinbase_archived', true );\n\t\t}\n\t}",
"public function changeOrderStatus(Order $order, Request $request)\n\t{\n\n\t\ttry\n\t\t{\n\t\t\t$data = request()->all();\n\t\t\t\t\n\t\t\t \n\t\t\tif(isset($data['id']))\n\t\t\t{\n\t\t\t\tif($data['value'] == 5) {\n\t\t\t\t\tfor ($i=0; $i<count($request->id); $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->Order->where('id',$request->id[$i])->update(['order_status_id' => $data['value'],'delivered_date'=>date('Y-m-d')]);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor ($i=0; $i<count($request->id); $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->Order->where('id',$request->id[$i])->update(['order_status_id' => $data['value']]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\t$message = $this->success($this->updated,'Oder');\n\t\t\t\t$cnt = $this->orderCount();\n\t\t\t\treturn response()->json(['orderStatus' => $status ,'pId'=> $request->id,'cnt' => $cnt ,'message' => $message]);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch (\\Exception $e) {\n\t\t\tdd($e);\n\t\t\treturn $this->debugLog($e->getMessage());\n\t\t}\n\t}",
"public function updating(Order $Order)\n {\n //code...\n }",
"function updateStatus($order, $newStatus) {\n $data = [];\n switch ($newStatus) {\n case 2: #processed\n $event = new OrderWasProcessed($order);\n $data['processed_on'] = Carbon::now();\n break;\n\n case 4: #traveling\n $event = new OrderShippedOn($order);\n $data['shipped_on'] = Carbon::now();\n $data['expected_delivery_on'] = Carbon::now()->addDay();\n break;\n\n case 5: #delivered\n $event = new OrderWasDelivered($order);\n $data['delivered_on'] = Carbon::now();\n break;\n }\n\n if (isset($event) && $event) {\n event($event);\n }\n\n return $data;\n}",
"public function updated(Order $order)\n\t{\n\t\t$oldStatus = $order->getOriginal();\n\t\tif ($order->status_id != $oldStatus['status_id'] && $order->status->notification != 0) {\n\t\t\t// example of usage: (be sure that a notification template mail with the slug \"example-slug\" exists in db)\n\t\t\treturn Mail::to($order->user->email)->send(new NotificationTemplateMail($order, \"order-status-changed\"));\n\t\t}\n\t}",
"public function sendStatusUpdateNotifications(OrderEvent $event)\n {\n $order = $event->getOrder();\n switch ($order->getStatus()) {\n\n case Order::STATUS_AWAITING_SEPA:\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_AWAITING_SEPA,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_NEW:\n // get payment\n $payment = $order->getPayments()->first();\n\n // is transport\n $isTransport = true;\n if (Shipping::TYPE_NOT_SHIPPED === $order->getShippingType()) {\n $isTransport = false;\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'invoiceUrl' => $this->router->generate('order_invoice_download', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $payment->getChargeId(),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'BoolTransport' => $isTransport,\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'expectedDeliveryDate' => null !== $order->getExpectedDeliveryDate() ? $order->getExpectedDeliveryDate()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y') : '',\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CONFIRMATION_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'BoolTransport' => $isTransport,\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'shippingLimitDate' => null !== $order->getShouldBeReadyAt() ? $order->getShouldBeReadyAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y') . ' avant 17h' : '',\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountForMakerTaxIncl() / 100), 2)// only display production amount - coupon amount to maker\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CONFIRMATION_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n\n case Order::STATUS_CANCELED:\n // order has been canceled by the customer\n if (OrderEvent::ORIGIN_CUSTOMER === $event->getOrigin()) {\n\n // get order payment id\n $paymentId = 'n/a';\n $payments = $order->getPayments();\n if (0 < count($payments)) {\n /** @var Payment $payment */\n $payment = $payments[0];\n $paymentId = $payment->getChargeId();\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $paymentId,\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CANCELLATION_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountForMakerTaxIncl() / 100), 2)// only display production amount - coupon amount to maker\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CANCELLATION_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n }\n break;\n\n case Order::STATUS_TRANSIT:\n\n // get shipment\n $shipments = $order->getShipments();\n /** @var Shipment $shipment */\n $shipment = $shipments[0];\n\n // send customer e-mail\n $emailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'trackingUrl' => $shipment->getTrackingUrl(),\n 'trackingNumber' => $shipment->getParcelNumber(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_SHIPPED,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $emailVars\n );\n\n break;\n\n case Order::STATUS_READY_FOR_PICKUP:\n\n // send customer e-mail\n $emailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_READY_FOR_PICKUP,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $emailVars\n );\n\n break;\n\n case Order::STATUS_REFUNDED:\n\n // get order payment id\n $paymentId = 'n/a';\n $payments = $order->getPayments();\n if (0 < count($payments)) {\n /** @var Payment $payment */\n $payment = $payments[0];\n $paymentId = $payment->getChargeId();\n }\n\n // get order refund id\n $refundId = 'n/a';\n $refunds = $order->getRefunds();\n if (0 < count($refunds)) {\n /** @var Refund $refund */\n $refund = $refunds[0];\n $refundId = $refund->getRefundId();\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $paymentId,\n 'refundId' => $refundId,\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_REFUNDED,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_DELIVERED:\n\n // send customer e-mail\n /* There is no longer any immediate notification sending when the order is delivered. The notification is made on D + 1 via the reminder system\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n //'ratingUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL) . '#rating'\n 'ratingUrl' => $this->router->generate('order_rating', array('token' => $order->getToken()), $this->router::ABSOLUTE_URL) . '#rating'\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_RATING,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n */\n break;\n\n case Order::STATUS_CLOSED:\n\n if ($order->getRating()->getEnabled() == True ) {\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'orderRateValue' => $order->getRating()->getRate(),\n 'orderRateValue' => $order->getRating()->getComment(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_RATE,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n }\n break;\n\n\n\n\n case Order::STATUS_FILE_AVAILABLE:\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_AVAILABLE_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_FILE_REJECTED:\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_REJECTED_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n\n case Order::STATUS_FILE_VALIDATED:\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'BoolTransport' => $order->getQuotation()->getProject()->getType()->isShipping(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_VALIDATED_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n }\n }",
"public static function updateOrder($order, $status, $callbackid)\n {\n if (!KomfortkasseConfig::getConfig(KomfortkasseConfig::activate_update, $order)) {\n return;\n }\n\n $om = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\n // Hint: PAID and CANCELLED are supported as of now.\n $order = $om->create('\\Magento\\Sales\\Model\\Order')->loadByIncrementId($order ['number']);\n\n $om->get('\\Magento\\Framework\\Event\\Manager')->dispatch('komfortkasse_change_order_status_before',\n [ 'order' => $order,'status' => $status,'callbackid' => $callbackid\n ]);\n\n $stateCollection = $om->create('\\Magento\\Sales\\Model\\Order\\Status')->getCollection()->joinStates();\n $stateCollection->addFieldToFilter('main_table.status', [ 'like' => $status\n ]);\n $state = $stateCollection->getFirstItem()->getState();\n\n if ($state == 'processing' || $state == 'closed' || $state == 'complete') {\n // If there is already an invoice, update the invoice, not the order.\n $invoiceColl = $order->getInvoiceCollection();\n if ($invoiceColl->getSize() > 0) {\n foreach ($order->getInvoiceCollection() as $invoice) {\n $invoice->pay();\n $invoice->addComment($callbackid, false, false);\n self::mysave($invoice);\n }\n } else {\n $payment = $order->getPayment();\n $payment->capture(null);\n\n if ($callbackid) {\n $payment->setTransactionId($callbackid);\n $transaction = $payment->addTransaction(\n \\Magento\\Sales\\Model\\Order\\Payment\\Transaction::TYPE_CAPTURE);\n }\n }\n\n $history = $order->addStatusHistoryComment('' . $callbackid, $status);\n $order->save();\n } elseif ($state == 'canceled') {\n if ($callbackid) {\n $history = $order->addStatusHistoryComment('' . $callbackid, $status);\n }\n if ($order->canCancel()) {\n $order->cancel();\n }\n $order->setStatus($status);\n $order->save();\n } else {\n $history = $order->addStatusHistoryComment('' . $callbackid, $status);\n $order->save();\n }\n\n $om->get('\\Magento\\Framework\\Event\\Manager')->dispatch('komfortkasse_change_order_status_after',\n [ 'order' => $order,'status' => $status,'callbackid' => $callbackid\n ]);\n }",
"function fn_order_status_history_change_order_status($status_to, $status_from, $order_info, $force_notification, $order_statuses, $place_order) {\n\n db_query(\"INSERT INTO ?:order_status_history values (\". $order_info['order_id'] . \",\". Tygh::$app['session']['auth']['user_id'] . \", '\".$status_to.\"' , '\".$status_from.\"', \" . time() .\")\");\n\n return true;\n}",
"public function change_status(Request $request,$id)\n {\n $order = OnlineOrder::where('id',$id)->first();\n $data = [\n 'status' => $request->status\n ];\n $order->update($data);\n Notification::insert( [\n 'notification_message'=> 'Your Order number'.' '.$order->id.' '.'status is'.' '.$order->status,\n 'user_id'=> $order->user_id,\n 'status' => 0\n ]);\n return redirect('/admin/pending_orders')->with('message','The order status has been Added successfully');\n }",
"public function update_status();",
"public function update(Request $request, Order $order)\n {\n // $order->status = $request->status;\n if ($order->status == 'cooking') {\n $order->status = 'cooked';\n }\n else if ($order->status == 'wait') {\n $order->status = 'cooking';\n }\n $order->save();\n return $order;\n }",
"function ostUpdateOrderStatus( $statusID, $status_name, $sort_order, $color, $bold, $italic ){\r\n\r\n\tdb_phquery('\r\n\t\tUPDATE ?#ORDER_STATUSES_TABLE SET '.LanguagesManager::sql_prepareFieldUpdate('status_name', $status_name).',sort_order=?, color=?, bold=?, italic=? \r\n\t\tWHERE statusID=?', $sort_order, $color, (int)$bold, (int)$italic, $statusID);\r\n}",
"public function log ($transaction_id, $status, $order_id)\n\t{\n\t\t// See if we should update an existing order or insert a new one.\n\t\t$query = tep_db_query(\"SELECT status FROM \" . self::DB_PAYMENTS_TABLE . \" WHERE payment_id = '\" . tep_db_input($transaction_id) . \"' AND status = 'paid'\");\n\t\t$rows = tep_db_fetch_array($query);\n\n\t\tif ($rows > 0)\n\t\t{\n\t\t\ttep_db_query(\"UPDATE \" . self::DB_PAYMENTS_TABLE . \" SET status = '\" . tep_db_input($status) . \"' WHERE payment_id = '\" . tep_db_input($transaction_id) . \"' AND osc_order_id = '\" . tep_db_input($order_id) . \"'\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttep_db_query(\"INSERT INTO \" . self::DB_PAYMENTS_TABLE . \" (payment_id, status, osc_order_id) VALUES('\" . tep_db_input($transaction_id) . \"', '\" . tep_db_input($status) . \"', '\" . tep_db_input($order_id) . \"')\");\n\t\t}\n\t}",
"public static function update_pre_order_status( $order, $new_status, $message = '' ) {\n\n\t\tif ( ! $new_status )\n\t\t\treturn;\n\n\t\tif ( ! is_object( $order ) )\n\t\t\t$order = new WC_Order( $order );\n\n\t\t$old_status = get_post_meta( $order->id, '_wc_pre_orders_status', true );\n\n\t\tif ( $old_status == $new_status )\n\t\t\treturn;\n\n\t\tif ( ! $old_status )\n\t\t\t$old_status = 'new';\n\n\t\tupdate_post_meta( $order->id, '_wc_pre_orders_status', $new_status );\n\n\t\t// actions for status changes\n\t\tdo_action( 'wc_pre_order_status_' . $new_status, $order->id, $message );\n\t\tdo_action( 'wc_pre_order_status_' . $old_status . '_to_' . $new_status, $order->id, $message );\n\t\tdo_action( 'wc_pre_order_status_changed', $order->id, $old_status, $new_status, $message );\n\n\t\t// add order note\n\t\t$order->add_order_note( $message . sprintf( __( 'Pre-Order status changed from %s to %s.', WC_Pre_Orders::TEXT_DOMAIN ), $old_status, $new_status ) );\n\t}"
] |
[
"0.736455",
"0.7322992",
"0.72940147",
"0.7285173",
"0.7202688",
"0.7139754",
"0.71305275",
"0.70694214",
"0.706809",
"0.706809",
"0.70668226",
"0.7034108",
"0.7005594",
"0.6966853",
"0.696341",
"0.6956363",
"0.6949814",
"0.6934086",
"0.6924498",
"0.6900451",
"0.68450713",
"0.6829488",
"0.682508",
"0.6815198",
"0.6796324",
"0.67888767",
"0.67725474",
"0.67285687",
"0.6727242",
"0.67090815"
] |
0.76652384
|
0
|
Set the order "should be ready" date if order is new (meaning the order has been paid)
|
public function updateOrderReadyDate(OrderEvent $event)
{
$order = $event->getOrder();
if (Order::STATUS_NEW === (int)$order->getStatus()) {
// get default production time setting value
$productionTime = $this->entityManager->getRepository('AppBundle:Setting')->findOneByKey(Setting::DEFAULT_PRODUCTION_TIME)->getValue();
// if order is related to a quotation, get the production time from the quotation instead
if (null !== $order->getQuotation()) {
$productionTime = $order->getQuotation()->getProductionTime();
}
// RUN-IMP-4: -1 on production time
if (1 <= $productionTime) {
$productionTime--;
}
// set the date when the order should be ready, depending on production time and starting from now (meaning the order has been paid)
$shouldBeReadyAt = $order->getShouldBeReadyDate($productionTime, new \DateTime('now', new \DateTimeZone('UTC')));
$order->setShouldBeReadyAt($shouldBeReadyAt);
// flush
$this->entityManager->flush();
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testCreateFromOrderShouldSetTheDateToInvoice()\n {\n $order = new Order();\n $invoice = $this->invoiceFactory->createFromOrder($order);\n $invoiceDate = $invoice->getInvoiceDate()->format('Y-m-d H:i:s');\n $currentDate = (new \\DateTime())->format('Y-m-d H:i:s');\n static::assertEquals($currentDate, $invoiceDate);\n }",
"public function markPaid()\n {\n $this->order->update(['status' => OrderStatus::PAID]);\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order is marked as paid.'),\n ]);\n }",
"function setDueDate( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->DueDate = $value;\n }",
"public function markAsActivate() : bool\n {\n $this->is_active = 1;\n $this->paid = 1;\n //$this->grace_period_ends = new RawValue('NULL');\n $this->ends_at = null; //new rawValue('NULL');\n $this->next_due_payment = $this->ends_at;\n $this->is_cancelled = 0;\n return $this->update();\n }",
"public function setOrderDate($date)\n {\n $this->order_date = $date;\n }",
"public function is_order_ready( WC_Order $order ) {\n\n\t\t// Assume it's not ready\n\t\t$is_ready = false;\n\n\t\t// Only continue checking if the order hasn't already been sent to AvaTax\n\t\tif ( ! $this->is_order_posted( $order ) ) {\n\n\t\t\t$status = $order->get_status();\n\n\t\t\t/**\n\t\t\t * Filter the order statuses that allow manual order sending.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t * @param array $ready_statuses The valid statuses.\n\t\t\t */\n\t\t\t$ready_statuses = apply_filters( 'wc_avatax_order_ready_statuses', array(\n\t\t\t\t'processing',\n\t\t\t\t'completed',\n\t\t\t) );\n\n\t\t\t// See if the order has one of the ready statuses\n\t\t\t$is_ready = in_array( $status, $ready_statuses );\n\n\t\t\t// If not, and Order Status Manager is active, then check the status' paid property\n\t\t\tif ( class_exists( 'WC_Order_Status_Manager_Order_Status' ) && ! $is_ready ) {\n\n\t\t\t\t$status = new WC_Order_Status_Manager_Order_Status( $status );\n\n\t\t\t\t$is_ready = ( $status->get_id() > 0 && ! $status->is_core_status() && $status->is_paid() );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filter whether an order is ready to be sent to AvaTax.\n\t\t *\n\t\t * @since 1.0.0\n\t\t * @param bool $is_ready\n\t\t * @param int $order_id The order ID\n\t\t */\n\t\treturn apply_filters( 'wc_avatax_order_is_ready', $is_ready, SV_WC_Order_Compatibility::get_prop( $order, 'id' ) );\n\t}",
"public function appliesForReminder(Mage_Sales_Model_Order $order)\n {\n $reminderDays = $this->config->getPaymentReminderDays();\n $dateNow = new \\DateTime();\n\n try {\n $orderReminderDate = new \\DateTime($order->getCreatedAt());\n $orderReminderDate->add(\n new \\DateInterval(\"P{$reminderDays}D\")\n );\n $isOldEnough = $orderReminderDate->getTimestamp() < $dateNow->getTimestamp();\n } catch(\\Exception $exception) {\n $isOldEnough = false;\n Mage::logException($exception);\n }\n\n $reminderSend = $order->getPayment()->getAdditionalInformation('reminder_sent') === 1;\n\n return $isOldEnough && !$reminderSend;\n }",
"function pay_renew_order($original_order_id) {\n\n\t$wait_order_id = allocate_renew_order($original_order_id);\n\tif ($wait_order_id !== false) {\n\t\t$sql = \"UPDATE orders set status='renew_paid' WHERE order_id='$wait_order_id' and status='renew_wait' \";\n\t\tmysql_query($sql) or die(mysql_error());\n\t\t\n\t}\n\n\tif (mysql_affected_rows()>0) { \n\t\treturn true;\n\t\t# this order will now wait until the old one expires so it can be completed\n\t} else { \n\t\treturn false;\n\t}\n\n\n}",
"public function fulfillOrder($order_id)\n {\n $order = $this->db->prepare(<<<SQL\nUPDATE orders SET arrival_date = NOW() WHERE orders.order_id = :order_id;\nSQL\n );\n $order->execute(array(':order_id' => $order_id));\n}",
"public function markInvoiceAsReady() {\n return $this->invoiceHistory->markAsReady();\n }",
"public function pastDue() : bool\n {\n return $this->stripe_status === StripeSubscription::STATUS_PAST_DUE;\n }",
"function confirm(&$order)\n\t\t{\n\t\t\tif(pmpro_isLevelRecurring($order->membership_level))\n\t\t\t{\n\t\t\t\t$order->ProfileStartDate = date_i18n(\"Y-m-d\", strtotime(\"+ \" . $order->BillingFrequency . \" \" . $order->BillingPeriod, current_time(\"timestamp\"))) . \"T0:0:0\";\n\t\t\t\t$order->ProfileStartDate = apply_filters(\"pmpro_profile_start_date\", $order->ProfileStartDate, $order);\n\t\t\t\treturn $this->subscribe($order);\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn $this->charge($order);\n\t\t}",
"public function setPaid()\n {\n $this->update([\n 'status' => self::STATUS_PAID,\n 'paid_date' => Carbon::now(),\n ]);\n }",
"private function setOrderAsPending($order){\r\n $this->log('Setting as pending order #'.$order->get_order_number());\r\n //Since the default status of the order is pending, we only add a note here.\r\n $this->addOrderNote($order, 'La orden se encuentra pendiente.');\r\n }",
"public function isDue(): bool\n {\n $this->schedule($this->event());\n\n return $this->event->isDue(app());\n }",
"function checkSubscriptionRenewal($order)\n {\n $plan = & $order['PaidOrder']['plan_info']['plan_array'];\n if($order['PaidOrder']['order_status'] == 'Complete') /* The order had already been procesed in the past */\n {\n $PaidTxnLog = ClassRegistry::getClass('PaidTxnLogModel');\n $PaidTxnLog->addNote(\"Subscription Renewal\");\n $new_expiration = PaidOrderModel::getExpirationDate($plan['duration_period'],$plan['duration_number'],$order['PaidOrder']['order_expires']);\n $order['PaidOrder']['order_expires'] = $new_expiration;\n $plan['moderation'] = 0; // If it was published before no need to moderate it again\n }\n\n return $order;\n }",
"public static function updateChargingStatusChangeDates( $order )\n {\n $chargingStatus = $order -> charging_status;\n $orderChargingStatusChargeDates = $order -> charging_status_change_dates; \n \n $isSet = @ $orderChargingStatusChargeDates [ $chargingStatus ];\n if( ! $isSet )\n {\n $orderChargingStatusChargeDates [ $chargingStatus ] = self :: now();\n $order -> charging_status_change_dates = $orderChargingStatusChargeDates;\n }\n }",
"function payment_complete( $order ){\n\n if( $order->status == 'processing' ){\n\n $order->update_status( 'completed' );\n\n add_post_meta( $order->id, '_paid_date', current_time('mysql'), true );\n\n $this_order = array(\n 'ID' => $order->id,\n 'post_date' => current_time( 'mysql', 0 ),\n 'post_date_gmt' => current_time( 'mysql', 1 )\n );\n wp_update_post( $this_order );\n \n if ( apply_filters( 'woocommerce_payment_complete_reduce_order_stock', true, $order->id ) ) {\n $order->reduce_order_stock(); // Payment is complete so reduce stock levels\n }\n\n do_action( 'woocommerce_payment_complete', $order->id );\n }\n }",
"public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }",
"public function isReadyForIssuing()\n {\n return $this->isFeePaid();\n }",
"public function bergenStatusAction()\r\n {\r\n if ($order = $this->_initOrder()) {\r\n try {\r\n $order->setData('sync_bergen_status',1)->save();\r\n $this->_getSession()->addSuccess(\r\n $this->__('The order has been ready for bergen.')\r\n );\r\n }\r\n catch (Mage_Core_Exception $e) {\r\n $this->_getSession()->addError($e->getMessage());\r\n }\r\n catch (Exception $e) {\r\n $this->_getSession()->addError($this->__('The order was not ready for bergen.'));\r\n }\r\n }\r\n $this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));\r\n }",
"function setDateCompleted($dateCompleted) {\n\t\t$this->setData('dateCompleted', $dateCompleted);\n\t}",
"public function setReadyDate($timestamp = null)\n {\n $this->_ready_date = $this->_helper->getReadyDate($timestamp);\n return $this;\n }",
"public function fulfill()\n {\n $this->status = true;\n\n $this->save();\n\n $this->user->notify(new OrderFulfilled($this));\n }",
"public function resetorder()\n {\n $oOrder = oxNew(\"oxorder\");\n if ($oOrder->load($this->getEditObjectId())) {\n $oOrder->oxorder__oxsenddate = new oxField(\"0000-00-00 00:00:00\");\n $oOrder->save();\n }\n }",
"public static function setChargingStatusInitialDates( $order ) \n {\n $availableOrderStatuses = OrderStatusEnum :: getConstantsValues();\n $initialStatuses = [];\n\n foreach( $availableOrderStatuses as $status )\n {\n $initialStatuses [ $status ] = null;\n }\n\n $order -> charging_status_change_dates = $initialStatuses;\n }",
"public function markAsPaid() {\n $this->status = parent::STATUS_PAID;\n $this->admin_id = Yii::app()->user->getId();\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }",
"public static function getNextDueDate() {\n }",
"public function isDue(): bool;",
"function may_be_complete_order( $next_step_id, $order_id ) {\n\n\t\twcf()->logger->log( 'Entering: ' . __CLASS__ . '::' . __FUNCTION__ );\n\n\t\t$template_type = get_post_meta( $next_step_id, 'wcf-step-type', true );\n\n\t\tif ( 'thankyou' === $template_type ) {\n\n\t\t\t$order = wc_get_order( $order_id );\n\n\t\t\twcf_pro()->order->may_be_normalize_status( $order );\n\t\t}\n\t}"
] |
[
"0.6325768",
"0.6152137",
"0.59336364",
"0.59054756",
"0.590117",
"0.58485246",
"0.584538",
"0.58111256",
"0.5808002",
"0.5806396",
"0.57667124",
"0.5765419",
"0.5737234",
"0.57244974",
"0.57180166",
"0.56955546",
"0.5655995",
"0.5653298",
"0.5648826",
"0.5646495",
"0.55943406",
"0.5587343",
"0.55812657",
"0.55740964",
"0.5573134",
"0.55673915",
"0.55526733",
"0.5513743",
"0.55011487",
"0.5478961"
] |
0.7658932
|
0
|
Set the order token
|
public function setTokenOrder (OrderEvent $event)
{
$order = $event->getOrder();
$token = $this->tokenGenerator->generateToken();
$order->setToken($token);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function setOrder(?string $order): void\n {\n $this->order = $order;\n }",
"public function setOrder(?string $order): void\n {\n $this->order = $order;\n }",
"public function setOrder(string $order): void\n {\n $this->_order = $order;\n }",
"function mORDER(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$ORDER;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:161:3: ( 'order' ) \n // Tokenizer11.g:162:3: 'order' \n {\n $this->matchString(\"order\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"function setOrder($order);",
"function setOrder($order){\n\t\t$this->order=$order;\n\t}",
"function setToken($token)\n {\n $this->token = $token;\n }",
"private function SetOrderData()\n\t\t{\n\t\t\t// doesn't factor in cookies stored by Interspire Shopping Cart, so we have to pass back the\n\t\t\t// order token manually from those payment providers. We do this by taking the\n\t\t\t// cart ID passed back from the provider which stores the order's unique token.\n\t\t\tif(isset($_COOKIE['SHOP_ORDER_TOKEN'])) {\n\t\t\t\t$this->orderToken = $_COOKIE['SHOP_ORDER_TOKEN'];\n\t\t\t}\n\t\t\telse if(isset($_REQUEST['provider'])) {\n\t\t\t\tGetModuleById('checkout', $this->paymentProvider, $_REQUEST['provider']);\n\n\t\t\t\tif(in_array(\"GetOrderToken\", get_class_methods($this->paymentProvider))) {\n\t\t\t\t\t$this->orderToken = $this->paymentProvider->GetOrderToken();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tob_end_clean();\n\t\t\t\t\theader(sprintf(\"Location:%s\", $GLOBALS['ShopPath']));\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Load the pending orders from the database\n\t\t\t$this->pendingData = LoadPendingOrdersByToken($this->orderToken, true);\n\t\t\tif(!$this->orderToken || $this->pendingData === false) {\n\t\t\t\t$this->BadOrder();\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tif($this->paymentProvider === null) {\n\t\t\t\tGetModuleById('checkout', $this->paymentProvider, $this->pendingData['paymentmodule']);\n\t\t\t}\n\n\t\t\tif($this->paymentProvider) {\n\t\t\t\t$this->paymentProvider->SetOrderData($this->pendingData);\n\t\t\t}\n\t\t}",
"public function setOrderId(?string $orderId): void\n {\n $this->orderId['value'] = $orderId;\n }",
"public function setOrder($order);",
"public function setToken($token){\n $this->token = $token;\n }",
"public function setToken($token);",
"public function setToken(string $token): void;",
"public function setToken(string $token): void\n {\n $this->token = $token;\n }",
"function setOrder( $order )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n if ( get_class( $order ) == \"ezorder\" )\n {\n $this->OrderID = $order->id();\n } \n }",
"public function setToken($token): void\n {\n $this->token = $token;\n }",
"public function setOrder ($value)\r\n\t{\r\n\t\t$this->order = $value;\r\n\t}",
"public function setOrder(\\Magento\\Sales\\Model\\Order $order);",
"public function set($token);",
"public function setToken($token)\n {\n $this->token = $token;\n }",
"public function setToken($token)\n {\n $this->token = $token;\n }",
"abstract public function setOrder(OrderModel $order);",
"public function setOrder($str) { $this->val .= ' ' . $str; }",
"function setToken($_token) {\n $this->token = $_token;\n return $this;\n }",
"private function _addCreateTokenElement($order)\n {\n if (! $this->tokenRequestConfig->istokenizationIsEnabled()) {\n return;\n }\n\n $createTokenElement = $order->addChild('createToken');\n $createTokenElement['tokenScope'] = self::TOKEN_SCOPE;\n\n if ($this->tokenRequestConfig->getTokenReason($this->orderCode)) {\n $createTokenElement->addChild(\n 'tokenReason',\n $this->tokenRequestConfig->getTokenReason($this->orderCode)\n );\n }\n }",
"public function setOrder($Order)\n {\n $this->__set(\"order\", $Order);\n }",
"public function setOrder($name)\n {\n $this->order = $name;\n }",
"public static function setToken($token)\n {\n self::$_data[self::KEY_TOKEN] = $token;\n }",
"public function setPreviousToken() {\n\t\t$this->_token = $this->_previousToken;\n\t\t$this->_session->key = $this->_previousToken;\n\t}",
"private function set_token_used()\n {\n update_post_meta($this->token_post['ID'], \"zbyva_hlasu\", 0);\n update_post_meta($this->token_post['ID'], \"hlasovani_zacatek\", $this->voting_start);\n update_post_meta($this->token_post['ID'], \"hlasovani_konec\", $this->voting_end);\n }"
] |
[
"0.70330596",
"0.70330596",
"0.69468534",
"0.68811363",
"0.6853178",
"0.6805746",
"0.6695317",
"0.6638474",
"0.65774786",
"0.6557135",
"0.6554236",
"0.655415",
"0.6502474",
"0.6453982",
"0.6441751",
"0.6427831",
"0.63958836",
"0.63925433",
"0.6390322",
"0.63764083",
"0.63764083",
"0.6171813",
"0.6164628",
"0.60996807",
"0.6053534",
"0.59711635",
"0.5963459",
"0.59581226",
"0.5957287",
"0.5947269"
] |
0.8012213
|
0
|
Send email notifications upon order status update
|
public function sendStatusUpdateNotifications(OrderEvent $event)
{
$order = $event->getOrder();
switch ($order->getStatus()) {
case Order::STATUS_AWAITING_SEPA:
// send customer e-mail
$customerEmailVars = array(
'customerName' => $order->getCustomer()->getFullname(),
'orderReference' => $order->getReference(),
'orderDate' => $order->getCreatedAt()->setTimezone(new \DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),
'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),
'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),
'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)
);
$this->sendinBlue->sendTransactional(
SendinBlue::TEMPLATE_ID_ORDER_AWAITING_SEPA,
$order->getCustomer()->getEmail(),
$order->getCustomer()->getFullname(),
$customerEmailVars
);
break;
case Order::STATUS_NEW:
// get payment
$payment = $order->getPayments()->first();
// is transport
$isTransport = true;
if (Shipping::TYPE_NOT_SHIPPED === $order->getShippingType()) {
$isTransport = false;
}
// send customer e-mail
$customerEmailVars = array(
'customerName' => $order->getCustomer()->getFullname(),
'invoiceUrl' => $this->router->generate('order_invoice_download', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),
'orderReference' => $order->getReference(),
'orderDate' => $order->getCreatedAt()->setTimezone(new \DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),
'paymentId' => $payment->getChargeId(),
'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),
'BoolTransport' => $isTransport,
'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),
'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),
'expectedDeliveryDate' => null !== $order->getExpectedDeliveryDate() ? $order->getExpectedDeliveryDate()->setTimezone(new \DateTimeZone('Europe/Paris'))->format('d/m/Y') : '',
'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)
);
$this->sendinBlue->sendTransactional(
SendinBlue::TEMPLATE_ID_ORDER_CONFIRMATION_CUSTOMER,
$order->getCustomer()->getEmail(),
$order->getCustomer()->getFullname(),
$customerEmailVars
);
// send maker e-mail
$makerEmailVars = array(
'makerName' => $order->getMaker()->getFullname(),
'orderReference' => $order->getReference(),
'orderDate' => $order->getCreatedAt()->setTimezone(new \DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),
'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),
'BoolTransport' => $isTransport,
'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),
'shippingLimitDate' => null !== $order->getShouldBeReadyAt() ? $order->getShouldBeReadyAt()->setTimezone(new \DateTimeZone('Europe/Paris'))->format('d/m/Y') . ' avant 17h' : '',
'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountForMakerTaxIncl() / 100), 2)// only display production amount - coupon amount to maker
);
$this->sendinBlue->sendTransactional(
SendinBlue::TEMPLATE_ID_ORDER_CONFIRMATION_MAKER,
$order->getMaker()->getUser()->getEmail(),
$order->getMaker()->getFullname(),
$makerEmailVars
);
break;
case Order::STATUS_CANCELED:
// order has been canceled by the customer
if (OrderEvent::ORIGIN_CUSTOMER === $event->getOrigin()) {
// get order payment id
$paymentId = 'n/a';
$payments = $order->getPayments();
if (0 < count($payments)) {
/** @var Payment $payment */
$payment = $payments[0];
$paymentId = $payment->getChargeId();
}
// send customer e-mail
$customerEmailVars = array(
'customerName' => $order->getCustomer()->getFullname(),
'orderReference' => $order->getReference(),
'orderDate' => $order->getCreatedAt()->setTimezone(new \DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),
'paymentId' => $paymentId,
'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),
'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)
);
$this->sendinBlue->sendTransactional(
SendinBlue::TEMPLATE_ID_ORDER_CANCELLATION_CUSTOMER,
$order->getCustomer()->getEmail(),
$order->getCustomer()->getFullname(),
$customerEmailVars
);
// send maker e-mail
$makerEmailVars = array(
'makerName' => $order->getMaker()->getFullname(),
'orderReference' => $order->getReference(),
'orderDate' => $order->getCreatedAt()->setTimezone(new \DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),
'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountForMakerTaxIncl() / 100), 2)// only display production amount - coupon amount to maker
);
$this->sendinBlue->sendTransactional(
SendinBlue::TEMPLATE_ID_ORDER_CANCELLATION_MAKER,
$order->getMaker()->getUser()->getEmail(),
$order->getMaker()->getFullname(),
$makerEmailVars
);
}
break;
case Order::STATUS_TRANSIT:
// get shipment
$shipments = $order->getShipments();
/** @var Shipment $shipment */
$shipment = $shipments[0];
// send customer e-mail
$emailVars = array(
'customerName' => $order->getCustomer()->getFullname(),
'orderReference' => $order->getReference(),
'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),
'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),
'trackingUrl' => $shipment->getTrackingUrl(),
'trackingNumber' => $shipment->getParcelNumber(),
'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),
'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)
);
$this->sendinBlue->sendTransactional(
SendinBlue::TEMPLATE_ID_ORDER_SHIPPED,
$order->getCustomer()->getEmail(),
$order->getCustomer()->getFullname(),
$emailVars
);
break;
case Order::STATUS_READY_FOR_PICKUP:
// send customer e-mail
$emailVars = array(
'customerName' => $order->getCustomer()->getFullname(),
'orderReference' => $order->getReference(),
'orderDate' => $order->getCreatedAt()->setTimezone(new \DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),
'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),
'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),
'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),
'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)
);
$this->sendinBlue->sendTransactional(
SendinBlue::TEMPLATE_ID_ORDER_READY_FOR_PICKUP,
$order->getCustomer()->getEmail(),
$order->getCustomer()->getFullname(),
$emailVars
);
break;
case Order::STATUS_REFUNDED:
// get order payment id
$paymentId = 'n/a';
$payments = $order->getPayments();
if (0 < count($payments)) {
/** @var Payment $payment */
$payment = $payments[0];
$paymentId = $payment->getChargeId();
}
// get order refund id
$refundId = 'n/a';
$refunds = $order->getRefunds();
if (0 < count($refunds)) {
/** @var Refund $refund */
$refund = $refunds[0];
$refundId = $refund->getRefundId();
}
// send customer e-mail
$customerEmailVars = array(
'customerName' => $order->getCustomer()->getFullname(),
'orderReference' => $order->getReference(),
'orderDate' => $order->getCreatedAt()->setTimezone(new \DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),
'paymentId' => $paymentId,
'refundId' => $refundId,
'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)
);
$this->sendinBlue->sendTransactional(
SendinBlue::TEMPLATE_ID_ORDER_REFUNDED,
$order->getCustomer()->getEmail(),
$order->getCustomer()->getFullname(),
$customerEmailVars
);
break;
case Order::STATUS_DELIVERED:
// send customer e-mail
/* There is no longer any immediate notification sending when the order is delivered. The notification is made on D + 1 via the reminder system
$customerEmailVars = array(
'customerName' => $order->getCustomer()->getFullname(),
'orderReference' => $order->getReference(),
//'ratingUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL) . '#rating'
'ratingUrl' => $this->router->generate('order_rating', array('token' => $order->getToken()), $this->router::ABSOLUTE_URL) . '#rating'
);
$this->sendinBlue->sendTransactional(
SendinBlue::TEMPLATE_ID_ORDER_RATING,
$order->getCustomer()->getEmail(),
$order->getCustomer()->getFullname(),
$customerEmailVars
);
*/
break;
case Order::STATUS_CLOSED:
if ($order->getRating()->getEnabled() == True ) {
// send maker e-mail
$makerEmailVars = array(
'makerName' => $order->getMaker()->getFullname(),
'orderReference' => $order->getReference(),
'orderDate' => $order->getCreatedAt()->setTimezone(new \DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),
'orderRateValue' => $order->getRating()->getRate(),
'orderRateValue' => $order->getRating()->getComment(),
'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)
);
$this->sendinBlue->sendTransactional(
SendinBlue::TEMPLATE_ID_ORDER_RATE,
$order->getMaker()->getUser()->getEmail(),
$order->getMaker()->getFullname(),
$makerEmailVars
);
}
break;
case Order::STATUS_FILE_AVAILABLE:
// send customer e-mail
$customerEmailVars = array(
'customerName' => $order->getCustomer()->getFullname(),
'orderReference' => $order->getReference(),
'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)
);
$this->sendinBlue->sendTransactional(
SendinBlue::TEMPLATE_ID_ORDER_FILE_AVAILABLE_CUSTOMER,
$order->getCustomer()->getEmail(),
$order->getCustomer()->getFullname(),
$customerEmailVars
);
break;
case Order::STATUS_FILE_REJECTED:
// send maker e-mail
$makerEmailVars = array(
'makerName' => $order->getMaker()->getFullname(),
'orderReference' => $order->getReference(),
'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)
);
$this->sendinBlue->sendTransactional(
SendinBlue::TEMPLATE_ID_ORDER_FILE_REJECTED_MAKER,
$order->getMaker()->getUser()->getEmail(),
$order->getMaker()->getFullname(),
$makerEmailVars
);
break;
case Order::STATUS_FILE_VALIDATED:
// send maker e-mail
$makerEmailVars = array(
'makerName' => $order->getMaker()->getFullname(),
'orderReference' => $order->getReference(),
'BoolTransport' => $order->getQuotation()->getProject()->getType()->isShipping(),
'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)
);
$this->sendinBlue->sendTransactional(
SendinBlue::TEMPLATE_ID_ORDER_FILE_VALIDATED_MAKER,
$order->getMaker()->getUser()->getEmail(),
$order->getMaker()->getFullname(),
$makerEmailVars
);
break;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function sendOrderChangeNotification()\n {\n if ($this->getSendNotificationFlag()) {\n \\XLite\\Core\\Mailer::getInstance()->sendOrderAdvancedChangedCustomer($this->getOrder());\n }\n }",
"public function updated(Order $order)\n\t{\n\t\t$oldStatus = $order->getOriginal();\n\t\tif ($order->status_id != $oldStatus['status_id'] && $order->status->notification != 0) {\n\t\t\t// example of usage: (be sure that a notification template mail with the slug \"example-slug\" exists in db)\n\t\t\treturn Mail::to($order->user->email)->send(new NotificationTemplateMail($order, \"order-status-changed\"));\n\t\t}\n\t}",
"public function onAfterWrite() {\n parent::onAfterWrite();\n\n // Check if an order number has been generated, if not, add it and save again\n if(!$this->OrderNumber) {\n $this->OrderNumber = $this->generate_order_number();\n $this->write();\n }\n\n // Deal with sending the status email\n if($this->isChanged('Status') && in_array($this->Status, array('failed','paid','processing','dispatched')) ) {\n $siteconfig = SiteConfig::current_site_config();\n\n $from = $siteconfig->EmailFromAddress;\n\n $vars = array(\n 'Order' => $this,\n 'SiteConfig' => $siteconfig\n );\n\n // Deal with customer email\n if($siteconfig->sendCommerceEmail('Customer', $this->Status)) {\n // if subsites installed, then get the native language for that site\n $current_i18n = i18n::get_locale();\n if($this->SubsiteID && class_exists('Subsite') && $this->Subsite())\n i18n::set_locale($this->Subsite()->Language);\n\n $subject = _t('CommerceEmail.Order', 'Order') . \" {$this->OrderNumber} {$this->getTranslatedStatus()}\";\n\n $body = $this->renderWith('OrderEmail_Customer', $vars);\n $email = new Email($from,$this->Email,$subject,$body);\n $email->sendPlain();\n\n // If subsites enabled, set the language back\n if($this->SubsiteID && class_exists('Subsite') && $this->Subsite())\n i18n::set_locale($current_i18n);\n }\n\n // Deal with vendor email\n if($siteconfig->sendCommerceEmail('Vendor', $this->Status)) {\n $subject = _t('CommerceEmail.Order', 'Order') . \" {$this->OrderNumber} {$this->getTranslatedStatus()}\";\n switch($this->Status) {\n case 'paid':\n $email_to = $siteconfig->PaidEmailAddress;\n case 'processing':\n $email_to = $siteconfig->ProcessingEmailAddress;\n case 'dispatched':\n $email_to = $siteconfig->DispatchedEmailAddress;\n }\n\n if(isset($email_to)) {\n $body = $this->renderWith('OrderEmail_Vendor', $vars);\n $email = new Email($from,$email_to,$subject,$body);\n $email->sendPlain();\n }\n }\n\n\n }\n }",
"public function salesOrderSaveAfter($observer)\n\t{\n\t\t// Get the settings\n\t\t$settings = Mage::helper('smsnotifications/data')->getSettings();\n\n\t\t// Get the new order object\n\t\t$order = $observer->getEvent()->getOrder();\n\n\t\t// Get the old order data\n\t\t$oldOrder = $order->getOrigData();\n\n\t\t// If the order status hasn't changed, don't do anything\n\t\tif($oldOrder['status'] === $order->getStatus()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the order status has changed, check if a notification should be sent\n\t\t// for the new status. If not, don't do anything\n\t\tif($order->getStatus() !== $settings['order_notification_status']) {\n\t\t\treturn;\n\t\t}\n\n\t\tMage::log('sending', null, 'm.txt');\n\n\t\t// Generate the body for the notification\n\t\t$store_name = Mage::app()->getStore()->getFrontendName();\n\t\t$customer_name = $order->getCustomerFirstname();\n\t\t$customer_name .= ' ' . $order->getCustomerLastname();\n\t\t$order_amount = $order->getBaseCurrencyCode();\n\t\t$order_amount .= ' ' . $order->getBaseGrandTotal();\n\n\t\t$body = sprintf('%s: %s has just placed an order for %s', $store_name, $customer_name, $order_amount);\n\n\t\t// If no recipients have been set, we can't do anything\n\t\tif(!count($settings['order_noficication_recipients'])) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Send the order notification by SMS\n\t\t$result = Mage::helper('smsnotifications/data')->sendSms($body, $settings['order_noficication_recipients']);\n\n\t\t// Check if the sending was successful\n\t\tif(!$result) {\n\t\t\t// If an error occured, notify the administrator\n\t\t\tMage::helper('smsnotifications/data')->sendAdminEmail(sprintf('%s was unable to send one or more order notifications to the specified number(s). Please check your configuration to make sure that your Twilio API settings are correct!', Mage::helper('smsnotifications/data')->app_name));\n\t\t}\n\t}",
"public function updateOrder($order)\n { \n event(new UpdateOrderNotification([\n 'id' => $order->id,\n 'status' => $order->status,\n ]));\n }",
"public function update(Request $request, Order $order)\n {\n // dd($order);\n $order->status = $request->status;\n $order->save();\n\n if ($request->status == 1) {\n $details = [\n 'title' => 'Order Confirmed',\n 'customer_name' => $order->user->name,\n 'voucher_no' => $order->voucherno,\n 'order_date' => $order->orderdate,\n 'total' => $order->total,\n 'items' => $order->items\n ];\n } else {\n $details = [\n 'title' => 'Order Cancelled',\n 'customer_name' => $order->user->name\n ];\n }\n\n\n $receiver_email = $order->user->email;\n \\Mail::to($receiver_email)->send(new \\App\\Mail\\MyMail($details));\n\n return redirect()->route('order.index');\n }",
"public function update_status($order_id, $payment_status)\n\t{\n\t\t$new_status_id = static::get_status_id($payment_status);\n\n\t\t$order_updated = false;\n\t\t$check_status_query = tep_db_query(\"select customers_name, customers_email_address, orders_status, date_purchased from \" . TABLE_ORDERS . \" where orders_id = '\" . intval($order_id) . \"'\");\n\t\t$check_status = tep_db_fetch_array($check_status_query);\n\t\t$customer_notified = '0';\n\n\t\tif ( $new_status_id && $check_status['orders_status'] != $new_status_id ) \n\t\t{\n\t\t\tif ( $this->get_status_notify($payment_status) ) \n\t\t\t{\n\t\t\t\t$internal_status = $this->get_internal_status_name_from_id($new_status_id);\n\n\t\t\t\t$email = STORE_NAME . \"\\n\" .\n\t\t\t\t\t\"------------------------------------------------------\\n\" .\n\t\t\t\t\t'Order Number: ' . $order_id . \"\\n\" .\n\t\t\t\t\t'Detailed Invoice: ' . tep_href_link(\"account_history_info.php\", 'order_id=' . $order_id, 'SSL') . \"\\n\" .\n\t\t\t\t\t'Date Ordered: ' . tep_date_long($check_status['date_purchased']) . \"\\n\\n\" .\n\t\t\t\t\t'Your order has been updated to the following status.' . \"\\n\\n\" .\n\t\t\t\t\t'New status: ' . $internal_status . \"\\n\\n\" .\n\t\t\t\t\t'Please reply to this email if you have any questions.' . \"\\n\";\n\n\t\t\t\ttep_mail($check_status['customers_name'], $check_status['customers_email_address'], \"Order Update\", $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);\n\t\t\t\t$customer_notified = '1';\n\t\t\t}\n\n\t\t\t// Only update order status when order_status is different then the saved order_status\n\t\t\ttep_db_query(\"UPDATE orders SET orders_status = '\" . $new_status_id . \"', last_modified = now() WHERE orders_id = \" . intval($order_id));\n\t\t\t$this->add_order_history($order_id, $payment_status, $customer_notified);\n\t\t}\n\t}",
"function deliverOrder($orderNum)\n\t\t{\n\t\t\t$db = dbConnect::getInstance();\n \t\t $mysqli = $db->getConnection();\n\t\t\t $query = \" update check_tb set status = '2' where id='\".$orderNum.\"' \"; \n $res=$mysqli->query($query) or die (mysqli_error($mysqli));\n $mysqli->query(\"CREATE EVENT updateStatus\".$orderNum.\" ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 MINUTE DO \n \tupdate check_tb set status = '1' where id='\".$orderNum.\"' ;\n \t\") or die (mysqli_error($mysqli));\n\t\t\tif($res)\n\t\t\t{\n\n\t\t\t\treturn true;\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\t\n\t\t\t}\n\t\t}",
"public function sendConfirmationEmail($order_id, $order_status_id, $comment = '', $notify = false)\n {\n \n $this->load->model('checkout/order');\n $order_info = $this->model_checkout_order->getOrder($order_id);\n $this->language->load('mail/payment_failed');\n\n \n\n\t\tif ($order_info && !$order_info['order_status_id']) {\n\n\t\t\t// Fraud Detection\n\n\t\t\tif ($this->config->get('config_fraud_detection')) {\n\n\t\t\t\t$this->load->model('checkout/fraud');\n\n\t\t\t\t\n\n\t\t\t\t$risk_score = $this->model_checkout_fraud->getFraudScore($order_info);\n\n\t\t\t\t\n\n\t\t\t\tif ($risk_score > $this->config->get('config_fraud_score')) {\n\n\t\t\t\t\t$order_status_id = $this->config->get('config_fraud_status_id');\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\n\t\t\t// Ban IP\n\n\t\t\t$status = false;\n\n\t\t\t\n\n\t\t\t$this->load->model('account/customer');\n\n\t\t\t\n\n\t\t\tif ($order_info['customer_id']) {\n\n\t\t\t\t$results = $this->model_account_customer->getIps($order_info['customer_id']);\n\n\t\t\t\t\n\n\t\t\t\tforeach ($results as $result) {\n\n\t\t\t\t\tif ($this->model_account_customer->isBanIp($result['ip'])) {\n\n\t\t\t\t\t\t$status = true;\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t$status = $this->model_account_customer->isBanIp($order_info['ip']);\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\tif ($status) {\n\n\t\t\t\t$order_status_id = $this->config->get('config_order_status_id');\n\n\t\t\t}\t\t\n\n\t\t\t\t\n\n\t\t\t$this->db->query(\"UPDATE `\" . DB_PREFIX . \"order` SET order_status_id = '\" . (int)$order_status_id . \"', date_modified = NOW() WHERE order_id = '\" . (int)$order_id . \"'\");\n\n\n\n\t\t\t$this->db->query(\"INSERT INTO \" . DB_PREFIX . \"order_history SET order_id = '\" . (int)$order_id . \"', order_status_id = '\" . (int)$order_status_id . \"', notify = '1', comment = '\" . $this->db->escape(($comment && $notify) ? $comment : '') . \"', date_added = NOW()\");\n\n\n\n\t\t\t$order_product_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"order_product WHERE order_id = '\" . (int)$order_id . \"'\");\n\n\t\t\t\n\n\t\t\tforeach ($order_product_query->rows as $order_product) {\n\n\t\t\t\t$this->db->query(\"UPDATE \" . DB_PREFIX . \"product SET quantity = (quantity - \" . (int)$order_product['quantity'] . \") WHERE product_id = '\" . (int)$order_product['product_id'] . \"' AND subtract = '1'\");\n\n\t\t\t\t\n\n\t\t\t\t$order_option_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"order_option WHERE order_id = '\" . (int)$order_id . \"' AND order_product_id = '\" . (int)$order_product['order_product_id'] . \"'\");\n\n\t\t\t\n\n\t\t\t\tforeach ($order_option_query->rows as $option) {\n\n\t\t\t\t\t$this->db->query(\"UPDATE \" . DB_PREFIX . \"product_option_value SET quantity = (quantity - \" . (int)$order_product['quantity'] . \") WHERE product_option_value_id = '\" . (int)$option['product_option_value_id'] . \"' AND subtract = '1'\");\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t$this->cache->delete('product');\n\n\t\t\t\n\n\t\t\t// Downloads\n\n\t\t\t$order_download_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"order_download WHERE order_id = '\" . (int)$order_id . \"'\");\n\n\t\t\t\n\n\t\t\t// Gift Voucher\n\n\t\t\t$this->load->model('checkout/voucher');\n\n\t\t\t\n\n\t\t\t$order_voucher_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"order_voucher WHERE order_id = '\" . (int)$order_id . \"'\");\n\n\t\t\t\n\n\t\t\tforeach ($order_voucher_query->rows as $order_voucher) {\n\n\t\t\t\t$voucher_id = $this->model_checkout_voucher->addVoucher($order_id, $order_voucher);\n\n\t\t\t\t\n\n\t\t\t\t$this->db->query(\"UPDATE \" . DB_PREFIX . \"order_voucher SET voucher_id = '\" . (int)$voucher_id . \"' WHERE order_voucher_id = '\" . (int)$order_voucher['order_voucher_id'] . \"'\");\n\n\t\t\t}\t\t\t\n\n\t\t\t\n\n\t\t\t// Send out any gift voucher mails\n\n\t\t\tif ($this->config->get('config_complete_status_id') == $order_status_id) {\n\n\t\t\t\t$this->model_checkout_voucher->confirm($order_id);\n\n\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t// Order Totals\t\t\t\n\n\t\t\t$order_total_query = $this->db->query(\"SELECT * FROM `\" . DB_PREFIX . \"order_total` WHERE order_id = '\" . (int)$order_id . \"' ORDER BY sort_order ASC\");\n\n\t\t\t\n\n\t\t\tforeach ($order_total_query->rows as $order_total) {\n\n\t\t\t\t$this->load->model('total/' . $order_total['code']);\n\n\t\t\t\t\n\n\t\t\t\tif (method_exists($this->{'model_total_' . $order_total['code']}, 'confirm')) {\n\n\t\t\t\t\t$this->{'model_total_' . $order_total['code']}->confirm($order_info, $order_total);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t// Send out order confirmation mail\n\n\t\t\t$language = new Language($order_info['language_directory']);\n\n\t\t\t$language->load($order_info['language_filename']);\n\n\t\t\t$language->load('mail/order');\n\n\t\t \n\n\t\t\t$order_status_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"order_status WHERE order_status_id = '\" . (int)$order_status_id . \"' AND language_id = '\" . (int)$order_info['language_id'] . \"'\");\n\n\t\t\t\n\n\t\t\tif ($order_status_query->num_rows) {\n\n\t\t\t\t$order_status = $order_status_query->row['name'];\t\n\n\t\t\t} else {\n\n\t\t\t\t$order_status = '';\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t$subject = sprintf($this->language->get('text_payment_subject'), $order_info['store_name'], $order_id);\n\n\t\t\n\n\t\t\t// HTML Mail\n\n\t\t\t$template = new Template();\n\n\t\t\t$template->data['line1'] = sprintf($this->language->get('text_payment_line1'),$order_id);\n $template->data['line2'] = sprintf($this->language->get('text_payment_line2'),$order_id,$order_info['date_added']);\n $template->data['line3'] = $this->language->get('text_payment_line3');\n\n\t\t\t$template->data['title'] = sprintf($this->language->get('text_payment_subject'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'), $order_id);\n\n\t\t\t\n\n\t\t\t$template->data['text_greeting'] = sprintf($language->get('text_new_greeting'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));\n\n\t\t\t$template->data['text_link'] = $language->get('text_new_link');\n\n\t\t\t$template->data['text_download'] = $language->get('text_new_download');\n\n\t\t\t$template->data['text_order_detail'] = $language->get('text_new_order_detail');\n\n\t\t\t$template->data['text_instruction'] = $language->get('text_new_instruction');\n\n\t\t\t$template->data['text_order_id'] = $language->get('text_new_order_id');\n\n\t\t\t$template->data['text_date_added'] = $language->get('text_new_date_added');\n\n\t\t\t$template->data['text_payment_method'] = $language->get('text_new_payment_method');\t\n\n\t\t\t$template->data['text_shipping_method'] = $language->get('text_new_shipping_method');\n\n\t\t\t$template->data['text_email'] = $language->get('text_new_email');\n\n\t\t\t$template->data['text_telephone'] = $language->get('text_new_telephone');\n\n\t\t\t$template->data['text_ip'] = $language->get('text_new_ip');\n\n\t\t\t$template->data['text_payment_address'] = $language->get('text_new_payment_address');\n\n\t\t\t$template->data['text_shipping_address'] = $language->get('text_new_shipping_address');\n\n\t\t\t$template->data['text_product'] = $language->get('text_new_product');\n\n\t\t\t$template->data['text_model'] = $language->get('text_new_model');\n\n\t\t\t$template->data['text_quantity'] = $language->get('text_new_quantity');\n\n\t\t\t$template->data['text_price'] = $language->get('text_new_price');\n\n\t\t\t$template->data['text_total'] = $language->get('text_new_total');\n\n\t\t\t$template->data['text_footer'] = $language->get('text_new_footer');\n\n\t\t\t$template->data['text_powered'] = $language->get('text_new_powered');\n\n\t\t\t$template->data['first_name'] = $order_info['firstname'];\n $template->data['last_name'] = $order_info['lastname'];\n\n\t\t\t$template->data['logo'] = $this->config->get('config_url') . 'image/' . $this->config->get('config_logo');\t\t\n\n\t\t\t$template->data['store_name'] = $order_info['store_name'];\n\n\t\t\t$template->data['store_url'] = $order_info['store_url'];\n\n\t\t\t$template->data['customer_id'] = $order_info['customer_id'];\n\n\t\t\t$template->data['link'] = $order_info['store_url'] . 'index.php?route=account/order/info&order_id=' . $order_id;\n\n\t\t\t\n\n\t\t\tif ($order_download_query->num_rows) {\n\n\t\t\t\t$template->data['download'] = $order_info['store_url'] . 'index.php?route=account/download';\n\n\t\t\t} else {\n\n\t\t\t\t$template->data['download'] = '';\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t$template->data['order_id'] = $order_id;\n\n\t\t\t$template->data['date_added'] = date($language->get('date_format_short'), strtotime($order_info['date_added'])); \t\n\n\t\t\t$template->data['payment_method'] = $order_info['payment_method'];\n\n\t\t\t$template->data['shipping_method'] = $order_info['shipping_method'];\n\n\t\t\t$template->data['email'] = $order_info['email'];\n\n\t\t\t$template->data['telephone'] = $order_info['telephone'];\n\n\t\t\t$template->data['ip'] = $order_info['ip'];\n\n\t\t\t\n\n\t\t\tif ($comment && $notify) {\n\n\t\t\t\t$template->data['comment'] = nl2br($comment);\n\n\t\t\t} else {\n\n\t\t\t\t$template->data['comment'] = '';\n\n\t\t\t}\n\n\t\t\t\t\t\t\n\n\t\t\tif ($order_info['payment_address_format']) {\n\n\t\t\t\t$format = $order_info['payment_address_format'];\n\n\t\t\t} else {\n\n\t\t\t\t$format = '{firstname} {lastname}' . \"\\n\" . '{company}' . \"\\n\" . '{address_1}' . \"\\n\" . '{address_2}' . \"\\n\" . '{city} {postcode}' . \"\\n\" . '{zone}' . \"\\n\" . '{country}';\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t$find = array(\n\n\t\t\t\t'{firstname}',\n\n\t\t\t\t'{lastname}',\n\n\t\t\t\t'{company}',\n\n\t\t\t\t'{address_1}',\n\n\t\t\t\t'{address_2}',\n\n\t\t\t\t'{city}',\n\n\t\t\t\t'{postcode}',\n\n\t\t\t\t'{zone}',\n\n\t\t\t\t'{zone_code}',\n\n\t\t\t\t'{country}'\n\n\t\t\t);\n\n\t\t\n\n\t\t\t$replace = array(\n\n\t\t\t\t'firstname' => $order_info['payment_firstname'],\n\n\t\t\t\t'lastname' => $order_info['payment_lastname'],\n\n\t\t\t\t'company' => $order_info['payment_company'],\n\n\t\t\t\t'address_1' => $order_info['payment_address_1'],\n\n\t\t\t\t'address_2' => $order_info['payment_address_2'],\n\n\t\t\t\t'city' => $order_info['payment_city'],\n\n\t\t\t\t'postcode' => $order_info['payment_postcode'],\n\n\t\t\t\t'zone' => $order_info['payment_zone'],\n\n\t\t\t\t'zone_code' => $order_info['payment_zone_code'],\n\n\t\t\t\t'country' => $order_info['payment_country'] \n\n\t\t\t);\n\n\t\t\n\n\t\t\t$template->data['payment_address'] = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), '<br />', preg_replace(array(\"/\\s\\s+/\", \"/\\r\\r+/\", \"/\\n\\n+/\"), '<br />', trim(str_replace($find, $replace, $format))));\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\n\n\t\t\tif ($order_info['shipping_address_format']) {\n\n\t\t\t\t$format = $order_info['shipping_address_format'];\n\n\t\t\t} else {\n\n\t\t\t\t$format = '{firstname} {lastname}' . \"\\n\" . '{company}' . \"\\n\" . '{address_1}' . \"\\n\" . '{address_2}' . \"\\n\" . '{city} {postcode}' . \"\\n\" . '{zone}' . \"\\n\" . '{country}';\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t$find = array(\n\n\t\t\t\t'{firstname}',\n\n\t\t\t\t'{lastname}',\n\n\t\t\t\t'{company}',\n\n\t\t\t\t'{address_1}',\n\n\t\t\t\t'{address_2}',\n\n\t\t\t\t'{city}',\n\n\t\t\t\t'{postcode}',\n\n\t\t\t\t'{zone}',\n\n\t\t\t\t'{zone_code}',\n\n\t\t\t\t'{country}'\n\n\t\t\t);\n\n\t\t\n\n\t\t\t$replace = array(\n\n\t\t\t\t'firstname' => $order_info['shipping_firstname'],\n\n\t\t\t\t'lastname' => $order_info['shipping_lastname'],\n\n\t\t\t\t'company' => $order_info['shipping_company'],\n\n\t\t\t\t'address_1' => $order_info['shipping_address_1'],\n\n\t\t\t\t'address_2' => $order_info['shipping_address_2'],\n\n\t\t\t\t'city' => $order_info['shipping_city'],\n\n\t\t\t\t'postcode' => $order_info['shipping_postcode'],\n\n\t\t\t\t'zone' => $order_info['shipping_zone'],\n\n\t\t\t\t'zone_code' => $order_info['shipping_zone_code'],\n\n\t\t\t\t'country' => $order_info['shipping_country'] \n\n\t\t\t);\n\n\t\t\n\n\t\t\t$template->data['shipping_address'] = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), '<br />', preg_replace(array(\"/\\s\\s+/\", \"/\\r\\r+/\", \"/\\n\\n+/\"), '<br />', trim(str_replace($find, $replace, $format))));\n\n\t\t\t\n\n\t\t\t// Products\n\n\t\t\t$template->data['products'] = array();\n\n\t\t\t\t\n\n\t\t\tforeach ($order_product_query->rows as $product) {\n\n\t\t\t\t$option_data = array();\n\n\t\t\t\t\n\n\t\t\t\t$order_option_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"order_option WHERE order_id = '\" . (int)$order_id . \"' AND order_product_id = '\" . (int)$product['order_product_id'] . \"'\");\n\n\t\t\t\t\n\n\t\t\t\tforeach ($order_option_query->rows as $option) {\n\n\t\t\t\t\tif ($option['type'] != 'file') {\n\n\t\t\t\t\t\t$value = $option['value'];\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$value = utf8_substr($option['value'], 0, utf8_strrpos($option['value'], '.'));\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\t$option_data[] = array(\n\n\t\t\t\t\t\t'name' => $option['name'],\n\n\t\t\t\t\t\t'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value)\n\n\t\t\t\t\t);\t\t\t\t\t\n\n\t\t\t\t}\n\n\t\t\t \n\n\t\t\t\t$template->data['products'][] = array(\n\n\t\t\t\t\t'name' => $product['name'],\n\n\t\t\t\t\t'model' => $product['model'],\n\n\t\t\t\t\t'option' => $option_data,\n\n\t\t\t\t\t'quantity' => $product['quantity'],\n\n\t\t\t\t\t'price' => $this->currency->format($product['price'] + ($this->config->get('config_tax') ? $product['tax'] : 0), $order_info['currency_code'], $order_info['currency_value']),\n\n\t\t\t\t\t'total' => $this->currency->format($product['total'] + ($this->config->get('config_tax') ? ($product['tax'] * $product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value'])\n\n\t\t\t\t);\n\n\t\t\t}\n\n\t\n\n\t\t\t// Vouchers\n\n\t\t\t$template->data['vouchers'] = array();\n\n\t\t\t\n\n\t\t\tforeach ($order_voucher_query->rows as $voucher) {\n\n\t\t\t\t$template->data['vouchers'][] = array(\n\n\t\t\t\t\t'description' => $voucher['description'],\n\n\t\t\t\t\t'amount' => $this->currency->format($voucher['amount'], $order_info['currency_code'], $order_info['currency_value']),\n\n\t\t\t\t);\n\n\t\t\t}\n\n\t\n\n\t\t\t$template->data['totals'] = $order_total_query->rows;\n\n\t\t\t\n\n\t\t\tif (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/payment_failed.tpl')) {\n\n\t\t\t\t$html = $template->fetch($this->config->get('config_template') . '/template/mail/payment_failed.tpl');\n\n\t\t\t} else {\n\n\t\t\t\t$html = $template->fetch('default/template/mail/payment_failed.tpl');\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t// Text Mail\n\n\t\t\t$text = sprintf($language->get('text_new_greeting'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8')) . \"\\n\\n\";\n\n\t\t\t$text .= $language->get('text_new_order_id') . ' ' . $order_id . \"\\n\";\n\n\t\t\t$text .= $language->get('text_new_date_added') . ' ' . date($language->get('date_format_short'), strtotime($order_info['date_added'])) . \"\\n\";\n\n\t\t\t$text .= $language->get('text_new_order_status') . ' ' . $order_status . \"\\n\\n\";\n\n\t\t\t\n\n\t\t\tif ($comment && $notify) {\n\n\t\t\t\t$text .= $language->get('text_new_instruction') . \"\\n\\n\";\n\n\t\t\t\t$text .= $comment . \"\\n\\n\";\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t// Products\n\n\t\t\t$text .= $language->get('text_new_products') . \"\\n\";\n\n\t\t\t\n\n\t\t\tforeach ($order_product_query->rows as $product) {\n\n\t\t\t\t$text .= $product['quantity'] . 'x ' . $product['name'] . ' (' . $product['model'] . ') ' . html_entity_decode($this->currency->format($product['total'] + ($this->config->get('config_tax') ? ($product['tax'] * $product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value']), ENT_NOQUOTES, 'UTF-8') . \"\\n\";\n\n\t\t\t\t\n\n\t\t\t\t$order_option_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"order_option WHERE order_id = '\" . (int)$order_id . \"' AND order_product_id = '\" . $product['order_product_id'] . \"'\");\n\n\t\t\t\t\n\n\t\t\t\tforeach ($order_option_query->rows as $option) {\n\n\t\t\t\t\t$text .= chr(9) . '-' . $option['name'] . ' ' . (utf8_strlen($option['value']) > 20 ? utf8_substr($option['value'], 0, 20) . '..' : $option['value']) . \"\\n\";\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\tforeach ($order_voucher_query->rows as $voucher) {\n\n\t\t\t\t$text .= '1x ' . $voucher['description'] . ' ' . $this->currency->format($voucher['amount'], $order_info['currency_code'], $order_info['currency_value']);\n\n\t\t\t}\n\n\t\t\t\t\t\t\n\n\t\t\t$text .= \"\\n\";\n\n\t\t\t\n\n\t\t\t$text .= $language->get('text_new_order_total') . \"\\n\";\n\n\t\t\t\n\n\t\t\tforeach ($order_total_query->rows as $total) {\n\n\t\t\t\t$text .= $total['title'] . ': ' . html_entity_decode($total['text'], ENT_NOQUOTES, 'UTF-8') . \"\\n\";\n\n\t\t\t}\t\t\t\n\n\t\t\t\n\n\t\t\t$text .= \"\\n\";\n\n\t\t\t\n\n\t\t\tif ($order_info['customer_id']) {\n\n\t\t\t\t$text .= $language->get('text_new_link') . \"\\n\";\n\n\t\t\t\t$text .= $order_info['store_url'] . 'index.php?route=account/order/info&order_id=' . $order_id . \"\\n\\n\";\n\n\t\t\t}\n\n\t\t\n\n\t\t\tif ($order_download_query->num_rows) {\n\n\t\t\t\t$text .= $language->get('text_new_download') . \"\\n\";\n\n\t\t\t\t$text .= $order_info['store_url'] . 'index.php?route=account/download' . \"\\n\\n\";\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t// Comment\n\n\t\t\tif ($order_info['comment']) {\n\n\t\t\t\t$text .= $language->get('text_new_comment') . \"\\n\\n\";\n\n\t\t\t\t$text .= $order_info['comment'] . \"\\n\\n\";\n\n\t\t\t}\n\n\n\n\t\t\t$text .= $language->get('text_new_footer') . \"\\n\\n\";\n\n\t\t\n \t\t$mail = new Mail(); \n\n\t\t\t$mail->protocol = $this->config->get('config_mail_protocol');\n\n\t\t\t$mail->parameter = $this->config->get('config_mail_parameter');\n\n\t\t\t$mail->hostname = $this->config->get('config_smtp_host');\n\n\t\t\t$mail->username = $this->config->get('config_smtp_username');\n\n\t\t\t$mail->password = $this->config->get('config_smtp_password');\n\n\t\t\t$mail->port = $this->config->get('config_smtp_port');\n\n\t\t\t$mail->timeout = $this->config->get('config_smtp_timeout');\t\t\t\n\n\t\t\t$mail->setTo(array($order_info['email'],$this->config->get('config_email')));\n\n\t\t\t$mail->setFrom($this->config->get('config_email'));\n\n\t\t\t$mail->setSender($order_info['store_name']);\n\n\t\t\t$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));\n\n\t\t\t$mail->setHtml($html);\n \n\t\t\t$mail->setText(html_entity_decode($text, ENT_QUOTES, 'UTF-8'));\n \n \n\n\t\t\t$mail->send();\n\n\n\n\t\t\t// Admin Alert Mail\n\n\t\t\tif ($this->config->get('config_alert_mail')) {\n\n\t\t\t\t$subject = sprintf($language->get('text_new_subject'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'), $order_id);\n\n\t\t\t\t\n\n\t\t\t\t// Text \n\n\t\t\t\t$text = $language->get('text_new_received') . \"\\n\\n\";\n\n\t\t\t\t$text .= $language->get('text_new_order_id') . ' ' . $order_id . \"\\n\";\n\n\t\t\t\t$text .= $language->get('text_new_date_added') . ' ' . date($language->get('date_format_short'), strtotime($order_info['date_added'])) . \"\\n\";\n\n\t\t\t\t$text .= $language->get('text_new_order_status') . ' ' . $order_status . \"\\n\\n\";\n\n\t\t\t\t$text .= $language->get('text_new_products') . \"\\n\";\n\n\t\t\t\t\n\n\t\t\t\tforeach ($order_product_query->rows as $product) {\n\n\t\t\t\t\t$text .= $product['quantity'] . 'x ' . $product['name'] . ' (' . $product['model'] . ') ' . html_entity_decode($this->currency->format($product['total'] + ($this->config->get('config_tax') ? ($product['tax'] * $product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value']), ENT_NOQUOTES, 'UTF-8') . \"\\n\";\n\n\t\t\t\t\t\n\n\t\t\t\t\t$order_option_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"order_option WHERE order_id = '\" . (int)$order_id . \"' AND order_product_id = '\" . $product['order_product_id'] . \"'\");\n\n\t\t\t\t\t\n\n\t\t\t\t\tforeach ($order_option_query->rows as $option) {\n\n\t\t\t\t\t\tif ($option['type'] != 'file') {\n\n\t\t\t\t\t\t\t$value = $option['value'];\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t$value = utf8_substr($option['value'], 0, utf8_strrpos($option['value'], '.'));\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t$text .= chr(9) . '-' . $option['name'] . ' ' . (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value) . \"\\n\";\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\tforeach ($order_voucher_query->rows as $voucher) {\n\n\t\t\t\t\t$text .= '1x ' . $voucher['description'] . ' ' . $this->currency->format($voucher['amount'], $order_info['currency_code'], $order_info['currency_value']);\n\n\t\t\t\t}\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t$text .= \"\\n\";\n\n\n\n\t\t\t\t$text .= $language->get('text_new_order_total') . \"\\n\";\n\n\t\t\t\t\n\n\t\t\t\tforeach ($order_total_query->rows as $total) {\n\n\t\t\t\t\t$text .= $total['title'] . ': ' . html_entity_decode($total['text'], ENT_NOQUOTES, 'UTF-8') . \"\\n\";\n\n\t\t\t\t}\t\t\t\n\n\t\t\t\t\n\n\t\t\t\t$text .= \"\\n\";\n\n\t\t\t\t\n\n\t\t\t\tif ($order_info['comment']) {\n\n\t\t\t\t\t$text .= $language->get('text_new_comment') . \"\\n\\n\";\n\n\t\t\t\t\t$text .= $order_info['comment'] . \"\\n\\n\";\n\n\t\t\t\t}\n\n\t\t\t\n\n\t\t\t\t$mail = new Mail(); \n\n\t\t\t\t$mail->protocol = $this->config->get('config_mail_protocol');\n\n\t\t\t\t$mail->parameter = $this->config->get('config_mail_parameter');\n\n\t\t\t\t$mail->hostname = $this->config->get('config_smtp_host');\n\n\t\t\t\t$mail->username = $this->config->get('config_smtp_username');\n\n\t\t\t\t$mail->password = $this->config->get('config_smtp_password');\n\n\t\t\t\t$mail->port = $this->config->get('config_smtp_port');\n\n\t\t\t\t$mail->timeout = $this->config->get('config_smtp_timeout');\n\n\t\t\t\t$mail->setTo($this->config->get('config_email'));\n\n\t\t\t\t$mail->setFrom($this->config->get('config_email'));\n\n\t\t\t\t$mail->setSender($order_info['store_name']);\n\n\t\t\t\t$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));\n\n\t\t\t\t$mail->setText(html_entity_decode($text, ENT_QUOTES, 'UTF-8'));\n\n\t\t\t\t$mail->send();\n\n\t\t\t\t\n\n\t\t\t\t// Send to additional alert emails\n\n\t\t\t\t$emails = explode(',', $this->config->get('config_alert_emails'));\n\n\t\t\t\t\n\n\t\t\t\tforeach ($emails as $email) {\n\n\t\t\t\t\tif ($email && preg_match('/^[^\\@]+@.*\\.[a-z]{2,6}$/i', $email)) {\n\n\t\t\t\t\t\t$mail->setTo($email);\n\n\t\t\t\t\t\t$mail->send();\n\n\t\t\t\t\t}\n\n\t\t\t\t}\t\t\t\t\n\n\t\t\t}\t\t\n\n\t\t}\n }",
"protected function send_core_update_notification_email($item)\n {\n }",
"public function sendNotifications()\n {\n foreach ($this->recipients_messages as $recipientID => $recipientInfo) {\n $recipient = $this->recipients_addresses[$recipientID];\n if ($recipient && $recipient['email']) {\n $message = implode(chr(10) . chr(10), $recipientInfo['messages']);\n\n $subject = $this->mail_subject;\n\n $subject .= ' Statechange: ';\n\n if ($recipientInfo['num_undefined'] > 0) {\n $subject .= ' ' . $recipientInfo['num_undefined'] . ' Undefined';\n }\n if ($recipientInfo['num_ok'] > 0) {\n $subject .= ' ' . $recipientInfo['num_ok'] . ' OK';\n }\n if ($recipientInfo['num_error'] > 0) {\n $subject .= ' ' . $recipientInfo['num_error'] . ' Errors';\n }\n if ($recipientInfo['num_warning'] > 0) {\n $subject .= ' ' . $recipientInfo['num_warning'] . ' Warnings';\n }\n if ($recipientInfo['num_ack'] > 0) {\n $subject .= ' ' . $recipientInfo['num_ack'] . ' Acknowledged';\n }\n if ($recipientInfo['num_due'] > 0) {\n $subject .= ' ' . $recipientInfo['num_due'] . ' Due';\n }\n\n $this->sendMail($subject, $recipient['email'], $this->mail_from, $message);\n }\n }\n }",
"function uc_order_view_update_form_submit($form, &$form_state) {\n global $user;\n\n if (!empty($form_state['values']['order_comment'])) {\n uc_order_comment_save($form_state['values']['order_id'], $user->uid, $form_state['values']['order_comment'], 'order', $form_state['values']['status'], $form_state['values']['notify']);\n }\n\n if (!empty($form_state['values']['admin_comment'])) {\n uc_order_comment_save($form_state['values']['order_id'], $user->uid, $form_state['values']['admin_comment']);\n }\n\n if ($form_state['values']['status'] != $form_state['values']['current_status']) {\n if (uc_order_update_status($form_state['values']['order_id'], $form_state['values']['status'])) {\n if (empty($form_state['values']['order_comment'])) {\n uc_order_comment_save($form_state['values']['order_id'], $user->uid, '-', 'order', $form_state['values']['status'], $form_state['values']['notify']);\n }\n }\n }\n\n // Let Rules send email if requested.\n if ($form_state['values']['notify']) {\n $order = uc_order_load($form_state['values']['order_id']);\n rules_invoke_event('uc_order_status_email_update', $order);\n }\n\n drupal_set_message(t('Order updated.'));\n}",
"public function salesOrderInvoiceSaveAfter($observer)\n {\n\n // Get the settings\n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $arr = $settings['order_status'];\n $a = explode(',', $settings['order_status']);\n $b = explode(',', $settings['order_status']);\n $final_array = array_combine($a, $b);\n\n $text = Mage::getStoreConfig('smsnotifications/invoice_notification/message');\n // If no invoice notification has been specified, no notification can be sent\n if (!$text) {\n return;\n }\n\n $order = $observer->getEvent()->getInvoice()->getOrder();\n $order_id = $order->getIncrementId();\n\n $invoice = $order->getInvoiceCollection()->getFirstItem();\n $invoiceId = $invoice->getIncrementId();\n\n $store_name = Mage::app()->getStore()->getFrontendName();\n\n $billingAdress = $order->getBillingAddress();\n $shippingAdress = $order->getShippingAddress();\n\n if ($order->getCustomerFirstname()) {\n $customer_name = $order->getCustomerFirstname();\n $customer_name .= ' '.$order->getCustomerLastname();\n } elseif ($billingAdress->getFirstname()) {\n $customer_name = $billingAdress->getFirstname();\n $customer_name .= ' '.$billingAdress->getLastname();\n } else {\n $customer_name = $shippingAdress->getFirstname();\n $customer_name .= ' '.$shippingAdress->getLastname();\n }\n\n $order_amount = $order->getBaseCurrencyCode();\n $order_amount .= ' '.$order->getBaseGrandTotal();\n\n $telephoneNumber = trim($shippingAdress->getTelephone());\n\n // Check if a telephone number has been specified\n if(in_array('invoice', $final_array)){\n if ($telephoneNumber) {\n $text = Mage::getStoreConfig('smsnotifications/invoice_notification/message');\n $text = $settings['invoice_notification_message'];\n $text = str_replace('{{name}}', $customer_name, $text);\n $text = str_replace('{{order}}', $order_id, $text);\n $text = str_replace('{{amount}}', $order_amount, $text);\n $text = str_replace('{{invoiceno}}', $invoiceId, $text);\n\n array_push($settings['order_noficication_recipients'], $telephoneNumber );\n\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n if ($result) {\n $recipients_string = implode(',', $settings['order_noficication_recipients']);\n Mage::getSingleton('adminhtml/session')->addSuccess(sprintf('The invoice notification has been sent via SMS to: %s', $recipients_string));\n } else {\n Mage::getSingleton('adminhtml/session')->addError('There has been an error sending the invoice notification SMS.');\n }\n }\n }\n}",
"function wcfm_mark_as_recived() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderitemid'] ) ) {\r\n $order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n //$comment_id = $order->add_order_note( sprintf( __( 'Item(s) <b>%s</b> received by customer.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) ), '1');\r\n \r\n // Keep Tracking URL as Order Item Meta\r\n\t\t\t$sql = \"INSERT INTO {$wpdb->prefix}woocommerce_order_itemmeta\";\r\n\t\t\t$sql .= ' ( `meta_key`, `meta_value`, `order_item_id` )';\r\n\t\t\t$sql .= ' VALUES ( %s, %s, %s )';\r\n\t\t\t\r\n\t\t\t$confirm_message = __( 'YES', 'wc-frontend-manager-ultimate' );\r\n\t\r\n\t\t\t$wpdb->get_var( $wpdb->prepare( $sql, 'wcfm_mark_as_recived', $confirm_message, $order_item_id ) );\r\n\t\t\t\r\n\t\t\t$vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id );\r\n\t\t\t\r\n\t\t\t// WCfM Marketplace Table Update\r\n\t\t\tif( $vendor_id && (wcfm_is_marketplace() == 'wcfmmarketplace') ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET shipping_status = 'completed' WHERE order_id = $order_id and vendor_id = $vendor_id and item_id = $order_item_id\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Notification\r\n\t\t\t$wcfm_messages = sprintf( __( 'Customer marked <b>%s</b> received.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) );\r\n\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -1, 0, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t\r\n\t\t\t// Vendor Notification\r\n\t\t\tif( $vendor_id ) {\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -2, $vendor_id, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// WC Order Note\r\n\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_received', $order_id, $order_item_id, $product_id );\r\n }\r\n die;\r\n\t}",
"private function _sendNewStatusUpdateEmailToUser()\n {\n // Get a reference to the Joomla! mailer object\n $mailer = \\JFactory::getMailer();\n\t\t\t\n\t\t\t$config = \\JFactory::getConfig();\n\t\t\t$sender = array( \n\t\t\t $config->get( 'mailfrom' ),\n\t\t\t $config->get( 'fromname' ) \n\t\t\t);\n \n\t\t\t$mailer->setSender($sender);\n\n\t\t\t$user = \\JFactory::getUser();\n\t\t\t$mailer->addRecipient($user->email);\n \n // Set the subject\n $subject = \\JFactory::getConfig()->get('sitename') . \": New Status Update...\";\n\t\t\t$mailer->setSubject($subject);\n\t\t\t$projectId = $this->recordData['hshrndreview_fk_project_id'];\n\t\t\t\n\t\t\t$db = \\JFactory::getDbo();\n\t\t\t//this is just to know whether we are in the user is in the reviewer group or not\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select($db->quoteName(array('name', 'owner')));\n\t\t\t$query->from($db->quoteName('#__hshrndreview_projects'));\n\t\t\t$query->where($db->quoteName('hshrndreview_project_id').\" = \". $projectId);\n\t\t\t$db->setQuery($query);\n\t\t\t$project = $db->loadRow();\n\t\t\t\n\t\t\t$body = \"Thank you for submitting a new status update for project named: \\\"\" . $project['0'] . \"\\\". It has been added to the HSH project database!\\n\\n Have a nice day - your friendly HSH RnD Review automailer...\";\n\t\t\t$mailer->setBody($body);\n // Send the email\n\t\t\t$send = $mailer->Send();\n\t\t\tif ( $send !== true ) {\n\t\t\t echo 'Error sending email: ' . $send->__toString();\n\t\t\t} else {\n\t\t\t echo 'Mail sent';\n\t\t\t}\n }",
"public function notifyAdmin($paid_status = null)\n {\n global $config, $reefless, $account_info, $lang;\n\n $reefless->loadClass('Mail');\n\n $listing_title = $GLOBALS['rlListings']->getListingTitle(\n $this->category['ID'],\n $this->listingData,\n $this->listingType['Key']\n );\n $mail_tpl = $GLOBALS['rlMail']->getEmailTemplate('admin_listing_added');\n\n $find = array('{username}', '{link}', '{date}', '{status}', '{paid}');\n $replace = array(\n $account_info['Username'],\n '<a href=\"' . RL_URL_HOME . ADMIN . '/index.php?controller=listings&action=view&id=' . $this->listingID . '\">' . $listing_title . '</a>',\n date(str_replace(array('b', '%'), array('M', ''), RL_DATE_FORMAT)),\n $lang[$config['listing_auto_approval'] ? 'active' : 'pending'],\n $paid_status,\n );\n $mail_tpl['body'] = str_replace($find, $replace, $mail_tpl['body']);\n\n if ($config['listing_auto_approval']) {\n $mail_tpl['body'] = preg_replace('/\\{if activation is enabled\\}(.*)\\{\\/if\\}/', '', $mail_tpl['body']);\n } else {\n $hash = md5($GLOBALS['rlDb']->getOne('Date', \"`ID` = '{$this->listingID}'\", 'listings'));\n $activation_link = RL_URL_HOME . ADMIN . '/index.php?controller=listings&action=remote_activation&id=' . $this->listingID . '&hash=' . $hash;\n $activation_link = '<a href=\"' . $activation_link . '\">' . $activation_link . '</a>';\n $mail_tpl['body'] = preg_replace(\n '/(\\{if activation is enabled\\})(.*)(\\{activation_link\\})(.*)(\\{\\/if\\})/',\n '$2 ' . $activation_link . ' $4',\n $mail_tpl['body']\n );\n }\n $GLOBALS['rlMail']->send($mail_tpl, $config['notifications_email']);\n }",
"public function sendUserUpdateNotification(): void\n {\n $this->notify(new VerifyAccountNotification());\n }",
"public function sendAdminNotification()\n {\n $subject = _t(\n 'SilverShop\\ShopEmail.AdminNotificationSubject',\n 'Order #{OrderNo} notification',\n '',\n ['OrderNo' => $this->order->Reference]\n );\n\n $email = $this->buildEmail('SilverShop/Model/Order_AdminNotificationEmail', $subject)\n ->setTo(Email::config()->admin_email);\n\n if ($this->debugMode) {\n return $this->debug($email);\n } else {\n return $email->send();\n }\n }",
"public function send()\n {\n if (!Mage::getStoreConfig(Epoint_SwissPostSales_Helper_Order::ENABLE_SEND_ORDER_CONFIG_PATH)) {\n return;\n }\n // Check if the date is configured.\n if(!Mage::getStoreConfig(\n Epoint_SwissPostSales_Helper_Order::XML_CONFIG_PATH_FROM_DATE \n )){\n \tMage::helper('swisspost_api')->log(\n Mage::helper('core')->__('Error on send order cron, from date filter is not configured!')\n );\n return ; \n }\n $status_filter = explode(',', \n \tMage::getStoreConfig(self::ENABLE_SEND_ORDER_STATUS_CONFIG_PATH)\n );\n if(is_array($status_filter)){\n \t$status_filter = array_map('trim', $status_filter);\n }\t\n $from_date = date('Y-m-d H:i:s', strtotime(Mage::getStoreConfig(\n Epoint_SwissPostSales_Helper_Order::XML_CONFIG_PATH_FROM_DATE)\n )\n );\n // All orders without odoo code id\n $order_collection = Mage::getModel('sales/order')\n ->getCollection()\n // Join invoices, send only \n ->join(array('invoice' => 'sales/invoice'), \n 'invoice.order_id=main_table.entity_id', \n array('invoice_entity_id'=>'entity_id'), null , 'left')\n ->addAttributeToFilter(\n 'main_table.created_at',\n array('gt' => $from_date)\n )\n ->addFieldToFilter(\n 'main_table.status',\n array(array('in'=>array($status_filter)))\n )\n ->addAttributeToFilter(\n 'main_table.'.Epoint_SwissPostSales_Helper_Data::ORDER_ATTRIBUTE_CODE_ODOO_ID,\n array(array('null' => true),\n array('eq' => 0)\n )\n );\n // Add group \n $order_collection->getSelect()->group('main_table.entity_id');\n // Add Limit \n $order_collection->getSelect()->limit((int)Mage::getStoreConfig(Epoint_SwissPostSales_Helper_Order::XML_CONFIG_PATH_CRON_LIMIT)); \n foreach ($order_collection as $order_item) {\n $order = Mage::getModel('sales/order')->load($order_item->getId());\n // check if can be sent again\n if(Mage::helper('swisspostsales/Order')->isConnected($order)){\n \t Mage::helper('swisspost_api')->log(\n Mage::helper('core')->__('Stop sending again order: %s, odoo id: %s', $order->getId(), \n $order->getData(Epoint_SwissPostSales_Helper_Data::ORDER_ATTRIBUTE_CODE_ODOO_ID)\n )\n );\n \tcontinue;\n }\n // The order was not invoiced ???\n if(!$order->getInvoiceCollection()){\n \tMage::helper('swisspost_api')->log(\n Mage::helper('core')->__('Stop sending again order, no invoice: %s', $order->getId()\n )\n );\n \tcontinue;\n }\n Mage::helper('swisspost_api/Order')->createSaleOrder($order);\n }\n }",
"public static function clientdeliveryTimeNotice(Order $order)\n {\n\n $notification = new Notification;\n if ($order->user) {\n\n $notification->user_id = $order->user->id;\n }\n else{\n $notification->user_id = 13;\n //I put my test user id for the sake of a notification count\n }\n $notification->order_id = $order->id;\n $notification->type = 'order_past_client_deadline';\n $notification->message = \"Order is past client's deadline\";\n $notification->status = 1;\n $notification->save();\n\n // We send SMS notifications to the admins\n $text ='The Client deadline for Order #'.$order->order_no.' has elapsed. Kindly check if it was uploaded by the writer and delivered to the client successfully.';\n\n $admins = User::where('ni_admin',1)->get();\n if ($admins->count()) {\n foreach ($admins as $admin) {\n\n self::sendSMSnotice($admin, $text);\n\n $admin_email = $admin->email;\n $admin_name = $admin->first_name;\n\n Mail::queue('emails.client_deadline_notice',['admin'=>$admin, 'order'=>$order],function ($m) use ($admin_email, $admin_name,$order)\n {\n $m->from('[email protected]','ARA');\n\n $m->to($admin_email, $admin_name)->subject('Order #'.$order->order_no.' client deadline has elapsed');\n });\n }\n }\n\n\n }",
"public function updateStatus(OrderEvent $event, $eventName, EventDispatcherInterface $dispatcher)\n {\n $order = $event->getOrder();\n\n if ($order->isPaid() && $order->getPaymentModuleId() === Payzen::getModuleId()) {\n if (PayzenConfigQuery::read('send_payment_confirmation_message')) {\n $this->mailer->sendEmailToCustomer(\n Payzen::CONFIRMATION_MESSAGE_NAME,\n $order->getCustomer(),\n [\n 'order_id' => $order->getId(),\n 'order_ref' => $order->getRef()\n ]\n );\n }\n\n // Send confirmation email if required.\n if (Payzen::getConfigValue('send_confirmation_message_only_if_paid')) {\n $dispatcher->dispatch($event, TheliaEvents::ORDER_SEND_CONFIRMATION_EMAIL);\n }\n }\n }",
"public function update_status($_order)\n {\n $note = __('Status via reminder plugin automatisch geändert', 'bbb-bac-reminder');\n\n return $_order->update_status('cancelled', $note);\n }",
"public function updateOrderStatus($orders = 0, $order_id = 0, $order_status = 0)\n {\n $total = 1;\n if (empty($orders)) {\n $orders = array();\n\n $orderslist = vRequest::getVar('orders', array());\n $total = 0;\n // Get the list of orders in post to update\n foreach ($orderslist as $key => $order) {\n if ($orderslist[$key]['order_status'] !== $orderslist[$key]['current_order_status']) {\n $orders[$key] = $orderslist[$key];\n $total++;\n }\n }\n }\n\n if (!is_array($orders)) {\n $orders = array($orders);\n }\n\n /* Process the orders to update */\n $updated = 0;\n $error = 0;\n if ($orders) {\n // $notify = vRequest::getVar('customer_notified', array()); // ???\n // $comments = vRequest::getVar('comments', array()); // ???\n foreach ($orders as $virtuemart_order_id => $order) {\n if ($order_id > 0) $virtuemart_order_id = $order_id;\n $this->useDefaultEmailOrderStatus = false;\n if ($this->updateStatusForOneOrder($virtuemart_order_id, $order, true)) {\n $updated++;\n } else {\n $error++;\n }\n }\n }\n $result = array('updated' => $updated, 'error' => $error, 'total' => $total);\n return $result;\n }",
"public function execute() {\n $request = $this->getRequest()->getParams();\n \n $order_id = strip_tags($request[\"orderId\"]);\n $order = $this->objectManagement->create('Magento\\Sales\\Model\\Order')->loadByIncrementId($order_id);\n $validateOrder = $this->validateWebhook($request, $order);\n\n $transactionId = $request['referenceId'];\n\n $mageOrderStatus = $order->getStatus();\n\n if($mageOrderStatus === 'pending') {\n\n if(!empty($validateOrder['status']) && $validateOrder['status'] === true) {\n if($request['txStatus'] == 'SUCCESS') {\n $request['additional_data']['cf_transaction_id'] = $transactionId;\n $this->logger->info(\"Cashfree Notify processing started for cashfree transaction_id(:$transactionId)\");\n $this->processPayment($transactionId, $order);\n $this->logger->info(\"Cashfree Notify processing complete for cashfree transaction_id(:$transactionId)\");\n return;\n } elseif($request['txStatus'] == 'FAILED' || $request['txStatus'] == 'CANCELLED') {\n $orderStatus = self::STATE_CANCELED;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n } elseif($request['txStatus'] == 'USER_DROPPED') {\n $orderStatus = self::STATE_CLOSED;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n } else {\n $orderStatus = self::STATE_PENDING_PAYMENT;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n }\n } else {\n $errorMsg = $validateOrder['errorMsg'];\n $this->logger->info(\"Cashfree Notify processing payment for cashfree transaction_id(:$transactionId) is failed due to ERROR(: $errorMsg)\");\n return;\n }\n } else {\n $this->logger->info(\"Order has been already in processing state for cashfree transaction_id(:$transactionId)\");\n return;\n }\n }",
"public function checkOrdersStatusForUpdateCheckout($observer)\n {\n Mage::log('update status');\n $order = $observer->getOrder();\n $configStatusTrigger = Mage::getStoreConfig('carriers/' . Vaimo_UrbIt_Model_System_Config_Source_Environment::CARRIER_CODE . '/order_status_trigger');\n $checkoutId = $order->getUrbitCheckoutId();\n $isTriggered = $order->getUrbitTriggered();\n\n if ($checkoutId && $isTriggered == 'false') {\n $orderStatus = $order->getState();\n\n if ($orderStatus == $configStatusTrigger) {\n $this->sendUpdateCheckout($order->getId());\n $order->setData('urbit_triggered', 'true');\n $order->save();\n }\n }\n\n }",
"public static function rac_change_cart_list_mailstatus() {\n check_ajax_referer('mailstatus-cartlist', 'rac_security');\n\n if (isset($_POST['row_id']) && isset($_POST['status'])) {\n $status = $_POST['status'];\n update_post_meta($_POST['row_id'], 'rac_cart_sending_status', $status);\n echo '1';\n }\n exit();\n }",
"public function salesOrderShipmentSaveAfter($observer)\n {\n\n // Get the settings\n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $arr = $settings['order_status'];\n $a = explode(',', $settings['order_status']);\n $b = explode(',', $settings['order_status']);\n $final_array = array_combine($a, $b);\n \n if (!$settings['shipment_notification_message']) {\n return;\n }\n $order = $observer->getEvent()->getShipment()->getOrder();\n \n $billingAdress = $order->getBillingAddress();\n $shippingAdress = $order->getShippingAddress();\n\n if ($order->getCustomerFirstname()) {\n $customer_name = $order->getCustomerFirstname();\n $customer_name .= ' '.$order->getCustomerLastname();\n } elseif ($billingAdress->getFirstname()) {\n $customer_name = $billingAdress->getFirstname();\n $customer_name .= ' '.$billingAdress->getLastname();\n } else {\n $customer_name = $shippingAdress->getFirstname();\n $customer_name .= ' '.$shippingAdress->getLastname();\n }\n\n $order_id = $order->getIncrementId();\n $order_amount = $order->getBaseCurrencyCode();\n $order_amount .= ' '.$order->getBaseGrandTotal();\n\n $telephoneNumber = trim($shippingAdress->getTelephone());\n\n $shipment = $order->getShipmentsCollection()->getFirstItem();\n $shipId = $shipment->getIncrementId();\n\n // Check if a telephone number has been specified\n if(in_array('shippment', $final_array)){\n if ($telephoneNumber) {\n // Send the shipment notification to the specified telephone number\n $text = $settings['shipment_notification_message'];\n $text = str_replace('{{name}}', $customer_name, $text);\n $text = str_replace('{{order}}', $order_id, $text);\n $text = str_replace('{{amount}}', $order_amount, $text);\n $text = str_replace('{{shipmentno}}', $shipId, $text);\n\n array_push($settings['order_noficication_recipients'], $telephoneNumber);\n\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n // Display a success or error message\n if ($result) {\n $recipients_string = implode(',', $settings['order_noficication_recipients']);\n Mage::getSingleton('adminhtml/session')->addSuccess(sprintf('The shipment notification has been sent via SMS to: %s', $recipients_string));\n } else {\n Mage::getSingleton('adminhtml/session')->addError('There has been an error sending the shipment notification SMS.');\n }\n }\n } \n}",
"function update_organiser_status(){\r\n\t\t$this->organiser_model->update_organiser_status($_POST['status'],$_POST['organiser_id']);\r\n\t\t$this->send_status_email($_POST['status'],$_POST['organiser_id']);\r\n\t\techo \"1\";exit;\r\n\t}",
"function acadp_order_completed( $order ) {\n\n\t// update order details\n\tupdate_post_meta( $order['id'], 'payment_status', 'completed' );\n\tupdate_post_meta( $order['id'], 'transaction_id', $order['transaction_id'] );\n\n\t// If the order has featured\n\t$featured = get_post_meta( $order['id'], 'featured', true );\n\n\tif( ! empty( $featured ) ) {\n\t\t$post_id = get_post_meta( $order['id'], 'listing_id', true );\n\t\tupdate_post_meta( $post_id, 'featured', 1 );\n\t}\n\n\t// Hook for developers\n\tdo_action( 'acadp_order_completed', $order['id'] );\n\n\t// send emails\n\tacadp_email_listing_owner_order_completed( $order['id'] );\n\tacadp_email_admin_payment_received( $order['id'] );\n\n}",
"function notify() {\n if ($this->active_invoice->isLoaded()) {\n if ($this->active_invoice->canResendEmail($this->logged_user)) {\n $company = $this->active_invoice->getCompany();\n if(!($company instanceof Company)) {\n $this->response->operationFailed();\n } // if\n \n $issue_data = $this->request->post('issue', array(\n 'issued_on' => $this->active_invoice->getIssuedOn(),\n 'due_on' => $this->active_invoice->getDueOn(),\n 'issued_to_id' => $this->active_invoice->getIssuedToId()\n ));\n \n $this->response->assign('issue_data', $issue_data);\n \n if ($this->request->isSubmitted()) {\n try {\n if($this->active_invoice->isIssued()) {\n $this->active_invoice->setDueOn($issue_data['due_on']);\n } // if\n \n $resend_to = isset($issue_data['user_id']) && $issue_data['user_id'] ? Users::findById($issue_data['user_id']) : null;\n \n if($issue_data['send_emails'] && $resend_to instanceof IUser) {\n $this->active_invoice->setIssuedTo($resend_to);\n \n $recipients = array($resend_to);\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_reminder', $this->active_invoice)\n ->sendToUsers($recipients, true);\n } // if\n \n $this->active_invoice->save();\n \n $this->response->respondWithData($this->active_invoice, array(\n 'detailed' => true, \n \t'as' => 'invoice'\n ));\n \t} catch (Exception $e) {\n \t DB::rollback('Failed to resend email @ ' . __CLASS__);\n \t $this->response->exception($e);\n \t} // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n }"
] |
[
"0.7514695",
"0.7458988",
"0.69368386",
"0.6883313",
"0.6848589",
"0.67386544",
"0.6675532",
"0.6648271",
"0.6583265",
"0.6565075",
"0.6560592",
"0.6556058",
"0.65312904",
"0.648997",
"0.64622563",
"0.64525604",
"0.6439578",
"0.6421992",
"0.6420949",
"0.6387681",
"0.638665",
"0.638517",
"0.6384301",
"0.6382911",
"0.63641393",
"0.6344691",
"0.63345945",
"0.63264996",
"0.6313587",
"0.63132894"
] |
0.8149546
|
0
|
Handle order cancellation (refund the customer, ...)
|
public function handleCancellation(OrderEvent $event)
{
$order = $event->getOrder();
if (Order::STATUS_CANCELED === $order->getStatus()) {
// refund customer
$this->orderManager->refund($order);
// update coupon count if necessary
if (null !== $order->getCoupon()) {
$coupon = $order->getCoupon();
if (null !== $coupon->getRemainingStock()) {
$coupon->setRemainingStock($coupon->getRemainingStock() + 1);
$this->entityManager->flush();
}
}
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function cancelOrder(Mage_Sales_Model_Order $order)\n {\n try {\n // works for 1.8 and 1.9\n $order->registerCancellation();\n } catch (Mage_Core_Exception $e) {\n // exist for backward compatibility with Magento 1.7\n $cancelState = Mage_Sales_Model_Order::STATE_CANCELED;\n /** @var Mage_Sales_Model_Order_Item $item */\n foreach ($order->getAllItems() as $item) {\n if ($cancelState != Mage_Sales_Model_Order::STATE_PROCESSING && $item->getQtyToRefund()) {\n if ($item->getQtyToShip() > $item->getQtyToCancel()) {\n $cancelState = Mage_Sales_Model_Order::STATE_PROCESSING;\n } else {\n $cancelState = Mage_Sales_Model_Order::STATE_COMPLETE;\n }\n }\n $item->cancel();\n }\n\n $order->setSubtotalCanceled($order->getSubtotal() - $order->getSubtotalInvoiced());\n $order->setBaseSubtotalCanceled($order->getBaseSubtotal() - $order->getBaseSubtotalInvoiced());\n\n $order->setTaxCanceled($order->getTaxAmount() - $order->getTaxInvoiced());\n $order->setBaseTaxCanceled($order->getBaseTaxAmount() - $order->getBaseTaxInvoiced());\n\n $order->setShippingCanceled($order->getShippingAmount() - $order->getShippingInvoiced());\n $order->setBaseShippingCanceled($order->getBaseShippingAmount() - $order->getBaseShippingInvoiced());\n\n $order->setDiscountCanceled(abs($order->getDiscountAmount()) - $order->getDiscountInvoiced());\n $order->setBaseDiscountCanceled(\n abs($order->getBaseDiscountAmount()) - $order->getBaseDiscountInvoiced()\n );\n\n $order->setTotalCanceled($order->getGrandTotal() - $order->getTotalPaid());\n $order->setBaseTotalCanceled($order->getBaseGrandTotal() - $order->getBaseTotalPaid());\n\n $order->setState($cancelState, true);\n }\n\t $order->save();\n }",
"private function cancelOrder($order){\r\n $this->log('Cancelling order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'La orden fue cancelada por Flow');\r\n $order->update_status('cancelled');\r\n }",
"public function cancel()\n {\n $this->canceled = true;\n\n $this->save();\n\n $this->user->notify(new OrderCanceled($this));\n\n }",
"function cancelOrder($sourceAccount, $orderId) {\n\techo \"Canceling Order: \" . $orderId . \" from: \" . $sourceAccount . \"</br>\";\n\t$response = putRequest('/api/order/' . $sourceAccount . '/' . $orderId . '/cancel');\n\tprintInfo($response);\n}",
"public function postCancelRecurring($order) {\n Auth::user()\n ->requires('delete')\n ->ofScope('Subscriber',Subscriber::current()->id)\n ->orScope('Protocol')\n ->orScope('Client',$order->client->id)\n ->over('Order',$order->id);\n\n $order->autoship->delete();\n\n return Redirect::route('order',array($order->id));\n }",
"function action_woocommerce_send_sms_order_cancelled($order_id) {\n # code... \n}",
"public function cancelOrder(OrderEntity $order, Context $context): void\n {\n $statusTechnical = ($order->getStateMachineState() instanceof StateMachineStateEntity) ? $order->getStateMachineState()->getTechnicalName() : '';\n\n if ($statusTechnical === OrderStates::STATE_CANCELLED) {\n return;\n }\n\n $availableTransitions = $this->getAvailableTransitions($order, $context);\n\n if (!$this->transitionIsAllowed(StateMachineTransitionActions::ACTION_CANCEL, $availableTransitions)) {\n $this->performTransition($order, StateMachineTransitionActions::ACTION_REOPEN, $context);\n }\n\n $this->performTransition($order, StateMachineTransitionActions::ACTION_CANCEL, $context);\n }",
"public function cancelOrder($param) { \n if (!$this->aaa->has_right('openruth', 500))\n $res->cancelOrderError->_value = 'authentication_error';\n else {\n $agencyId = self::strip_agency($param->agencyId->_value);\n $targets = $this->config->get_value('ruth', 'ztargets');\n if ($tgt = $targets[$agencyId]) {\n $ord = &$order->ReservationDelete->_value;\n $ord->LibraryNo->_value = $agencyId;\n $ord->DisposalID->_value = $param->orderId->_value;\n $xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?'.'>' . utf8_decode($this->objconvert->obj2xml($order));\n $z = new z3950();\n $z->set_target($tgt['host']);\n $z->set_database($tgt['database'].'-ophelia');\n $z->set_authentication($tgt['authentication']);\n if ($tgt['proxy']) {\n $z->set_proxy($tgt['proxy']);\n }\n $xml_ret = $z->z3950_xml_update($xml, $tgt['timeout']);\n//echo 'error: ' . $z->get_errno();\n//print_r($xml);\n//print_r($xml_ret);\n if ($z->get_errno() == 0 && $xml_ret['xmlUpdateDoc']) {\n $dom = new DomDocument();\n $dom->preserveWhiteSpace = false;\n if ($dom->loadXML($xml_ret['xmlUpdateDoc'])) {\n if ($err = $dom->getElementsByTagName('ReservationDeleteResponse')->item(0)->nodeValue) {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') errno: ' . $err);\n if (!($res->cancelOrderError->_value = $this->errs[$err])) \n $res->cancelOrderError->_value = 'unspecified error (' . $err . '), order not possible';\n } else {\n $res->cancelOrderOk->_value = $param->orderId->_value;\n }\n } else {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') loadXML error of: ' . $xml_ret['xmlUpdateDoc']);\n $res->cancelOrderError->_value = 'system error';\n }\n } else {\n self::log_z_error(__FUNCTION__, __LINE__, $agencyId, $z->get_errno(), $z->get_error_string());\n $res->cancelOrderError->_value = 'system error';\n }\n } else\n $res->cancelOrderError->_value = 'unknown agencyId';\n }\n\n $ret->cancelOrderResponse->_value = $res;\n //var_dump($param); print_r($res); die();\n return $ret;\n }",
"public function handleCancellation($request, $context) { }",
"public function cancelAction()\n {\n \n $po_order_id = $this->getRequest()->getParam('po_order_id');\n \n Mage::dispatchEvent('purchase_order_stockmovement_cancel_po', array('po_order_id'=>$po_order_id)); \n \n //move to 'purchase_order_stockmovement_cancel' event to handle.\n /*$collection = mage::getModel('Purchase/StockMovement')\n ->getCollection()\n ->addFieldToFilter('sm_po_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n }\n */\n /*\n $order = mage::getModel('Purchase/Order')->load($po_num);\n foreach ($order->getProducts() as $item)\n {\n $productId = $item->getpop_product_id();\n Mage::dispatchEvent('purchase_update_supply_needs_for_product', array('product_id'=>$productId));\n }\n */\n \n //Move to order cancel funciton.\n /*$collection = mage::getModel('purchase/orderitem')\n ->getCollection()\n ->addFieldToFilter('pop_order_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n } */\n \n \n $purchaseOrder = Mage::getModel('purchase/order')->load($po_order_id);\n\n $purchaseOrder->cancel();\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Purchase order successfully Canceled'));\n \n $this->_redirect('purchase/orders/list');\n }",
"function woocommerce_stripe_cancel_payment( $order_id ) {\n\t\t$order = new WC_Order( $order_id );\n\n\t\tif ( $order->payment_method == 'stripe' ) {\n\t\t\t$charge = get_post_meta( $order_id, '_stripe_charge_id', true );\n\n\t\t\tif ( $charge ) {\n\t\t\t\t$stripe = new WC_Gateway_Stripe();\n\n\t\t\t\t$result = $stripe->stripe_request( array(\n\t\t\t\t\t'amount' => $order->order_total * 100\n\t\t\t\t), 'charges/' . $charge . '/refund' );\n\n\t\t\t\tif ( is_wp_error( $result ) ) {\n\t\t\t\t\t$order->add_order_note( __( 'Unable to refund charge!', 'wc_stripe' ) . ' ' . $result->get_error_message() );\n\t\t\t\t} else {\n\t\t\t\t\t$order->add_order_note( sprintf( __('Stripe charge refunded (Charge ID: %s)', 'wc_stripe' ), $result->id ) );\n\t\t\t\t\tdelete_post_meta( $order->id, '_stripe_charge_captured' );\n\t\t\t\t\tdelete_post_meta( $order->id, '_stripe_charge_id' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"static function cancelOrder($order_id) {\n\t\t\t$query = \"delete from orders where OID = ?\";\n\t\t\t$dataArr = array($order_id);\n\t\t\tOrder::manDb($query, $dataArr);\n\t\t}",
"protected function cancelOrder(jshopOrder $order)\r\n {\r\n $this->redirect($this->getActionUrl('cancel', $order->order_id));\r\n }",
"public function refundCancel($refundHandle);",
"public function abortAction()\n {\n /** @var $session Mage_Checkout_Model_Session */\n $session = Mage::getSingleton('checkout/session');\n $order = Mage::getModel('sales/order');\n\n try {\n /** @var $order Mage_Sales_Model_Order */\n\n $order->loadByIncrementId($session->getLastRealOrderId());\n $order->addStatusHistoryComment('Customer cancelled the payment',false);\n\n if (!$order->getId()) {\n Mage::throwException('No order for processing found');\n }\n if($order->canCancel()) {\n $order->cancel()->save();\n }\n } catch (Exception $e) {\n\n }\n\n $quote = Mage::getSingleton('sales/quote');\n $quote->load($order->getQuoteId());\n $session->setQuoteId($order->getQuoteId());\n $session->getQuote()->setIsActive(1)->save();\n\n // redirect customer to the cart (dirty)\n $redirectUrl = Mage::helper('checkout/cart')->getCartUrl();\n $block = new Mage_Core_Block_Template();\n $block->setTemplate('mcpservice/redirect.phtml');\n $block->assign('url',$redirectUrl);\n $block->assign('media_url',Mage::getBaseUrl() . '/../../media/micropayment/');\n $block->assign('year',date('Y'));\n $block->assign('payment_method',$order->getPayment());\n $block->assign('target','parent');\n\n echo $block->renderView();\n\n }",
"public function profileTransactionCancellationAction(Request $request)\r\n {\r\n $response = array(\r\n 'isSuccessful' => false,\r\n 'message' => '',\r\n 'data' => array(),\r\n );\r\n\r\n $tokenStorage = $this->container->get('security.token_storage');\r\n $authenticatedUser = $this->getUser(); \r\n $orderProductIds = $request->get('orderProducts');\r\n $em = $this->getDoctrine()->getEntityManager();\r\n $orderProducts = $em->getRepository(\"YilinkerCoreBundle:OrderProduct\")\r\n ->getBuyerOrderProductsByIds(\r\n $authenticatedUser, $orderProductIds\r\n );\r\n \r\n $form = $this->createForm('order_product_cancellation', null, array(\r\n 'orderProducts' => $orderProducts,\r\n 'userCancellationType' => OrderProductCancellationReason::USER_TYPE_BUYER\r\n ));\r\n $form->submit(array(\r\n '_token' => $request->get('_token'),\r\n 'orderProducts' => $orderProductIds,\r\n 'reason' => $request->get('reason'),\r\n 'remark' => $request->get('remark'),\r\n ));\r\n \r\n if ($form->isValid()) {\r\n \r\n $formData = $form->getData();\r\n $invoices = array();\r\n foreach($formData['orderProducts'] as $orderProduct){\r\n $order = $orderProduct->getOrder();\r\n $invoices[$order->getOrderId()] = $order;\r\n }\r\n\r\n if(count($invoices) === 1){\r\n if(reset($invoices)->getBuyer()->getUserId() === $authenticatedUser->getUserId()){\r\n $transactionService = $this->container->get('yilinker_core.service.transaction');\r\n $response['isSuccessful'] = $transactionService->cancellationRequestTransactionByUser(\r\n $formData['orderProducts'],\r\n $formData['reason'],\r\n $formData['remark'],\r\n $authenticatedUser\r\n );\r\n if($response['isSuccessful']){\r\n $response['message'] = \"Cancellation request successfuly sent.\";\r\n }\r\n }\r\n else{\r\n $response['message'] = 'Order does not belong to the authenticated user';\r\n }\r\n }\r\n else{\r\n $response['message'] = 'Items do not belong to the same order';\r\n }\r\n }\r\n else{\r\n $response['message'] = $form->getErrors(true)[0]->getMessage();\r\n }\r\n\r\n return new JsonResponse($response);\r\n }",
"public function hookActionProductCancel($params)\n {\n if ($params['action'] === CancellationActionType::STANDARD_REFUND) {\n $order = $params['order'];\n $cart_id = $order->id_cart;\n $cart = new Cart($cart_id);\n\n // realizamos la consulta de base de datos para el tiketNumber\n $query = 'SELECT * FROM '._DB_PREFIX_.'kushkipagos WHERE `cart_id` = \\''.$cart_id.'\\' limit 1 ';\n $order_kushki = Db::getInstance()->executeS($query);\n\n $ticket_number = $order_kushki[0][\"ticket_number\"];\n $kushkiToken = $order_kushki[0][\"token\"];\n\n $currency_order = new Currency((int)((int)$params[\"order\"]->id_currency));\n\n $amount = $this->getAmountValues($cart);\n\n $obj_amount = array_merge($amount, array(\"currency\" =>$currency_order->iso_code));\n // llamamos al endpoint de refund\n $refund = $this->callUrlRefund($obj_amount, $ticket_number);\n\n if ( ! $refund ) {\n throw new PrestaShopException('An error occurred while attempting to create the refund using the payment gateway API.');\n }else{\n if ($refund->isSuccessful()) {\n //cambiamos el status a refunded\n $history = new OrderHistory();\n $history->id_order = (int)$order->id;\n $history->changeIdOrderState(7, (int)($order->id));\n $order->setCurrentState(7);\n PrestaShopLogger::addLog('Kushki Refund CORRECTO en orden' . $order->id . ' Ticket number: ' . $refund->getTicketNumber(), 1);\n $this->saveDataRefund($kushkiToken, $refund->getTicketNumber(), $cart_id, (int)$order->id, (int)Configuration::get('PS_OS_REFUND'), $order->total_paid, \"kushkipagos\", \"refund\", (int)$order->id_currency, $order->secure_key, \"initialized\" );\n } else {\n PrestaShopLogger::addLog('Kushki Refund FALLIDO en orden '.$order->id.' Message ' . $refund->getResponseText(), 3);\n throw new OrderException('Hubo un error en el refund de esta orden.');\n }\n }\n\n } else if ($params['action'] === CancellationActionType::PARTIAL_REFUND) {\n throw new OrderException('Kushki no puede hacer devoluciones parciales, debe hacer la devolución del total del pedido');\n }\n }",
"function cancel() {\n\t\t\tglobal $wpdb;\n\t\t\t\n\t\t\t//only need to cancel on the gateway if there is a subscription id\n\t\t\tif(empty($this->subscription_transaction_id)) {\n\t\t\t\t//just mark as cancelled\n\t\t\t\t$this->updateStatus(\"cancelled\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t//get some data\n\t\t\t\t$order_user = get_userdata($this->user_id);\n\n\t\t\t\t//cancel orders for the same subscription\n\t\t\t\t//Note: We do this early to avoid race conditions if and when the\n\t\t\t\t//gateway send the cancel webhook after cancelling the subscription.\t\t\t\t\n\t\t\t\t$sqlQuery = $wpdb->prepare(\n\t\t\t\t\t\"UPDATE $wpdb->pmpro_membership_orders \n\t\t\t\t\t\tSET `status` = 'cancelled' \n\t\t\t\t\t\tWHERE user_id = %d \n\t\t\t\t\t\t\tAND membership_id = %d \n\t\t\t\t\t\t\tAND gateway = %s \n\t\t\t\t\t\t\tAND gateway_environment = %s \n\t\t\t\t\t\t\tAND subscription_transaction_id = %s \n\t\t\t\t\t\t\tAND `status` IN('success', '') \",\t\t\t\t\t\n\t\t\t\t\t$this->user_id,\n\t\t\t\t\t$this->membership_id,\n\t\t\t\t\t$this->gateway,\n\t\t\t\t\t$this->gateway_environment,\n\t\t\t\t\t$this->subscription_transaction_id\n\t\t\t\t);\t\t\t\t\t\t\t\t\n\t\t\t\t$wpdb->query($sqlQuery);\n\t\t\t\t\n\t\t\t\t//cancel the gateway subscription first\n\t\t\t\tif (is_object($this->Gateway)) {\n\t\t\t\t\t$result = $this->Gateway->cancel( $this );\n\t\t\t\t} else {\n\t\t\t\t\t$result = false;\n\t\t\t\t}\n\n\t\t\t\tif($result == false) {\n\t\t\t\t\t//there was an error, but cancel the order no matter what\n\t\t\t\t\t$this->updateStatus(\"cancelled\");\n\n\t\t\t\t\t//we should probably notify the admin\n\t\t\t\t\t$pmproemail = new PMProEmail();\n\t\t\t\t\t$pmproemail->template = \"subscription_cancel_error\";\n\t\t\t\t\t$pmproemail->data = array(\"body\"=>\"<p>\" . sprintf(__(\"There was an error canceling the subscription for user with ID=%s. You will want to check your payment gateway to see if their subscription is still active.\", 'paid-memberships-pro' ), strval($this->user_id)) . \"</p><p>Error: \" . $this->error . \"</p>\");\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('User Email', 'paid-memberships-pro') . ': ' . $order_user->user_email . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('User Display Name', 'paid-memberships-pro') . ': ' . $order_user->display_name . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Order', 'paid-memberships-pro') . ': ' . $this->code . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Gateway', 'paid-memberships-pro') . ': ' . $this->gateway . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Subscription Transaction ID', 'paid-memberships-pro') . ': ' . $this->subscription_transaction_id . '</p>';\n\t\t\t\t\t$pmproemail->sendEmail(get_bloginfo(\"admin_email\"));\n\t\t\t\t} else {\n\t\t\t\t\t//Note: status would have been set to cancelled by the gateway class. So we don't have to update it here.\n\n\t\t\t\t\t//remove billing numbers in pmpro_memberships_users if the membership is still active\t\t\t\t\t\n\t\t\t\t\t$sqlQuery = \"UPDATE $wpdb->pmpro_memberships_users SET initial_payment = 0, billing_amount = 0, cycle_number = 0 WHERE user_id = '\" . $this->user_id . \"' AND membership_id = '\" . $this->membership_id . \"' AND status = 'active'\";\n\t\t\t\t\t$wpdb->query($sqlQuery);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}",
"public function cancel_order( $args = array() )\n {\n return $this->_request('cancelorder', $args);\n }",
"public function cancelOrder($symbol, $orderId = NULL, $origClientOrderId = NULL, $recvWindow = NULL);",
"function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }",
"function wp_aff_handle_woocommerce_order_refund($order_id) {\n wp_affiliate_log_debug(\"WooCommerce Affiliate integration - order refunded. Order ID: \" . $order_id, true);\n //$order = new WC_Order($order_id);\n $txn_id = $order_id;\n wp_aff_handle_refund($txn_id);\n}",
"public function cancelDeferred(Varien_Object $payment)\n {\n /* @var $payment Mage_Sales_Model_Order_Payment */\n Mage::helper('optile')->log('Handling cancellation of deferred payment');\n\n // Get the order info, find out if the order is made in deferred mode.\n $optileQuote = Mage::getModel('optile/quote')\n ->load($payment->getOrder()->getQuoteId());\n /* @var $optileQuote Optile_Payment_Model_Quote */\n\n // Making sure that the order is in deferred mode\n if($optileQuote->getDeferredMode() != Optile_Payment_Model_Quote::DEFERRED){\n Mage::helper('optile')->log('Quote not in deferred mode, not sending cancel request to Optile.', Zend_log::INFO);\n return $this;\n }\n\n // Will send a cancel request only if cancelling entire order. TODO: how to handle partial cancellations?\n // Answered by Sebastian: Whenever there is something to cancel, it is ok to execute.\n// if($payment->getAmountPaid() > 0){\n// Mage::helper('optile')->log('Quote already paid, not sending cancel request to Optile.', Zend_log::INFO);\n// return $this;\n// }\n\n // Create Cancel request and send to Optile\n $longId = $optileQuote->getLongId();\n $url = rtrim(Mage::getStoreConfig('payment/optile/api_url'), '/').\"/api/charges/{$longId}\";\n\n RequestFactory::setLogger(Mage::helper('optile')); // TODO: refactor the logger setter?\n $request = RequestFactory::getCancelRequest($url)\n ->setMerchantCode($this->getMerchantCode())\n ->setMerchantToken($this->getMerchantToken());\n\n $response = $request->send();\n /* @var $response Response */\n\n // Check response for Close confirmation\n Mage::helper('optile')->log($response);\n\n if($response->getInteraction()->getCode() != \\Optile\\Response\\InteractionCode::PROCEED){\n $msg = \"Received interaction code: \".$response->getInteraction()->getCode().', '.$response->getInfo().'. Unable to proceed with order cancellation.';\n $order = $payment->getOrder();\n /* @var $order Mage_Sales_Model_Order */\n $order->addStatusHistoryComment($msg)->save();\n Mage::getSingleton('core/session')->addError($msg);\n Mage::helper('optile')->log($msg, Zend_Log::ERR);\n throw new Exception($msg);\n\n }\n\n return $this;\n }",
"private function process_cancel_subscription( ){\n\t\t$subscription_id = $_POST['ec_account_subscription_id'];\n\t\t$subscription_row = $this->mysqli->get_subscription_row( $subscription_id );\n\t\t$stripe = new ec_stripe( );\n\t\t$cancel_success = $stripe->cancel_subscription( $this->user, $subscription_row->stripe_subscription_id );\n\t\tif( $cancel_success ){\n\t\t\t$this->mysqli->cancel_subscription( $subscription_id );\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscriptions&account_success=subscription_canceled\" );\n\t\t}else{\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscription_details&subscription_id=\" . $subscription_id . \"&account_error=subscription_cancel_failed\" );\n\t\t}\n\t}",
"private function merchantPageCancel()\n {\n $cart = $this->context->cart;\n\n $customer = new Customer($cart->id_customer);\n\n if (!Validate::isLoadedObject($customer) || !isset($this->module->currentOrder)) {\n $error_message = $this->module->l('You have cancelled the payment, please try again.');\n\n $id_order = $this->module->currentOrder;\n if (! $id_order || null == $id_order || empty($id_order)) {\n $id_order = Context::getContext()->cookie->__get('aps_apple_order_id');\n $this->aps_payment->refillCart($id_order);\n $this->aps_helper->log('refill cart and merchantPageCancel called');\n }\n Context::getContext()->cookie->apsErrors = $error_message;\n Tools::redirect('index.php?controller=order&step=1');\n }\n $this->aps_payment->merchantPageCancel();\n $objOrder = new Order($this->module->currentOrder);\n if ($objOrder) {\n $this->aps_payment->refillCart($objOrder->id);\n $error_message = $this->module->l('You have cancelled the payment, please try again.');\n Context::getContext()->cookie->apsErrors = $error_message;\n $this->aps_helper->log('merchantPageCancel called');\n\n Tools::redirect('index.php?controller=order&step=1');\n } else {\n $error_message = $this->module->l('You have cancelled the payment, please try again.');\n Context::getContext()->cookie->__set('aps_error_msg', $error_message);\n Tools::redirect(\n 'index.php?fc=module&module=amazonpaymentservices&controller=error&action=displayError'\n );\n }\n }",
"public function cancelled_order( $order_id ) {\n\n\t\t$this->api_record_event( $this->event_name['cancelled_order'], array( $this->property_name['order_id'] => $order_id ) );\n\t}",
"public function cancelAction() {\n /**\n * Admin configuration for order cancel request active status.\n */\n $orderCancelStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_cancel_request' );\n $data = $this->getRequest ()->getPost ();\n $emailSent = '';\n /**\n * Get order id\n * @var int\n */\n $orderId = $data ['order_id'];\n $loggedInCustomerId = '';\n /**\n * Check that customer login or not.\n */\n if (Mage::getSingleton ( 'customer/session' )->isLoggedIn () && isset ( $orderId )) {\n /**\n * Get customer data\n * @var id\n */\n $customerData = Mage::getSingleton ( 'customer/session' )->getCustomer ();\n $loggedInCustomerId = $customerData->getId ();\n $customerid = Mage::getModel ( 'sales/order' )->load ( $data ['order_id'] )->getCustomerId ();\n } else {\n /**\n * Error message for the when unwanted person access these request.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page\" ) );\n $this->_redirect ( 'sales/order/history' );\n return;\n }\n if ($orderCancelStatusFlag == 1 && ! empty ( $loggedInCustomerId ) && $customerid == $loggedInCustomerId) {\n $shippingStatus = 0;\n try {\n /**\n * Get templete id for the order cancel request notification.\n */\n $templateId = ( int ) Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_cancel_request_notification_template_selection' );\n if ($templateId) {\n /**\n * Load email templete.\n */\n $emailTemplate = Mage::helper ( 'marketplace/marketplace' )->loadEmailTemplate ( $templateId );\n } else {\n $emailTemplate = Mage::getModel ( 'core/email_template' )->loadDefault ( 'marketplace_cancel_order_admin_email_template_selection' );\n }\n /**\n * Load order product details based on the orde id.\n */\n $_order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n /**\n * Get increment id\n * @var int\n */\n $incrementId = $_order->getIncrementId ();\n $sellerProductDetails = array ();\n $selectedProducts = $data ['products'];\n $selectedItemproductId = '';\n /**\n * Get the order item from the order.\n */\n foreach ( $_order->getAllItems () as $item ) {\n /**\n * Get Product id\n * @var int\n */\n $itemProductId = $item->getProductId ();\n $orderItem = $item;\n if (in_array ( $itemProductId, $selectedProducts )) {\n $shippingStatus = $this->getShippingStatus ( $orderItem );\n\n $sellerId = Mage::getModel ( 'catalog/product' )->load ( $itemProductId )->getSellerId ();\n $selectedItemproductId = $itemProductId;\n $sellerProductDetails [$sellerId] [] = $item->getName ();\n }\n }\n /**\n * Get seller product details.\n */\n foreach ( $sellerProductDetails as $key => $productDetails ) {\n $productDetailsHtml = \"<ul>\";\n /**\n * Increment foreach loop\n */\n foreach ( $productDetails as $productDetail ) {\n $productDetailsHtml .= \"<li>\";\n $productDetailsHtml .= $productDetail;\n $productDetailsHtml .= \"</li>\";\n }\n $productDetailsHtml .= \"</ul>\";\n $customer = Mage::getModel ( 'customer/customer' )->load ( $loggedInCustomerId );\n $seller = Mage::getModel ( 'customer/customer' )->load ( $key );\n /**\n * Get customer name and customer email id.\n */\n $buyerName = $customer->getName ();\n $buyerEmail = $customer->getEmail ();\n $sellerEmail = $seller->getEmail ();\n $sellerName = $seller->getName ();\n $recipient = $sellerEmail;\n if (empty ( $sellerEmail )) {\n $adminEmailIdVal = Mage::getStoreConfig ( 'marketplace/marketplace/admin_email_id' );\n /**\n * Get the to mail id\n */\n $getToMailId = Mage::getStoreConfig ( \"trans_email/ident_$adminEmailIdVal/email\" );\n $recipient = $getToMailId;\n }\n $emailTemplate->setSenderName ( $buyerName );\n $emailTemplate->setSenderEmail ( $buyerEmail );\n /**\n * To set cancel/refund request sent\n */\n if ($shippingStatus == 1) {\n $requestedType = $this->__ ( 'cancellation' );\n Mage::getModel ( 'marketplace/order' )->updateSellerRequest ( $selectedItemproductId, $orderId, $loggedInCustomerId, $sellerId, 0 );\n } else {\n $requestedType = $this->__ ( 'return' );\n Mage::getModel ( 'marketplace/order' )->updateSellerRequest ( $selectedItemproductId, $orderId, $loggedInCustomerId, $sellerId, 1 );\n }\n $emailTemplateVariables = array (\n 'ownername' => $sellerName,'productdetails' => $productDetailsHtml, 'order_id' => $incrementId,\n 'customer_email' => $buyerEmail,'customer_firstname' => $buyerName,\n 'reason' => $data ['reason'],'requesttype' => $requestedType,\n 'requestperson' => $this->__ ( 'Customer' )\n );\n $emailTemplate->setDesignConfig ( array ('area' => 'frontend') );\n /**\n * Sending email to admin\n */\n $emailTemplate->getProcessedTemplate ( $emailTemplateVariables );\n $emailSent = $emailTemplate->send ( $recipient, $sellerName, $emailTemplateVariables );\n }\n if ($shippingStatus == 1) {\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"Item cancellation request has been sent successfully.\" ) );\n } else {\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"Item return request has been sent successfully.\" ) );\n }\n $this->_redirect ( 'sales/order/view/order_id/' . $data ['order_id'] );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'sales/order/view/order_id/' . $data ['order_id'] );\n }\n } else {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page\" ) );\n $this->_redirect ( 'sales/order/view/order_id/' . $orderId );\n }\n }",
"public function cancelAction()\n {\n $event = Mage::getModel('payanyway/event')\n ->setEventData($this->getRequest()->getParams());\n $message = $event->cancelEvent();\n\n // set quote to active\n $session = $this->_getCheckout();\n if ($quoteId = $session->getPayanywayQuoteId()) {\n $quote = Mage::getModel('sales/quote')->load($quoteId);\n if ($quote->getId()) {\n $quote->setIsActive(true)->save();\n $session->setQuoteId($quoteId);\n }\n }\n $session->addError($message);\n $this->_redirect('checkout/cart');\n }",
"public function onOrderSave($observer) {\n\t\t\n\t\t$event = $observer->getEvent ();\n\t\t$order = $event->getOrder();\n\t\t\n\t\t$orderHelper = Mage::helper('megaventory/order');\n\t\t\n\t\t//under certain conditions\n\t\t//this code is called twice and therefore we get an 'extra' api call\n\t\t//to cancel an order that is already cancelled in megaventory\n\t\t//the following commented out code remedies this BUT has problems\n\t\t//when order is cancelled programmatically for instance when cancelling\n\t\t//orders via a payment gateway system (i.e Moneybookers) \n\t\tif ($order->getState() == 'canceled')\n\t\t{\n\t\t\t\n\t\t\t/* if(version_compare(Mage::getVersion(), '1.5.0', '>=')) {\n\t\t\t\t$statusHistory = $order->getAllStatusHistory();\n\t\t\t\t$lastItem = count($statusHistory)-2;\n\t\t\t\t\n\t\t\t\t$lastStatus = $statusHistory[$lastItem];\n\t\t\t\t\n\t\t\t\t$statusCollection = Mage::getResourceModel('sales/order_status_collection')\n\t\t\t\t->joinStates();\n\t\t\t\t$state = '';\n\t\t\t\tforeach ($statusCollection as $status){\n\t\t\t\t\tif ($status->getStatus() == $lastStatus->getStatus())\n\t\t\t\t\t{\n\t\t\t\t\t\t$state = $status->getState();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($state !== Mage_Sales_Model_Order::STATE_CANCELED)\n\t\t\t\t\t$orderHelper->cancelOrder($order);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tMage::log('order canceled',null,'megaventory.log',true);\n\t\t\t\t$statusHistory = $order->getAllStatusHistory();\n\t\t\t\t$lastItem = count($statusHistory)-2;\n\t\t\t\t\n\t\t\t\tMage::log('status history = '.count($statusHistory),null,'megaventory.log');\n\t\t\t\tMage::log('last item index = '.$lastItem,null,'megaventory.log');\n\t\t\t\t$lastStatus = $statusHistory[$lastItem];\n\t\t\t\tMage::log('last status = '.$lastStatus->getStatus(),null,'megaventory.log');\n\t\t\t\t\n\t\t\t\tif ($lastStatus->getStatus() !== Mage_Sales_Model_Order::STATE_CANCELED)\n\t\t\t\t\t$orderHelper->cancelOrder($order);\n\t\t\t} */\n\t\t\t\n\t\t\t\n\t\t\t$orderHelper->cancelOrder($order);\n\t\t}\n\t}",
"public function buyer_cancel($order_id)\n {\n $changes = array('progress' => '0',\n 'shipping_costs' => 0.00000000,\n 'fees' => 0.00000000,\n 'confirmed_time' => '',\n 'buyer_public_key' => '');\n $this->db->where('id', $order_id);\n return $this->db->update('orders', $changes) == TRUE;\n }"
] |
[
"0.7258528",
"0.7226291",
"0.7163893",
"0.713417",
"0.69597745",
"0.69474053",
"0.6848765",
"0.6843906",
"0.68119556",
"0.6811265",
"0.68025076",
"0.67306167",
"0.67221385",
"0.6708286",
"0.66450477",
"0.66341233",
"0.6630646",
"0.6614599",
"0.6596405",
"0.6593629",
"0.659315",
"0.659057",
"0.65715915",
"0.6561848",
"0.65528464",
"0.6547179",
"0.6544529",
"0.6541423",
"0.6482412",
"0.6452938"
] |
0.7671002
|
0
|
Manage Quotation & Project (if order status is STATUS_NEW & type = design)
|
public function manageQuotationProject(OrderEvent $event)
{
$order = $event->getOrder();
if (Order::STATUS_NEW === $order->getStatus() && Order::TYPE_DESIGN === $order->getType()) {
$project = $order->getQuotation()->getProject();
// Project Update Status
$this->projectManager->updateStatus($project, Project::STATUS_ORDERED, ProjectEvent::ORIGIN_SYSTEM);
//Foreach Quotation update status : 1 STATUS_ACCEPTED / X STATUS_DISCARDED, only if current status is STATUS_DISPATCHED and STATUS_CLOSED for other
$quotations = $project->getQuotations();
foreach ($quotations as $quotation) {
/** @var Quotation $quotation */
if (Quotation::STATUS_REFUSED != $quotation->getStatus()) {
$status = Quotation::STATUS_CLOSED;
if ((Quotation::STATUS_DISPATCHED === $quotation->getStatus()) or (Quotation::STATUS_SENT === $quotation->getStatus()) or (Quotation::STATUS_NOT_DISPATCHED === $quotation->getStatus()) ) {
$status = Quotation::STATUS_DISCARDED;
if($quotation->getId() == $order->getQuotation()->getId()){
$status = Quotation::STATUS_ACCEPTED;
}
}
$this->quotationManager->updateStatus($quotation, $status, QuotationEvent::ORIGIN_SYSTEM);
}
}
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function quote($status = null, $id = null) {\n if($status == 'create') {\n $ongoing = $this->CrmQuotation->find('first', array(\n 'conditions' => array( \n 'CrmQuotation.admin_id' => $this->Auth->user('id'),\n 'CrmQuotation.status' => 'ONGOING'\n )));\n \n \n if(count($ongoing)!=0){\n //meaning meron syang ongoing na ginagawang quotation\n $quote_data = $ongoing; //retrieved data from existing ongoing quotation\n }else{\n //walang existing so data magcreate na ng data \n $terms_information = '<h3>I. PAYMENT</h3>\n <ol>\n <li>\n <p>A<strong> FIFTY PERCENT (50%)</strong> downpayment shall be required unless Raeas Marketing and the Client shall otherwise agree, balance upon completion of delivery as per agreement.</p>\n </li>\n <li>\n <p>Payment will be accepted in Dated Company Check, Manager’s Check, thru Bank Transfer or Cash.</p>\n </li>\n <li>\n <p>All check is payable to Raeas Marketing.</p>\n </li>\n </ol>\n <h3>II. DELIVERY</h3>\n <ol>\n <li>\n <p>Delivery is FREE for purchases above Php3, 000.00 within Metro Manila. </p>\n </li>\n <li>\n <p>Delivery outside Metro Manila may be charged to client.</p>\n </li>\n </ol>\n <h3>III. Validity</h3> \n <ol>\n <li>\n <p>10 Days from the date of proposal.</p>\n </li>\n <li>\n <p>Prices may vary without prior notice and shall not be considered final unless and until this Quotation Proposal has been signed and accepted.</p>\n </li>\n </ol>\n <h3>IV. Warranty</h3> \n <ol>\n <li>\n <p>One (1) year warranty against factory defect upon normal operating condition.</p>\n </li>\n </ol>\n <h3>V. Cancellation of orders</h3> \n <ol>\n <li>\n <p>All cancellation of orders will be charged a cancellation fee of 30% of the order value.</p>\n </li>\n </ol>';\n $dateToday = date(\"Hymds\");\n $milliseconds = round(microtime(true) * 1000);\n $newstring = substr($milliseconds, -3);\n $quote_number = $newstring . '' . $dateToday;\n \n $quote_exist = $this->CrmQuotation->find('count', array(\n 'conditions' => array(\n 'CrmQuotation.quote_number' => $quote_number\n )));\n\n if ($quote_exist == 0) {\n $quote_no = $quote_number;\n } else {\n $news = substr($milliseconds, -4);\n $quote_no = $news . '' . $dateToday;\n }\n $this->CrmQuotation->create();\n $this->CrmQuotation->set(array(\n 'quote_number' => $quote_no,\n 'admin_id' => $this->Auth->user('id'),\n 'status' => 'ONGOING',\n 'terms' => $terms_information, \n ));\n $this->CrmQuotation->save();\n $id = $this->CrmQuotation->getLastInsertID(); \n $quote_data = $this->CrmQuotation->find('first', array(\n 'conditions' => array('CrmQuotation.admin_id' => $this->Auth->user('id'), 'CrmQuotation.status' => 'ONGOING')\n )); \n }\n } else{\n $quote_data = $this->CrmQuotation->findById($id); \n }\n \n $this->set(compact('quote_data'));\n \n \n $companies = $this->getCompanies();\n // pr($quote_data);\n $quote_prods = $this->getQuotationProducts($quote_data['CrmQuotation']['id']);\n \n $product_lists = $this->getProducts();\n \n $this->set(compact('status','companies', 'quote_prods', 'product_lists'));\n \n\n }",
"public function actionNew()\n {\n $model = new Quotation();\n $detail = new QuotationDetail();\n $qAttachment = new QuotationAttachment();\n $firstCustomer = Customer::find()->one();\n $customerAddresses = array();\n if ( $firstCustomer ) {\n $address = Address::find()->where(['customer_id' => $firstCustomer->id,'address_type'=>'billing'])->all();\n $customerAddresses[$firstCustomer->addr_1] = $firstCustomer->addr_1;\n $customerAddresses[$firstCustomer->addr_2] = $firstCustomer->addr_2;\n }\n\n if ($model->load(Yii::$app->request->post()) ) {\n /* if no item was selected, redirect back*/\n if ( ! $detail->load(Yii::$app->request->post()) ) {\n Yii::$app->getSession()->setFlash('error', 'Please select parts or services!');\n return $this->redirect(['new']);\n }\n /* save user involved */\n $model->created_by = Yii::$app->user->identity->id;\n $currentDateTime = date(\"Y-m-d H:i:s\");\n $model->created = $currentDateTime;\n\n /* continue the previous quo number */\n $model->quotation_no = 1;\n $quoP = Quotation::find()->where(['<>','deleted', 1])->orderBy('quotation_no DESC')->limit(1)->one();\n if ( !empty ( $quoP ) ) {\n $previousNo = $quoP->quotation_no;\n $model->quotation_no = $previousNo+1;\n }\n\n\n\n if ( $model->save() ) {\n $quotationId = $model->id;\n\n if ( $detail->load(Yii::$app->request->post()) ) {\n\n foreach ( Yii::$app->request->post()['QuotationDetail'] as $d ) { \n\n $quo = new QuotationDetail();\n $quo->quotation_id = $quotationId;\n\n\n $quo->service_details = $d['service_details'];\n $quo->group = $d['group'];\n $quo->work_type = $d['work_type'];\n $quo->quantity = $d['quantity'];\n $quo->unit_price = $d['unit_price'];\n $quo->subtotal = $d['subTotal'];\n\n $quo->save();\n\n }\n\n\n } /* if load detail */ \n\n\n if ( $qAttachment->load(Yii::$app->request->post()) ) {\n $qAttachment->attachment = UploadedFile::getInstances($qAttachment, 'attachment');\n\n foreach ($qAttachment->attachment as $file) {\n\n $fileName = md5(date(\"YmdHis\")).'-'.$file->name;\n $qAttachmentClass = explode('\\\\', get_class($qAttachment))[2];\n $file->saveAs('uploads/'.$qAttachmentClass.'/'.$fileName);\n /* image upload */\n $quoA = new QuotationAttachment();\n $quoA->quotation_id = $quotationId;\n $quoA->value = $fileName;\n $quoA->save();\n\n }\n \n }/* if load attachment */ \n \n return $this->redirect(['preview', 'id' => $model->id]);\n } /* if save model */\n\n \n } \n return $this->render('new', [\n 'model' => $model,\n 'detail' => $detail,\n 'qAttachment' => $qAttachment,\n 'customerAddresses' => $customerAddresses,\n ]);\n \n }",
"public function getQuoteDetails()\n {\n $types = [\n ['value' => 'Full Kitchen', 'text' => 'Full Kitchen'],\n ['value' => 'Cabinet Only', 'text' => 'Cabinet Only'],\n ['value' => 'Cabinet Small Job', 'text' => 'Cabinet Small Job'],\n ['value' => 'Cabinet and Install', 'text' => 'Cabinet and Install'],\n ['value' => 'Granite Only', 'text' => 'Granite Only'],\n ];\n if (Auth::user()->id == 5 || Auth::user()->id == 1)\n {\n $types[] = ['value' => 'Builder', 'text' => 'Builder'];\n }\n $type = Editable::init()->id(\"quote_type\")->placement('right')->type('select')->title(\"Quote Type\")\n ->linkText($this->quote->type)\n ->source($types)->url(\"/quote/{$this->quote->id}/type/liveupdate\")->render();\n\n if (!$this->quote->title)\n {\n $this->quote->title = \"Main Quote\";\n }\n $title = Editable::init()->id(\"quote_title\")->placement('right')->type('text')->title(\"Title\")\n ->linkText($this->quote->title)\n ->url(\"/quote/{$this->quote->id}/title/liveupdate\")->render();\n $markup = Editable::init()->id(\"quote_markup\")->placement('right')->type('text')->title(\"Markup Percentage\")\n ->linkText($this->quote->markup)\n ->url(\"/quote/{$this->quote->id}/markup/liveupdate\")->render();\n\n $rows = [];\n $rows[] = ['Quote Type:', $type];\n $rows[] = ['Title (Description)', $title];\n if ($this->quote->type == 'Full Kitchen')\n {\n $rows[] = ['Customer Picking Slab:', $this->quote->picking_slab];\n }\n if ($this->quote->type == 'Builder')\n {\n $rows[] = ['Frugal Markup Percentage:', $markup];\n }\n if (isset($this->meta['finance']))\n {\n switch ($this->meta['finance']['type'])\n {\n case 'all':\n $type = \"100% Financing Option for \" . $this->meta['finance']['terms'] . \" months\";\n break;\n case 'partial':\n\n $type = \"Partial financing Option putting $\" . $this->meta['finance']['downpayment'] . \" down\n with \";\n if (isset($this->meta['finance']['down_cash']) && $this->meta['finance']['down_cash'] > 0)\n {\n $type .= '$' . $this->meta['finance']['down_cash'] . \" in cash, \";\n }\n if (isset($this->meta['finance']['down_credit']) && $this->meta['finance']['down_credit'] > 0)\n {\n $type .= '$' . $this->meta['finance']['down_credit'] . \" in cash, \";\n }\n $type = substr($type, 0, -2);\n $type .= \" and financing for \" . $this->meta['finance']['terms'] . \" months\";\n break;\n case 'none':\n $type = \"No financing paying \";\n if (isset($this->meta['finance']['method']) && $this->meta['finance']['method'] == 'split')\n {\n if (isset($this->meta['finance']['no_cash']) && $this->meta['finance']['no_cash'] > 0)\n {\n $type .= \"$\" . number_format($this->meta['finance']['no_cash'], 2) . \" in cash, \";\n }\n if (isset($this->meta['finance']['no_credit']) && $this->meta['finance']['no_credit'] > 0)\n {\n $type .= \"$\" . number_format($this->meta['finance']['no_credit'], 2) . \" in credit, \";\n }\n $type = substr($type, 0, -2);\n }\n else\n {\n $type = \"No finance using \" . $this->meta['finance']['method'] . \" for payment\";\n }\n break;\n default:\n $type = \"Financing Option Needed\";\n }\n $rows[] = ['Financing Options', $type];\n }\n\n $table = Table::init()->rows($rows)->render();\n $panel = Panel::init('primary')\n ->header(\"Quote Details <small style='color:#fff'>Quote Type and Cabinet Information</small>\")\n ->content($table)->render();\n return $panel;\n }",
"public function sendTeamQuoteAction()\n\t{\n\t\t//setlocale(LC_TIME, \"fr_FR\");\n\t\tif($this->quote_creation->create_step1['quote_type']=='only_tech' || $this->quote_creation->create_step1['quote_type']=='only_seo')\n\t\t{\t\t\t\n\t\t\t\n\t\t\t$client_id=$this->quote_creation->create_step1['client_id'];\n\t\t\t$client_obj=new Ep_Quote_Client();\t\t\n\t\t\t$quote_obj=new Ep_Quote_Quotes();\n\n\t\t\t$this->quote_creation->custom['mission_added']='no';\n\n\t\t\t//getting Client details of selected client\n\t\t\t$client_details=$client_obj->getClientDetails($client_id);\n\t\t\tif($client_details!='NO')\n\t\t\t{\n\t\t\t\t$this->quote_creation->create_mission['company_name']=$client_details[0]['company_name'];\n\t\t\t\t$this->quote_creation->create_mission['ca_number']=$client_details[0]['ca_number'];\n\t\t\t\t$this->quote_creation->create_mission['client_id']=$client_details[0]['identifier'];\n\t\t\t}\t\n\n\t\t\t\n\n\t\t\t$quote_monthly_cnt=$quote_obj->getMonthlyCount($client_id);\n\t\t\t$quote_monthly_cnt+=1;\n\n\t\t\t//titel should be form DB in edit\n\t\t\tif($this->quote_creation->custom['action']!='edit' || !$this->quote_creation->create_mission['quote_title'] || ($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes'))\n\t\t\t{\n\t\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')\n\t\t\t\t{\n\t\t\t\t\t$old_version='v'.($this->quote_creation->custom['version']-1);\n\t\t\t\t\t$new_version='v'.($this->quote_creation->custom['version']);\n\t\t\t\t\t$old_title=$this->quote_creation->create_mission['quote_title'];\n\n\t\t\t\t\t$this->quote_creation->create_mission['quote_title']=str_replace($old_version, $new_version, $old_title);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$this->quote_creation->create_mission['quote_title']='Quote - '.$this->quote_creation->create_mission['company_name'].' - '.strftime(\"%B %Y\").' - '.$quote_monthly_cnt. \" - v1\";\t\n\t\t\t}\n\n\t\t\t//getting Quote user details of selected Bo user\t\t\t\n\t\t\t$quote_by=$this->quote_creation->create_step1['quote_by'];\n\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote_by);\n\t\t\tif($bo_user_details!='NO')\n\t\t\t{\n\t\t\t\t$this->quote_creation->create_mission['quote_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t$this->quote_creation->create_mission['email']=$bo_user_details[0]['email'];\n\t\t\t\t$this->quote_creation->create_mission['phone_number']=$bo_user_details[0]['phone_number'];\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\n\t\t\t$this->quote_creation->create_mission['category_name']=$this->getCategoryName($this->quote_creation->create_step1['category']);\n\t\t\t\n\n\t\t\t$this->_view->create_mission=$this->quote_creation->create_mission;\n\t\t\t$this->_view->create_step1=$this->quote_creation->create_step1;\n\t\t\t$this->_view->custom=$this->quote_creation->custom;\n\t\t //Added w.r.t edit/duplicate\n\t\t $this->_view->send_quote=$this->quote_creation->send_quote;\n\t\t \n\t\t //echo \"<pre>\";print_r($this->quote_creation->send_team_quote);exit;\n\n\t\t\t$this->render('send-team-quote');\n\t\t}\n\t\telse\n\t\t\t$this->_redirect(\"/quote/create-quote-step1?submenuId=ML13-SL2\");\t\n\t}",
"public function createQuote()\n\t{\n\t\t$this->setType($_POST['frmquotetype']);\n\t\t$this->setDate($_POST['frmquotedate']);\n\t\t$this->setStatus('Open');\n\t\t$this->setJobName($_POST['frmjobname']);\n\t\t$this->setJobAddress($_POST['frmjobaddress']);\n\t\t$this->setJobCity($_POST['frmjobcity']);\n\t\t$this->setJobZipcode($_POST['frmjobzipcode']);\n\t\t$this->setAttention($_POST['frmattn']);\n\t\t// Here we are going to post the tax rate and turn it into a float.\n\t\t$unformatted_tax_rate = $_POST['frmtaxrate'];\n\t\t$this->setTaxRate((float)$unformatted_tax_rate);\n\t\t$this->setCostBeforeTax($_POST['cartBeforeTaxCost']);\n\t\t$this->setTotalCost($_POST['cartTotalCost']);\n\t\t$this->setSalesTax($_POST['cartTax']);\n\t\t$this->setMonthlyTotal($_POST['cartMonthlyTotal']);\n\t\t$this->setDeliveryTotal($_POST['cartDeliveryTotal']);\n\t\t$this->setHidden(null);\n\n\t\t// Need to insert the new order into the database.\n\t\t$this->getDB()->insert('quotes', [\n\t\t\t\t'quote_customer' \t\t=> $this->getCustomer(),\n\t\t\t\t'quote_customer_id' \t=> $this->getCustomerId(),\n\t\t\t\t'quote_date' \t\t\t=> $this->getDate(),\n\t\t\t\t'quote_status' \t\t\t=> $this->getStatus(),\n\t\t\t\t'quote_type' \t\t\t=> $this->getType(),\n\t\t\t\t'job_name' \t\t\t\t=> $this->getJobName(),\n\t\t\t\t'job_city' \t\t\t\t=> $this->getJobCity(),\n\t\t\t\t'job_address' \t\t\t=> $this->getJobAddress(),\n\t\t\t\t'job_zipcode' \t\t\t=> $this->getJobZipcode(),\n\t\t\t\t'attn' \t\t\t\t\t=> $this->getAttention(),\n\t\t\t\t'tax_rate' \t\t\t\t=> $this->getTaxRate(),\n\t\t\t\t'cost_before_tax' \t\t=> $this->getCostBeforeTax(),\n\t\t\t\t'total_cost' \t\t\t=> $this->getTotalCost(),\n\t\t\t\t'sales_tax' \t\t\t=> $this->getSalesTax(),\n\t\t\t\t'monthly_total' \t\t=> $this->getMonthlyTotal(),\n\t\t\t\t'delivery_total'\t\t=> $this->getDeliveryTotal(),\n\t\t\t\t'hidden'\t\t\t\t=> $this->getHidden()\n\t\t\t]);\n\n\t\t// If properly inserted, grab the ID, else throw error.\n\t\tif($this->getDB()->lastId() != null)\n\t\t{\n\t\t\t$this->id = $this->getDB()->lastId();\n\t\t} \n\t\telse \n\t\t{\n\t\t\tthrow new Exception(\"There was an error inserting the quote into the database.\");\n\t\t}\n\t\t\n\t}",
"public function quote_request_new() {\n\t /*\t$step_one_sidebar = '<div class=\"col-md-2\">\n\t <div class=\"sidebar\">\n\t <h3>Talk TO A REPRESENTATIVE</h3>\n\t <div class=\"selection-container\">\n\t <ul>\n\t <li>1 (877) 589-2214 (US/Canada)<br/><a href=\"mailto:[email protected]\">[email protected]</a></li>\n\t </ul>\n\t \n\t </div>\n\t </div>\n\t </div>'; */ \n\t\t$step_four = 'test';\n\t //return $this->new_product_finder('quote_request', NULL, $step_four);\n\t\t$path = \\Drupal::request()->getpathInfo();\n $arg = explode('/', $path);\t\t\n $cur_page = $arg[1];\n\t\t\n\t\t$pid = $_GET['pid'];\n\t\t\n\t\t$newrfq = $fpage;\n\t\t//$newrfq = $step_four;\n\t\t\n\t\treturn array(\n\t '#theme' => 'quote_request',\n\t\t '#cur_page' => $cur_page,\n\t\t '#pid' => $pid,\n\t '#quote_related_products' => $step_four,\n\t );\n \t}",
"function commerce_quickbooks_settings_form($form, &$form_state) {\n\n $form['commerce_quickbooks_commerce_cron'] = array(\n '#type' => 'checkbox',\n '#title' => t('Enable Drupal Commerce cron'),\n '#default_value' => variable_get('commerce_quickbooks_commerce_cron'),\n '#description' => t('Warning - This setting will send all your customers, products and orders to QuickBooks online during cron runs.'),\n );\n \n // Build an array of order status options grouped by order state.\n $options = array();\n foreach (commerce_order_state_get_title() as $name => $title) {\n foreach (commerce_order_statuses(array('state' => $name)) as $order_status) {\n\n // Only include enabled statues and the current order status.\n if (!empty($order_status['status']) || $order->status == $order_status['name']) {\n $options[check_plain($title)][$order_status['name']] = check_plain($order_status['title']);\n }\n }\n }\n \n $form['commerce_quickbooks_order_status'] = array(\n '#type' => 'select',\n '#title' => t('Order status to send'),\n '#multiple' => TRUE,\n '#options' => $options,\n '#default_value' => variable_get('commerce_quickbooks_order_status'),\n '#description' => t('Select the order statuses that should be considered ready to send. You will want to select the final status. Not one that gets systematically updated. <br>This is because the queue gets built by querying the database for orders matching this status.'),\n );\n\n return(system_settings_form($form));\n\n}",
"public static function geoCart_payment_choicesProcess()\n {\n //get the cart\n $cart = geoCart::getInstance();\n\n //get the gateway since this is a static function\n $gateway = geoPaymentGateway::getPaymentGateway(self::gateway_name);\n\n //get invoice on the order\n $invoice = $cart->order->getInvoice();\n $invoice_total = $invoice->getInvoiceTotal();\n\n if ($invoice_total >= 0) {\n //DO NOT PROCESS! Nothing to process, no charge (or returning money?)\n return ;\n }\n //BUILD DATA TO SEND TO GATEWAY TO COMPLETE THE TRANSACTION\n $info = parent::_getInfo();\n\n //create initial transaction\n try {\n //let parent create a new transaction, since it does all that common stuff for us.\n //(including encrypting CC data)\n $transaction = self::_createNewTransaction($cart->order, $gateway, $info, false, true);\n\n //Add the transaction to the invoice\n $transaction->setInvoice($invoice);\n $invoice->addTransaction($transaction);\n\n //save it so there is an id\n $transaction->save();\n } catch (Exception $e) {\n //catch any error thrown by _createNewTransaction\n trigger_error('ERROR TRANSACTION CART PAYFLOW_PRO: Exception thrown when attempting to create new transaction.');\n return;\n }\n\n\n $cart->order->processStatusChange('pending_admin');\n }",
"function qform_manage($def, $cfg, $title = array())\n{\n global $config, $txt;\n\n $cmd = get_param('qform_cmd');\n $id = get_param('id');\n\n // get cmd from POST\n if (empty($cmd)) {\n $cmd = post_param('qform_cmd');\n }\n if (empty($id)) {\n $id = post_param('primary_val');\n }\n\n // manage cmd\n if (empty($cmd)) {\n $cmd = $cfg['cmd_default'];\n }\n if (!empty($id)) {\n $cmd = 'update';\n }\n if (post_param('qform_process')) {\n $cmd = 'process';\n }\t\t// id not required for NEW cmd\n\n // logging\n if (!isset($cfg['enable_log'])) {\n $cfg['enable_log'] = $config['enable_qform_log'];\n }\n if (!isset($cfg['detailed_log'])) {\n $cfg['detailed_log'] = $config['enable_detailed_log'];\n }\n if (empty($cfg['log_title'])) {\n $cfg['enable_log'] = $cfg['detailed_log'] = '';\n }\n\n // default vars\n if (!isset($cfg['pre_process'])) {\n $cfg['pre_process'] = '';\n }\n if (!isset($cfg['auto_save_changes'])) {\n $cfg['auto_save_changes'] = true;\n }\n if (!isset($cfg['update_ignore_value'])) {\n $cfg['update_ignore_value'] = false;\n }\n if (!isset($cfg['cmd_save_enable'])) {\n $cfg['cmd_save_enable'] = true;\n }\n\n switch ($cmd) {\n case 'search':\n if (function_exists($cfg['pre_process'])) {\n call_user_func($cfg['pre_process'], 'search', false);\n }\n $cfg['title'] = empty($title['search']) ? 'Search' : $title['search'];\n if ($cfg['cmd_search_enable']) {\n return qform_search($def, $cfg);\n } else {\n just_die('Search disabled!');\n }\n break;\n\n\n case 'list':\n if (function_exists($cfg['pre_process'])) {\n call_user_func($cfg['pre_process'], 'list', false);\n }\n $cfg['title'] = empty($title['list']) ? 'List' : $title['list'];\n if ($cfg['cmd_list_enable']) {\n return qform_list($def, $cfg);\n } else {\n just_die('List disabled!');\n }\n break;\n\n\n case 'new':\n if (function_exists($cfg['pre_process'])) {\n call_user_func($cfg['pre_process'], 'new', false);\n }\n $cfg['title'] = empty($title['new']) ? 'New Item' : $title['new'];\n if ($cfg['cmd_new_enable']) {\n $cfg['cmd'] = 'new';\t\t\t\t\t// cmd: new, update, search\n $output = qform_compile($def, $cfg);\n return $output;\n } else {\n just_die('New item not allowed.');\n }\n break;\n\n\n case 'update':\n $cfg['title'] = empty($title['update']) ? 'Update Item' : $title['update'];\n if ($cfg['cmd_update_enable']) {\n $cfg['cmd'] = 'update';\n $cfg['primary_val'] = get_param('id');\n if (function_exists($cfg['pre_process'])) {\n call_user_func($cfg['pre_process'], 'update', $id);\n }\n $output = qform_compile($def, $cfg);\n return $output;\n } else {\n just_die('Item update not allowed.');\n }\n break;\n\n\n case 'process':\n $id = post_param('primary_val');\n if (!$cfg['cmd_new_enable'] && !$id) {\n just_die('New not allowed');\n }\n if (!$cfg['cmd_update_enable'] && $id) {\n just_die('Edit not allowed');\n }\n if (!$cfg['cmd_save_enable'] && $id) {\n just_die('Save not allowed');\n }\n if (function_exists($cfg['pre_process'])) {\n call_user_func($cfg['pre_process'], $id ? 'update' : 'new', $id);\n }\n $output = qform_process($def, $cfg);\n if (!$cfg['auto_save_changes']) {\n return $output;\n }\n break;\n\n\n case 'remove_item':\n if ($cfg['cmd_remove_enable']) {\n $cfg['cmd'] = 'remove_item';\n $id = get_param('primary_val');\n if (function_exists($cfg['pre_process'])) {\n call_user_func($cfg['pre_process'], 'remove_item', $id);\n }\n if (!$cfg['auto_save_changes']) {\n return array('qqq');\n }\n qform_remove_item($def, $cfg);\n } else {\n just_die('Item removal not allowed.');\n }\n break;\n\n\n case 'remove_file':\n $id = get_param('primary_val');\n $cfg['cmd'] = 'remove_file';\n if (function_exists($cfg['pre_process'])) {\n call_user_func($cfg['pre_process'], 'remove_file', $id);\n }\n qform_remove_file($def, $cfg);\n break;\n\n\n default:\n just_die('Unknown command type of <b>'.$cmd.'</b>!');\n break;\n }\n}",
"public function selectQuoteMissionAction()\n\t{\n\t\t$quote_missions=array();\n\n\t\tif(!is_array($this->quote_creation->select_missions['missions_selected']))\n\t\t\t$this->quote_creation->select_missions['missions_selected']=array();\n\n\t\t//echo \"<pre>\";print_r($this->quote_creation->select_missions['missions_selected']);\n\n\t\tif(is_array($this->quote_creation->create_mission['product']) && count($this->quote_creation->create_mission['product'])>0)\n\t\t{\n\t\t\t$i=0;\n\t\t\tforeach($this->quote_creation->create_mission['product'] as $mission)\n\t\t\t{\n\t\t\t\t/*Added w.r.t Autre mission*/\n\t\t\t\tif($this->quote_creation->create_mission['product'][$i]=='autre')\n\t\t\t\t{\n\t\t\t\t\t$this->quote_creation->create_mission['language'][$i]='fr';\n\t\t\t\t\t$this->quote_creation->create_mission['volume'][$i]=1;\n\t\t\t\t\t$this->quote_creation->create_mission['nb_words'][$i]=1;\n\t\t\t\t\t$this->quote_creation->create_mission['producttype'][$i]='autre';\n\t\t\t\t}\n\n\n\t\t\t\t$quote_missions[$i]['product']=$this->quote_creation->create_mission['product'][$i];\n\t\t\t\t$quote_missions[$i]['product_name']=$this->product_array[$this->quote_creation->create_mission['product'][$i]];\n\t\t\t\t$quote_missions[$i]['language']=$this->quote_creation->create_mission['language'][$i];\n\t\t\t\t$quote_missions[$i]['language_name']=$this->getLanguageName($this->quote_creation->create_mission['language'][$i]);\n\t\t\t\t$quote_missions[$i]['languagedest']=$this->quote_creation->create_mission['languagedest'][$i];\n\t\t\t\t$quote_missions[$i]['languagedest_name']=$this->getLanguageName($this->quote_creation->create_mission['languagedest'][$i]);\n\n\t\t\t\t$quote_missions[$i]['producttype']=$this->quote_creation->create_mission['producttype'][$i];\n\t\t\t\t$quote_missions[$i]['producttypeother']=$this->quote_creation->create_mission['producttypeother'][$i];\n\t\t\t\t$quote_missions[$i]['producttype_name']=$this->producttype_array[$this->quote_creation->create_mission['producttype'][$i]];\n\t\t\t\t$quote_missions[$i]['nb_words']=$this->quote_creation->create_mission['nb_words'][$i];\n\t\t\t\t$quote_missions[$i]['volume']=$this->quote_creation->create_mission['volume'][$i];\n\t\t\t\t/*added w.r.t Tempo*/\n\t\t\t\t$quote_missions[$i]['volume_max']=$this->quote_creation->create_mission['volume_max'][$i];\n\t\t\t\t$quote_missions[$i]['mission_length']=$this->quote_creation->create_mission['mission_length'][$i];\n\t\t\t\t$quote_missions[$i]['mission_length_option']=$this->quote_creation->create_mission['mission_length_option'][$i];\n\t\t\t\t$quote_missions[$i]['delivery_volume_option']=$this->quote_creation->create_mission['delivery_volume_option'][$i];\n\t\t\t\t$quote_missions[$i]['tempo']=$this->quote_creation->create_mission['tempo'][$i];\n\t\t\t\t$quote_missions[$i]['tempo_length']=$this->quote_creation->create_mission['tempo_length'][$i];\n\t\t\t\t$quote_missions[$i]['tempo_length_option']=$this->quote_creation->create_mission['tempo_length_option'][$i];\n\t\t\t\t$quote_missions[$i]['oneshot']=$this->quote_creation->create_mission['oneshot'][$i];\n\t\t\t\t$quote_missions[$i]['demande_client']=$this->quote_creation->create_mission['demande_client'][$i];\n\t\t\t\t$quote_missions[$i]['duration_dont_know']=$this->quote_creation->create_mission['duration_dont_know'][$i];\n\t\t\t\t//flag retrive\n\t\t\t\t$quote_missions[$i]['producttypeautre']=$this->quote_creation->create_mission['producttypeautre'][$i];\n\t\t\t\t$quote_missions[$i]['comments']=$this->quote_creation->create_mission['comments'][$i];\n\n\t\t\t\t$quote_missions[$i]['identifier']=$this->quote_creation->create_mission['identifier'][$i];\t\t\t\t\n\n\t\t\t\t//mission object\n\t\t\t\t$mission_obj=new Ep_Quote_Mission();\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t/*dont change the order of this array*/\n\t\t\t\t$searchParameters['product']=$this->quote_creation->create_mission['product'][$i];\n\t\t\t\t$searchParameters['language']=$this->quote_creation->create_mission['language'][$i];\n\t\t\t\t$searchParameters['languagedest']=$this->quote_creation->create_mission['languagedest'][$i];\n\t\t\t\t$searchParameters['producttype']=$this->quote_creation->create_mission['producttype'][$i];\n\t\t\t\t$searchParameters['volume']=$this->quote_creation->create_mission['volume'][$i];\n\t\t\t\t$searchParameters['nb_words']=$this->quote_creation->create_mission['nb_words'][$i];\n\t\t\t\t\n\n\t\t\t\t$missionDetails=$mission_obj->getMissionDetails($searchParameters,3);\n\t\t\t\tif($missionDetails)\n\t\t\t\t{\n\t\t\t\t\t$m=0;\n\t\t\t\t\tforeach($missionDetails as $misson)\n\t\t\t\t\t{\n\t\t\t\t\t\t$missionDetails[$m]['category_name']=$this->getCategoryName($misson['category']);\n\t\t\t\t\t\t$missionDetails[$m]['product']=$this->product_array[$misson['type']];\n\t\t\t\t\t\t$missionDetails[$m]['language1_name']=$this->getLanguageName($misson['language1']);\n\t\t\t\t\t\t$missionDetails[$m]['producttype']=$this->producttype_array[$misson['type_of_article']];\n\n\t\t\t\t\t\t//Added w.r.t conversion\t\t\t\t\t\t\n\t\t\t\t\t\tif($misson['writing_cost_before_signature_currency']!=$this->quote_creation->create_step1['currency'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$missionDetails[$m]['writing_cost_before_signature']=($misson['writing_cost_before_signature']*$this->quote_creation->create_step1['conversion']);\n\t\t\t\t\t\t\t$missionDetails[$m]['correction_cost_before_signature']=($misson['correction_cost_before_signature']*$this->quote_creation->create_step1['conversion']);\n\t\t\t\t\t\t\t$missionDetails[$m]['other_cost_before_signature']=($misson['other_cost_before_signature']*$this->quote_creation->create_step1['conversion']);\n\t\t\t\t\t\t\t$missionDetails[$m]['unit_price']=($misson['selling_price']*$this->quote_creation->create_step1['conversion']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$missionDetails[$m]['unit_price']=$misson['selling_price'];\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t$missionDetails[$m]['mission_turnover']=($misson['num_of_articles']*$missionDetails[$m]['unit_price'])/1000;\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t$m++;\n\t\t\t\t\t}\n\n\t\t\t\t\t$quote_missions[$i]['missionDetails']=$missionDetails;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$i++;\n\t\t\t}\t\t\t\n\n \t\t\t//echo \"<pre>\";print_r($quote_missions);exit;\n \t\t\t$this->quote_creation->create_mission['quote_missions']=$quote_missions;\n\n\t\t\t$this->_view->quote_missions=$quote_missions;\n\t\t\t$this->_view->create_mission=$this->quote_creation->create_mission;\n\t $this->_view->create_step1=$this->quote_creation->create_step1;\n\t $this->_view->select_missions=$this->quote_creation->select_missions;\n\n\t\t\t$this->render('select-quote-mission');\n\n\t\t}\n\t\telse\n\t\t\t$this->_redirect(\"/quote/create-quote-step1?submenuId=ML13-SL2\");\t\t\n\n\n\n\t}",
"function main()\t{\n global $LANG;\n $this->previousQuestions();\n $arrRecord = BackendUtility::getRecord($this->arrWizardParameters['table'], $this->arrWizardParameters['uid']);\n $strOutput = $this->objDoc->startPage($LANG->getLL('conditions_title'));\n\t\tif ($this->arrWizardParameters['table'] && $this->arrWizardParameters['field'] && $this->arrWizardParameters['uid'] && is_array($this->arrPrevQuestions))\t{\n\t\t\t$strOutput.=$this->objDoc->section($LANG->getLL('conditions_title'),$this->conditionsWizard($arrRecord),0,1);\n\t\t} else {\n\t\t\t$strOutput.=$this->objDoc->section($LANG->getLL('conditions_title'),'<span class=\"typo3-red\">'.$LANG->getLL('conditions_error',1).'</span>',0,1);\n\t\t\t$strOutput.= '\n\t\t\t<div id=\"c-saveButtonPanel\">\n <a href=\"#\" onclick=\"' . htmlspecialchars('jumpToUrl(unescape(\\'' . rawurlencode($this->arrWizardParameters['returnUrl']).'\\')); return false;').'\"><img class=\"c-inputButton\"'.IconUtility::skinImg($this->objDoc->backPath, 'gfx/closedok.gif') . BackendUtility::titleAltAttrib($LANG->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc')).'\" /></a>\n\t\t\t</div>';\n\t\t}\n\t\t$strOutput.=$this->objDoc->endPage();\n\t\t$this->content = $strOutput;\n\t}",
"function qedit(){\r\n \r\n\t\tif(isset($_POST['bdel'])) if($_POST['bdel']==\"DELETE\"){\t\t \r\n\t\t\t$q = \"UPDATE `\".$_POST['TABLE'].\"` SET `status_id` = 0 WHERE `id` = '\".$_POST['id'].\"' LIMIT 1\"; \r\n\t\t\t$this->db->query($q); \r\n\t\t\t//--create log\r\n\t\t\t$this->allfunc->createLog('user',$this->session->userdata('ID'),strtolower(__CLASS__),$_POST['TABLE'].' - DEL id: '.$_POST['id']);\r\n\t\t redirect('/'.strtolower(__CLASS__).'/'.$_POST['ci_func'].'/','refresh'); \r\n\t\t\texit;\r\n\t\t}\r\n \t\t\r\n\t\t$qstr1 = $qstr2 = $qstr3 = ''; \r\n\t\tforeach($_POST as $k => $v){ //echo \"<br>$k => $v\"; \r\n\t\t\t$$k = $v; \r\n\t\t\tif( \r\n\t\t\t\t($k!=\"TABLE\" && $k!=\"ci_func\" && $k!=\"button\" && $k!=\"status_id\" && $v!=\"Submit\" && $k!='redir') \r\n\t\t\t\t&&\r\n\t\t\t\t( substr($k,0,10)!='product_id' && \tsubstr($k,0,13)!='delivery_type' && substr($k,0,8)!='trx_code')\t\r\n\t\t\t){ \r\n\t\t\t\t$qstr1 .= \"`\".$k.\"`,\"; \r\n\t\t\t\tif($k==\"id\") $qstr2 .= \"'',\"; \r\n\t\t\t\telse \t\t\t{$qstr2 .= \"'\".$v.\"',\"; \r\n\t\t\t\t\r\n\t\t\t\t$qstr3 .= \"`\".$k.\"` = '\".$v.\"',\";} \r\n\t\t\t} \r\n\t\t\tif( substr($k,0,10)=='product_id' ){\r\n\t\t\t\t$p_key = substr($k,10,strlen($k));\r\n\t\t\t\t$p_val = $v; \r\n\t\t\t\t$product_ids[$p_key] = $p_val; \r\n\t\t\t\t$vendor_ids[$p_key] = $this->allmodel->getTableWhere('pd_product','id',$p_val,1,'id','suplier_id'); \r\n\t\t\t\t\r\n\t\t\t} \r\n\t\t\tif( substr($k,0,13)=='delivery_type' ){\r\n\t\t\t\t$d_key = substr($k,13,strlen($k));\r\n\t\t\t\t$d_val = $v; \r\n\t\t\t\t$delivery_types[$d_key] = $d_val;\r\n\t\t\t} \r\n\t\t\tif( substr($k,0,8)=='trx_code' ){\r\n\t\t\t\t$t_key = substr($k,8,strlen($k));\r\n\t\t\t\t$t_val = $v; \r\n\t\t\t\t$trx_codes[$t_key] = $t_val;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t}\r\n\t\t//$product_ids\r\n\t\tif(isset($product_ids)){\r\n\t\t\t$im_product_id = implode(\",\",$product_ids); \r\n\t\t\t$qstr3 .= \" `product_id`= '\".$im_product_id.\"',\";\r\n\t\t\t\r\n\t\t\t$im_vendor_id = implode(\",\",$vendor_ids); \r\n\t\t\t$qstr3 .= \" `product_vendor_id`= '\".$im_vendor_id.\"',\";\r\n\t\t\t\r\n\t\t\t$im_delivery_type = implode(\",\",$delivery_types); \r\n\t\t\t$qstr3 .= \" `product_delivery_id`= '\".$im_delivery_type.\"',\";\r\n\t\t\t\r\n\t\t\t$im_trx_code = implode(\",\",$trx_codes); \r\n\t\t\t$qstr3 .= \" `trx_code_id`= '\".$im_trx_code.\"',\";\r\n\t\t\t\r\n\t\t\t//-- get vendor id from product id\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n \r\n\t\t//foreach($product_ids as $k => $v) echo \"<br>$k => $v\"; \r\n\t\t\r\n\t\t\r\n///------------------ product_delivery_id \tproduct_vendor_id \tproduct_alert_id \ttrx_code_id\r\n///---- VENDOR IDS!!!!\r\n\t\t\r\n\t\t\r\n\t\t/* \r\n\t\tTABLE => vending_terminal\r\n\t\tci_func => vending_terminal\r\n\t\tid => 3\r\n\t\tredir => http://lunari/dealer_terminal/edit_data/3/vending_terminal/1/1/1/1\r\n\t\t\r\n\t\tproduct_id0 => 1\r\n\t\tdelivery_type0 => 1\r\n\t\ttrx_code0 => 1\r\n\t\t\r\n\t\tproduct_id1 => 2\r\n\t\tdelivery_type1 => 7\r\n\t\ttrx_code1 => 10\r\n\t\t\r\n\t\tproduct_id2 => 3\r\n\t\tdelivery_type2 => 5\r\n\t\ttrx_code2 => 9\r\n\t\t\r\n\t\tbutton => Submit\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\tif(empty($id)){ //-- add new data \r\n\t\t\t$qstr1 = substr($qstr1,0,strlen($qstr1)-1);\r\n\t\t\t$qstr2 = substr($qstr2,0,strlen($qstr2)-1); \r\n\t\t\t$q = \"INSERT INTO `\".$TABLE.\"` (\".$qstr1.\")VALUES(\".$qstr2.\")\";\r\n\t\t\t$this->db->query($q); \r\n\t\t\t$cid = mysql_insert_id(); \r\n\t\t\t\r\n\t\t\t//--create log\r\n\t\t\t$this->allfunc->createLog('user',$this->session->userdata('ID'),strtolower(__CLASS__),$_POST['TABLE'].' - ADD id : '.$cid); \r\n\t\t\t\r\n\t\t }else{ //-- edit data\r\n\t\t\t$qstr3 = substr($qstr3,0,strlen($qstr3)-1); \r\n\t\t\t$stractive = '';\r\n\t\t\tif($_POST['button']==\"ACTIVATE\") $stractive = ', `status_id`=1 '; \r\n\t\t\t\r\n \t\t\t$q = \"UPDATE `\".$TABLE.\"` SET \". $qstr3.$stractive. \" WHERE `id` = \".$id.\" LIMIT 1\"; \r\n \r\n\t\t\t$this->db->query($q); \r\n\t\t\t$cid = $id; \r\n \r\n\t\t\t//--create log\r\n\t\t\t$this->allfunc->createLog('user',$this->session->userdata('ID'),strtolower(__CLASS__),$_POST['TABLE'].' - UPDATE id: '.$_POST['id']); \r\n\t\t} \r\n \r\n \r\n \r\n\t\tif(isset($product_ids)){\r\n\t\t\tredirect(str_replace(\"http://25.59.210.248/\",\"/\",$redir.\"/done\"),'refresh'); \r\n\t\t\t \r\n\t\t}\r\n\t\telse\r\n\t\tredirect('/'.strtolower(__CLASS__).'/edit_data/'.$cid.'/'.$ci_func.'/','refresh'); \r\n\t}",
"function add_work_order_quick($wo_ref, $loc_code, $units_reqd, $stock_id, $type, \n\t$date_, $memo_, $costs, $cr_acc, $labour, $cr_lab_acc)\n{\n\tglobal $Refs;\n\n\tbegin_transaction();\n\t$args = func_get_args();\n\t$args = (object)array_combine(array('wo_ref', 'loc_code', 'units_reqd', 'stock_id',\n\t\t'type', 'date_', 'memo_', 'costs', 'cr_acc', 'labour', 'cr_lab_acc'), $args);\n\t$args->woid = 0;\n\thook_db_prewrite($args, ST_WORKORDER);\n\n\t// if unassembling, reverse the stock movements\n\tif ($type == WO_UNASSEMBLY)\n\t\t$units_reqd = -$units_reqd;\n\n\tadd_material_cost($stock_id, $units_reqd, $date_);\n\n\t$date = date2sql($date_);\n\tif (!isset($costs) || ($costs == \"\"))\n\t\t$costs = 0;\n\tadd_overhead_cost($stock_id, $units_reqd, $date_, $costs);\n\tif (!isset($labour) || ($labour == \"\"))\n\t\t$labour = 0;\n\tadd_labour_cost($stock_id, $units_reqd, $date_, $labour);\n\t\t\n\t$sql = \"INSERT INTO \".TB_PREF.\"workorders (wo_ref, loc_code, units_reqd, units_issued, stock_id,\n\t\ttype, additional_costs, date_, released_date, required_by, released, closed)\n \tVALUES (\".db_escape($wo_ref).\", \".db_escape($loc_code).\", \".db_escape($units_reqd)\n \t.\", \".db_escape($units_reqd).\", \".db_escape($stock_id).\",\n\t\t\".db_escape($type).\", \".db_escape($costs).\", '$date', '$date', '$date', 1, 1)\";\n\tdb_query($sql, \"could not add work order\");\n\n\t$woid = db_insert_id();\n\n\t//--------------------------------------------------------------------------\n\n\t// create Work Order Requirements based on the bom\n\t$result = get_bom($stock_id);\n\n\twhile ($bom_item = db_fetch($result))\n\t{\n\n\t\t$unit_quantity = $bom_item[\"quantity\"];\n\t\t$item_quantity = $bom_item[\"quantity\"] * $units_reqd;\n\n\n\t\t$sql = \"INSERT INTO \".TB_PREF.\"wo_requirements (workorder_id, stock_id, workcentre, units_req, units_issued, loc_code)\n\t\t\tVALUES ($woid, \" . \"'\" . $bom_item[\"component\"] . \"'\" . \",\n\t\t\t'\". $bom_item[\"workcentre_added\"] . \"',\n\t\t\t$unit_quantity,\t$item_quantity, '\" . $bom_item[\"loc_code\"] . \"')\";\n\n db_query($sql, \"The work order requirements could not be added\");\n\n\t\t// insert a -ve stock move for each item\n\t\t// Chaitanya: Updated to record price and cost as std_cost for work order issued item\n\t\t$UnitCost = get_standard_cost($bom_item[\"component\"]);\n\t\tadd_stock_move(ST_WORKORDER, $bom_item[\"component\"], $woid,\n\t\t\t$bom_item[\"loc_code\"], $date_, $wo_ref, -$item_quantity, $UnitCost, 0, 1, $UnitCost);\n\t}\n\t\n\t// -------------------------------------------------------------------------\n\t//Negative Stock Handling\n\t$qoh = get_qoh_on_date($stock_id);\n\t$cost_adjust = false;\n\tif ($qoh < 0)\n\t{\n\t\tif ($qoh + $units_reqd >= 0)\n\t\t\t$cost_adjust = true;\n\t}\n\n\t// -------------------------------------------------------------------------\n\t\n\t//Negative Stock Handling First; Prior to add_stock_move\n\tif ($cost_adjust)\n\t\tadjust_deliveries($stock_id, get_standard_cost($stock_id), $date_);\n\t\t\n\t// -------------------------------------------------------------------------\t\n\n\t// insert a +ve stock move for the item being manufactured\n\tadd_stock_move(ST_WORKORDER, $stock_id, $woid,\t$loc_code, $date_,\n\t\t$wo_ref, $units_reqd, 0);\n\n\t// -------------------------------------------------------------------------\n\n\twork_order_quick_costs($woid, $stock_id, $units_reqd, $date_, 0, $costs, $cr_acc, $labour, $cr_lab_acc);\n\t\t\n\t//--------------------------------------------------------------------------\n\n\tadd_comments(ST_WORKORDER, $woid, $date_, $memo_);\n\n\t$Refs->save(ST_WORKORDER, $woid, $wo_ref);\n\tadd_audit_trail(ST_WORKORDER, $woid, $date_,_(\"Quick production.\"));\n\n\t$args->woid = $woid;\n\thook_db_postwrite($args, ST_WORKORDER);\n\tcommit_transaction();\n\treturn $woid;\n}",
"protected function paiementCarte($orderoid, $bqstatus, $bqtransid=NULL){\n if(!self::checkValidationActive($orderoid)){\n $etatfabrication = self::$WTSORDER_ETATFABRICATION_COMPLETE;\n $etatta = self::$WTSORDER_ETATTA_NON_TRANSMIS;\n } else {\n $etatfabrication = self::$WTSORDER_ETATFABRICATION_PAIEMENT_ACCEPTE;\n $etatta = '';\n }\n $this->dsorder->procEdit(array('_options'=>array('local'=>true),\n\t\t\t\t 'oid'=>$orderoid,\n\t\t\t\t 'CYBERSTATUS'=>$bqstatus,\n\t\t\t\t 'MODEPAIEMENT'=>self::$WTSORDER_MODEPAIEMENT_CARTE_BANQUAIRE,\n\t\t\t\t 'ETATFABRICATION'=>$etatfabrication,\n\t\t\t\t 'ETATTA'=>$etatta,\n\t\t\t\t 'ETATPAIECN'=>self::$WTSORDER_ETATPAIECN_AUTORISATION_ACCEPTEE,\n\t\t\t\t 'ETATPAIECHQ'=>NULL,\n\t\t\t\t 'BQTRANSID'=>($bqtransid==NULL)?'':$bqtransid\n\t\t\t\t )\n\t\t\t );\n return $orderoid;\n }",
"public function main() {\n \t\n \t$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true;\n \n $content = '<h2>Converting old plugin configuration to flexforms</h2>';\n \n if (t3lib_div::GPvar('action') == 'doit') {\n foreach ($this->selectContentRowsToConvert() as $row){\n $content .= 'Updating uid '.$row['uid'].' on page '.$row['pid'].'<br />';\n $this->updateRow($row['uid'], $this->convertRowToFlexForm($row)); \n }\n } else {\n foreach ($this->selectContentRowsToConvert() as $row){\n $content .= 'Found uid '.$row['uid'].' on page '.$row['pid'].'<br />';\n }\n }\n \n $content .= '<h2>Filling column \"tx_ptgsashop_orders_addresses.irreParentTable\" with data</h2>';\n \n \tif (t3lib_div::GPvar('action') == 'doit') {\n \t\t$table = 'tx_ptgsashop_orders_addresses';\n \t\t\n \t$updateFieldsArr = array ('irreParentTable' => 'tx_ptgsashop_orders'); \n \t$where = 'deliveries_id = 0';\n \t $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, $where, $updateFieldsArr);\n \t #tx_pttools_assert::isMySQLRessource($res);\n \t $content .= 'Updating billing addresses... done.<br />';\n \t \n \t$updateFieldsArr = array ('irreParentTable' => 'tx_ptgsashop_orders_deliveries'); \n \t$where = 'deliveries_id != 0';\n \t $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, $where, $updateFieldsArr);\n \t #tx_pttools_assert::isMySQLRessource($res);\n \t $content .= 'Updating delivery addresses... done.<br />';\n } else {\n\t\t\t$select = 'count(*) as c';\n \t$from = 'tx_ptgsashop_orders_addresses';\n \t$where = 'irreParentTable = \"\"';\n \n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);\n\t #tx_pttools_assert::isMySQLRessource($res);\n\t $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\n\t $content .= 'Found \"'. (empty($row['c']) ? '0' : $row['c']) . '\" records without data in irreParentTable column<br />';\n }\n \n if (t3lib_div::GPvar('action') != 'doit') {\n \t$content .= '<br><a href=\"index.php?&id=0&CMD[showExt]=pt_gsashop&SET[singleDetails]=updateModule&action=doit\"><b>Start updating!</b></a>';\n }\n \n return $content;\n }",
"private function _recalcProject() {\n $this->_recalcEntity($this->project, $this->advGroup->click_price); // @TODO Price is on advGroup. But this can be in the near future on every adv\n }",
"public function saveSendTeamQuoteAction()\n\t{\n\t\tif($this->_request-> isPost() && $this->adminLogin->userId) \n {\n\t\t\t$final_parameters=$this->_request->getParams();\n\n\t\t\t$quote_obj=new Ep_Quote_Quotes();\n\n\t\t\t//echo \"<pre>\";print_r($final_parameters);exit;\n\n\t\t\t//insert Quotes\n\t\t\t$quotes_data['title']=$this->quote_creation->create_mission['quote_title'];\n\t\t\t$quotes_data['client_id']=$this->quote_creation->create_step1['client_id'];\n\t\t\t$quotes_data['category']=$this->quote_creation->create_step1['category'];\n\t\t\tif($quotes_data['category']=='other')\n\t\t\t\t\t$quotes_data['category_other']=isodec($this->quote_creation->create_step1['category_other']);\n\t\t\tif($this->quote_creation->create_step1['client_websites'])\n\t\t\t$quotes_data['websites']=implode(\"|\",$this->quote_creation->create_step1['client_websites']);\n\t\t\t$quotes_data['quote_by']=$this->quote_creation->create_step1['quote_by'];\n\t\t\t$quotes_data['created_by']=$this->adminLogin->userId;\n\t\t\t$quotes_data['sales_suggested_price']=0;\n\t\t\t$quotes_data['sales_suggested_currency']=$this->quote_creation->create_step1['currency'];\n\t\t\t$quotes_data['sales_comment']=$final_parameters['bo_comments'];\n\t\t\t$quotes_data['client_email_text']=$final_parameters['client_email'];\n\t\t\t$quotes_data['conversion']=$this->quote_creation->create_step1['conversion'];\n\n\t\t\t//$quotes_data['sales_delivery_time']=$final_parameters['delivery_time'];\n\t\t\t//$quotes_data['sales_delivery_time_option']=$final_parameters['delivery_option'];\n\t\t\t$quotes_data['client_know']=$final_parameters['client_know']? 'no':'yes';\n\t\t\t$quotes_data['urgent']=$final_parameters['urgent']? 'yes':'no';\n\t\t\t$quotes_data['urgent_comments']=$final_parameters['urgent_comments']?$final_parameters['urgent_comments']:NULL;\t\t\t\n\t\t\n\t\t\t/*$quotes_data['market_team_sent']=$final_parameters['market_team_sent'];\n\t\t\tif($quotes_data['market_team_sent']=='yes')\n\t\t\t\t$quotes_data['from_platform']=$final_parameters['from_platform']; */\n\t\t\t\t\n\t\t\t$quotes_data['quote_type']=$this->quote_creation->create_step1['quote_type'];\t\n\n\t\t\t\n\t\t\t//NEW QUOTE FILEDS \n\t\t\t$client_aims=$final_parameters['client_aims'];\n\t\t\t$quotes_data['client_aims']=implode(\",\",$client_aims);\n\n\t\t\tforeach($client_aims as $aim)\n\t\t\t{\n\t\t\t\t$client_prio[]=$final_parameters['priority_'.$aim];\n\t\t\t}\n\t\t\t$quotes_data['client_prio']=implode(\",\",$client_prio);\n\n\t\t\t$client_aims_comments=$final_parameters['client_aims_comments'];\n\t\t\t$quotes_data['client_aims_comments']=$client_aims_comments;\n\n\n\t\t\t$content_ordered_agency=$final_parameters['content_ordered_agency'];\n\t\t\t$quotes_data['content_ordered_agency']=$content_ordered_agency;\n\t\t\tif($content_ordered_agency=='yes')\n\t\t\t{\n\t\t\t\tif($final_parameters['agency']=='dont_know')\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['agency']=$final_parameters['agency'];\n\t\t\t\t\t$quotes_data['agency_name']='';\n\t\t\t\t}\n\t\t\t\telseif($final_parameters['agency_name'])\n\t\t\t\t{\n\t\t\t\t\t$quotes_data['agency']='';\n\t\t\t\t\t$quotes_data['agency_name']=$final_parameters['agency_name'];\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse if($content_ordered_agency=='no')\n\t\t\t{\n\t\t\t\t$quotes_data['client_internal_team']=$final_parameters['client_internal_team'];\n\t\t\t}\n\n\t\t\t$quotes_data['client_know_writers']=$final_parameters['client_know_writers'];\n\n\t\t\t$volume_option=$final_parameters['volume_option'];\n\t\t\t$quotes_data['volume_option']=$volume_option;\n\t\t\tif($volume_option=='per')\n\t\t\t{\n\t\t\t\t$quotes_data['volume_option_multi']=$final_parameters['volume_option_multi'];\n\t\t\t}\n\t\t\telse if($volume_option=='every')\n\t\t\t{\n\t\t\t\t$quotes_data['volume_option_multi']=$final_parameters['volume_option_multi_every'];\n\t\t\t\t$quotes_data['volume_every']=$final_parameters['volume_every'];\n\t\t\t}\n\n\t\t\t$budget_marketing=$final_parameters['budget_marketing'];\n\t\t\tif($budget_marketing=='dont_know')\n\t\t\t{\n\t\t\t\t$quotes_data['budget_marketing']=$budget_marketing;\n\t\t\t\t$quotes_data['budget']='';\n\t\t\t\t$quotes_data['budget_currency']='';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$quotes_data['budget_marketing']='';\n\t\t\t\t$quotes_data['budget']=$final_parameters['budget'];\n\t\t\t\t$quotes_data['budget_currency']=$final_parameters['budget_currency'];\n\t\t\t}\t\n\n\t\t\t$quotes_data['estimate_sign_percentage']=$final_parameters['estimate_sign_percentage'];\n\t\t\t$quotes_data['estimate_sign_date']=$final_parameters['estimate_sign_date'];\n\t\t\t$quotes_data['estimate_sign_comments']=$final_parameters['estimate_sign_comments'];\n\n\n\t\t\t//Quote current version\n\t\t\tif($this->quote_creation->custom['version'])\n\t\t\t{\n\t\t\t\t$version=$this->quote_creation->custom['version'];\n\t\t\t}\n\t\t\telse\n\t\t\t\t$version=1;\n\t\t\t$quotes_data['version']=$version;\n\n\t\t\t//Getting Quote details if quote id available\n\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\tif($quoteIdentifier)\n\t\t\t{\n\t\t\t\t$quoteEditDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t\t\t$sales_review_staus=$quoteEditDetails[0]['sales_review'];\n\t\t\t}\t\t\n\n\t\t\t\n\t\t\t//Staus of tech,seo,prod and sales\n\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')//new version quote\n\t\t\t{\n\t\t\t\t$quotes_data['quote_send_team']=$final_parameters['quote_send_team'];\n\n\t\t\t\tif(($final_parameters['quote_send_team']=='send_sales_team'))\n\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t$quotes_data[\"sales_validation_expires\"]=time()+($this->configval['sales_validation_timeline']*60*60);\t\t\t\t\t\t\n\t\t\t\t\t$prod_hours=$this->configval['sales_validation_timeline'];\n\t\t\t\t\t$onlySales=true;\n\t\t\t\t}\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_tech_team')\n\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\t\t\t\t\t\t\n\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\n\t\t\t\t\t$quotes_data['tech_timeline']=NULL;\n\t\t\t\t\t$quotes_data['tech_challenge_comments']='';\n\t\t\t\t\t$quotes_data['tech_challenge']='yes';\n\t\t\t\t}\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_seo_team')\n\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t$quotes_data['seo_review']='not_done';\t\t\t\t\t\t\t\n\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\n\t\t\t\t\t$quotes_data['seo_timeline']=NULL;\n\t\t\t\t\t$quotes_data['seo_comments']='';\n\t\t\t\t\t$quotes_data['seo_challenge']='yes';\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\telseif($this->quote_creation->custom['action']=='edit' && !$this->quote_creation->custom['create_new_version']) //quote edit\n\t\t\t{\t\n\t\t\t\t\n\t\t\t\t$oldTechReview=$quoteEditDetails[0]['tec_review'];\n\t\t\t\t$oldSeoReview=$quoteEditDetails[0]['seo_review'];\n\n\t\t\t\tif(($final_parameters['quote_send_team']=='send_sales_team'))\n\t\t\t\t{\t\n\n\t\t\t\t\t$quotes_data[\"sales_validation_expires\"]=time()+($this->configval['sales_validation_timeline']*60*60);\n\t\t\t\t}\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_tech_team')\n\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t//restart tech review \n\t\t\t\t\tif($oldTechReview=='auto_skipped' || $oldTechReview=='skipped' || $oldTechReview=='not_done')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\n\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t}\n\t\t\t\t\telseif($oldTechReview=='challenged' || $oldTechReview=='validated')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['tec_review']='challenged';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if($final_parameters['quote_send_team']=='send_seo_team')\n\t\t\t\t{\n\t\t\t\t\t//restart seo review \n\t\t\t\t\tif($oldSeoReview=='auto_skipped' || $oldSeoReview=='skipped' || $oldSeoReview=='not_done')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\t\t\n\t\t\t\t\t}\n\t\t\t\t\telseif($oldSeoReview=='challenged' || $oldSeoReview=='validated')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['seo_review']='challenged';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif($tech_seo_time)\n\t\t\t\t\t$quotes_data[\"response_time\"]=time()+($tech_seo_time*60*60);\n\t\t\t\t$edited=TRUE;\t\t\t\t\n\t\t\t}\n\t\t\telse//quote creation v1\n\t\t\t{\n\t\t\t\tif(isset($final_parameters['send_team_quote']))\n\t\t\t\t{\n\t\t\t\t\tif($quotes_data['quote_type']=='only_tech')\n\t\t\t\t\t\t$quotes_data['quote_send_team']='send_tech_team';\n\t\t\t\t\telseif($quotes_data['quote_type']=='only_seo')\n\t\t\t\t\t\t$quotes_data['quote_send_team']='send_seo_team';\n\n\t\t\t\t\tif($quotes_data['quote_type']=='only_tech')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['tec_review']='not_done';\t\n\t\t\t\t\t\t$quotes_data['seo_review']='auto_skipped';\n\t\t\t\t\t\t$quotes_data['prod_review']='auto_skipped';\n\n\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t}\n\t\t\t\t\telse if($quotes_data['quote_type']=='only_seo')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['tec_review']='auto_skipped';\t\n\t\t\t\t\t\t$quotes_data['seo_review']='not_done';\n\t\t\t\t\t\t$quotes_data['prod_review']='auto_skipped';\n\n\t\t\t\t\t\t$tech_seo_time=$this->configval['quote_sent_timeline'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$quotes_data[\"response_time\"]=time()+($this->configval['quote_sent_timeline']*60*60);\n\t\t\t\t\t$quote_end_hours=$this->configval['quote_end_time'];\n\t\t\t\t\t\n\t\t\t\t\t$quotes_data['quote_delivery_hours']=($tech_seo_time+$quote_end_hours);\n\t\t\t\t}\n\t\t\t}\t\t\n\n\t\t\t//echo \"<pre>\";print_r($quotes_data);print_r($final_parameters);exit;\n\n\n\t\t\t//versioning when edited validated quote\n\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')\n\t\t\t{\n\t\t\t\t//Insert this quote in to Quote version table\n\t\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\t\tif($quoteIdentifier)\n\t\t\t\t{\n\t\t\t\t\t$quote_obj->insertQuoteVersion($quoteIdentifier);\n\n\t\t\t\t\t//versioning Tech missions\n\t\t\t\t\t$techMissionObj=new Ep_Quote_TechMissions();\n\t\t\t\t\t$techParams['quote_id']=$quoteIdentifier;\n\t\t\t\t\t$techMissionsDetails=$techMissionObj->getTechMissionDetails($techParams);\n\t\t\t\t\tif($techMissionsDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($techMissionsDetails as $techMission)\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$techMissionId=$techMission['identifier'];\n\t\t\t\t\t\t\t$techMissionObj->insertMissionVersion($techMissionId);\n\n\t\t\t\t\t\t\t//update tech version\n\t\t\t\t\t\t\t$update_tech['version']=$version;\n\t\t\t\t\t\t\t$techMissionObj->updateTechMission($update_tech,$techMissionId);\n\t\t\t\t\t\t\t//if($quotes_data['tec_review']=='auto_skipped')\n\t\t\t\t\t\t\t\t//$techMissionObj->deleteTechMission($techMissionId);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\n\t\t\t\t\t//versioning SEO missions\n\t\t\t\t\t$seoParameters['quote_id']=$quoteIdentifier;\n\t\t\t\t\t$seoParameters['misson_user_type']='seo';\n\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t$seoMissionDetails=$quoteMission_obj->getMissionDetails($seoParameters);\n\t\t\t\t\tif($seoMissionDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($seoMissionDetails as $seoMission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$seoMissionId=$seoMission['identifier'];\n\t\t\t\t\t\t\t$quoteMission_obj->insertMissionVersion($seoMissionId);\t\n\n\t\t\t\t\t\t\t//update seo mission version\n\t\t\t\t\t\t\t$update_seo['version']=$version;\n\t\t\t\t\t\t\t$quoteMission_obj->updateQuoteMission($update_seo,$seoMissionId);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\t\n\n\n\t\t\t\t$quotes_data['sales_review']='not_done';\t\t\t\t\n\t\t\t\t$quotes_data['sales_margin_percentage']=0;\t\t\t\t\n\t\t\t\t//$quotes_data['techmissions_assigned']='';\t\n\t\t\t\t$quotes_data['created_at']=date(\"Y-m-d H:i:s\");\t\n\t\t\t\t$quotes_data['updated_at']=NULL;\n\t\t\t\t\n\t\t\t\t$quotes_data['final_turnover']=0;\n\t\t\t\t$quotes_data['final_margin']=0;\n\t\t\t\t$quotes_data['final_mission_length']=0;\n\n\t\t\t\t$quotes_data['closed_comments']='';\n\t\t\t\t//$quotes_data['prod_timeline']=0;\n\t\t\t\t$quotes_data['signed_comments']=NULL;\n\t\t\t\t$quotes_data['signed_at']=NULL;\n\t\t\t\t$quotes_data['sign_expire_timeline']=NULL;\n\t\t\t\t$quotes_data['closed_reason']=NULL;\t\t\t\t\n\t\t\t\t$quotes_data['boot_customer']=NULL;\n\n\t\t\t}\n\t\t\n\t\t\t//echo \"<pre>\";;print_r($this->quote_creation->custom);print_r($quotes_data);exit;\n\t\t\t//echo \"<pre>\";print_r($this->quote_creation->create_mission['quote_missions']);print_r($quotes_data);exit;\n\n\t\t\ttry\n\t\t\t{ \t\n\t\t\t\tif($this->quote_creation->custom['quote_id'])\n\t\t\t\t{\t\n\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$quotes_data['updated_at']=date(\"Y-m-d H:i:s\");\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$quoteIdentifier=$this->quote_creation->custom['quote_id'];\n\t\t\t\t\t\n\t\t\t\t\t$quote_obj->updateQuote($quotes_data,$quoteIdentifier);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\n\t\t\t\t\tif(!$this->quote_creation->custom['create_new_version'])\n\t\t\t\t\t\t$quotes_data['created_at']=date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\n\t\t\t\t\t$quote_obj->insertQuote($quotes_data);\n\t\t\t\t\t$quoteIdentifier=$quote_obj->getIdentifier();\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(count($_FILES['quote_documents']['name'])>0)\t\n\t\t\t\t{\n\t\t\t\t\t$update = false;\n\t\t\t\t\t$documents_path=array();\n\t\t\t\t\t$documents_name=array();\n\t\t\t\t\tforeach($_FILES['quote_documents']['name'] as $index=>$quote_files)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($_FILES['quote_documents']['name'][$index]):\n\t\t\t\t\t\t//upload quote documents\n\t\t\t\t\t\n\t\t\t\t\t\t$quoteDir=$this->quote_documents_path.$quoteIdentifier.\"/\";\n\t\t if(!is_dir($quoteDir))\n\t\t mkdir($quoteDir,TRUE);\n\t\t chmod($quoteDir,0777);\n\t\t $document_name=frenchCharsToEnglish($_FILES['quote_documents']['name'][$index]);\n\t\t\t\t\t\t$pathinfo = pathinfo($document_name);\n\t\t\t\t\t\t$document_name =$pathinfo['filename'].rand(100,1000).\".\".$pathinfo['extension'];\n\t\t $document_name=str_replace(' ','_',$document_name);\n\t\t $document_path=$quoteDir.$document_name;\n\t\t if (move_uploaded_file($_FILES['quote_documents']['tmp_name'][$index], $document_path))\n\t\t chmod($document_path,0777);\n\t\n\t\t\t\t\t\t\t$update = true;\n\t\t $documents_path[]=$quoteIdentifier.\"/\".$document_name;\n\t\t $documents_name[]= str_replace('|',\"_\",$final_parameters['document_name'][$index]);\n\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t}\n\t\t\t\t\tif($update)\n\t\t\t\t\t{\n\t\t\t\t\t\t $quotes_update_data = array();\n\t\t\t\t\t\t $quoteDetails=$quote_obj->getQuoteDetails($quoteIdentifier);\n\t\t\t\t\t\t $uploaded_documents1 = explode(\"|\",$quoteDetails[0]['documents_path']);\n\t\t\t\t\t\t $documents_path =array_merge($documents_path,$uploaded_documents1);\n\t\t\t\t\t\t $quotes_update_data['documents_path']=implode(\"|\",$documents_path);\n\t\t\t\t\t\t $document_names =explode(\"|\",$quoteDetails[0]['documents_name']);\n\t\t\t\t\t\t $documents_name =array_merge($documents_name,$document_names);\n\t\t\t\t\t\t $quotes_update_data['documents_name']=implode(\"|\",$documents_name);\n\t\t\t\t\t\t $quote_obj->updateQuote($quotes_update_data,$quoteIdentifier);\n\t\t\t\t\t}\n\t\t\t\t\t//echo \"<pre>\";print_r($quotes_update_data);print_r($documents_name);exit;\n\t \n\t } \n\t\t\t\t\n\t\t\t\t//Insert Quote log\n\n\t\t\t\t$log_params['quote_id']\t= $quoteIdentifier;\n\t\t\t\t$log_params['bo_user']\t= $this->adminLogin->userId;\n\t\t\t\t$log_params['quote_size']=$quotes_data['sales_suggested_price'] < 5000 ? \"small\" :\"big\";\n\t\t\t\t$log_params['urgent']\t= $final_parameters['urgent']? 'urgent':'';\n\t\t\t\t$log_params['version']\t= $version;\t\t\t\t\t\n\t\t\t\t$log_params['created_date']\t= date(\"Y-m-d H:i:s\");\n\n\t\t\t\t$log_obj=new Ep_Quote_QuotesLog();\n\t\t\t\tif($edited)\n\t\t\t\t{\n\t\t\t\t\t$log_params['action']\t= 'quote_updated';\n\t\t\t\t\t$actionId=9;\n\n\t\t\t\t\tif($final_parameters['quote_updated_comments'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$log_params['comments']=$final_parameters['quote_updated_comments'];\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$log_params['action']\t= 'quote_created';\n\t\t\t\t\t$actionId=1;\t\n\n\t\t\t\t\tif($final_parameters['bo_comments'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$log_params['comments']=$final_parameters['bo_comments'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$log_obj->insertLog($actionId,$log_params);\t\t\t\n\t\t\t\t\n\t\t\t\t//echo \"<pre>\";print_r($log_params);exit;\n\n\t\t\t}\n\t\t\tcatch(Zend_Exception $e)\n {\n echo $e->getMessage();exit; \n\n }\n\n\t\t\t//sending email to seo &tech OR Prod to challenge after creating the quote\n\t\t\tif(!$edited)\n\t\t\t{\n\t\t\t\t$client_obj=new Ep_Quote_Client();\t\n\t\t\t\t\n\t\t\t\tif($quotes_data['quote_type']=='only_tech')\n\t\t\t\t\t$email_users=$get_head_tech_seos=$client_obj->getEPContacts('\"techuser\",\"techmanager\"');\n\t\t\t\telseif($quotes_data['quote_type']=='only_seo')\t\n\t\t\t\t\t$email_users=$get_head_tech_seos=$client_obj->getEPContacts('\"seouser\",\"seomanager\"');\n\t\t\t\tif(count($email_users)>0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tforeach($email_users as $user=>$name)\n\t\t\t\t\t{\n\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t$mail_parameters['bo_user']=$user;\n\t\t\t\t\t\t$mail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t$mail_parameters['quote_title']=$quotes_data['title'];\n\t\t\t\t\t\t$mail_parameters['sales_suggested_price']=$quotes_data['sales_suggested_price'].\" \".$quotes_data['sales_suggested_currency'].\"s\";\n\t\t\t\t\t\t$mail_parameters['challenge_link']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\n\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,142,$mail_parameters); \t\n\t\t \t}\n\t\t }\t\t\t\n\t\t\t\t\n\t\t\t}\n\n\n\n\t\t\t//intimation email to facturation and created user\n\t\t\tif(!$edited)\n\t\t\t{\n\t\t $client_obj=new Ep_Quote_Client();\n\t\t //$intimate_users=$client_obj->getEPContacts('\"facturation\"');\n\t\t //$intimate_users[$this->adminLogin->userId]=$this->adminLogin->userId;\n\t\t $intimate_users=array('138960180336581'=>'[email protected]',\n\t\t \t\t\t\t\t '139282188375889'=>'[email protected]',\n\t\t \t\t\t\t\t '141745044124851'=>'[email protected]'\n\t\t \t\t\t\t\t );//[email protected], [email protected] and [email protected]\n\t\t if(count($intimate_users)>0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tforeach($intimate_users as $user=>$name)\n\t\t\t\t\t{\n\t\t\t\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t$receiver_id=$user;\n\t\t\t\t\t\t$mail_parameters['bo_user']=$user;\n\t\t\t\t\t\t$mail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t//$mail_parameters['quote_title']=$quotes_data['title'];\n\t\t\t\t\t\t//$mail_parameters['sales_suggested_price']=$quotes_data['sales_suggested_price'].\" \".$quotes_data['sales_suggested_currency'].\"s\";\n\t\t\t\t\t\t//$mail_parameters['followup_link_en']='/quote/sales-quotes-list?submenuId=ML13-SL2';\n\t\t\t\t\t\t$mail_parameters['validate_link']='/quote/quote-followup?quote_id='.$quoteIdentifier.'&submenuId=ML13-SL2';\n\n\t\t\t\t\t\t$mail_parameters['client_name']=$this->quote_creation->create_mission['company_name'];\n\t\t\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,174,$mail_parameters); \t\n\t\t \t}\n\t\t } \n\t\t }\n\n\n\n\t\t //When a quote has been closed and then reactivated, the reason why sales has closed the quote the first time should be communicated to the concerned BO users \n\t\t if($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes' && $sales_review_staus=='closed')\n\t\t {\n\t\t \t\t\n\t\t \t$challengers=$this->getImpactedChallengers($quoteIdentifier,$final_parameters['quote_send_team']);\n\t\t\t\tif(count($challengers)>0)\n\t\t\t\t{\n\t\t\t\t\tforeach($challengers as $impactUser)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($impactUser!=$this->adminLogin->userId)\n\t\t\t\t\t\t{\t\n\t\t\t\t \t\t$cmail_obj=new Ep_Message_AutoEmails();\n\t\t\t\t\t\t\t$receiver_id=$impactUser;\n\t\t\t\t\t\t\t$cmail_parameters['bo_user']=$impactUser;\n\t\t\t\t\t\t\t$cmail_parameters['sales_user']=$this->adminLogin->userId;\n\t\t\t\t\t\t\t$cmail_parameters['quote_title']=$quotes_data['title'];\t\n\t\t\t\t\t\t\t$cmail_parameters['client_name']=$this->quote_creation->create_mission['company_name'];\n\t\t\t\t\t\t\t$cmail_parameters['closed_reason']=$this->closedreason[$quoteEditDetails[0]['closed_reason']];\n\t\t\t\t\t\t\t$cmail_parameters['closed_comments']=$quoteEditDetails[0]['closed_comments'];\n\t\t\t\t\t\t\t$cmail_parameters['validate_link']='/quote/quote-followup?quote_id='.$quoteIdentifier.'&submenuId=ML13-SL2';\n\t\t\t\t\t\t\t$cmail_obj->sendQuotePersonalEmail($receiver_id,180,$cmail_parameters);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t \t\n\t\t }\n\t\t //exit;\n\n unset($this->quote_creation->create_step1);\n unset($this->quote_creation->create_mission);\n unset($this->quote_creation->select_missions);\n unset($this->quote_creation->custom);\n\t\t\tunset($this->quote_creation->send_quote);\n\t\t\tunset($this->quote_creation->send_team_quote);\n\t\t\tif($edited)\n\t\t\t{\n \t$this->_helper->FlashMessenger('Devis updaté avec succès');\n\t\t\t}\n else\n {\n \t$this->_helper->FlashMessenger('Devis crée avec succès');\n\n \tif($onlySales)\n \t\t$this->_helper->FlashMessenger('Onlysales');\n \telse if($quotes_data['quote_type']=='only_tech')\n\t\t\t\t\t$this->_helper->FlashMessenger('Onlytech');\n\t\t\t\telse if($quotes_data['quote_type']=='only_seo')\n\t\t\t\t\t$this->_helper->FlashMessenger('Onlyseo');\n }\n\t\t\t\n $this->_redirect(\"/quote/sales-quotes-list?submenuId=ML13-SL2\");\n\t\t}\t\n\t}",
"public function automatchMissionPopupAction()\n\t{\n\t\t$mission_params=$this->_request->getParams();\n\t\t$mission_obj=new Ep_Quote_Mission();\n\t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\n\t\t$quote_id=$mission_params['quote_id'];\n\t\t$mission_id=$mission_params['mission_id'];\n\t\t$suggested_mission=$mission_params['suggested_mission'];\n\t\t$suggested_status=$mission_params['suggested'];\n\n\t\t$archieve_mission=$suggested_mission;\n\t\t//get quotemission details\n\t\t$qmission_params['mission_id']=$mission_id;\n\t\t$QuotemissionDetails=$quoteMissionObj->getMissionDetails($qmission_params);\t\t\n\n\t\t//getting auto matched quotes\n\t\tif($QuotemissionDetails)\n\t\t{\n\t\t\t$i=0;//\n\t\t\tforeach ($QuotemissionDetails as $qmission) \n\t\t\t{\n\t\t\t\n\t\t\t\t$QuotemissionDetails[$i]['product']=$qmission['product'];\n\t\t\t\t$QuotemissionDetails[$i]['product_name']=$this->product_array[$qmission['product']];\n\t\t\t\t$QuotemissionDetails[$i]['language']=$qmission['language_source'];\n\t\t\t\t$QuotemissionDetails[$i]['language_name']=$this->getLanguageName($qmission['language_source']);\n\t\t\t\t$QuotemissionDetails[$i]['languagedest']=$qmission['language_dest'];\n\t\t\t\t$QuotemissionDetails[$i]['languagedest_name']=$this->getLanguageName($qmission['language_dest']);\n\t\t\t\t$QuotemissionDetails[$i]['producttype']=$qmission['product_type'];\n\t\t\t\t$QuotemissionDetails[$i]['producttype_name']=$this->producttype_array[$qmission['product_type']];\n\t\t\t\t$QuotemissionDetails[$i]['nb_words']=$qmission['nb_words'];\n\t\t\t\t$QuotemissionDetails[$i]['comments']=$qmission['comments'];\n\t\t\t\t\n\t\t\t\tif($qmission['related_to'])\n\t\t\t\t{\n\t\t\t\t\t$qmission_params['mission_id']=$qmission['related_to'];\t\t\t\t\t\n\t\t\t\t\t$relatedMissionDetails=$quoteMissionObj->getMissionDetails($qmission_params);\t\n\t\t\t\t\t//echo \"<pre>\";print_r($relatedMissionDetails);\n\t\t\t\t\t$qmission['volume']=$relatedMissionDetails[0]['volume'];\n\t\t\t\t\tif(!$qmission['sales_suggested_missions'])\n\t\t\t\t\t$qmission['sales_suggested_missions']=$relatedMissionDetails[0]['sales_suggested_missions'];\n\n\t\t\t\t}\n\n\t\t\t\t$QuotemissionDetails[$i]['volume']=$qmission['volume'];\n\n\n\t\t\t\t$quote_by=$qmission['quote_by'];\n\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote_by);\n\t\t\t\tif($bo_user_details!='NO')\n\t\t\t\t{\n\t\t\t\t\t$QuotemissionDetails[$i]['sales_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t$suggested_mission=$qmission['sales_suggested_missions'];\n\n\t\t\t\t$suggested_currency=$qmission['sales_suggested_currency'];\n\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\t/*dont change the order of this array*/\n\t\t\t$searchParameters['product']=$QuotemissionDetails[0]['product'];\n\t\t\t$searchParameters['language']=$QuotemissionDetails[0]['language_source'];\n\t\t\t$searchParameters['languagedest']=$QuotemissionDetails[0]['language_dest'];\t\t\t\n\t\t\t$searchParameters['producttype']=$QuotemissionDetails[0]['product_type'];\n\t\t\t$searchParameters['volume']=$QuotemissionDetails[0]['volume'];\n\t\t\t$searchParameters['nb_words']=$QuotemissionDetails[0]['nb_words'];\n\t\t\t\n\t\t}\t\n\n\t\t$missionDetails=$mission_obj->getMissionDetails($searchParameters,3);\n\t\tif($missionDetails)\n\t\t{\n\t\t\t$m=0;\n\t\t\tforeach($missionDetails as $misson)\n\t\t\t{\n\t\t\t\t$missionDetails[$m]['category_name']=$this->getCategoryName($misson['category']);\n\t\t\t\t$missionDetails[$m]['product']=$this->product_array[$misson['type']];\n\t\t\t\t$missionDetails[$m]['language1_name']=$this->getLanguageName($misson['language1']);\n\t\t\t\t$missionDetails[$m]['producttype']=$this->producttype_array[$misson['type_of_article']];\n\t\t\t\t\n\t\t\t\tif($misson['writing_cost_before_signature_currency']!=$QuotemissionDetails[0]['sales_suggested_currency'])\n\t\t\t\t{\n\t\t\t\t\t$conversion=$QuotemissionDetails[0]['conversion'];\n\t\t\t\t\t$missionDetails[$m]['writing_cost_before_signature']=($misson['writing_cost_before_signature']*$conversion);\n\t\t\t\t\t$missionDetails[$m]['correction_cost_before_signature']=($misson['correction_cost_before_signature']*$conversion);\n\t\t\t\t\t$missionDetails[$m]['other_cost_before_signature']=($misson['other_cost_before_signature']*$conversion);\n\t\t\t\t\t$missionDetails[$m]['unit_price']=($misson['selling_price']*$conversion);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$missionDetails[$m]['unit_price']=$misson['selling_price'];\n\n\t\t\t\t$missionDetails[$m]['mission_turnover']=($misson['num_of_articles']*$missionDetails[$m]['unit_price'])/1000;\n\t\t\t\t\n\n\t\t\t\t$m++;\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t\t$QuotemissionDetails[0]['missionDetails']=$missionDetails;\n\n\n\t\t$this->_view->quote_missions=$QuotemissionDetails;\n\t\t$this->_view->suggested_mission=$suggested_mission;\n\t\t$this->_view->suggested_currency=$suggested_currency;\n\t\t//echo \"<pre>\";print_r($QuotemissionDetails);\n\n\t\t$this->render('popup_automatch_missions');\n\t}",
"public function actionCreate()\n {\n $model = new Quotation();\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 deleteQuoteMissionAction()\n\t{\n\t\t//if($this->_request-> isPost())\n\t\t//{\n\t\t\t$mission_params=$this->_request->getParams();\n\t\t\t$quote_obj=new Ep_Quote_QuoteMissions();\n\n\t\t\t\n\t\t\tif($mission_params['mission_identifier'] && $mission_params['mission_type']=='tech' && $mission_params['type']=='includes_update' )\n\t\t\t{\n\t\t\t\t$update_mission['include_final']='no';\n\t\t\t\t$identifier=$mission_params['mission_identifier'];\n\n\t\t\t\t$tech_obj=new Ep_Quote_TechMissions();\n\t\t\t\t$tech_obj->updateTechMission($update_mission,$identifier);\n\t\t\t}\n\n\t\t\telse if($mission_params['mission_identifier'] && $mission_params['type']=='includes_update' )\n\t\t\t{\n\t\t\t\t$update_mission['include_final']='no';\n\t\t\t\t$identifier=$mission_params['mission_identifier'];\n\n\t\t\t\t$quote_obj->updateQuoteMission($update_mission,$identifier);\n\t\t\t}\n\n\t\t\telse if($mission_params['mission_identifier'])\n\t\t\t{\n\t\t\t\t$identifier=$mission_params['mission_identifier'];\n\t\t\t\tif($this->quote_creation->custom['action']=='edit' && $this->quote_creation->custom['create_new_version']=='yes')\n\t\t\t\t{\n\t\t\t\t\t//echo $this->quote_creation->custom['version'];\n\t\t\t\t\t//Insert this mission in to QuoteMissionsversions table\t\t\t\t\t\t\t\n\t\t\t\t\tif($identifier)\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\n\t\t\t\t\t\t$quoteMission_obj->insertMissionVersion($identifier);\n\n\t\t\t\t\t\t//versioning Prod Missions\n\t\t\t\t\t\t$prodObj=new Ep_Quote_ProdMissions();\n\t\t\t\t\t\t$prodParams['quote_mission_id']=$identifier;\n\t\t\t\t\t\t$prodMissionDetails=$prodObj->getProdMissionDetails($prodParams);\n\t\t\t\t\t\tif($prodMissionDetails)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach($prodMissionDetails as $prodMission)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$prodMissionId=$prodMission['identifier'];\n\t\t\t\t\t\t\t\t$prodObj->insertMissionVersion($prodMissionId);\n\n\t\t\t\t\t\t\t\t//deleting prod mission from Prodmissions after insert into prod versioning\n\t\t\t\t\t\t\t\t$prodObj->deleteProdMission($prodMissionId);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\n\n\n\n\t\t\t\tif($mission_params['mission_index'])//Added w.r.t Quote edit\n\t\t\t\t{\n\t\t\t\t\t$index=$mission_params['mission_index']-1;\n\t\t\t\t\tunset($this->quote_creation->create_mission['product'][$index]);\n\t\t\t\t\tunset($this->quote_creation->create_mission['language'][$index]);\n\t\t\t\t\tunset($this->quote_creation->create_mission['languagedest'][$index]);\n\t\t\t\t\tunset($this->quote_creation->create_mission['producttype'][$index]);\n\t\t\t\t\tunset($this->quote_creation->create_mission['nb_words'][$index]);\n\t\t\t\t\tunset($this->quote_creation->create_mission['volume'][$index]);\n\t\t\t\t\tunset($this->quote_creation->create_mission['comments'][$index]);\n\t\t\t\t\tunset($this->quote_creation->create_mission['identifier'][$index]);\n\t\t\t\t\tunset($this->quote_creation->create_mission['mission_identifier'][$index]);\n\t\t\t\t\tunset($this->quote_creation->select_missions['missions_selected'][$index]);\n\n\t\t\t\t\t$this->quote_creation->create_mission['product']=array_values($this->quote_creation->create_mission['product']);\n\t\t\t\t\t$this->quote_creation->create_mission['language']=array_values($this->quote_creation->create_mission['language']);\n\t\t\t\t\t$this->quote_creation->create_mission['languagedest']=array_values($this->quote_creation->create_mission['languagedest']);\n\t\t\t\t\t$this->quote_creation->create_mission['producttype']=array_values($this->quote_creation->create_mission['producttype']);\n\t\t\t\t\t$this->quote_creation->create_mission['nb_words']=array_values($this->quote_creation->create_mission['nb_words']);\n\t\t\t\t\t$this->quote_creation->create_mission['volume']=array_values($this->quote_creation->create_mission['volume']);\n\t\t\t\t\t$this->quote_creation->create_mission['comments']=array_values($this->quote_creation->create_mission['comments']);\n\t\t\t\t\t$this->quote_creation->create_mission['identifier']=array_values($this->quote_creation->create_mission['identifier']);\n\t\t\t\t\t$this->quote_creation->create_mission['mission_identifier']=array_values($this->quote_creation->create_mission['mission_identifier']);\n\t\t\t\t\t$this->quote_creation->create_mission['missions_selected']=array_values($this->quote_creation->create_mission['missions_selected']);\n\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$quote_obj->deleteQuoteMission($identifier);\n\t\t\t\t\n\t\t\t} \n\t\t//}\t\n\t\t \n\t}",
"function kilman_prep_for_questionform($kilman, $qid, $qtype) {\n $context = context_module::instance($kilman->cm->id);\n if ($qid != 0) {\n $question = clone($kilman->questions[$qid]);\n $question->qid = $question->id;\n $question->sid = $kilman->survey->id;\n $question->id = $kilman->cm->id;\n $draftideditor = file_get_submitted_draft_itemid('question');\n $content = file_prepare_draft_area($draftideditor, $context->id, 'mod_kilman', 'question',\n $qid, array('subdirs' => true), $question->content);\n $question->content = array('text' => $content, 'format' => FORMAT_HTML, 'itemid' => $draftideditor);\n\n if (isset($question->dependencies)) {\n foreach ($question->dependencies as $dependencies) {\n if ($dependencies->dependandor === \"and\") {\n $question->dependquestions_and[] = $dependencies->dependquestionid.','.$dependencies->dependchoiceid;\n $question->dependlogic_and[] = $dependencies->dependlogic;\n } else if ($dependencies->dependandor === \"or\") {\n $question->dependquestions_or[] = $dependencies->dependquestionid.','.$dependencies->dependchoiceid;\n $question->dependlogic_or[] = $dependencies->dependlogic;\n }\n }\n }\n } else {\n $question = \\mod_kilman\\question\\base::question_builder($qtype);\n $question->sid = $kilman->survey->id;\n $question->id = $kilman->cm->id;\n $question->type_id = $qtype;\n $question->type = '';\n $draftideditor = file_get_submitted_draft_itemid('question');\n $content = file_prepare_draft_area($draftideditor, $context->id, 'mod_kilman', 'question',\n null, array('subdirs' => true), '');\n $question->content = array('text' => $content, 'format' => FORMAT_HTML, 'itemid' => $draftideditor);\n }\n return $question;\n}",
"public function editJobStatus(Request $request)\n {\n $data = Validator::make($request->all(), [\n 'jobId' => 'required|numeric',\n 'status' => 'required',\n ]);\n\n if ($data->fails()) {\n return response()->json([\n 'status' => 400,\n 'message' => 'All fields are required',\n 'data' => []\n ], 400);\n }\n\n $job = Job::find($request->jobId);\n\n if ($job == \"\") {\n return response()->json([\n 'status' => 400,\n 'message' => 'Job does not exist',\n 'data' => $job\n ], 400);\n }\n $job->update([\n 'status' => $request->status\n ]);\n\n $checkQuotation = Quotation::where('jobId', $job->id)->first();\n\n if ($checkQuotation == \"\") {\n $job->quotation = \"Quotation has not been created\";\n } else {\n $job->quotation = [\n 'quotationDetails' => Quotation::where('jobId', $job->id)->first(),\n 'items' => [\n 'totalNumber' => Item::where('jobId', $job->id)->count(),\n 'totalAmount' => Item::where('jobId', $job->id)->get('totalPrice')->sum('totalPrice'),\n 'itemList' => Item::where('jobId', $job->id)->get(),\n ],\n\n 'tax' => [\n 'totalAmount' => Payment::where('jobId', $job->id)->where('paymentType', 'tax')->get('amount')->sum('amount'),\n 'totalNumber' => Payment::where('jobId', $job->id)->where('paymentType', 'tax')->count(),\n 'taxList' => Payment::where('jobId', $job->id)->where('paymentType', 'tax')->get()\n ],\n 'discount' => [\n 'totalAmount' => Payment::where('jobId', $job->id)->where('paymentType', 'discount')->get('amount')->sum('amount'),\n 'totalNumber' => Payment::where('jobId', $job->id)->where('paymentType', 'discount')->count(),\n 'discountList' => Payment::where('jobId', $job->id)->where('paymentType', 'discount')->get()\n ]\n ];\n }\n return response()->json([\n 'status' => 200,\n 'message' => 'Job status has been updated successfully',\n 'data' => $job\n ], 200);\n }",
"private function alterOrderInformation()\n {\n if (version_compare(Shopware()->Config()->get( 'Version' ), '5.2.0', '<')) {\n $sql = \"UPDATE `s_core_snippets`\n SET `value` = CASE\n WHEN `value` = 'Free text 4' THEN 'Transaction ID'\n WHEN `value` = 'Freitextfeld 4' THEN 'Transaktions-ID'\n ELSE `value`\n END\n WHERE `namespace` = 'backend/order/main'\n AND `value` IN ('Freitextfeld 4', 'Free text 4')\";\n } elseif (version_compare(Shopware()->Config()->get( 'Version' ), '5.2.0', '>=')) {\n $sql = \"INSERT INTO `s_attribute_configuration` (table_name, column_name, \"\n . \"column_type, position, translatable, display_in_backend, custom, \"\n . \"help_text, support_text, label, entity, array_store) \"\n . \"VALUES ('s_order_attributes','attribute4','string',1,0,1,0,'','','Transaction ID','NULL',NULL)\";\n }\n Shopware()->Db()->query($sql);\n }",
"function MyShop_Order($args) {\n global $_CONF, $_TABLES, $_MYSHOP_CONF;\n\n $sql = \"SELECT orderid,productid,email,quantity,status from {$_TABLES['myshop_order']}\";\n $result = DB_query($sql);\n $num = DB_numrows($result);\n\n if($num > 0)\n {\n for ($i = 0; $i < $num; $i++)\n {\n $A = DB_fetchArray($result);\n \n $product_name = DB_getItem($_TABLES['myshop_product'], 'name', \"productid={$A['productid']}\");\n if($A['status'] == \"on\"){\n $ship = \" checked\";\n }\n \n $row .= \"<form action=\\\"index.php\\\" METHOD=\\\"POST\\\"><tr>\\n\";\n $row .= \"<input type=\\\"hidden\\\" name=\\\"orderid\\\" value=\\\"{$A['orderid']}\\\">\\n\";\n $row .= \"<td>$product_name</td>\";\n $row .= \"<td>{$A['quantity']}</td>\";\n $row .= \"<td>{$A['email']}</td>\";\n $row .= \"<td><input type=\\\"checkbox\\\" name=\\\"status\\\"{$ship}></td>\";\n $row .= \"<td><button type=\\\"submit\\\" name=\\\"mode\\\" value=\\\"order_save\\\" class=\\\"uk-button uk-button-primary\\\">変更</button>\";\n $row .= \"<button type=\\\"submit\\\" name=\\\"mode\\\" value=\\\"order_delete\\\" class=\\\"uk-button\\\">削除</button></td>\\n\";\n $row .= \"</tr></form>\\n\";\n }\n }\n else {\n $row = MyShop_str('no_order');\n }\n\n $T = new Template($_CONF['path'] . 'plugins/myshop/templates');\n\n $T->set_file(array (\n 'topmenu' => 'topmenu.thtml',\n 'table' => 'table.thtml',\n ));\n\n $T->set_var(array(\n 'lang_piname' => $_MYSHOP_CONF['pi_display_name'],\n 'icon_url' => $_CONF['site_url'] . '/myshop/images/myshop.png',\n 'title' => MyShop_str('pi_name'),\n 'caption' => MyShop_str('top_menu_caption'),\n 'menu1' => MyShop_str('top_menu1'),\n 'menu2' => MyShop_str('top_menu2'),\n 'menu3' => MyShop_str('top_menu3'),\n 'menu4' => MyShop_str('top_menu4'),\n 'notfound' => $notfound,\n 'h1' => MyShop_str('product_name'),\n 'h2' => MyShop_str('tbl_head_amount'),\n 'h3' => MyShop_str('publish'),\n 'h4' => MyShop_str('finish'),\n 'h5' => \"-\",\n 'list' => $row,\n ));\n\n $T->parse('output', 'topmenu');\n $content .= $T->finish($T->get_var('output'));\n\n $T->parse('output', 'table');\n $content .= $T->finish($T->get_var('output'));\n \n $display = COM_createHTMLDocument($content);\n COM_output($display);\n}",
"function work_order_produce($woid, $ref, $quantity, $date_, $memo_, $close_wo)\n{\n\tglobal $Refs;\n\n\tbegin_transaction();\n\t$args = func_get_args();\n\t$args = (object)array_combine(array('woid', 'ref', 'quantity', 'date_', 'memo_','close_wo'),\n\t\t$args);\n\t$args->trans_no = 0;\n\thook_db_prewrite($args, ST_MANURECEIVE);\n\n\t$details = get_work_order($woid);\n\n if (strlen($details[0]) == 0)\n {\n \techo _(\"The order number sent is not valid.\");\n \texit;\n }\n\n\tif (work_order_is_closed($woid))\n\t{\n\t\tdisplay_error(\"UNEXPECTED : Producing Items for a closed Work Order\");\n\t\tcancel_transaction();\n\t\texit;\n\t}\n\n $date = date2sql($date_);\n\n $sql = \"INSERT INTO \".TB_PREF.\"wo_manufacture (workorder_id, reference, quantity, date_)\n\t\tVALUES (\".db_escape($woid).\", \".db_escape($ref).\", \".db_escape($quantity)\n\t\t.\", '$date')\";\n\n\tdb_query($sql,\"A work order manufacture could not be added\");\n\n\t$id = db_insert_id();\n\t\n\t// -------------------------------------------------------------------------\n\n\twork_order_quick_costs($woid, $details[\"stock_id\"], $quantity, $date_, $id);\n\t\n\t// -------------------------------------------------------------------------\n\n\t// Chaitanya: stamp BOM cost to finished item\n\t$m_cost = 0;\n $result = get_bom($details[\"stock_id\"]);\n\twhile ($bom_item = db_fetch($result))\n\t{\n\t\t$standard_cost = get_standard_cost($bom_item['component']);\n\t\t$m_cost += ($bom_item['quantity'] * $standard_cost);\n\t}\t\n\n\t// insert a +ve stock move for the item being manufactured\n\t// negative means \"unproduce\" or unassemble\n\tadd_stock_move(ST_MANURECEIVE, $details[\"stock_id\"], $id,\n\t\t$details[\"loc_code\"], $date_, $ref, $quantity, $m_cost);\n\t// update wo quantity and close wo if requested\n\twork_order_update_finished_quantity($woid, $quantity, $close_wo);\n\n\tif ($memo_)\n\t\tadd_comments(ST_MANURECEIVE, $id, $date_, $memo_);\n\n\t$Refs->save(ST_MANURECEIVE, $id, $ref);\n\tadd_audit_trail(ST_MANURECEIVE, $id, $date_, _(\"Production.\"));\n\n\t$args->trans_no = $id;\n\thook_db_postwrite($args, ST_MANURECEIVE);\n\tcommit_transaction();\n}",
"public function loadQuarterDetails() {\r\n $this->load->model('clients');\r\n\r\n $q = $this->input->post(\"quarter\");\r\n $q = $this->encrypt->decode($q);\r\n $VATYear = $this->input->post(\"VATYear\");\r\n $quarterDetails = $this->clients->getQuarterDetails($q, $VATYear);\r\n\t\t\r\n $vat_listing = $this->clients->getVatType();\r\n $data['EXPitems'] = false;\r\n if ($vat_listing->Type != 'flat') {\r\n $this->load->model('clients/expense');\r\n $EXPitems = $this->expense->getQuarterExpDetails($q, $VATYear);\r\n $data['EXPitems'] = $EXPitems;\r\n }\r\n\r\n $data['vat_listing'] = $vat_listing;\r\n $data['quarterDetails'] = $quarterDetails;\r\n $jsonHTML = $this->load->view('client/invoices/quarter_details', $data, true);\r\n die($jsonHTML);\r\n }",
"public function action_order(Order $order, $status) {\n // dd($status);\n if($status == 3){\n $order_id = $order->id;\n $order_items = OrderItem::where('order_id' , $order_id)->get();\n for($i = 0; $i < count($order_items); $i++){\n $count = $order_items[$i]['count'];\n $product_id = $order_items[$i]['product_id'];\n if ($order->status == 2) {\n $product = Product::find($product_id);\n $product->update(['remaining_quantity' => $product->remaining_quantity + $count, 'sold_count' => $product->sold_count - $count]);\n if ($order_items[$i]['option_id'] != 0) {\n $m_option = ProductMultiOption::find($order_items[$i]['option_id']);\n $m_option->update(['remaining_quantity' => $m_option->remaining_quantity + $count, 'sold_count' => $m_option->sold_count - $count]);\n }\n }\n \n\n // $product->save();\n }\n }\n\n if($status == 2){\n $order_id = $order->id;\n $order_items = OrderItem::where('order_id' , $order_id)->get();\n for($i = 0; $i < count($order_items); $i++){\n $count = $order_items[$i]['count'];\n $product_id = $order_items[$i]['product_id'];\n $product = Product::find($product_id);\n $product->sold_count = $product->sold_count + $count;\n $product->save();\n if ($order_items[$i]['option_id'] != 0) {\n $m_option = ProductMultiOption::find($order_items[$i]['option_id']);\n $m_option->update(['sold_count' => (int)$m_option->sold_count + $count]);\n }\n }\n }\n\n $order->update(['status' => (int)$status]);\n\n\n return redirect()->back();\n }",
"public function executeStatusProject()\n {\n $this->statusProjectList = StatusProjectPeer::getStatusProjectListCounted(); \n if($this->getRequest()->getParameter('status')){\n $this->status_select = $this->getRequest()->getParameter('status');\n }else{\n $this->status_select = $this->getUser()->getAttribute('status','all','project/list'); \n }\n\n //add nb total project\n $total_nb_project = 0;\n foreach($this->statusProjectList as $status)\n {\n $total_nb_project += $status['nb'];\n }\n $this->total_nb_project = $total_nb_project;\n \n //add nb active project\n $c = new Criteria();\n $c->addJoin(StatusProjectPeer::ID, ProjectPeer::STATUS_PROJECT_ID);\n $c->add(StatusProjectPeer::POSITION, 200, Criteria::LESS_THAN);\n MagentaAccessRestrictions::applyFilterSecurityProject($c); \n $this->active_nb_project = ProjectPeer::doCount($c);\n \n }",
"function deletedMissionVersions($quote_id,$version=NULL,$type=NULL)\n\t{\t\t\t\t\t\t\t\n\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t$deletedMissionVersions=$quoteMission_obj->getDeletedMissionVersionDetails($quote_id,$version,$type);\n\t\tif(!$deletedMissionVersions)\n\t\t\t$deletedMissionVersions=array();\n\n\t\t//getting mission details showing current version deleted missions of final stage too\n\t\tif(!$type)\n\t\t{\n\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t$searchParameters['include_final']='no';\n\n\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t$missonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\tif(!$missonDetails)\n\t\t\t\t$missonDetails=array();\n\n\t\t\t$deletedMissionVersions=array_merge($deletedMissionVersions,$missonDetails);\n\t\t}\t\n\n\n\t\t//echo \"<pre>\";print_r($deletedMissionVersions);exit;\n\n\t\tif($deletedMissionVersions && count($deletedMissionVersions)>0)\t\t\n\t\t{\n\t\t\t$d=0;\n\t\t\tforeach($deletedMissionVersions as $dmission)\n\t\t\t{\n\t\t\t\t$deletedMissionVersions[$d]['product_name']=$this->product_array[$dmission['product']];\t\t\t\n\t\t\t\t$deletedMissionVersions[$d]['language_source_name']=$this->getLanguageName($dmission['language_source']);\n\t\t\t\t$deletedMissionVersions[$d]['product_type_name']=$this->producttype_array[$dmission['product_type']];\n\t\t\t\tif($mission['language_dest'])\n\t\t\t\t\t$deletedMissionVersions[$d]['language_dest_name']=$this->getLanguageName($dmission['language_dest']);\n\n\t\t\t\t\n\n\t\t\t\t$deletedMissionVersions[$d]['comment_time']=time_ago($dmission['created_at']);\n\n\t\t\t\t$prodMissionObj=new Ep_Quote_ProdMissions();\n\t\t\t\t\n\t\t\t\t$prodMissionDetails=$prodMissionObj->getProdVersionCostDetails($dmission['identifier'],$version);\n\n\t\t\t\tif(!$prodMissionDetails)\n\t\t\t\t{\n\t\t\t\t\t$prodParams['quote_mission_id']=$dmission['identifier'];\n\t\t\t\t\t$prodMissionDetails=$prodMissionObj->getProdMissionDetails($prodParams);\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\tif($prodMissionDetails)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$internalcost_details='';\n\t\t\t\t\t$staff_time=array();\n\n\t\t\t\t\tforeach($prodMissionDetails as $prodMission)\n\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t$internalcost_details.=$this->seo_product_array[$prodMission['product']]. \" : \".zero_cut($prodMission['cost'],2).\" &\".$prodMission['currency'].\";<br>\";\n\t\t\t\t\t}\n\t\t\t\t\t$deletedMissionVersions[$d]['internalcost_details']=$internalcost_details;\n\n\t\t\t\t\t$deletedMissionVersions[$d]['prod_mission_details']=$prodMissionDetails;\t\n\t\t\t\t}\n\n\t\t\t\tif($deletedMissionVersions[$d]['turnover']<=0)\t\t\n\t\t\t\t\t$deletedMissionVersions[$d]['turnover']=($dmission['volume']*$dmission['unit_price']);\n\n\t\t\t\t$d++;\n\t\t\t}\n\t\t}\n\n\t\treturn $deletedMissionVersions;\n\t}",
"private function question()\n\t{\n\t\t$this->qns['questionnaire']['questionnairecategories_id'] = $this->allinputs['questioncat'];\n\t\t$this->qns['questionnaire']['questionnairesubcategories_id'] = $this->allinputs['questionsubcat'];\n\t\t$this->qns['questionnaire']['label'] = $this->allinputs['question_label'];\n\n\n\t\t$this->qns['questionnaire']['question'] = $this->allinputs['question'];\n\t\t$this->qns['questionnaire']['has_sub_question'] = $this->allinputs['subquestion'];\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 )\n\t\t{\n\t\t\t$this->qns['answers']['answer_type'] = $this->allinputs['optiontype'];\n\t\t}\n\n\t\t$this->qns['questionnaire']['active'] = 1;\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 ){\n\t\t\t//This code must be skipped if sub_question is 1\n\t\t\t$optionCounter = 0;\n\t\t\tforeach ($this->allinputs as $key => $value) {\n\n\t\t\t\tif( str_is('option_*', $key) ){\n\t\t\t\t\t$optionCounter++;\n\t\t\t\t\t$this->qns['answers'][$optionCounter] = ( $this->qns['answers']['answer_type'] == 'opentext' ) ? 'Offered answer text' : $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}"
] |
[
"0.6281304",
"0.567413",
"0.55188507",
"0.55164105",
"0.536146",
"0.532572",
"0.531378",
"0.52873176",
"0.5209415",
"0.5181532",
"0.51443446",
"0.5143258",
"0.51208",
"0.5086724",
"0.5055555",
"0.50412196",
"0.5033678",
"0.50324446",
"0.4998879",
"0.49754715",
"0.49581343",
"0.49384236",
"0.49261996",
"0.4918539",
"0.491136",
"0.49108437",
"0.49066317",
"0.48997703",
"0.48810804",
"0.4879671"
] |
0.6853866
|
0
|
Handle design orders file validation workflow
|
public function handleOrderFileValidation(OrderEvent $event)
{
$order = $event->getOrder();
if (Order::STATUS_FILE_VALIDATED === (int)$order->getStatus() && null !== $order->getQuotation() && false === $order->getQuotation()->getProject()->getType()->isShipping()&& false === $order->getQuotation()->getProject()->getType()->isShippingChoice()) {
// change order status to delivered (will pay the maker)
$this->orderManager->updateStatus($order, Order::STATUS_DELIVERED, OrderEvent::ORIGIN_SYSTEM);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function validateOrder();",
"abstract protected function validateFile() : object;",
"protected function _validate() {\n\t}",
"private function validateForm(): void\n {\n if (!$this->form->isSubmitted()) {\n return;\n }\n\n /** @var $fileFile \\SpoonFormFile */\n $fileFile = $this->form->getField('file');\n $zip = null;\n $zipFiles = null;\n\n // Validate the file. Check if the file field is filled and if it's a zip.\n if ($fileFile->isFilled(BL::err('FieldIsRequired')) &&\n $fileFile->isAllowedExtension(['zip'], sprintf(BL::getError('ExtensionNotAllowed'), 'zip'))\n ) {\n // Create ziparchive instance\n $zip = new ZipArchive();\n\n // Try and open it\n if ($zip->open($fileFile->getTempFileName()) === true) {\n // zip file needs to contain some files\n if ($zip->numFiles > 0) {\n $infoXml = $this->findInfoFileInZip($zip);\n\n // Throw error if info.xml is not found\n if ($infoXml === null) {\n $fileFile->addError(\n sprintf(BL::getError('NoInformationFile'), $fileFile->getFileName())\n );\n\n return;\n }\n\n // Parse xml\n try {\n // Load info.xml\n $infoXml = @new \\SimpleXMLElement($infoXml, LIBXML_NOCDATA, false);\n\n // Convert xml to useful array\n $this->info = BackendExtensionsModel::processThemeXml($infoXml);\n\n // Empty data (nothing useful)\n if (empty($this->info)) {\n $fileFile->addError(BL::getMessage('InformationFileIsEmpty'));\n\n return;\n }\n\n // Define the theme name, based on the info.xml file.\n $this->themeName = $this->info['name'];\n } catch (Exception $e) {\n // Warning that the information file is corrupt\n $fileFile->addError(BL::getMessage('InformationFileCouldNotBeLoaded'));\n\n return;\n }\n\n // Wow wow, you are trying to upload an already existing theme\n if (BackendExtensionsModel::existsTheme($this->themeName)) {\n $fileFile->addError(sprintf(BL::getError('ThemeAlreadyExists'), $this->themeName));\n\n return;\n }\n\n $zipFiles = $this->getValidatedFilesList($zip);\n } else {\n // Empty zip file\n $fileFile->addError(BL::getError('FileIsEmpty'));\n }\n } else {\n // Something went very wrong, probably corrupted\n $fileFile->addError(BL::getError('CorruptedFile'));\n\n return;\n }\n }\n\n // Passed all validation\n if ($zip !== null && $this->form->isCorrect()) {\n // Unpack the zip. If the files were not found inside a parent directory, we create the theme directory.\n $themePath = FRONTEND_PATH . '/Themes';\n if ($this->parentFolderName === null) {\n $themePath .= \"/{$this->themeName}\";\n }\n $zip->extractTo($themePath, $zipFiles);\n\n // Rename the original name of the parent folder from the zip to the correct theme foldername.\n $fs = new Filesystem();\n $parentZipFolderPath = $themePath . '/' . $this->parentFolderName;\n if ($this->parentFolderName !== $this->themeName &&\n $this->parentFolderName !== null &&\n $fs->exists($parentZipFolderPath)\n ) {\n $fs->rename($parentZipFolderPath, \"$themePath/{$this->themeName}\");\n }\n\n // Run installer\n BackendExtensionsModel::installTheme($this->themeName);\n\n // Redirect with fireworks\n $this->redirect(\n BackendModel::createUrlForAction('Themes') . '&report=theme-installed&var=' . $this->themeName\n );\n }\n }",
"private function validate() {\n\t\tif( empty($this->header) )\n\t\t\tthrow new Exception('ACH file header record is required.');\n\n\t\tif( empty($this->batches) )\n\t\t\tthrow new Exception('ACH file requires at least 1 batch record.');\n\n\t\tif( empty($this->control))\n\t\t\tthrow new Exception('ACH file control record is required.');\t\t\t\n\t}",
"public function validateOrderFile(GGLFileProcessorComponent $fileProcessorComponent){\n\n\t\t$this->_rows = [];\n\n\t\t//validate general settings\n\t\t$settingsModel = new SettingsModel();\n\t\t$settingsModel->setOmitErrors($this->isOmitErrors());\n\n\t\tif (!$settingsModel->validate()){\n\t\t\t$this->_settings = $settingsModel;\n\t\t}\n\n\t\t//validate file's data\n\t\tif (!$fileProcessorComponent->getProjectsCount()){\n\t\t\t$rowExcelSource = new RowExcelSource();\n\t\t\t$rowExcelSource->validate();\n\t\t\t$this->_rows[] = $rowExcelSource;\n\t\t}else {\n\t\t\tfor ($i = 0; $i < $fileProcessorComponent->getProjectsCount(); $i++) {\n\t\t\t\t$rowExcelSource = new RowExcelSource();\n\t\t\t\t$rowExcelSource->setOmitErrors($this->isOmitErrors());\n\n\t\t\t\t$fileProcessorComponent->setProjectIndex($i);\n\t\t\t\t$rowExcelSource->setAttributes($fileProcessorComponent->getExcelRowValues($i));\n\n\t\t\t\tif (!$rowExcelSource->validate()) {\n\t\t\t\t\t$this->_rows[$fileProcessorComponent->getVideoId()] = $rowExcelSource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->isValid();\n\t}",
"function form_backend_validation()\r\n {\r\n // Need to make sure file contains meet results.\r\n //\r\n // What is a results file?\r\n //\r\n // - 1 A0 record\r\n // - 1 B1 record\r\n // - 1 B2 record (optional)\r\n // - 1 or more C1 records\r\n // - 1 or more C2 records\r\n // - 0 or more D0 records\r\n // - 0 or more D3 records\r\n // - 0 or more G0 records\r\n // - 0 or more E0 records\r\n // - 0 or more F0 records\r\n // - 0 or more G0 records\r\n // - 1 Z0 record\r\n //\r\n // A results file can contain results for more than\r\n // one team - so what to do if that happens?\r\n\r\n $legal_records = array(\"A0\" => 1, \"B1\" => 1, \"B2\" => 0,\r\n \"C1\" => 1, \"C2\" => 0, \"D0\" => 0, \"D3\" => 0, \"G0\" => 0,\r\n \"E0\" => 0, \"F0\" => 0, \"Z0\" => 1) ;\r\n \r\n $record_counts = array(\"A0\" => 0, \"B1\" => 0, \"B2\" => 0,\r\n \"C1\" => 0, \"C2\" => 0, \"D0\" => 0, \"D3\" => 0, \"G0\" => 0,\r\n \"E0\" => 0, \"F0\" => 0, \"Z0\" => 0) ;\r\n \r\n $z0_record = new SDIFZ0Record() ;\r\n\r\n $file = $this->get_element(\"SDIF Filename\") ; \r\n $fileInfo = $file->get_file_info() ; \r\n\r\n $lines = file($fileInfo['tmp_name']) ; \r\n\r\n // Scan the records to make sure there isn't something odd in the file\r\n\r\n $line_number = 1 ;\r\n\r\n foreach ($lines as $line)\r\n {\r\n if (trim($line) == \"\") continue ;\r\n\r\n $record_type = substr($line, 0, 2) ;\r\n\r\n if (!array_key_exists($record_type, $legal_records))\r\n {\r\n $this->add_error(\"SDIF Filename\", sprintf(\"Invalid record \\\"%s\\\" encountered in SDIF file on line %s.\", $record_type, $line_number)) ;\r\n return false ;\r\n }\r\n else\r\n {\r\n $record_counts[$record_type]++ ;\r\n }\r\n\r\n $line_number++ ;\r\n\r\n if ($record_type == \"Z0\")\r\n $z0_record->setSDIFRecord($line) ;\r\n }\r\n\r\n // Got this far, the file has the right records in it, do\r\n // the counts make sense?\r\n \r\n foreach ($record_counts as $record_type => $record_count)\r\n {\r\n if ($record_count < $legal_records[$record_type])\r\n {\r\n $this->add_error(\"SDIF Filename\", sprintf(\"Missing required \\\"%s\\\" record(s) in SDIF file.\", $record_type)) ;\r\n return false ;\r\n }\r\n }\r\n\r\n // Suppress Z0 checking?\r\n if ($this->get_element('Override Z0 Record Validation'))\r\n {\r\n return true ;\r\n }\r\n\r\n // Got this far, the file has the right records in it, do\r\n // the counts match what is reported in the Z0 record?\r\n\r\n $z0_record->ParseRecord() ;\r\n\r\n // Make sure this is a results file!\r\n if ($z0_record->getFileCode() != FT_SDIF_FTT_CODE_MEET_RESULTS_VALUE)\r\n {\r\n $this->add_error('SDIF Filename',\r\n sprintf('File Code (%02d) field in Z0 record does not match Results File Code(%02d).',\r\n $z0_record->getFileCode(), FT_SDIF_FTT_CODE_MEET_RESULTS_VALUE)) ;\r\n return false ;\r\n }\r\n \r\n // Make sure number of B records match Z0 record field\r\n if ($z0_record->getBRecordCount() != $record_counts['B1'])\r\n {\r\n $this->add_error('SDIF Filename',\r\n sprintf('Number of B records (%d) does not match field in Z0 record (%d).',\r\n $record_counts['B1'], $z0_record->getBRecordCount())) ;\r\n return false ;\r\n }\r\n\r\n // Make sure number of C records match Z0 record field\r\n if ($z0_record->getCRecordCount() != $record_counts['C1'])\r\n {\r\n $this->add_error('SDIF Filename',\r\n sprintf('Number of C records (%d) does not match field in Z0 record (%d).',\r\n $record_counts['C1'], $z0_record->getCRecordCount())) ;\r\n return false ;\r\n }\r\n\r\n // Make sure number of D records match Z0 record field\r\n if ($z0_record->getDRecordCount() != $record_counts['D0'])\r\n {\r\n $this->add_error('SDIF Filename',\r\n sprintf('Number of D records (%d) does not match field in Z0 record (%d).',\r\n $record_counts['D0'], $z0_record->getDRecordCount())) ;\r\n return false ;\r\n }\r\n\r\n // Make sure number of E records match Z0 record field\r\n if ($z0_record->getERecordCount() != $record_counts['E0'])\r\n {\r\n $this->add_error('SDIF Filename',\r\n sprintf('Number of E records (%d) does not match field in Z0 record (%d).',\r\n $record_counts['E0'], $z0_record->getERecordCount())) ;\r\n return false ;\r\n }\r\n\r\n // Make sure number of F records match Z0 record field\r\n if ($z0_record->getFRecordCount() != $record_counts['F0'])\r\n {\r\n $this->add_error('SDIF Filename',\r\n sprintf('Number of F records (%d) does not match field in Z0 record (%d).',\r\n $record_counts['F0'], $z0_record->getFRecordCount())) ;\r\n return false ;\r\n }\r\n\r\n // Make sure number of G records match Z0 record field\r\n if ($z0_record->getGRecordCount() != $record_counts['G0'])\r\n {\r\n $this->add_error('SDIF Filename',\r\n sprintf('Number of G records (%d) does not match field in Z0 record (%d).',\r\n $record_counts['G0'], $z0_record->getGRecordCount())) ;\r\n return false ;\r\n }\r\n\r\n unset($lines) ; \r\n\r\n\t return true ;\r\n }",
"private function _postValidation()\r\n\t{\r\n // Used $_POST here to allow us to modify them directly - naughty I know :)\r\n\r\n\t\tif (empty($_POST['description']) OR strlen($_POST['description']) > 10000)\r\n\t\t\t$this->_mod_errors[] = $this->l('Description is invalid');\r\n\t\t// could check that this is a valid path, but the next test will\r\n\t\t// do that for us anyway\r\n\t\t// But first we need to get rid of the escape characters\r\n\t\t$_POST['filepath'] = $this->winFixFilename($_POST['filepath']);\r\n\t\tif (empty($_POST['filepath']) OR (strlen($_POST['filepath']) > 255))\r\n\t\t\t$this->_mod_errors[] = $this->l('The target location is invalid');\r\n\r\n\t\tif (file_exists($_POST['filepath']) && !is_writable($_POST['filepath']))\r\n\t\t\t$this->_mod_errors[] = $this->l('File error.<br />Cannot write to').' '.$_POST['filepath'];\r\n\t}",
"function validate_expense_file() {\n return validate_post_file($this->input->post(\"file_name\"));\n }",
"abstract public function runValidation();",
"function is_valid_order($order) {\n $is_valid_order = true;\n\n // check if Header is present\n if (!array_key_exists(HEADER, $order)) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with no Header:\\n\" . var_export($order, true));\n }\n\n // check if Lines is present\n else if (!array_key_exists(LINES, $order)) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with no Lines:\\n\" . var_export($order, true));\n }\n\n // check if Lines is an array\n else if (!is_array($order[LINES])) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with non-array Lines:\\n\" . var_export($order, true));\n }\n\n // check if there is at least one Line item\n else if (!count($order[LINES])) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with no Line items:\\n\" . var_export($order, true));\n }\n\n // check if there is at least one total demand\n else if (line_demand_total($order[LINES]) === 0) {\n $is_valid_order = false;\n error_log(\"ERROR: Invalid order found with zero total demand:\\n\" . var_export($order, true));\n }\n\n return $is_valid_order;\n}",
"protected function isValidOrder()\n {\n return true;\n }",
"public function rules()\n {\n return [\n 'importedFile' => 'required',\n ];\n }",
"protected function validateOrder()\n {\n $helper = Mage::helper('checkout');\n if ($this->getQuote()->getIsMultiShipping()) {\n Mage::throwException($helper->__('Invalid checkout type.'));\n }\n\n if (!$this->getQuote()->isVirtual()) {\n $address = $this->getQuote()->getShippingAddress();\n $addressValidation = $this->validateAddress($address);\n if ($addressValidation !== true) {\n Mage::throwException($helper->__('Please check shipping address information.'));\n }\n $method= $address->getShippingMethod();\n $rate = $address->getShippingRateByCode($method);\n if (!$this->getQuote()->isVirtual() && (!$method || !$rate)) {\n Mage::throwException($helper->__('Please specify shipping method.'));\n }\n }\n\n $addressValidation = $this->validateAddress($this->getQuote()->getBillingAddress());\n if ($addressValidation !== true) {\n Mage::throwException($helper->__('Please check billing address information.'));\n }\n\n if (!($this->getQuote()->getPayment()->getMethod())) {\n Mage::throwException($helper->__('Please select valid payment method.'));\n }\n }",
"function wtsCtrlValidateOrder($ar){\n $p = new XParam($ar, array('mode'=>'a'));\n $mode = $p->get('mode');\n $r = array('ok'=>1, 'errors'=>array(), 'message'=>'');\n $mf = array('adresse1', 'nom', 'prenom', 'codepostal', 'ville', 'email');\n // possibilite d'ajouter des champs obligatoires\n if(isset($ar['mf'])){\n $mf = array_merge($mf, $ar['mf']);\n }\n $wtsliv = $p->get('wtsliv');\n $wtscoord = $p->get('wtscoord');\n foreach($mf as $f){\n $v = trim($wtscoord[$f]);\n if (empty($v)) {\n $r['errors'][] = array('wtscoord['.$f.']', 'mandatory');\n }\n }\n // livraison si ...\n if (isset($wtsliv['retrait']) && $wtsliv['retrait'] == 'domicile' && isset($wtsliv['choixadresse'])){\n $mf2 = array('adresse1', 'nom', 'prenom', 'codepostal', 'ville');\n foreach($mf2 as $f){\n $v = trim($wtsliv[$f]);\n if (empty($v))\n $r['errors'][] = array('wtsliv['.$f.']', 'mandatory');\n }\n }\n\n // cas du mail\n if (!self::isEmail($wtscoord['email'])){\n $r['errors'][] = array('wtscoord[email]', 'value');\n }\n // si demande de création de compte\n //\n \n if (isset($wtsliv['creercompte']) && $wtsliv['creercompte'] == '1'){\n $errors = $this->modcustomer->ctrlCreateCustomerFromOrder();\n if (count($errors)>0){\n $r['errors'] = array_merge($errors, $r['errors']);\n }\n }\n if (!isset($wtsliv['retrait'])){\n $r['message'] .= \"\\n\".$GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_retraitchoix');\n $r['ok'] = 0;\n }\n $cgv=false;\n if (!$p->is_set('wtsokcgv')){\n $r['message'] .= \"\\n\".$GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_acceptercgv');\n $cgv=true;\n $r['ok'] = 0;\n\n }\n $textbeforepayment_hid=$p->get('textbeforepayment_hid');\n $textbeforepayment=$p->get('textbeforepayment');\n if(!empty($textbeforepayment_hid)) {\n foreach($textbeforepayment_hid as $oid=>$foo) {\n\tif(empty($textbeforepayment[$oid])) {\n\t if(!$cgv) {\n\t $r['message'] .= \"\\n\".$GLOBALS['XSHELL']->labels->getCustomSysLabel('wts_acceptercgv');\n\t $cgv=true;\n\t }\n\t $r['ok'] = 0;\n\t}\n }\n }\n \n if (count($r['errors'])>0)\n $r['ok'] = 0;\n if ($mode == 'a')\n die(json_encode($r));\n return $r;\n }",
"function process() // OK\n { \n if(! $this->validate()) {\n\t $this->_errors->addError('Failed at event validation.');\n\t return false;\n }\n \n $this->_getTransactions();\n \n// -- added\n if(! $this->validate()) {\n\t $this->_errors->addError('Failed after dynamic validations.');\n\t return false;\n }\n// --\n if (! $this->_executeTransactions()) return false;\n else return $this->storeEventDetail();\n }",
"public function validate()\n {\n parent::validate();\n if ( ! $this->getRelease()\n || in_array($this->getRelease()->getState(), [\n array_search('failed', config('projects.states')),\n array_search('destroyed', config('projects.states'))\n ])\n ) {\n $this->failedValidation($this->getValidatorInstance());\n }\n }",
"protected function localValidation()\n\t\t{\n\t\t}",
"function patternentity_form_validate(&$form, &$form_state) {\n $validators = array('file_validate_extensions' => array('yaml xml'));\n //if (empty($form_state['value']['pattern_file'])) {\n // form_set_error('pattern_file', t('please choose a pattern file.'));\n //}\n //else {\n $file = file_save_upload('pattern_file', $validators);\n\n $file_exist = db_select('patternentity', 'pe')\n ->fields('pe', array('file_name'))\n ->condition('file_name', $file->filename, '=')\n ->execute()\n ->fetchAssoc();\n\n if ($file_exist) {\n form_set_error('pattern_file', t('pattern file already exists.'));\n }\n\n $form_state['storage']['file_obj'] = $file;\n $pattern = NULL;\n $file_extension = NULL;\n if ($file) {\n $file_extension = pathinfo($file->filename, PATHINFO_EXTENSION);\n\n // Choose appropriate function based on the file extension.\n // Can be FALSE, if no parser is found.\n $load_function = patterns_parser_get_parser_function($file_extension, PATTERNS_PARSER_LOAD);\n\n // Load and save pattern.\n if (!$load_function || !($pattern = $load_function($file->uri))) {\n form_set_error('pattern_file', t('parser pattern file failed.'));\n }\n\n if (!patterns_validate_pattern($pattern, $file_extension, PATTERNS_VALIDATE_SYNTAX)) {\n form_set_error('pattern_file', t('pattern file has wrong syntax.'));\n }\n }\n else {\n form_set_error('pattern_file', t('No file was uploaded.'));\n }\n \n if (isset($pattern['info']['title']) && !empty($pattern['info']['title'])) {\n $form_state['values']['title'] = $pattern['info']['title'];\n }\n else {\n form_set_error('pattern_file', t('file don\\'t have \\'title\\' field.'));\n }\n if (isset($pattern['info']['description']) && !empty($pattern['info']['description'])) {\n $form_state['values']['description'] = $pattern['info']['description'];\n }\n else {\n form_set_error('pattern_file', t('file don\\'t have \\'description\\' field.'));\n }\n if (isset($pattern['info']['category']) && !empty($pattern['info']['category'])) {\n $form_state['values']['category'] = $pattern['info']['category'];\n }\n else {\n form_set_error('pattern_file', t('file don\\'t have \\'category\\' field.'));\n }\n $form_state['values']['pattern'] = $pattern;\n if (isset($pattern['info']['author']) && !empty($pattern['info']['author'])) {\n $form_state['values']['author'] = $pattern['info']['author'];\n }\n else {\n form_set_error('pattern_file', t('file don\\'t have \\'author\\' field.'));\n }\n Global $user;\n $form_state['values']['uploader'] = $user->uid;\n $form_state['values']['file_name'] = $file->filename;\n $form_state['values']['file_format'] = $file_extension;\n //$form_state['values']['file_path'] = $file->uri;\n\n $dir = 'public://patternentity/';\n if (!file_prepare_directory($dir)) {\n form_set_error('pattern_file', t('public://patternentity doesn\\'t exist, or isn\\'t writable.'));\n }\n else {\n if ($file = file_move($file, $dir)) {\n $form_state['storage']['file_obj'] = $file;\n $file->status = FILE_STATUS_PERMANENT;\n file_save($file);\n $form_state['values']['file_path'] = $file->uri;\n }\n else {\n form_set_error('pattern_file', t('save to public dir failed'));\n }\n }\n //}\n}",
"protected function preValidate() {}",
"public function validate() {\n\t\t$errors = [];\n\t\t\n\t\t$requiredFiles = [\n\t\t\t\"{$this->dmDir}/config.json\",\n\t\t\t\"{$this->dmDir}/email-transport.json.template\",\n\t\t\t\"{$this->dmDir}/create-database.sql.template\",\n\t\t\t\"{$this->dmDir}/dbc.json.template\",\n\t\t];\n\t\t$missingFiles = [];\n\t\tforeach( $requiredFiles as $f ) {\n\t\t\tif( !file_exists($f) ) $missingFiles[] = $f;\n\t\t}\n\t\tif( $missingFiles ) {\n\t\t\t$errors[] = \"The following required files are missing:\\n- \".implode(\"\\n- \", $missingFiles);\n\t\t}\n\t\t\n\t\t$requiredConfigVars = [\n\t\t\t\"hostname-postfix\",\n\t\t\t\"deployment-root\",\n\t\t\t\"users\",\n\t\t\t\"users/postgres/username\",\n\t\t\t\"users/deployment-owner/username\",\n\t\t\t\"users/apache-manager/username\",\n\t\t\t\"sendgrid-password\",\n\t\t\t\"email-recipient-override\",\n\t\t];\n\t\t$missingConfigVars = [];\n\t\tforeach( $requiredConfigVars as $var ) {\n\t\t\tif( $this->getConfig($var,'__UNS') === '__UNS' ) {\n\t\t\t\t$missingConfigVars[] = $var;\n\t\t\t}\n\t\t}\n\t\tif( $missingConfigVars ) {\n\t\t\t$errors[] = \"The following required config entries are missing:\\n- \".implode(\"\\n- \",$missingConfigVars);\n\t\t}\n\t\t\n\t\tif( $errors ) {\n\t\t\tthrow new EarthIT_PhrebarDeploymentManager_EnvironmentException(implode(\"\\n\\n\", $errors));\n\t\t}\n\t}",
"protected function prepareForValidation() {\n\t\t$this->importStatus = [\n\t\t\tContentUserReportViewHelper::COPY_CONTENT_JOB_NOT_STARTED,\n\t\t\tContentUserReportViewHelper::COPY_CONTENT_JOB_RUNNING,\n\t\t\tContentUserReportViewHelper::COPY_CONTENT_JOB_COMPLETED,\n\t\t\tContentUserReportViewHelper::COPY_CONTENT_JOB_FAILED,\n\t\t];\n\t}",
"public function acfedu_do_something_with_file() {\n\n\t\t\t\tif ( isset( $_POST[\"select_file_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"select_file_nonce\"], 'select-file-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_nonce_no_match', esc_html__( 'Something went wrong. Please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( ! isset( $_POST['file_name'] ) ) {\n\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_file_selected', esc_html__( \"You didn't select a file.\", 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$file_name = $_POST['file_name'];\n\t\t\t\t\t\t$import = ! empty( $_POST['import'] ) ? $_POST['import'] : false;\n\t\t\t\t\t\t$remove = ! empty( $_POST['remove'] ) ? $_POST['remove'] : false;\n\t\t\t\t\t\t$verify = ! empty( $_POST['verify'] ) ? $_POST['verify'] : false;\n\n\t\t\t\t\t\tif ( ! empty( $verify ) ) {\n\n\t\t\t\t\t\t\t$read_data = acfedu_read_file_only( $file_name[0] );\n\t\t\t\t\t\t\t$verified_data = acfedu_verify_csv_data( $read_data );\n\n\t\t\t\t\t\t\tif ( false != $verified_data ) {\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_no_errors_in_csv', esc_html__( 'Congratulations, there appear to be no errors in your CSV.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_verify' );\n\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} elseif ( ! empty( $import ) ) {\n\n\t\t\t\t\t\t\t// import data\n\t\t\t\t\t\t\t$read_data = acfedu_read_file_only( $file_name[0] );\n\t\t\t\t\t\t\t$verified_data = acfedu_verify_csv_data( $read_data );\n\t\t\t\t\t\t\tif ( false != $verified_data ) {\n\t\t\t\t\t\t\t\t$line_number = 0;\n\t\t\t\t\t\t\t\tforeach ( $verified_data as $line ) {\n\t\t\t\t\t\t\t\t\t$line_number ++;\n\n\t\t\t\t\t\t\t\t\t$faculty = $line[0];\n\t\t\t\t\t\t\t\t\t$univ_abbr = $line[1];\n\t\t\t\t\t\t\t\t\t$univ = $line[2];\n\t\t\t\t\t\t\t\t\t$country_abbr = $line[3];\n\t\t\t\t\t\t\t\t\t$country = $line[4];\n\t\t\t\t\t\t\t\t\t$price = $line[5];\n\n\t\t\t\t\t\t\t\t\t$faculty_row = array(\n\t\t\t\t\t\t\t\t\t\t'faculty_name' => $faculty,\n\t\t\t\t\t\t\t\t\t\t'univ_code' => $univ_abbr,\n\t\t\t\t\t\t\t\t\t\t'univ_name' => $univ,\n\t\t\t\t\t\t\t\t\t\t'country_code' => $country_abbr,\n\t\t\t\t\t\t\t\t\t\t'country' => $country,\n\t\t\t\t\t\t\t\t\t\t'price' => $price,\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t\t$wpdb->insert( $wpdb->prefix . 'faculty', $faculty_row );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_lines_imported', sprintf( esc_html__( 'Congratulations. You have successfully imported %d faculty.', 'acf-faculty-selector' ), $line_number ) );\n\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import' );\n\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} elseif ( ! empty( $remove ) ) {\n\n\t\t\t\t\t\t\tif ( isset( $_POST['file_name'] ) ) {\n\t\t\t\t\t\t\t\tforeach ( $_POST['file_name'] as $file_name ) {\n\t\t\t\t\t\t\t\t\t// delete file\n\t\t\t\t\t\t\t\t\tunlink( wp_upload_dir()['basedir'] . '/acfedu/' . $file_name );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( count( $_POST['file_name'] ) == 1 ) {\n\t\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_file_deleted', sprintf( esc_html__( 'File \"%s\" successfully deleted.', 'acf-faculty-selector' ), $file_name ) );\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_files_deleted', esc_html__( 'Files successfully deleted.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"protected function setupValidation()\n {\n }",
"private function validateModeFromJsonFile( $projectStructure ) {\n // detect if the project created was a zip file, in which case try to detect \n // id_qa_model from json file. \n // otherwise assign the default model \n \n $qa_model = FALSE; \n $fs = new FilesStorage();\n $zip_file = $fs->getTemporaryUploadedZipFile( $projectStructure['uploadToken'] );\n\n \\Log::doLog( $zip_file ); \n\n if ( $zip_file !== FALSE ) {\n $zip = new ZipArchive();\n $zip->open( $zip_file );\n $qa_model = $zip->getFromName( '__meta/qa_model.json');\n }\n\n // File is not a zip OR model was not found in zip\n\n \\Log::doLog( $qa_model ); \n\n if ( $qa_model === FALSE ) {\n $qa_model = file_get_contents( INIT::$ROOT . '/inc/qa_model.json');\n }\n\n $decoded_model = json_decode( $qa_model, TRUE ) ;\n\n if ( $decoded_model === null ) {\n $projectStructure['result']['errors'][ ] = array(\n 'code' => '-900', // TODO: decide how to assign such errors\n 'message' => 'QA model failed to decode'\n );\n }\n\n // TODO: implement other validations\n\n\n /**\n * Append the qa model to the project structure for later use.\n */\n if ( ! array_key_exists('features', $projectStructure ) ) {\n $projectStructure['features'] = array();\n }\n\n $projectStructure['features'] = array(\n 'review_improved' => array(\n '__meta' => array(\n 'qa_model' => $decoded_model\n )\n )\n );\n\n }",
"function validate(){\n\t\t//always validate on order processing\n\t \tif(isset($_POST['action_processOrder'])){\n\t \t\t$data = $this->getData();\n\t \t\t$this->saveDataToSession($data);\n\t \t\t//check items are in cart, and each item can be purchased\n\t \t\t$order = ShoppingCart::singleton()->current();\n\t \t\tif(!$order){\n\t \t\t\treturn false;\n\t \t\t}\n\t \t\t$items = $order->Items();\n\t \t\tif($items->exists()){\n\t\t \t\tforeach($items as $item){\n\t\t \t\t\tif(!$item->Buyable()->canPurchase()){\n\t\t \t\t\t\t$this->sessionMessage(sprintf(_t(\"OrderForm.PRODUCTCANTPURCHASE\",\"%s cannot be purchased\"),$item->Title), \"bad\");\n\t\t \t\t\t\treturn false;\n\t\t \t\t\t}\t\t \t\t\t\t\n\t\t \t\t}\n\t \t\t}else{\n\t \t\t\t$this->sessionMessage(_t(\"OrderForm.EMPTYCART\",\"Your cart is empty\"), $type);\n\t \t\t\treturn false;\n\t \t\t}\n\t\t\t//TODO: Check if prices have changed\n\t \t\t$valid = parent::validate();\n\t \t\t//TODO: check that member details are not already taken, if entered\n\t \t\t//check terms have been accepted\n\t\t\t$controller = $this->Controller();\n\t \t\tif(SiteConfig::current_site_config()->TermsPage()->exists() && (!isset($data['ReadTermsAndConditions']) || !(bool)$data['ReadTermsAndConditions'])){\n\t \t\t\t$this->sessionMessage(_t(\"OrderForm.MUSTREADTERMS\",\"You must agree to terms and conditions\"), \"bad\");\n\t \t\t\treturn false;\n\t \t\t}\n\t \t\treturn $valid;\n\t \t}\n\t \t//Override form validation to make different shipping address button, and other form actions work\n\t\tforeach($this->getValidActions() as $action){\n\t\t\tif(isset($_POST[$action])){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn parent::validate();\n\t }",
"public function rules()\n {\n return [\n //'osc_desc.' => 'required|min:1|max:100',\n 'osc_id' => 'required',\n 'periodo_id' => 'required'\n //'osc_d01' => 'required',\n //'osc_d01' => 'sometimes|mimes:xls,xlsx|max:2048',\n //'per01_id' => 'required', \n //'num01_id' => 'required',\n //'osc_edo01' => 'required',\n //'osc_d02' => 'required',\n //'osc_d02' => 'sometimes|mimes:xls,xlsx|max:2048',\n //'per02_id' => 'required', \n //'num02_id' => 'required',\n //'osc_edo02' => 'required',\n //'osc_d03' => 'required',\n //'osc_d03' => 'sometimes|mimes:xls,xlsx|max:2048',\n //'per03_id' => 'required', \n //'num03_id' => 'required',\n //'osc_edo03' => 'required',\n //'osc_d04' => 'required',\n //'osc_d04' => 'sometimes|mimes:xls,xlsx|max:2048',\n //'per04_id' => 'required', \n //'num04_id' => 'required',\n //'osc_edo04' => 'required',\n //'osc_d05' => 'required',\n //'osc_d05' => 'sometimes|mimes:xls,xlsx|max:2048',\n //'per05_id' => 'required', \n //'num05_id' => 'required',\n //'osc_edo05' => 'required',\n //'osc_d06' => 'required',\n //'osc_d06' => 'sometimes|mimes:xls,xlsx|max:2048',\n //'per06_id' => 'required', \n //'num06_id' => 'required',\n //'osc_edo06' => 'required',\n //'osc_d07' => 'required',\n //'osc_d07' => 'sometimes|mimetypes:application/pdf|max:2048',\n //'osc_d07' => 'sometimes|mimetypes:pdf|max:2048',\n //'osc_d07' => 'sometimes|mimes:application/pdf|max:2048',\n //'osc_d07' => 'sometimes|mimes:pdf|max:2048',\n //'per07_id' => 'required', \n //'num07_id' => 'required',\n //'osc_edo07' => 'required',\n //'osc_d08' => 'required',\n //'osc_d08' => 'sometimes|mimetypes:application/pdf|max:2048',\n //'osc_d08' => 'sometimes|mimetypes:pdf|max:2048',\n //'osc_d08' => 'sometimes|mimes:application/pdf|max:2048',\n //'osc_d08' => 'sometimes|mimes:pdf|max:2048' \n //'per08_id' => 'required',\n //'num08_id' => 'required',\n //'osc_edo08' => 'required'\n //'apor_recibe'=> 'required|min:1|max:100'\n //'accion' => 'required|regex:/(^([a-zA-z%()=.\\s\\d]+)?$)/i',\n //'medios' => 'required|regex:/(^([a-zA-z\\s\\d]+)?$)/i'\n //'rubro_desc' => 'min:1|max:80|required|regex:/(^([a-zA-zñÑ%()=.\\s\\d]+)?$)/iñÑ'\n ];\n }",
"private static function validation()\n {\n $files = ['Validator', 'ValidationResult'];\n $folder = static::$root.'Validation'.'/';\n\n self::call($files, $folder);\n\n //Initiate the validation surface\n Validator::ini();\n }",
"public function beforeValidate()\n {\n if ($this->filesToDelete()) {\n $this->deleteFiles(json_decode($this->owner->getOldAttribute($this->attribute)), null, false);\n }\n $this->owner->{$this->attribute} = $this->files = $this->contentAttribute\n ? $this->processContentFiles(false)['files']\n : UploadedFile::getInstances($this->owner, $this->attribute);\n }",
"function oa_export_blueprint_import_form_validate($form, &$form_state) {\n if (!$_FILES['files']['name']['file']) {\n drupal_set_message(t('Please upload a file to import.'), 'error');\n form_set_error('', NULL);\n }\n}"
] |
[
"0.6289103",
"0.61295015",
"0.5924467",
"0.58466774",
"0.5845686",
"0.5825999",
"0.57774895",
"0.57302916",
"0.56859314",
"0.56685543",
"0.5648442",
"0.56384075",
"0.55994177",
"0.5549619",
"0.5543154",
"0.5520733",
"0.5493414",
"0.54726183",
"0.5460693",
"0.5457844",
"0.5445788",
"0.5443218",
"0.5435387",
"0.5433246",
"0.5426862",
"0.5423864",
"0.5422882",
"0.5404811",
"0.53928214",
"0.5382351"
] |
0.66735774
|
0
|
/ PRIVATE METHODS Returns a references to the package cache. Should be called as follows: $cache =& $this>_get_package_cache();
|
private function &_get_package_cache()
{
return $this->EE->session->cache[$this->_namespace][$this->_package_name];
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function saveToPackageCache() {}",
"public static function getCache() {}",
"public function getCache();",
"public function getCache()\r\n\t{\r\n\t\treturn \\Bitrix\\Main\\Data\\Cache::createInstance();\r\n\t}",
"public function getCache()\r\n {\r\n \treturn $this->_cache;\r\n }",
"protected function getCacheModule() {}",
"public function getCache() {\n\t\treturn $this->get('Cundd\\\\Rest\\\\Cache\\\\Cache');\n\t}",
"public function getCache()\n {\n return $this->_cache;\n }",
"public function cache() {\n\t\treturn $this->_cache;\n\t}",
"public static function getCache()\n {\n return self::$_cache;\n }",
"function getCache() {\n return $this->cache;\n }",
"public function cache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->cache;\n }",
"public function getCache()\n {\n return $this->Cache;\n }",
"public function getCache()\n\t{\n\t\treturn $this->cache;\n\t}",
"public function getCache()\r\n\t{\r\n\t\treturn $this->m_cache;\r\n\t}",
"function getCache() {\n return $this->cache;\n }",
"public function getCache() {\n return $this->cache;\n }",
"protected function getCache()\n {\n return $this->cache;\n }",
"public static function getCache() {\n\t\treturn null;\n\t}",
"static public function getCache(){\n return static::$cache;\n }",
"public function getCache()\n\t{\n\t\treturn ($this->_cache);\n\t}",
"protected function getCacheService()\n {\n return $this->services['cache'] = new \\phpbb\\cache\\service(${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'}, ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, './../', 'php');\n }",
"protected function _getCache()\n\t{\n\t\t/**\n\t\t * @todo needs to be adjusted for use with Zend_Cache_Manager\n\t\t */\n\t\treturn self::$_cache;\n\n\t}"
] |
[
"0.7136654",
"0.7012844",
"0.69072074",
"0.6893167",
"0.68829966",
"0.6837031",
"0.6822065",
"0.681674",
"0.6769723",
"0.67093194",
"0.66844875",
"0.6681645",
"0.6678107",
"0.6678107",
"0.6678107",
"0.6678107",
"0.6678107",
"0.6678107",
"0.6678107",
"0.6676471",
"0.66356075",
"0.6610636",
"0.6587471",
"0.6582883",
"0.65778893",
"0.6566046",
"0.655935",
"0.65576893",
"0.65419596",
"0.65261966"
] |
0.8350881
|
0
|
Clears all the log entries for the specified site.
|
public function clear_log($site_id = NULL)
{
$site_id = valid_int($site_id, 1)
? (int) $site_id : $this->get_site_id();
$this->EE->db->delete('omnilog_entries', array('site_id' => $site_id));
return TRUE;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function clear_log()\n\t{\n\t\tfile_put_contents( NHS_LOG_FILE );\n\t}",
"public function flushlogs()\n\t{\n\t\t$this->deleteAll(array('1 = 1'));\n\t}",
"public static function clearLog() \n\t{\n\t\ttry {\n\t\t\tVCDClassFactory::getInstance('logSQL')->clearLog();\n\t\t} catch (Exception $ex) {\n\t\t\tthrow $ex;\n\t\t}\n\t}",
"public function clear_recent_visitors_log() {\n\t\tdelete_option(self::$ROLES_LOG_KEY);\n\t}",
"private function clear_log()\n {\n if ($this->_log && is_array($this->_log)) {\n $this->_log = array();\n }\n }",
"public function clear()\n {\n $this->log = [];\n }",
"public function clear()\n {\n if ($this->directory->isExist($this->logFile)) {\n $this->directory->delete($this->logFile);\n }\n }",
"public function clear_log() {\r\n\t\t@unlink( $this->file );\r\n\t}",
"public function clearlogAction()\n {\n $this->_helper->layout->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true); \n $bizlogModel = new Core_Model_Bizlog;\n $bizlogModel->deleteAllEntries();\n $this->_helper->FlashMessenger('Cleared log');\n $this->_helper->redirector('viewlog', 'status', 'admin');\n }",
"public function purgeSystemLog()\n\t{\n\t\t$objDatabase = \\Database::getInstance();\n\n\t\t// Truncate the table\n\t\t$objDatabase->execute(\"TRUNCATE TABLE tl_log\");\n\n\t\t// Add a log entry\n\t\t$this->log('Purged the system log', __METHOD__, TL_CRON);\n\t}",
"final public function purgeLog() {\n $this->log = array();\n }",
"private function clearLog() {\n $this -> log = array();\n $this -> log[\"success\"] = array();\n $this -> log[\"failure\"] = array();\n }",
"function dblog_clear_log_submit() {\n $_SESSION['dblog_overview_filter'] = array();\n db_truncate('watchdog')->execute();\n db_query('alter sequence watchdog_wid_seq restart');\n drupal_set_message(t('Database log cleared.'));\n}",
"public function clearLogfiles()\n {\n $logfiles = JFolder::files(ECRPATH_LOGS, 'log', false, true);\n\n $application = JFactory::getApplication();\n\n if(count($logfiles))\n {\n if(JFile::delete($logfiles))\n {\n $application->enqueueMessage(jgettext('The logfiles have been deleted'));\n $application->input->set('view', 'easycreator');\n }\n else\n {\n $application->enqueueMessage(jgettext('The logfiles could not be deleted'), 'error');\n $application->input->set('view', 'logfiles');\n }\n }\n\n parent::display();\n }",
"public function clear_log_from_url_request() {\n\t\t// Clear the log if clear button was clicked in settings\n\t\t// and redirect user to show message.\n\t\tif (\n\t\t\tisset( $_GET['simple_history_clear_log_nonce'] ) &&\n\t\t\twp_verify_nonce( $_GET['simple_history_clear_log_nonce'], 'simple_history_clear_log' )\n\t\t) {\n\t\t\tif ( $this->user_can_clear_log() ) {\n\t\t\t\t$num_rows_deleted = $this->clear_log();\n\n\t\t\t\t/**\n\t\t\t\t * Fires after the log has been cleared using\n\t\t\t\t * the \"Clear log now\" button on the settings page.\n\t\t\t\t *\n\t\t\t\t * @param int $num_rows_deleted Number of rows deleted.\n\t\t\t\t */\n\t\t\t\tdo_action( 'simple_history/settings/log_cleared', $num_rows_deleted );\n\t\t\t}\n\n\t\t\t$msg = __( 'Cleared database', 'simple-history' );\n\n\t\t\tadd_settings_error(\n\t\t\t\t'simple_history_settings_clear_log',\n\t\t\t\t'simple_history_settings_clear_log',\n\t\t\t\t$msg,\n\t\t\t\t'updated'\n\t\t\t);\n\n\t\t\tset_transient( 'settings_errors', get_settings_errors(), 30 );\n\n\t\t\t$goback = esc_url_raw( add_query_arg( 'settings-updated', 'true', wp_get_referer() ) );\n\t\t\twp_redirect( $goback );\n\t\t\texit();\n\t\t}\n\t}",
"public function run($request)\n {\n echo _t(\n __class__ . \".CLEARLOG\",\n \"Emptying logs for table SolrLog.\" . PHP_EOL . \"WARNING: Any logs that are not inspected will be gone soon.\"\n );\n DB::query('TRUNCATE TABLE `SolrLog`');\n }",
"function clear_log(){\n\t$query=\"DROP TABLE \".DB_TABLE_LOG;\n\t$result = mysql_query($query);\n\tlog_this(\"new log\");\n}",
"public function clear_log() {\n\t\tglobal $wpdb;\n\n\t\t$tableprefix = $wpdb->prefix;\n\n\t\t$simple_history_table = self::DBTABLE;\n\t\t$simple_history_context_table = self::DBTABLE_CONTEXTS;\n\n\t\t// Get number of rows before delete.\n\t\t$sql_num_rows = \"SELECT count(id) AS num_rows FROM {$tableprefix}{$simple_history_table}\";\n\t\t// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\t$num_rows = $wpdb->get_var( $sql_num_rows, 0 );\n\n\t\t// Use truncate instead of delete because it's much faster (I think, writing this much later).\n\t\t$sql = \"TRUNCATE {$tableprefix}{$simple_history_table}\";\n\t\t// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\t$wpdb->query( $sql );\n\n\t\t$sql = \"TRUNCATE {$tableprefix}{$simple_history_context_table}\";\n\t\t// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\t$wpdb->query( $sql );\n\n\t\tHelpers::get_cache_incrementor( true );\n\n\t\treturn $num_rows;\n\t}",
"function afap_clear_log() {\n\n if (!empty($_GET) && wp_verify_nonce($_GET['_wpnonce'], 'afap-clear-log-nonce')) {\n\n global $wpdb;\n\n $log_table_name = $wpdb->prefix . 'afap_logs';\n\n $wpdb->query(\"TRUNCATE TABLE $log_table_name\");\n\n $_SESSION['afap_message'] = __('Logs cleared successfully.', 'accesspress-facebook-auto-post');\n\n wp_redirect(admin_url('admin.php?page=afap&tab=logs'));\n\n exit();\n\n } else {\n\n die('No script kiddies please!');\n\n }\n\n }",
"public function ClearLog()\r\n\t{\r\n\t\treturn $this->RemovedOldFiles(\r\n\t\t\t\t\\Cmp3\\Cmp3::$LogPath,\r\n\t\t\t\t'log',\r\n\t\t\t\t'log');\r\n\t}",
"public function cleanUpOldLog() {\n\t\t$timestamp = Utils::instance()->localToUtc( apply_filters( 'ip_lockout_logs_store_backward', '-' . Settings::instance()->storage_days . ' days' ) );\n\t\tLog_Model::deleteAll( array(\n\t\t\t'date' => array(\n\t\t\t\t'compare' => '<=',\n\t\t\t\t'value' => $timestamp\n\t\t\t),\n\t\t), '0,1000' );\n\t}",
"function acf_clear_log()\n{\n}",
"function clearLogs($filename){\n\t\n\t// Path for all the log files\n\t$filepath = '../logs/';\n\n\tunlink($filepath . $filename);\n}",
"function delete_all()\n{\n\t$model = $this->getModel('logs');\n\t$read = $model->delete_all();\n\t$this->view_logs();\n}",
"public function clear_tables()\n\t{\n\t\tglobal $wpdb;\n\t\t$wpdb->query( 'DELETE FROM '.self::$site_table.';' );\n\t}",
"function simple_history_settings_field_clear_log() {\n\n\t$clear_log = false;\n\n\tif (isset($_GET[\"simple_history_clear_log\"]) && $_GET[\"simple_history_clear_log\"]) {\n\t\t$clear_log = true;\n\t\techo \"<div class='simple-history-settings-page-updated'><p>\";\n\t\t_e(\"Cleared database\", 'simple-history');\n\t\techo \"</p></div>\";\n\t}\n\t\n\tif ($clear_log) {\n\t\tsimple_history_clear_log();\n\t}\n\t\n\t_e(\"Items in the database are automatically removed after 60 days.\", 'simple-history');\n\t$update_link = add_query_arg(\"simple_history_clear_log\", \"1\");\n\tprintf(' <a href=\"%2$s\">%1$s</a>', __('Clear it now.', 'simple-history'), $update_link);\n}",
"public function clearTempLog(): void\n {\n $this->tempLog = '';\n }",
"public function delete_site($site) {\n $this->delete_blog($site->id);\n }",
"public function clearLog($data = null)\n {\n $path = $this->getLogPath();\n if (is_file($path)) {\n unlink($path);\n touch($path);\n }\n if (!empty($data)) {\n self::log($data);\n }\n }",
"public static function unsetAllSessionOnSite() {\n session_unset();\n session_destroy();\n }"
] |
[
"0.6755485",
"0.6648822",
"0.6558718",
"0.6500558",
"0.6429238",
"0.63660794",
"0.63406533",
"0.63257164",
"0.62527764",
"0.62131935",
"0.6200704",
"0.6102674",
"0.6063299",
"0.605214",
"0.6021218",
"0.5975174",
"0.5965449",
"0.5869927",
"0.58194685",
"0.5814251",
"0.5759896",
"0.5752675",
"0.57484233",
"0.5742022",
"0.57330906",
"0.5730879",
"0.5648753",
"0.5638697",
"0.5598422",
"0.5581958"
] |
0.7257532
|
0
|
Returns an array of addons with one or more log entries in the OmniLog table.
|
public function get_addons_with_an_omnilog_entry($site_id = NULL)
{
// Ensure we have a valid site ID.
$site_id = valid_int($site_id, 1)
? (int) $site_id : $this->get_site_id();
$db_result = $this->EE->db
->select('addon_name')
->group_by('addon_name')
->order_by('addon_name', 'asc')
->get_where('omnilog_entries', array('site_id' => $site_id));
$addons = array();
foreach ($db_result->result() AS $db_addon)
{
$addons[] = $db_addon->addon_name;
}
return $addons;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function get_all_log() {\r\n\t\treturn $this->edb->selectAll ( \"log\" );\r\n\t}",
"public static function adLogList()\n {\n $adLog = ORM::for_table('sales_inte_online_inquiries', 'ksi')\n ->find_array();\n\n return $adLog;\n }",
"protected function get_log_entries( $log = null ) {\n\t\tif ( $logger = $this->current_logger() ) {\n\t\t\t$logger->use_log( $log );\n\t\t\treturn (array) $logger->retrieve();\n\t\t}\n\n\t\treturn array();\n\t}",
"public function getLogs(){\n $logs = [];\n\n if($this->connectionLog){\n $logs = $this->connectionLog;\n }\n\n return $logs;\n }",
"public function getLogs () : array {\n\t\treturn $this->logs;\n\t}",
"public function getLogs(){\n $obj=new Application_Model_Log();\n $entries=$obj->fetchAll();\n $arrLogs=array();\n \n foreach($entries as $entry)\n { \t\n \t$arrlogs[$entry->getConfigId()]=ucfirst($entry->getConfigName());\n }\n return $arrlogs;\n \n }",
"public function getLogs() {\n\n $logs = isset($this->data['logs']) ? $this->data['logs'] : array();\n\n return $logs;\n }",
"public function findAll() {\r\r\n\r\r\n $result = array();\r\r\n $query = \"SELECT * FROM log ORDER BY action_datetime DESC\";\r\r\n\r\r\n try {\r\r\n $this->pdo->beginTransaction(); // Start transaction\r\r\n $qresult = $this->pdo->prepare($query); \r\r\n $qresult->execute();\r\r\n $this->pdo->commit(); // If all goes well the transaction is validated\r\r\n\r\r\n while( $row = $qresult->fetch() ) {\r\r\n list ( $idLog, $idEnterprise, $ipAddress, $actionDateTime ) = $row; // Like that $idLog = $row['id_log'] etc.\r\r\n $newLog = new Log($idEnterprise, $ipAddress, $actionDateTime, $idLog);\r\r\n $result[] = $newLog; // Adds new log to array\r\r\n }\r\r\n\r\r\n // $this->pdo = NULL;\r\r\n return $result;\r\r\n }\r\r\n catch(Exception $e) // In case of error\r\r\n {\r\r\n // The transaction is cancelled\r\r\n $this->pdo->rollback();\r\r\n\r\r\n // An error message is displayed\r\r\n print 'Tout ne s\\'est pas bien passé, voir les erreurs ci-dessous<br />';\r\r\n print 'Erreur : '.$e->getMessage().'<br />';\r\r\n print 'N° : '.$e->getCode();\r\r\n\r\r\n // Execution of the code is stopped\r\r\n die();\r\r\n }\r\r\n }",
"public function getLog()\n\t{\n\t\t$models = CWizardLog::model()->forSession($this->session)->findAll();\n\t\tfor ($log = array(); list(, $model) = each($models);\n\t\t $log[$model->action_id] = $model) ;\n\t\tif (!count($log))\n\t\t\t$log = array(new CWizardLog);\n\t\treturn $log;\n\t}",
"public static function getAll(){\n global $conn;\n $result_logs = array();\n $logs = $conn->query(\"SELECT * FROM log\")->fetchAll(PDO::FETCH_ASSOC);\n\n foreach($logs as $log_){\n $log = new Log();\n $data = json_decode($log_['atividade'], true);\n $log->atividade = $data['atividade'];\n if(isset($data['dados']))\n $log->dados = $data['dados'];\n if(isset($data['data']))\n $log->dados = $data['data'];\n $log->tempo = new DateTime($log_['tempo']);\n $log->dados_sessao = json_decode($log_['dados_sessao'], true);\n array_push($result_logs, $log);\n }\n\n return $result_logs;\n }",
"public function log(): array\r\n {\r\n return $this->activityRepository->getLogData();\r\n }",
"public function getLogOn() {\n $conn = $this->getConnection();\n $getQuery = \"SELECT * from logon group by username\";\n $q = $conn->prepare($getQuery);\n $q->execute();\n return $q->fetchAll();\n }",
"public function getLogs()\n {\n $lines = array();\n foreach ($this->logs as $l)\n $lines[] = $l[0] . \" \" . Logger::fillPlaceholders($l[1], $l[2]);\n $this->logs = array();\n return $lines;\n }",
"public function get_log_entries($site_id = NULL, $limit = NULL,\n $offset = NULL, $addon_filter = NULL, $type_filter = NULL\n )\n {\n // Ensure we have valid arguments.\n $site_id = valid_int($site_id, 1)\n ? (int) $site_id : $this->get_site_id();\n\n $limit = valid_int($limit, 1)\n ? (int) $limit : $this->get_default_log_limit();\n\n $offset = valid_int($offset, 0) ? (int) $offset : 0;\n\n $db = $this->EE->db;\n\n $db\n ->select('addon_name, admin_emails, date, log_entry_id, message,\n extended_data, notify_admin, type')\n ->where('site_id', $site_id);\n\n // Filter by add-on.\n if ($addon_filter)\n {\n $db->where('addon_name', $addon_filter);\n }\n\n // Filter by entry type.\n if (is_string($type_filter))\n {\n $db->where('type', $type_filter);\n }\n\n // Run the query.\n $db_result = $db\n ->order_by('log_entry_id', 'desc')\n ->get('omnilog_entries', $limit, $offset);\n\n $entries = array();\n\n foreach ($db_result->result_array() AS $db_row)\n {\n $db_row['admin_emails'] = explode('|', $db_row['admin_emails']);\n $db_row['notify_admin'] = (strtolower($db_row['notify_admin']) === 'y');\n $entries[] = new Omnilog_entry($db_row);\n }\n\n return $entries;\n }",
"public function getLogs()\n {\n $logs = [];\n\n foreach ($this->loggers as $name => $logger) {\n $logs[$name] = $logger->getEvents();\n }\n\n return $logs;\n }",
"public function getLogs()\n {\n $logs = [];\n\n foreach ($this->loggers as $name => $logger) {\n $logs[$name] = $logger->getEvents();\n }\n\n return $logs;\n }",
"public function listLogs(): array\n {\n return [];\n }",
"public function logEntries()\n {\n return $this->hasMany(LogEntry::class);\n }",
"public function logs()\n {\n return $this->hasMany(Log::class);\n }",
"public function getLogsData() : array {\n $logsData = [];\n $logs = $this->getLogs();\n\n foreach($logs as $log){\n $logsData[] = $log->getData();\n }\n\n return $logsData;\n }",
"public function getLogs() {\n\t\tif(check($this->_identifier)) {\n\t\t\tif($this->_limit > 0) {\n\t\t\t\t$result = $this->db->queryFetch(\"SELECT * FROM \"._WE_CREDITSYSLOG_.\" WHERE `log_identifier` = ? ORDER BY `log_id` DESC LIMIT ?\", array($this->_identifier, $this->_limit));\n\t\t\t} else {\n\t\t\t\t$result = $this->db->queryFetch(\"SELECT * FROM \"._WE_CREDITSYSLOG_.\" WHERE `log_identifier` = ? ORDER BY `log_id` DESC\", array($this->_identifier));\n\t\t\t}\n\t\t} else {\n\t\t\tif($this->_limit > 0) {\n\t\t\t\t$result = $this->db->queryFetch(\"SELECT * FROM \"._WE_CREDITSYSLOG_.\" ORDER BY `log_id` DESC LIMIT ?\", array($this->_limit));\n\t\t\t} else {\n\t\t\t\t$result = $this->db->queryFetch(\"SELECT * FROM \"._WE_CREDITSYSLOG_.\" ORDER BY `log_id` DESC\");\n\t\t\t}\n\t\t}\n\t\tif(is_array($result)) return $result;\n\t}",
"public function getLog(): array\n {\n return $this->log;\n }",
"public function getLogList() {\n return json_encode($this->setLogList());\n }",
"public function ListarLogs()\n{\n\tself::SetNames();\n\n\t$sql = \" select * from log \";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}",
"function erp_get_audit_log_modules() {\n return \\WeDevs\\ERP\\Admin\\Models\\Audit_Log::select( 'component' )->distinct()->get()->toArray();\n}",
"public function logs()\n {\n return $this->hasMany('App\\Model\\Log');\n }",
"public function getLog(): array\n {\n return [];\n }",
"public function logs()\n {\n return $this->hasMany('App\\Log');\n }",
"public function retrieveLogs($entity): array\n {\n /** @var LogEntryRepository $logRepository */\n $logRepository = $this->em->getRepository(LogEntry::class); // we use default log entry class\n $logs = $logRepository->getLogEntries($entity);\n\n return LogFactory::createSiteLogs($logs);\n }",
"public function getAllFromDb() {\n\t\t$db = $this->connection();\n\n\t\t$sql = \"SELECT * FROM \" . SCRAPE_LOG_TABLE;\n\n\t\t$query = $db->prepare($sql);\n\t\t$query->execute();\n\n\t\t$result = $query->fetchAll();\n\t\t$counties = array();\n\t\t\n\t\tforeach($result as $row) {\n\t\t\t$scrapeLog = new \\model\\ScrapeLog($row[ID_COLUMN], $row[SCRAPE_LOG_TABLE_NAME_COLUMN], $row[SCRAPE_LOG_NEW_RECORDS_COLUMN], \n\t\t\t$row[SCRAPE_LOG_STARTED_AT_COLUMN], $row[SCRAPE_LOG_FINISHED_AT_COLUMN]);\n\t\t\t$scrapeLogs[] = $scrapeLog;\n\t\t}\n\t\t\n\t\treturn $scrapeLogs;\n\t}"
] |
[
"0.72860485",
"0.6897347",
"0.6720128",
"0.6655777",
"0.6654344",
"0.66380733",
"0.6566929",
"0.656359",
"0.65309525",
"0.65308285",
"0.65093875",
"0.64722425",
"0.64607996",
"0.64550537",
"0.643392",
"0.643392",
"0.6405256",
"0.6397679",
"0.63976777",
"0.6387476",
"0.6369466",
"0.63608015",
"0.6346717",
"0.6345078",
"0.63362294",
"0.6213984",
"0.6201215",
"0.6113841",
"0.61019105",
"0.6079868"
] |
0.7385091
|
0
|
Returns the default log 'limit'. That is, the number of log entries returned when calling the get_log_entries method.
|
public function get_default_log_limit()
{
return $this->_log_limit;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function getLimit()\n\t{\n\t\t$option_limit = $this->io->getOption('limit');\n\n\t\tif ( $option_limit !== null ) {\n\t\t\treturn $option_limit;\n\t\t}\n\n\t\treturn $this->getSetting(self::SETTING_LOG_LIMIT);\n\t}",
"public static function getDefaultLimit()\n {\n return config('consts.DefaultLimit');\n }",
"protected function setLimit($limit = null) {\n if (!$limit) {\n $limit = config('login-activity.number_of_getLatest_logs', 100);\n }\n\n return $limit;\n }",
"public function get_logger_limit() {\n\t\treturn $this->get_option('ring_logger_limit', 20);\n\t}",
"public function getDefaultLimit()\n {\n return $this->defaultLimit;\n }",
"public function getDefaultLimit()\n {\n return $this->default_limit;\n }",
"public function get_log_entry_pages( $limit ) {\n\t\t$count = (int) wp_count_posts( $this->post_type )->publish;\n\n\t\tif ( false !== $count ) {\n\t\t\t$count = $count - intval( 1 );\n\t\t\treturn floor( $count / $limit );\n\t\t} else {\n\t\t\treturn 1;\n\t\t}\n\t}",
"public function getDefaultLimit()\n {\n $limit = $this->config->getConfig(JobConfig::XML_PATH_LIMIT);\n\n return (int) !empty($limit) ? $limit : JobConfig::DEFAULT_PAGE_SIZE;\n }",
"protected function maxFiles()\n {\n if ($this->app->bound('config')) {\n return $this->app->make('config')->get('app.log_max_files', 5);\n }\n\n return 0;\n }",
"public function getLimit() {\n\t\treturn $this->limit;\n\t}",
"public function getLimit ()\r\n\t{\r\n\t\treturn $this->limit;\r\n\t}",
"protected function getLimit()\n {\n return (int)$this->getSettingsValue('limit');\n }",
"public function getLimit()\n {\n return isset($this->limit) ? $this->limit : 0.0;\n }",
"public function getLimit() : int\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return $this->limit;\n }",
"public function limit(): int\n {\n return $this->limit;\n }",
"public function getLimit()\n {\n return self::LIMIT;\n }",
"public function get_limit() {\n\t\t$job_listing_limit = $this->get_job_listing_limit();\n\t\tif ( $job_listing_limit ) {\n\t\t\treturn $job_listing_limit;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}",
"public function get_limit() {\n\t\t// This matches the maximum number of indexables created by this action.\n\t\treturn 4;\n\t}"
] |
[
"0.7790581",
"0.7662265",
"0.7652399",
"0.7605411",
"0.7402544",
"0.7359578",
"0.70214295",
"0.7002908",
"0.68240625",
"0.67454135",
"0.67325073",
"0.67320526",
"0.6703681",
"0.6698814",
"0.6677555",
"0.6677555",
"0.6677555",
"0.6677555",
"0.6677555",
"0.6677555",
"0.6677555",
"0.6677555",
"0.6677555",
"0.6677555",
"0.6677555",
"0.6677555",
"0.66374314",
"0.6602523",
"0.6593824",
"0.6562975"
] |
0.84575397
|
0
|
Returns the installed package version.
|
public function get_installed_version()
{
$db = $this->EE->db;
$db_result = $db
->select('module_version')
->get_where(
'modules',
array('module_name' => $this->get_package_name()),
1
);
return $db_result->num_rows() === 1
? $db_result->row()->module_version
: '';
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getInstalledVersion() {}",
"public function get_package_version()\n {\n return $this->_package_version;\n }",
"public function getInstalledVersion() {\n return $this->installedVersion;\n }",
"function version() {\n return app(\\PragmaRX\\Version\\Package\\Version::class);\n }",
"public function getVersion()\n {\n return $this->getNodeText('/p:package/p:version/p:release');\n }",
"function version() \n {\n return \"@package_version@\";\n }",
"public function getVersionString() {\n\t\tif ($this->installedVersion === 'core') {\n\t\t\treturn Cgn_SystemRunner::getReleaseNumber();\n\t\t}\n\t\treturn $this->installedVersion;\n\t}",
"public static function get_current_version() {\n\t\t// $db = JFactory::getDbo();\n\t\t// $db->setQuery('SELECT manifest_cache FROM #__extensions WHERE element = \"mod_slideshowck\"');\n\t\t// $manifest = json_decode($db->loadResult(), true);\n\t\t// $installed_version = $manifest['version'];\n\t\t\n\t\t// get the version installed\n\t\t$installed_version = 'UNKOWN';\n\t\t$file_url = JPATH_SITE .'/modules/mod_slideshowck/mod_slideshowck.xml';\n\t\tif ($xml_installed = JFactory::getXML($file_url)) {\n\t\t\t$installed_version = (string)$xml_installed->version;\n\t\t}\n\n\t\treturn $installed_version;\n\t}",
"public function get_version(): string\n {\n return $this->version;\n }",
"static function version ()\r\n\t{\r\n\t\treturn json_decode(file_get_contents(dirname(__FILE__).'/../composer.json'))->version;\r\n\t}",
"function armin_version()\n { \n $composer = json_decode(File::get(base_path('composer.json')));\n\n return optional($composer)->version;\n }",
"public function getInstalledSchemaVersion(): string\n {\n return $this->getInfo()->schemaVersion ?: $this->schemaVersion;\n }",
"function plex_config_get_installed_version() {\n\treturn get_option( 'plex_config_version' );\n}",
"public function getPackageVersion(): ?string\n {\n $request = app()->make(RequestContract::class)\n ->setVerb('GET')\n ->setUrl(Package::prefix() . '/packages/' . $this->project->getVersionedPackage()->getName());\n\n $trying = $this->client->try($request, GetPackageVersionFailed::getException($this->project));\n \n if (!$trying->ok()):\n report($trying->error());\n return null;\n endif;\n\n return $trying->response()->get()\n ->data->version;\n }",
"function myplugin_installed_version() {\n\n\treturn get_option( MYPLUGIN_NAME ); // returns the version number of this plugin that the current stored data is registered to.\n}",
"public function get_version();",
"public function getVersion()\n {\n return $this->getComposerVersion($this->getModuleName());\n }",
"public static function get_version() {\n return self::$version;\n }",
"public function getVersion ()\n {\n $moduleCode = 'Paymill_Paymill';\n $moduleInfo = $this->_moduleList->getOne($moduleCode);\n return $moduleInfo['setup_version'];\n }",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version()\n {\n return $this->version;\n }"
] |
[
"0.8293738",
"0.7901257",
"0.7883691",
"0.73681307",
"0.7354583",
"0.7283841",
"0.7275142",
"0.7209074",
"0.7208654",
"0.7183792",
"0.7153626",
"0.71418035",
"0.7134026",
"0.71273595",
"0.7121247",
"0.71054006",
"0.70808196",
"0.70578575",
"0.7040753",
"0.70336914",
"0.70336914",
"0.70336914",
"0.70336914",
"0.70336914",
"0.70336914",
"0.70336914",
"0.70336914",
"0.70336914",
"0.70336914",
"0.7022405"
] |
0.8323721
|
0
|
Returns the total number of log entries for the specified site.
|
public function get_log_entries_count($site_id = NULL)
{
$site_id = valid_int($site_id, 1)
? (int) $site_id : $this->get_site_id();
return $this->EE->db
->where(array('site_id' => $site_id))
->count_all_results('omnilog_entries');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function count_by_site($site_id = NULL) {\n $site_id = is_null($site_id) ? kohana::config('chapterboard.site_id') : $site_id;\n $result = $this->db->select('COUNT(*) as total')->from('finance_charges')->where('site_id', $site_id)->get()->current();\n return $result->total;\n }",
"function getSiteCount()\n\t\t{\n\t\t\tglobal $CFG;\n\t\t\tglobal $objSmarty;\n\t\t\t$sql_qry = \"SELECT count(theme_id) as site_count FROM \".$CFG['table']['domaindetails'].\" WHERE theme_id != '0'\";\n\t\t \t$res_qry = $this->ExecuteQuery($sql_qry,'select');\n\t\t \treturn $res_qry[0]['site_count'];\n\t\t}",
"private function getSiteAmount()\n {\n $repository = $this->getDoctrine()\n ->getRepository('AppBundle:Site');\n\n return $repository->createQueryBuilder('s')\n ->select('count(s.id)')\n ->where('s.isModerated = 1')\n ->getQuery()\n ->getSingleScalarResult();\n }",
"function getCount() {\n $this->putCount();\n //opens countlog.data to read the number of hits\n $datei = fopen(dirname(__FILE__) . DIRECTORY_SEPARATOR .\"countlog.data\", \"r\");\n $count = fgets($datei, 1000);\n fclose($datei);\n return $count;\n }",
"public static function record_count() {\n\t\tglobal $wpdb;\n\t\t$term_id = WP_SweepBright_Logs::get_term_id_by_slug();\n\n\t\t$sql = \"SELECT COUNT(*) FROM {$wpdb->prefix}posts\n\t\t\tLEFT JOIN $wpdb->term_relationships ON\n\t\t\t($wpdb->posts.ID = $wpdb->term_relationships.object_id)\n\t\t\tLEFT JOIN $wpdb->term_taxonomy ON\n\t\t\t($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)\n\t\t\tWHERE $wpdb->posts.post_type = 'wp_log'\n\t\t\tAND $wpdb->term_taxonomy.taxonomy = 'wp_log_type'\n\t\t\tAND $wpdb->term_taxonomy.term_id = $term_id\n\t\t\tAND $wpdb->posts.post_status = 'publish'\";\n\n\t\treturn $wpdb->get_var( $sql );\n\t}",
"public function get_total_number_of_blogs()\n {\n $total = 0;\n \n try\n {\n $stmt = $this->db->prepare(\"SELECT id FROM blogs WHERE date < :now AND enabled\");\n $stmt->execute( array(':now'=>time()) );\n $total = $stmt->rowCount();\n }\n catch(PDOException $e) {echo $e; }\n \n return $total;\n }",
"public function getWebsiteCount()\n {\n return count($this->getWebsites());\n }",
"public function getEntryCount() {}",
"public function count()\n {\n return count($this->sitemaps);\n }",
"function edd_count_total_file_downloads() {\n global $edd_logs;\n return $edd_logs->get_log_count( null, 'file_download' );\n}",
"function bpb_extended_get_total_blog_count_for_user( $count = 0 ) {\n\tif ( ! bpb_extended()->is_debug ) {\n\t\treturn $count;\n\t}\n\n\treturn count( bpb_extended_get_user_blog_ids() );\n}",
"function getTotalServerCount() {\n\t\t$count = 0;\n\t\tforeach ($this->masterservers as $masterserver) {\n\t\t\tif (isset($masterserver['num_servers_loaded'])) {\n\t\t\t\t$count += $masterserver['num_servers_loaded'];\n\t\t\t} else if (isset($masterserver['num_servers'])) {\n\t\t\t\t$count += $masterserver['num_servers'];\n\t\t\t}\n\t\t}\n\t\treturn $count;\n\t}",
"function getBlogCount()\n\t\t{\n\t\t\tglobal $CFG;\n\t\t\tglobal $objSmarty;\n\t\t\t$sql_qry = \"SELECT count(blog_id) as blog_count FROM \".$CFG['table']['domaindetails'].\" WHERE blog_id != '0'\";\n\t\t \t$res_qry = $this->ExecuteQuery($sql_qry,'select');\n\t\t \treturn $res_qry[0]['blog_count'];\n\t\t}",
"public function getTotalRecordsCount(): int\n {\n $records = $this->catalogSyncCron->getCatalogSyncList();\n return (int)$records->getTotalCount();\n }",
"public function getCountMessages()\n {\n if (null === $this->_countMessages)\n {\n $this->_countMessages = count($this->logs);\n }\n return $this->_countMessages;\n }",
"public function getTotalCount() {\n\n try {\n $amount = (int) $this->db->fetchOne(\"SELECT COUNT(*) as amount FROM email_log \" . $this->getCondition(), $this->model->getConditionVariables());\n } catch (Exception $e) {\n\n }\n return $amount;\n }",
"public function count() : int\n {\n return count($this->entries);\n }",
"public function countTotalUrls()\n {\n return $this->createQueryBuilder('t')\n ->select('COUNT(1)')\n ->getQuery()\n ->getSingleScalarResult();\n }",
"public function getRowCount() {\n $count_rows = $this->database->select('watchdog', 'w')\n ->fields('w')\n ->countQuery()\n ->execute()\n ->fetchField();\n if ($count_rows) {\n return $this->t(\"There are @count_entries log entries.\", [\n '@count_entries' => $count_rows,\n ]);\n }\n return FALSE;\n }",
"public function get_sites_count( $filter, $search, $orderby )\n\t{\n\t\tglobal $wpdb;\n \t\t$groupby = null;\n\t\treturn $wpdb->get_var( \"SELECT COUNT(DISTINCT \".self::$site_table.\".id) FROM \".self::$site_table.' '.$this->filter_sql($filter, $search, $groupby, $orderby) );\n\t}",
"public function getEntriesCount()\n\t{\n\t\treturn $this->lastCount;\n\t}",
"public function totalEntries()\n\t{\n\t\t$count = craft()->formBuilder2_entry->getTotalEntries();\n\t\treturn $count;\n\t}",
"public function countSiteTags($siteId);",
"public function total_notes()\n {\n $count = 0;\n\n foreach($this->sites as $site)\n $count = $count + $site->notes->count();\n\n return $count;\n }",
"public function countEntries()\n\t{\n\t\treturn count($this->_results);\n\t}",
"public function count()\n {\n return count($this->entries);\n }",
"function getTotalArticlesInSite()\n\t{\n\t\tglobal $CFG;\n\t\tglobal $db;\n\t\t$sql =\t'SELECT SUM(total_articles) AS total_articles'.\n\t \t\t' FROM '.$CFG['db']['tbl']['users'].' WHERE usr_status=\\'Ok\\'';\n\n\t\t$paramFields = array();\n\t\t$stmt = $db->Prepare($sql);\n\t\t$rs = $db->Execute($stmt, $paramFields);\n\t\tif (!$rs)\n\t\t\ttrigger_error($db->ErrorNo().' '.\n\t\t\t\t$db->ErrorMsg(), E_USER_ERROR);\n\n\t\tif ($rs->PO_RecordCount())\n\t\t{\n\t\t\tif($row = $rs->FetchRow())\n\t\t\t{\n \t\t\t\tif($row['total_articles'])\n \t\t\t\t{\n \t\t\t\t\t$all_article_url = getUrl('articlelist','?pg=articlenew', 'articlenew/','','article');\n \t\t\t\t\treturn '<a href=\"'.$all_article_url.'\">'.$row['total_articles'].'</a>';\n \t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public function getGuildLogCount()\n {\n return $this->count(self::_GUILD_LOG);\n }",
"public function getTotalRecordCount() {\n\t\treturn $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(\n\t\t\t'uid',\n\t\t\t'tx_t3blog_cat',\n\t\t\t'deleted=0 AND t3ver_id=0 AND t3ver_wsid = 0'\n\t\t);\n\t}",
"public function getEliteDailyRecordCount()\n {\n return $this->count(self::_ELITE_DAILY_RECORD);\n }"
] |
[
"0.7000025",
"0.68972504",
"0.66355914",
"0.63886684",
"0.62118727",
"0.61180156",
"0.61041385",
"0.6100256",
"0.60845643",
"0.6081004",
"0.607921",
"0.60015315",
"0.59946305",
"0.5971886",
"0.59710264",
"0.5951458",
"0.59458244",
"0.5909176",
"0.5894237",
"0.5877228",
"0.5871384",
"0.5815989",
"0.58159846",
"0.58032084",
"0.57973325",
"0.57895863",
"0.5772305",
"0.57680005",
"0.5754253",
"0.57395273"
] |
0.8068013
|
0
|
Returns the package name.
|
public function get_package_name()
{
return $this->_package_name;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getPackageName()\n {\n return $this->package_name;\n }",
"public function getPackagedName()\n {\n return Generator::getPackageName() . $this->getContextualPart() . ucfirst(self::uniqueName($this->getCleanName(), $this->getContextualPart()));\n }",
"public function getName()\n {\n return $this->getNodeText('/p:package/p:name');\n }",
"public static function getPackageName() {\n\t\treturn self::$_packageName;\n\t}",
"public function getPackageName() {\n\t\treturn t('Coworking Space Package');\n\t}",
"public function getPackageName(): string;",
"public function getRootPackageName()\n {\n return $this->composerJson['name'];\n }",
"public function getModuleName()\n {\n $name = $this->getComposerJson()->name;\n $name = join('_', array_map('ucfirst', explode('/', $name)));\n return $name;\n }",
"protected function getPackageName(PackageEvent $event)\n {\n return $this->getPackage($event)->getName();\n }",
"public function getPackage()\n {\n return $this->package;\n }",
"public function getPackage()\n {\n return $this->package;\n }",
"function packageNameWithParent()\n {\n $parent = $this->getParent();\n return ucwords($parent) . $this->getPackageName();\n }",
"function get_package_internal_name($package_data) {\n\tif (isset($package_data['internal_name']) &&\n\t ($package_data['internal_name'] != \"\")) {\n\t\t/* e.g. name is Ipguard-dev, internal name is ipguard */\n\t\treturn $package_data['internal_name'];\n\t} else {\n\t\treturn $package_data['name'];\n\t}\n}",
"function packagename()\r\n{\r\n\treturn app('packagename');\r\n}",
"public function getPseudoPackageName()\n\t{\n\t\tif ($this->reflection->isInternal()) {\n\t\t\treturn 'PHP';\n\t\t}\n\n\t\tif ($package = $this->reflection->getAnnotation('package')) {\n\t\t\t$packageName = preg_replace('~\\s+.*~s', '', $package[0]);\n\t\t\tif ($subpackage = $this->reflection->getAnnotation('subpackage')) {\n\t\t\t\t$packageName .= '\\\\' . preg_replace('~\\s+.*~s', '', $subpackage[0]);\n\t\t\t}\n\t\t\treturn $packageName;\n\t\t}\n\n\t\treturn 'None';\n\t}",
"public function package() {\n\t\treturn $this->package;\n\t}",
"function get_meta_pkg_name() {\n\tglobal $g;\n\n\t/* XXX: Use pkg annotation */\n\tif (is_pkg_installed(g_get('product_name'))) {\n\t\treturn g_get('product_name');\n\t}\n\tforeach (g_get('alternativemetaports') as $suffix) {\n\t\tif (is_pkg_installed(g_get('product_name') . '-' . $suffix)) {\n\t\t\treturn g_get('product_name') . '-' . $suffix;\n\t\t}\n\t}\n\treturn false;\n}",
"public function getLowerName(): string\n {\n return strtolower($this->packageName);\n }",
"protected function getModuleName( PackageInterface $package )\n {\n\n $name = $package->getPrettyName();\n $split = explode( \"/\", $name );\n\n if ( count( $split ) !== 2 ) {\n throw LaravelModuleInstallerException::fromInvalidPackage( $name );\n }\n\n $splitNameToUse = explode( \"-\", $split[1] );\n\n if ( count( $splitNameToUse ) < 2 ) {\n throw LaravelModuleInstallerException::fromInvalidPackage( $name );\n }\n\n if ( array_pop( $splitNameToUse ) !== 'module' ) {\n throw LaravelModuleInstallerException::fromInvalidPackage( $name );\n }\n\n return implode( '', array_map( 'ucfirst', $splitNameToUse ) );\n }",
"public function getPackageIdentityName()\n {\n if (array_key_exists(\"packageIdentityName\", $this->_propDict)) {\n return $this->_propDict[\"packageIdentityName\"];\n } else {\n return null;\n }\n }",
"public function getModuleName()\n {\n $module = $this->argument('module') ?: $this->laravel['modules']->used();\n \n return $this->laravel['modules']->findOrFail($module)->getStudlyName();\n }",
"public function getPackage() {}",
"public function getPackageType(): string\n {\n //if it starts with / like /foo/bar\n if (strpos($this->name, '/') === 0) {\n //it's a root package\n return self::TYPE_ROOT;\n }\n\n //if theres a slash like foo/bar\n if (strpos($this->name, '/') !== false) {\n //it's vendor package\n return self::TYPE_VENDOR;\n }\n\n //by default it's a pseudo package\n return self::TYPE_PSEUDO;\n }",
"public function getPackage()\n {\n return $this->tpPackage;\n }",
"public function get_name() {\n\treturn 'composer';\n}",
"private static function get_java_packagename($code) {\n $matches = array();\n $package = preg_match('/package([\\s\\S]*?);/', $code, $matches);\n if ($package === 0) {\n return \"\";\n }\n if ($package === false) {\n debugging('preg_match failed in get_java_packagename');\n return \"\";\n }\n\n switch (count($matches)) {\n case 0:\n return \"\"; // No package found!\n case 1:\n return $matches[0]; // Unclear what it is, deliver everything.\n default:\n return trim($matches[1]); // Found, expect package name as 2nd.\n }\n }",
"function get_base_pkg_name() {\n\tglobal $g;\n\n\t/* XXX: Use pkg annotation */\n\tif (is_pkg_installed(g_get('product_name') . '-base-' . g_get('product_name'))) {\n\t\treturn g_get('product_name') . '-base-' . g_get('product_name');\n\t} else if (is_pkg_installed(g_get('product_name') . '-base')) {\n\t\treturn g_get('product_name') . '-base';\n\t}\n\treturn false;\n}",
"public function name() : string\n {\n return call_user_func([get_called_class(), 'resolveName']);\n }",
"public function getNodename();",
"protected function getPackageName()\n {\n return null;\n }"
] |
[
"0.83387315",
"0.8184771",
"0.80038345",
"0.7964943",
"0.7953524",
"0.7545917",
"0.74056655",
"0.73583496",
"0.72224236",
"0.71802086",
"0.71802086",
"0.71106803",
"0.70990974",
"0.70679367",
"0.70645344",
"0.70457757",
"0.70101166",
"0.700779",
"0.6973187",
"0.68952733",
"0.6858541",
"0.68315566",
"0.6822643",
"0.67916995",
"0.67516094",
"0.67454344",
"0.673798",
"0.6671265",
"0.6623626",
"0.6615606"
] |
0.8799802
|
0
|
Returns the package theme folder URL. Appends a forward slash if required.
|
public function get_package_theme_url()
{
$theme_url = $this->EE->config->item('theme_folder_url');
$theme_url .= substr($theme_url, -1) == '/'
? 'third_party/'
: '/third_party/';
return $theme_url .$this->get_package_name() .'/';
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function theme_folder_url()\n\t{\n\t\treturn $this->sc->addon_theme_url;\n\t}",
"public function theme_folder_url()\n\t{\n\t\treturn $this->sc->addon_theme_url;\n\t}",
"public function getThemeUrl()\n\t{\n\t\treturn ActiveSite::getLink('theme') . $this->theme . '/';\n\t}",
"public function get_theme_url() {\n return '/' . \\Drupal::theme()->getActiveTheme()->getPath();\n }",
"public function _theme_url() {\n\t\treturn $this->EE->elements->_theme_url();\n\t}",
"protected function getThemeUrl()\n\t{\n\t\treturn get_stylesheet_directory_uri();\n\t}",
"function theme_dir()\n{\n \n $themeActived = is_theme('Y');\n\n $folder = $themeActived['theme_directory'].DS;\n\n return app_info()['app_url'].DS.APP_PUBLIC.DS.$folder;\n\n}",
"function wpcom_vip_themes_root_uri() {\n\tif ( ! is_admin() ) {\n\t\treturn home_url( '/wp-content/themes' );\n\t} else {\n\t\treturn content_url( '/themes' );\n\t}\n}",
"public function getThemePath()\n\t{\n\t\t$config = Config::getInstance();\n\t\treturn $config['path']['theme'] . $this->theme . '/';\n\t}",
"function get_theme_url()\n{\n $theme = Theme::GetTheme();\n return !is_null($theme) ? $theme->GetURL() : '';\n}",
"public function getThemeRootUri()\n {\n return $this->paths->getThemeRootUri();\n }",
"public static function getThemeUrl()\n {\n return (isset(self::$data['_url'])) ? self::$data['_url'] : '';\n }",
"public function get_theme_path(){\n\t\treturn $this->theme_path;\n\t}",
"private function themeUrl($path)\n {\n if (!$this->getParam('path', false)) {\n $url = URL::assemble(\n Config::get('system.filesystems.themes.url'),\n Config::get('theming.theme'),\n $path\n );\n } else {\n $url = URL::assemble($this->getParam('path'), $path);\n }\n\n $url = URL::prependSiteUrl(\n $url,\n $this->get('locale', default_locale()),\n false\n );\n\n if (!$this->getBool('absolute')) {\n $url = URL::makeRelative($url);\n }\n\n return $url;\n }",
"public function getThemePath(): string;",
"public static function getThemeFolder()\n {\n return self::$folder;\n }",
"function theme_path()\r\n{\r\n return base_path().'/cms/local/'.Cms::getCurrentTheme().'/';\r\n}",
"protected function getThemeDir()\n\t{\n\t\treturn Stringify::formatPath(get_stylesheet_directory());\n\t}",
"function get_theme_root_uri($stylesheet_or_template = '', $theme_root = '')\n {\n }",
"public function getThemeDirectory()\n {\n return $this->config->get('dirs.view').DIRECTORY_SEPARATOR.$this->config->get('site.theme').DIRECTORY_SEPARATOR;\n }",
"function get_theme_path(){\n\tglobal $theme;\n\treturn $theme->get_theme_path();\n}",
"public function get_theme_path() {\n return $this->_theme_path;\n }",
"protected function _getThemesPath()\n {\n $pathElements = array(\n dirname(__FILE__),\n '..',\n '..',\n 'public',\n 'themes'\n );\n return realpath(implode(DIRECTORY_SEPARATOR, $pathElements));\n }",
"public function getThemePath(): string\n {\n if (null === $this->themePath) {\n if ($this->isProtected()) {\n $this->themePath = $this->getProtectedThemePath();\n } elseif ($this->isValid()) {\n $this->themePath = call_user_func([$this->getClassname(), 'getThemeFolder']);\n } else {\n $this->themePath = $this->projectDir . '/themes/' . $this->getThemeName();\n }\n }\n return $this->themePath;\n }",
"function get_theme_dir()\n{\n $theme = Theme::GetTheme();\n return !is_null($theme) ? $theme->GetDirectory() : '';\n}",
"public function get_theme_root()\n {\n }",
"function frame_theme_url($path = '')\n{\n return trailingslashit(get_stylesheet_directory_uri()).$path;\n}",
"public function getUrl()\n {\n return Kuler_Api::viewThemeUrl((int) $this->ID);\n }",
"public function getFolder()\n {\n return $this->config['folder'] . '/' . basename($this->themeSlug);\n }",
"public function theme_url($directory=NULL)\n\t{\n\t\t$directory = ((NULL === $directory)) ? '' : \"/$directory\";\n\t\t\n\t\treturn \"/_data/$this->site_name/themes/$this->theme$directory\";\n\t}"
] |
[
"0.84751433",
"0.84096074",
"0.7769692",
"0.7497981",
"0.7494105",
"0.7471115",
"0.73227227",
"0.7321098",
"0.7274422",
"0.716755",
"0.7159447",
"0.7138727",
"0.7085141",
"0.70374066",
"0.70367223",
"0.69801134",
"0.69792885",
"0.6974108",
"0.6959581",
"0.69504607",
"0.69476146",
"0.69377387",
"0.69016516",
"0.68884933",
"0.6878567",
"0.6844793",
"0.6841977",
"0.6812094",
"0.6791638",
"0.6772789"
] |
0.84771454
|
0
|
Returns the package version.
|
public function get_package_version()
{
return $this->_package_version;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getVersion()\n {\n return $this->getNodeText('/p:package/p:version/p:release');\n }",
"function version() \n {\n return \"@package_version@\";\n }",
"public function get_version(): string\n {\n return $this->version;\n }",
"function version() {\n return app(\\PragmaRX\\Version\\Package\\Version::class);\n }",
"public static function get_version() {\n return self::$version;\n }",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function getVersion()\n {\n return $this->get(self::_VERSION);\n }",
"public function get_version()\n\t{\n\t\treturn $this->version;\n\t}",
"public function getVersion(): string\n {\n return $this->version;\n }",
"public function getVersion(): string\n {\n return $this->version;\n }",
"public function get_version()\n {\n return $this->version;\n }",
"public function get_version()\n {\n return $this->version;\n }",
"public function getVersion()\n {\n return $this->values[\"version\"];\n }",
"public function get_version() {\n return $this->version;\n }",
"public function get_version();",
"public function getVersion()\n {\n return $this->get(self::VERSION);\n }",
"static public function get_Version()\n {\n $version = self::get_version_number();\n \n $build_num = self::get_build_number();\n \n return \"v{$version[2]}.{$version[1]}.{$build_num}\";\n }",
"function get_version() {\n\n\t\treturn $this->version;\n\n\t}",
"public final function getVersion() : string\n {\n return $this->version;\n }",
"public function getVersion() {\n\t\tif($this->version == \"\")\n\t\t$this->version = \"0.0.0\";\n\t\treturn $this->version;\n\t}",
"public function getVersion(): string\n {\n return $this->rawData['version'];\n }"
] |
[
"0.83013153",
"0.8234755",
"0.8211189",
"0.81472105",
"0.80680233",
"0.80317706",
"0.80317706",
"0.80317706",
"0.80317706",
"0.80317706",
"0.80317706",
"0.80317706",
"0.80317706",
"0.80317706",
"0.80317706",
"0.7992452",
"0.79914933",
"0.7985992",
"0.7985992",
"0.79707134",
"0.79707134",
"0.79581815",
"0.7957641",
"0.79567426",
"0.7926435",
"0.79251707",
"0.7916497",
"0.7915652",
"0.79025733",
"0.789586"
] |
0.85262036
|
0
|
Returns an array of entry types with one or more entries in the OmniLog table.
|
public function get_types_with_an_omnilog_entry($site_id = NULL)
{
// Ensure we have a valid site ID.
$site_id = valid_int($site_id, 1)
? (int) $site_id : $this->get_site_id();
$db_types = $this->EE->db
->select('type')
->group_by('type')
->order_by('type', 'asc')
->get_where('omnilog_entries', array('site_id' => $site_id));
$types = array();
foreach ($db_types->result() AS $db_type)
{
$types[] = $db_type->type;
}
return $types;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getAllTypes() {\n\n $select = $this->select()\n ->setIntegrityCheck(false)\n ->from(\n array('t' => 'NEWAGENTTYPELOOKUP')\n );\n $allTypes = $this->fetchAll($select);\n $returnVal = array();\n foreach ($allTypes as $typeRow) {\n $returnVal[$typeRow->NEWAGENTTYPELOOKUPID] = $typeRow->LABEL;\n }\n\n return $returnVal;\n }",
"public static function getAllFieldsWithTypes(): array\n {\n $className = get_called_class();\n $table = with(new $className)->getTable();\n\n\n $cache_key = self::$cache_prefix.'.ALLFIELDS.WITH.TYPES.' . strtoupper($table);\n\n return self::$use_cache ? Cache::remember($cache_key, 5 * 60, function () use ($table) {\n return self::getArrayTableInfo($table);\n }) : self::getArrayTableInfo($table);\n }",
"public function get_log_entries($site_id = NULL, $limit = NULL,\n $offset = NULL, $addon_filter = NULL, $type_filter = NULL\n )\n {\n // Ensure we have valid arguments.\n $site_id = valid_int($site_id, 1)\n ? (int) $site_id : $this->get_site_id();\n\n $limit = valid_int($limit, 1)\n ? (int) $limit : $this->get_default_log_limit();\n\n $offset = valid_int($offset, 0) ? (int) $offset : 0;\n\n $db = $this->EE->db;\n\n $db\n ->select('addon_name, admin_emails, date, log_entry_id, message,\n extended_data, notify_admin, type')\n ->where('site_id', $site_id);\n\n // Filter by add-on.\n if ($addon_filter)\n {\n $db->where('addon_name', $addon_filter);\n }\n\n // Filter by entry type.\n if (is_string($type_filter))\n {\n $db->where('type', $type_filter);\n }\n\n // Run the query.\n $db_result = $db\n ->order_by('log_entry_id', 'desc')\n ->get('omnilog_entries', $limit, $offset);\n\n $entries = array();\n\n foreach ($db_result->result_array() AS $db_row)\n {\n $db_row['admin_emails'] = explode('|', $db_row['admin_emails']);\n $db_row['notify_admin'] = (strtolower($db_row['notify_admin']) === 'y');\n $entries[] = new Omnilog_entry($db_row);\n }\n\n return $entries;\n }",
"public static function getAllAsArray()\n {\n $savedTableTypes = ipGetOption(self::OPTION);\n $array = array();\n\n foreach ($savedTableTypes as $savedTableType) {\n array_push($array, $savedTableType);\n }\n\n return $array;\n }",
"function monitor_list_activity_types() {\n $query = \"select distinct(`wf_type`) from `\".GALAXIA_TABLE_PREFIX.\"activities`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_type'];\n }\n return $ret; \n }",
"public function getFieldtypesFromTable()\n {\n $used_fieldtypes = ee()->db->select('name')->order_by('name')->get('fieldtypes');\n\n return array_column($used_fieldtypes->result_array(), 'name');\n }",
"public function get_entities()\n\t{\t\n\t\t$query = $this->db->get('entity_types');\n\t\treturn $query->result_array();\n\t}",
"public function getAdtTypes()\n {\n $query = \"SELECT ALL FROM adv_type\";\n return $this->getQueryData($query, $this->getConnection());\n }",
"public function entries();",
"public function getEntries() {\n\t\t$this->_initDbConnection();\n\t\t\n\t\t$stm = $this->_prepareStatement('entry', 'getAll');\t\t\n\t\t$stm->execute();\n\t\t\n\t\tif ($this->_checkPdoError($stm)) {\n\t\t\treturn NULL;\n\t\t}\n\n\t\t$entries = array();\n\t\twhile($row = $stm->fetchObject()) {\n\t\t\t$row = $this->_hydrateEntry($row);\n\t\t\t$entries[] = $row;\n\t\t}\n\t\treturn $entries;\n\t}",
"public function findAll() {\n $sql = \"select * from eventtype order by num_ET\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $entities = array();\n foreach ($result as $row) {\n $id = $row['num_ET'];\n $entities[$id] = $this->buildDomainObject($row);\n }\n return $entities;\n }",
"public function listAllType(){\n try {\n return $this->identityTypeGateway->getAllTypes();\n } catch (Exception $ex) {\n throw $ex;\n }catch (PDOException $e){\n throw $e;\n }\n }",
"public function getTermRecordTypes() {\n \treturn $this->manager->getTermRecordTypes();\n\t}",
"protected function getEntityTypes() : array {\n $existingData = $this->entityTypeManager->getDefinitions();\n\n $entity_types = array_keys(array_intersect_key($this->reportData, $existingData));\n return array_diff($entity_types, [\n // TODO: Remove when crop type is exported.\n 'crop',\n 'update_helper_checklist_update',\n 'access_token',\n 'menu_link_content',\n 'redirect',\n 'shortcut',\n ]);\n }",
"protected function getTableTypes(): array\n {\n // are not detected unless the corresponding table type flag is added.\n /*if (DatabaseUtil.checkDatabaseType(DbSqlSessionFactory.POSTGRES)) {\n return PG_DBC_METADATA_TABLE_TYPES;\n }\n return DBC_METADATA_TABLE_TYPES;*/\n return self::PG_DBC_METADATA_TABLE_TYPES;\n }",
"public function get_if_types()\n {\n $this->db->from('oid__iftype');\n $this->db->where('active', 1);\n $this->db->order_by('id', 'ASC');\n $query = $this->db->get();\n return $query->result_array();\n }",
"public function getAuditTypes(): array\n {\n $auditableTypes = DB::table('audits')\n ->distinct('auditable_type')\n ->pluck('auditable_type')\n ->toArray();\n\n $hasExportTag = DB::table('audits')\n ->where('tags', 'export')\n ->first();\n\n $formattedTypes = $this->formatTypes($auditableTypes);\n\n if (isset($hasExportTag)) {\n $formattedTypes[] = ['model' => 'Export', 'tag' => 'export'];\n }\n\n return $formattedTypes;\n }",
"public static function getLogsByType($type)\n {\n return Log::where(\"type\", \"=\", $type)->get();\n }",
"public function definition(): array\n {\n return [\n 'type' => Arr::random(array_keys(EntryFactoryClass::$entries)),\n ];\n }",
"public function getTypes();",
"public function getTypes();",
"public function getTypes();",
"public function getTypes();",
"public function getTypes(): array;",
"public function getTypes(): array;",
"public static function messageTypes(): array\n {\n return _dblog_get_message_types();\n }",
"function FieldTypesArray() {}",
"public function getEntityTypes() {\n return $this->entity_types;\n }",
"public static function get_entity_types($conn, $cache = FALSE) \n {\n Ossim_db::check_connection($conn);\n \n $types = array();\n $query = \"SELECT HEX(id) AS id, entity_type FROM acl_entities\"; \n \n $rs = ($cache) ? $conn->CacheExecute ($query) : $conn->Execute ($query); \n \n if (!$rs)\n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n \n return array();\n } \n \n while (!$rs->EOF) \n {\n $types[$rs->fields['id']] = $rs->fields['entity_type'];\n \n $rs->MoveNext();\n } \n \n return $types;\n }",
"public static function getTypes()\n {\n $sql = 'SELECT * FROM location_type';\n $command = Yii::app()->db->createCommand($sql);\n return $command->queryAll(true);\n }"
] |
[
"0.62338525",
"0.61583334",
"0.6106545",
"0.6050748",
"0.6023981",
"0.6001256",
"0.5975038",
"0.5959057",
"0.59178257",
"0.5897438",
"0.5830466",
"0.58094156",
"0.5800249",
"0.5752458",
"0.57488894",
"0.5733378",
"0.57315373",
"0.5704",
"0.5687784",
"0.5679355",
"0.5679355",
"0.5679355",
"0.5679355",
"0.56539536",
"0.56539536",
"0.5653167",
"0.564849",
"0.5648357",
"0.56370175",
"0.5622458"
] |
0.66961247
|
0
|
Creates the OmniLog entries table.
|
public function install_module_entries_table()
{
$this->EE->load->dbforge();
$this->EE->dbforge->add_field(array(
'log_entry_id' => array(
'auto_increment' => TRUE,
'constraint' => 10,
'type' => 'INT',
'unsigned' => TRUE
),
'site_id' => array(
'constraint' => 5,
'type' => 'INT',
'unsigned' => TRUE
),
'addon_name' => array(
'constraint' => 50,
'type' => 'VARCHAR'
),
'admin_emails' => array(
'type' => 'MEDIUMTEXT'
),
'date' => array(
'constraint' => 10,
'type' => 'INT',
'unsigned' => TRUE
),
'notify_admin' => array(
'constraint' => 1,
'default' => 'n',
'type' => 'CHAR'
),
'type' => array(
'constraint' => 10,
'type' => 'VARCHAR'
),
'message' => array(
'type' => 'TEXT'
),
'extended_data' => array(
'type' => 'TEXT'
)
));
$this->EE->dbforge->add_key('log_entry_id', TRUE);
$this->EE->dbforge->add_key('addon_name');
$this->EE->dbforge->create_table('omnilog_entries', TRUE);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function create_ipn_messages_table() {\n\t\tglobal $wpdb;\n\t\t// Insert log table.\n\t\t$create_ipn_messages_table = \"CREATE TABLE IF NOT EXISTS \" . $wpdb->prefix . $this->log_table . \" (\n\t\t\tid BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\tuser_id BIGINT(20) NOT NULL,\n\t\t\ttimestamp DATETIME NOT NULL,\n\t\t\ttxn_id VARCHAR(30),\n\t\t\tresult VARCHAR(30),\n\t\t\tpayment_status VARCHAR(30),\n\t\t\tpending_reason VARCHAR(30),\n\t\t\tipn_detail LONGTEXT,\n\t\t\tnotes VARCHAR(80)\n\t\t)\";\n\t\t$wpdb->query( $create_ipn_messages_table );\n\t}",
"private function createTables() {\n \n foreach($this->G->tableInfo as $table) {\n $this->tables[$table[\"title\"]] = new IdaTable($table[\"title\"]);\n } \n }",
"public static function table () {\n\t\tglobal $pdo_handler;\n\t\t$pdo_handler->query( \"\n\t\t\tCREATE TABLE IF NOT EXISTS `etc_texts_history` (\n\t\t\t `text_id` int(11) NOT NULL,\n\t\t\t `user_id` int(11) NOT NULL,\n\t\t\t `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t\t `text` mediumtext COLLATE utf8_unicode_ci NOT NULL,\n\t\t\t PRIMARY KEY (`text_id`,`user_id`,`timestamp`)\n\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n\t\t\" );\n\t}",
"public function createTable()\n\t{\n\t\t$app = Factory::getApplication();\n\n\t\tif ($app->isSite())\n\t\t{\n\t\t\techo 'Error creating DB table - Need to run this in admin area';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$user = Factory::getUser();\n\n\t\tif (!$user->authorise('core.admin'))\n\t\t{\n\t\t\techo 'Error creating DB table - You need to be superadmin user to exeacute this task';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$jinput = $app->input;\n\t\t$context = $jinput->get->get('context', '', 'cmd');\n\n\t\tif (empty($context))\n\t\t{\n\t\t\techo 'Error creating DB table - No context is passed';\n\n\t\t\treturn;\n\t\t}\n\n\t\t$model = $this->getModel('indexer');\n\t\t$model->createTable($context);\n\t}",
"protected function _Upkeep_Entry_Notes_Table() {\n\t\tglobal $wpdb; \n // Submission table name (including wp prefix)\n $entry_notes_table = $this->Get_Notes_Table(); \n // Charset string\n\t\t$charset_collate = $wpdb->get_charset_collate();\n // SQL for the entries table\n $entries_notes_table_sql = \"CREATE TABLE $entry_notes_table (\n\t\t\tid bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\tuuid varchar(255) NOT NULL,\n entry_uuid varchar(255) NOT NULL,\n form_uuid varchar(255) NOT NULL,\n note_data longtext NULL,\n time_created bigint(20) UNSIGNED NOT NULL,\n time_modified bigint(20) UNSIGNED NULL,\n date_created date NOT NULL,\n date_modifed date NULL,\n\t\t\tPRIMARY KEY (id)\n\t\t) \".$charset_collate.\";\"; \n // Use the dbdelta to compare and upgrade\n dbDelta($entries_notes_table_sql);\n }",
"private function newTrackingTable () {\n\t\t//set timezone for timestamps\n\t\tdate_default_timezone_set('America/Toronto');\n\t\t$query = \n\t\t\t\"CREATE TABLE IF NOT EXISTS a2_tracking (id INTEGER AUTO_INCREMENT, hostname VARCHAR(100), url VARCHAR(100), timestamp VARCHAR(20), sequence INTEGER, increment INTEGER, count INTEGER, PRIMARY KEY (id))\";\n\t\t$this->sendQuery($query);\n\t}",
"private function createTables()\n {\n $this->createConfigsTable();\n $this->createServersTable();\n $this->createSearchesTable();\n }",
"private function createDummyTable() {}",
"private function initialize()\n {\n $this->pdo->exec(\n 'CREATE TABLE IF NOT EXISTS ' . $this->table . '\n(\n id VARCHAR(30) PRIMARY KEY NOT NULL,\n channel VARCHAR(60) NOT NULL,\n level INT NOT NULL,\n level_name VARCHAR(10) NOT NULL,\n message VARCHAR(250) NOT NULL,\n trace TEXT,\n payload TEXT,\n time DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,\n INDEX logs_channel_index (channel) USING HASH,\n INDEX logs_level_index (level) USING HASH,\n INDEX logs_time_index (time) USING HASH\n);'\n );\n\n $this->initialized = true;\n }",
"function edithistory_install()\n{\n\tglobal $db;\n\t$db->write_query(\"CREATE TABLE \".TABLE_PREFIX.\"edithistory (\n\t\t\t\teid int(10) unsigned NOT NULL auto_increment,\n\t\t\t\tpid int(10) unsigned NOT NULL default '0',\n\t\t\t\ttid int(10) unsigned NOT NULL default '0',\n\t\t\t\tuid int(10) unsigned NOT NULL default '0',\n\t\t\t\tdateline bigint(30) NOT NULL default '0',\n\t\t\t\toriginaltext text NOT NULL,\n\t\t\t\tsubject varchar(200) NOT NULL default '',\n\t\t\t\tipaddress varchar(30) NOT NULL default '',\n\t\t\t\treason varchar(200) NOT NULL default '',\n\t\t\t\tKEY pid (pid),\n\t\t\t\tPRIMARY KEY(eid)\n\t\t\t) ENGINE=MyISAM;\");\n\n\t$db->add_column(\"posts\", \"reason\", \"varchar(200) NOT NULL default ''\");\n}",
"private function _createTable() {\n $query = \"\n CREATE TABLE `seo_metadata` (\n `metadata_id` int(11) NOT NULL auto_increment,\n `seo_id` char(60) NOT NULL,\n `seo_title` varchar(255) NOT NULL,\n `seo_description` varchar(255) NOT NULL,\n `seo_keyword` varchar(255) NOT NULL,\n PRIMARY KEY (`metadata_id`),\n KEY `id_idx` (`id`)\n )\";\n $this->getAdapter()->query( $query );\n }",
"public function create_tables() {\n global $wpdb;\n $charset_collate = $wpdb->get_charset_collate();\n $schema = \"CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}wc_addresses` (\n `id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,\n `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `created_by` bigint(20) unsigned NOT NULL,\n `created_at` datetime DEFAULT NULL,\n PRIMARY KEY (`id`)\n ) $charset_collate\";\n if ( !function_exists( 'dbDelta' ) ) {\n require_once ABSPATH . '/wp-admin/includes/upgrade.php';\n }\n\n dbDelta( $schema );\n }",
"private function newPostTable () {\n\t\t$query = \n\t\t\t\"CREATE TABLE IF NOT EXISTS a2_posts (hostname VARCHAR(100), url VARCHAR(100), date VARCHAR(20), image VARCHAR(100), text VARCHAR(100), PRIMARY KEY (url))\";\n\t\t$this->sendQuery($query);\n\t}",
"public function getLogTable() {}",
"private function createTables()\n {\n $query = array();\n\n // creating games table\n $query[] = \"\n CREATE TABLE IF NOT EXISTS games (\n id INTEGER PRIMARY KEY,\n player1_hash TEXT,\n player1_name TEXT,\n player1_ships TEXT,\n player2_hash TEXT,\n player2_name TEXT,\n player2_ships TEXT,\n timestamp NUMERIC\n )\n \";\n\n // creating events table\n $query[] = \"\n CREATE TABLE IF NOT EXISTS events (\n id INTEGER PRIMARY KEY,\n game_id INTEGER,\n player INTEGER,\n event_type TEXT,\n event_value TEXT,\n timestamp NUMERIC\n )\n \";\n\n foreach ($query as $value) {\n $this->oDB->query($value);\n }\n }",
"function createAtomEntry() {\n\t\t$this->create();\n\t}",
"private function _createAndPopulateInfoTable($inputs)\n\t{\n\t\tCraft::log('Creating the info table.');\n\n\t\tcraft()->db->createCommand()->createTable('info', array(\n\t\t\t'version' => array('column' => ColumnType::Varchar, 'length' => 15, 'null' => false),\n\t\t\t'build' => array('column' => ColumnType::Int, 'length' => 11, 'unsigned' => true, 'null' => false),\n\t\t\t'schemaVersion' => array('column' => ColumnType::Varchar, 'length' => 15, 'null' => false),\n\t\t\t'releaseDate' => array('column' => ColumnType::DateTime, 'null' => false),\n\t\t\t'edition' => array('column' => ColumnType::TinyInt, 'length' => 1, 'unsigned' => true, 'default' => 0, 'null' => false),\n\t\t\t'siteName' => array('column' => ColumnType::Varchar, 'length' => 100, 'null' => false),\n\t\t\t'siteUrl' => array('column' => ColumnType::Varchar, 'length' => 255, 'null' => false),\n\t\t\t'timezone' => array('column' => ColumnType::Varchar, 'length' => 30),\n\t\t\t'on' => array('column' => ColumnType::TinyInt, 'length' => 1, 'unsigned' => true, 'default' => 0, 'null' => false),\n\t\t\t'maintenance' => array('column' => ColumnType::TinyInt, 'length' => 1, 'unsigned' => true, 'default' => 0, 'null' => false),\n\t\t\t'track' => array('column' => ColumnType::Varchar, 'maxLength' => 40, 'required' => true),\n\t\t));\n\n\t\tCraft::log('Finished creating the info table.');\n\n\t\tCraft::log('Populating the info table.');\n\n\t\t$info = new InfoModel(array(\n\t\t\t'version' => CRAFT_VERSION,\n\t\t\t'build' => CRAFT_BUILD,\n\t\t\t'schemaVersion' => CRAFT_SCHEMA_VERSION,\n\t\t\t'releaseDate' => CRAFT_RELEASE_DATE,\n\t\t\t'edition' => 0,\n\t\t\t'siteName' => $inputs['siteName'],\n\t\t\t'siteUrl' => $inputs['siteUrl'],\n\t\t\t'on' => 1,\n\t\t\t'maintenance' => 0,\n\t\t\t'track' => 'stable',\n\t\t));\n\n\t\tif (craft()->saveInfo($info))\n\t\t{\n\t\t\tCraft::log('Info table populated successfully.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCraft::log('Could not populate the info table.', LogLevel::Error);\n\t\t\tthrow new Exception(Craft::t('There was a problem saving to the info table:').$this->_getFlattenedErrors($info->getErrors()));\n\t\t}\n\t}",
"public function create()\n {\n $db = XenForo_Application::get('db');\n $db->query('CREATE TABLE `' . self::DB_TABLE . '`\n (`threema_id` CHAR(8) NOT NULL PRIMARY KEY,\n `public_key` CHAR(64) NOT NULL)\n ');\n }",
"public function create()\n {\n parent::create();\n\n $sheet = $this->add_sheet();\n\n $this->add_table($sheet, $this->database, $this->generate_table());\n }",
"private function create_event_log_table($db) {\n\t\t$this->company_forge = $this->load->dbforge($db, TRUE);\n\t\t// Load fields to create the Event Log table\n\t\t$fields = array(\n\t\t\t'id' => array(\n\t\t\t\t'type'\t\t\t\t=> 'INT',\n\t\t\t\t'constraint'\t\t=> 11,\n\t\t\t\t'unsigned'\t\t\t=> TRUE,\n\t\t\t\t'null'\t\t\t\t=> FALSE,\n\t\t\t\t'auto_increment'\t=> TRUE\n\t\t\t),\n\t\t\t'user' => array(\n\t\t\t\t'type'\t\t\t\t=> 'INT',\n\t\t\t\t'constraint'\t\t=> 11,\n\t\t\t\t'unsigned'\t\t\t=> TRUE,\n\t\t\t\t'null'\t\t\t\t=> FALSE\n\t\t\t),\n\t\t\t'event' => array(\n\t\t\t\t'type'\t\t\t\t=> 'VARCHAR',\n\t\t\t\t'constraint'\t\t=> 100,\n\t\t\t\t'null'\t\t\t\t=> FALSE\n\t\t\t),\n\t\t\t'event_type' => array(\n\t\t\t\t'type'\t\t\t\t=> 'INT',\n\t\t\t\t'constraint'\t\t=> 11,\n\t\t\t\t'unsigned'\t\t\t=> TRUE,\n\t\t\t\t'null'\t\t\t\t=> TRUE\n\t\t\t),\n\t\t);\n\t\t// Add the fields before creating the Forms table\n\t\t$this->company_forge->add_field($fields);\n\t\t// Array format doesn't work for default DateTimes, so we add them by string\n\t\t$this->company_forge->add_field(\"date DATETIME NOT NULL\");\n\t\t$this->company_forge->add_field(\"signature BLOB NOT NULL\");\n\t\t// Make the id the primary key of the Event Log table\n\t\t$this->company_forge->add_key('id', TRUE);\n\t\t// Attempt to create the Event Log table and return success or failure\n\t\tif ($this->company_forge->create_table('event_log'))\n\t\t\treturn TRUE;\n\t\telse\n\t\t\treturn FALSE;\n\t}",
"public function create_table() {\n\n\t\tglobal $wpdb;\n\n\t\t$table_name \t = $this->table_name;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$query = \"CREATE TABLE {$table_name} (\n\t\t\tid bigint(10) NOT NULL AUTO_INCREMENT,\n\t\t\tname text NOT NULL,\n\t\t\tdate_created datetime NOT NULL,\n\t\t\tdate_modified datetime NOT NULL,\n\t\t\tstatus text NOT NULL,\n\t\t\tical_hash text NOT NULL,\n\t\t\tPRIMARY KEY id (id)\n\t\t) {$charset_collate};\";\n\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\tdbDelta( $query );\n\n\t}",
"function init_tables(){\n $db = new PDO('sqlite:history.pyramid.sqlite');\n $db->exec(\"PRAGMA foreign_keys = ON\");\n $db->exec(\"drop table if exists areas\");\n $db->exec(\"drop table if exists codigos\");\n $db->exec(\"drop table if exists outs\");\n $db->exec(\"CREATE TABLE Areas (\n Id INTEGER PRIMARY KEY,\n out_date DATETIME DEFAULT CURRENT_TIMESTAMP,\n name TEXT,\n target INTEGER);\");\n $db->exec(\"CREATE TABLE codigos (\n Id INTEGER PRIMARY KEY,\n out_date DATETIME DEFAULT CURRENT_TIMESTAMP,\n name TEXT,\n target INTEGER);\");\n $db->exec(\"CREATE TABLE outs (\n Id INTEGER PRIMARY KEY,\n out_date DATETIME DEFAULT CURRENT_TIMESTAMP,\n name TEXT,\n target INTEGER);\");\n}",
"public static function createIAPAutorenewReceiptTable()\n {\n return TDOTableManager::createGenericTable(\"CREATE TABLE tdo_iap_autorenew_receipts (userid VARCHAR(36) NOT NULL, latest_receipt_data BLOB NOT NULL, expiration_date INT NOT NULL DEFAULT 0, transaction_id VARCHAR(255) NOT NULL, autorenewal_canceled TINYINT(1) NOT NULL DEFAULT 0, INDEX tdo_iap_autorenew_receipts_userid (userid), INDEX tdo_iap_autorenewal_canceled (autorenewal_canceled))\");\n }",
"protected function createEntryRecord() {\n\n\t\t$lot = CqlixHistory::getInstance()->getEntryLotRecord();\n\t\t$modelName = $this->model->getTable()->getModelName();\n\n\t\treturn HistoryEntry::create(array(\n\t\t\t'history_id' => $this->historyRecord->getId(),\n\t\t\t'Lot' => $lot,\n\t\t\t'model' => $modelName,\n\t\t\t'model_id' => $this->model->getPrimaryKeyValue(),\n\t\t\t'operation' => $this->operation,\n\t\t));\n\t}",
"public function __construct() {\n parent::__construct();\n $this->_table_columns = array(\"id\", \"entry_date\", \"account_type\", \"entry_value\", \"memo\", \"expense\", \"confirm\", \"deleted\", \"create_stamp\", \"modified_stamp\");\n }",
"public static function create_tables() {\n Site::create_table();\n Membership_Area::create_table();\n Restricted_Content::create_table();\n User::create_table();\n }",
"private function _createContentTable()\n\t{\n\t\tCraft::log('Creating the content table.');\n\n\t\tcraft()->db->createCommand()->createTable('content', array(\n\t\t\t'elementId' => array('column' => ColumnType::Int, 'null' => false),\n\t\t\t'locale' => array('column' => ColumnType::Locale, 'null' => false),\n\t\t\t'title' => array('column' => ColumnType::Varchar),\n\t\t));\n\t\tcraft()->db->createCommand()->createIndex('content', 'elementId,locale', true);\n\t\tcraft()->db->createCommand()->createIndex('content', 'title');\n\t\tcraft()->db->createCommand()->addForeignKey('content', 'elementId', 'elements', 'id', 'CASCADE', null);\n\t\tcraft()->db->createCommand()->addForeignKey('content', 'locale', 'locales', 'locale', 'CASCADE', 'CASCADE');\n\n\t\tCraft::log('Finished creating the content table.');\n\t}",
"public function createTable()\n {\n $table = self::$table_name;\n $SQL = <<<EOD\n CREATE TABLE IF NOT EXISTS `$table` (\n `communication_usage_id` INT(11) NOT NULL AUTO_INCREMENT,\n `communication_usage_name` VARCHAR(32) NOT NULL DEFAULT '',\n `communication_usage_description` VARCHAR(255) NOT NULL DEFAULT '',\n PRIMARY KEY (`communication_usage_id`),\n UNIQUE (`communication_usage_name`)\n )\n COMMENT='The communication usage definition table'\n ENGINE=InnoDB\n AUTO_INCREMENT=1\n DEFAULT CHARSET=utf8\n COLLATE='utf8_general_ci'\nEOD;\n try {\n $this->app['db']->query($SQL);\n $this->app['monolog']->addInfo(\"Created table 'contact_communication_usage'\", array(__METHOD__, __LINE__));\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }",
"public static function buildTableMap()\n {\n $dbMap = Propel::getServiceContainer()->getDatabaseMap(EmailManagerHistoryTableMap::DATABASE_NAME);\n if (!$dbMap->hasTable(EmailManagerHistoryTableMap::TABLE_NAME)) {\n $dbMap->addTableObject(new EmailManagerHistoryTableMap());\n }\n }",
"function createTable() {\n print \"\\nCreate table: \".$dbtable.\"\\n\";\n if (createDB()) {\n print \"OK\\n\";\n }\n interceptExit();\n }"
] |
[
"0.6423526",
"0.61381954",
"0.59992075",
"0.5883385",
"0.58077437",
"0.57728875",
"0.5758807",
"0.57038915",
"0.56779057",
"0.56749713",
"0.56676584",
"0.56479555",
"0.56425416",
"0.5616564",
"0.56099",
"0.56070423",
"0.5566029",
"0.5553123",
"0.55169845",
"0.55093926",
"0.54998",
"0.54952013",
"0.5459563",
"0.5438249",
"0.54320836",
"0.5431972",
"0.5421384",
"0.54148644",
"0.5399253",
"0.53698164"
] |
0.6990205
|
0
|
Registers the module in the database.
|
public function install_module_register()
{
$this->EE->db->insert('modules', array(
'has_cp_backend' => 'y',
'has_publish_fields' => 'n',
'module_name' => ucfirst($this->get_package_name()),
'module_version' => $this->get_package_version()
));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function register(){\n $this->registration->execute([], $this);\n }",
"public function register()\n {\n $this->registration->execute([],$this);\n }",
"function registerToDatabase() {\n\t\t\tif ($this->id != null && $this->id != 0) return false;\n\n\t\t\t$this->conn = connectToDb(\"db_avalanche_store\");\n\n\t\t\t$add_query = \"INSERT INTO tbl_dev_info \n\t\t\t(user_id, \n\t\t\t dev_name,\t\n\t\t\t dev_desc) \n\t\t\tVALUES \n\t\t\t('$this->dev_id', \n\t\t\t '$this->dev_name',\t\n\t\t\t '$this->dev_description');\";\n\n\t\t\t$result = $this->conn->query($add_query);\n\n\t\t\t$this->conn->close();\n\n\t\t\tif (!$result) return false;\n\n\t\t\treturn true;\n\t\t}",
"public function install()\r\n {\r\n //----------------------------------------\r\n // EXP_MODULES\r\n //----------------------------------------\r\n $module = ee('Model')->make('Module');\r\n $module->module_name = ucfirst($this->module_name);\r\n $module->module_version = $this->version;\r\n $module->has_cp_backend = 'y';\r\n $module->has_publish_fields = 'n';\r\n $module->save();\r\n\r\n //----------------------------------------\r\n // EXP_TAGGER\r\n //----------------------------------------\r\n $tagger = array(\r\n 'tag_id' => array('type' => 'INT', 'unsigned' => true, 'auto_increment' => true),\r\n 'tag_name' => array('type' => 'VARCHAR', 'constraint' => 255),\r\n 'site_id' => array('type' => 'TINYINT', 'unsigned' => true, 'default' => 1),\r\n 'author_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n 'entry_date' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n 'edit_date' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n 'hits' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'total_entries' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n );\r\n\r\n ee()->dbforge->add_field($tagger);\r\n ee()->dbforge->add_key('tag_id', true);\r\n ee()->dbforge->add_key('tag_name');\r\n ee()->dbforge->create_table('tagger', true);\r\n\r\n //----------------------------------------\r\n // EXP_TAGGER_LINKS\r\n //----------------------------------------\r\n $tagger = array(\r\n 'rel_id' => array('type' => 'INT', 'unsigned' => true, 'auto_increment' => true),\r\n 'site_id' => array('type' => 'TINYINT', 'unsigned' => true, 'default' => 1),\r\n 'entry_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'channel_id' => array('type' => 'SMALLINT', 'unsigned' => true, 'default' => 0),\r\n 'field_id' => array('type' => 'MEDIUMINT', 'unsigned' => true, 'default' => 0),\r\n// 'item_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'tag_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'author_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n 'type' => array('type' => 'SMALLINT', 'unsigned' => true, 'default' => 1),\r\n 'tag_order' => array('type' => 'SMALLINT', 'unsigned' => true, 'default' => 0),\r\n );\r\n\r\n ee()->dbforge->add_field($tagger);\r\n ee()->dbforge->add_key('rel_id', true);\r\n ee()->dbforge->add_key('tag_id');\r\n ee()->dbforge->add_key('entry_id');\r\n ee()->dbforge->create_table('tagger_links', true);\r\n\r\n //----------------------------------------\r\n // EXP_TAGGER_GROUPS\r\n //----------------------------------------\r\n $tagger = array(\r\n 'group_id' => array('type' => 'INT', 'unsigned' => true, 'auto_increment' => true),\r\n 'group_title' => array('type' => 'VARCHAR', 'constraint' => 255),\r\n 'group_name' => array('type' => 'VARCHAR', 'constraint' => 255),\r\n 'group_desc' => array('type' => 'VARCHAR', 'constraint' => 255),\r\n 'parent_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'site_id' => array('type' => 'TINYINT', 'unsigned' => true, 'default' => 1),\r\n '`order`' => array('type' => 'MEDIUMINT', 'unsigned' => true, 'default' => 1),\r\n );\r\n\r\n ee()->dbforge->add_field($tagger);\r\n ee()->dbforge->add_key('group_id', true);\r\n ee()->dbforge->create_table('tagger_groups', true);\r\n\r\n //----------------------------------------\r\n // EXP_TAGGER_GROUPS_ENTRIES\r\n //----------------------------------------\r\n $tagger = array(\r\n 'rel_id' => array('type' => 'INT', 'unsigned' => true, 'auto_increment' => true),\r\n 'tag_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'group_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n '`order`' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n );\r\n\r\n ee()->dbforge->add_field($tagger);\r\n ee()->dbforge->add_key('rel_id', true);\r\n ee()->dbforge->add_key('group_id');\r\n ee()->dbforge->add_key('tag_id');\r\n ee()->dbforge->create_table('tagger_groups_entries', true);\r\n\r\n //----------------------------------------\r\n // EXP_ACTIONS\r\n //----------------------------------------\r\n $action = ee('Model')->make('Action');\r\n $action->class = ucfirst($this->module_name);\r\n $action->method = $this->module_name . '_router';\r\n $action->csrf_exempt = 0;\r\n $action->save();\r\n\r\n //----------------------------------------\r\n // EXP_MODULES\r\n // The settings column, Ellislab should have put this one in long ago.\r\n // No need for a seperate preferences table for each module.\r\n //----------------------------------------\r\n if (ee()->db->field_exists('settings', 'modules') == false) {\r\n ee()->dbforge->add_column('modules', array('settings' => array('type' => 'TEXT') ) );\r\n }\r\n\r\n return true;\r\n }",
"public function run()\n {\n DB::table('modules')->insert([\n [\n 'name' => 'TestModuleA',\n 'label' => 'Test Module A',\n 'active' => 1\n ]\n ]);\n }",
"protected static function addModuleConfigurationsToDb()\n {\n static::_addMainConfigurationEntries();\n static::_addCredentialsConfigurationEntries();\n static::_addTransactionsConfigurationEntries();\n static::_addWpfConfigurationEntries();\n static::_addOrderConfigurationEntries();\n static::_addThreedsOptions();\n static::_addScaExemptionOptions();\n }",
"protected function registerModule()\n {\n //determine module and bind urls\n $requestUri = $this->url;\n if(empty($requestUri)) {\n $requestUri = '/';\n }\n if($requestUri == '/') {\n $mod = 'index';\n } else {\n $requestUri = trim($requestUri, '/');\n if(strpos($requestUri, '/') === false) {\n $mod = $requestUri;\n } else {\n list($mod) = explode('/',$requestUri);\n }\n }\n $mod = filter_var($mod, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);\n\n $this->mod = $mod;\n $this->uri = $requestUri;\n }",
"public function upModule()\n {\n // check if module is already installed\n if (!is_null(App::findOne(['name' => $this->module->id, 'className' => $this->module->getModuleClassName()])))\n {\n throw new yii\\base\\Exception('Module is already installed');\n }\n\n // 1 - Adds the Module into the database\n $app_record = new App();\n $app_record->name = $this->module->getName();\n $app_record->app_id = $this->module->getId();\n $app_record->description = $this->module->getDescription();\n $app_record->className = $this->module->getModuleClassName();\n $app_record->directory = $this->module->getModuleDirectory();\n $app_record->namespace = $this->module->getModuleNamespace();\n $app_record->version = $this->module->getVersion();\n $app_record->alias = '@' . $this->module->getAlias();\n $app_record->install_date = date(\"Y-m-d H:i:s\");\n $app_record->backend = $this->module->is_backend;\n $app_record->frontend = $this->module->is_frontend;\n $app_record->core_module = $this->module->is_core_module;\n $app_record->status = 'active';\n $app_record->insert();\n\n \n // Add the class and aliases to each module config\n $this->normalizeModuleConfig($app_record);\n\n return $app_record;\n }",
"public function initDatabase()\n {\n $this->register(new Provider\\DatabaseServiceProvider());\n }",
"public function install()\n\t{\n\t\t$data = array(\n\t\t\t'module_name' => $this->module_name,\n\t\t\t'module_version' => $this->version,\n\t\t\t'has_cp_backend' => 'y',\n\t\t\t'has_publish_fields' => 'n'\n\t\t);\n\n\t\t$this->EE->db->insert('modules', $data);\n\n\t\treturn TRUE;\n\t}",
"public function register(){}",
"public function run()\n {\n DB::table('role_has_modules')->insert([\n [\n 'module_id' => 1,\n 'role_id' => 1\n ],\n [\n 'module_id' => 2,\n 'role_id' => 1\n ],\n [\n 'module_id' => 3,\n 'role_id' => 1\n ],\n ]);\n }",
"function install(){\n\t\n\t\t$this->EE->load->dbforge();\n\n\t\t$data = array(\n\t\t\t'module_name' => 'Likee' ,\n\t\t\t'module_version' => $this->version,\n\t\t\t'has_cp_backend' => 'y',\n\t\t\t'has_publish_fields' => 'n'\n\t\t);\n\n\t\t$this->EE->db->insert('modules', $data);\n\n\t\t$fields = array(\n\t\t\t\t\t\t'like_id'\t\t\t=> array('type' \t\t => 'int',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'constraint'\t => '10',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'unsigned'\t\t => TRUE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'auto_increment' => TRUE),\n\t\t\t\t\t\t'liked'\t\t\t\t=> array('type'\t=> 'tinyint', 'constraint'=>'4'),\n\t\t\t\t\t\t'disliked'\t\t\t=> array('type'\t=> 'tinyint', 'constraint'=>'4'),\n\t\t\t\t\t\t'entry_id'\t\t\t=> array('type'\t=> 'int', 'constraint'=>'10'),\n\t\t\t\t\t\t'comment_id'\t\t=> array('type'\t=> 'int', 'constraint'=>'10'),\n\t\t\t\t\t\t'member_id'\t\t\t=> array('type'\t=> 'int', 'constraint'=>'10'),\n\t\t\t\t\t\t'date'\t\t\t\t=> array('type' => 'datetime'),\n\t\t\t\t\t\t'ip_address'\t\t=> array('type' => 'varchar', 'constraint' => '255'),\n\t\t\t\t\t\t'cookie_uid'\t\t=> array('type' => 'varchar', 'constraint' => '255'),\n\t\t\t\t\t\t);\n\n\t\t$this->EE->dbforge->add_field($fields);\n\t\t$this->EE->dbforge->add_key('like_id', TRUE);\n\t\t$this->EE->dbforge->create_table('likee');\t\n\t\tunset($fields);\n\t\n\t\treturn TRUE;\n\t}",
"public function register(): void;",
"public function run()\n {\n DB::table('modules')->insert([\n [\n 'name' => 'role',\n 'icon' => 'web',\n 'path' => 'roles',\n 'table_name' => 'roles',\n 'controller' => 'RoleController',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'name' => 'menu',\n 'icon' => 'web',\n 'path' => 'menus',\n 'table_name' => 'menus',\n 'controller' => 'MenuController',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'name' => 'user',\n 'icon' => 'web',\n 'path' => 'users',\n 'table_name' => 'users',\n 'controller' => 'UserController',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ],\n [\n 'name' => 'permission',\n 'icon' => 'web',\n 'path' => 'permissions',\n 'table_name' => 'permissions',\n 'controller' => 'PermissionController',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]\n ]);\n }",
"public function register() {}",
"public function run()\n\t{\n\t\tDB::table('gg_modules')->delete();\n\t\t$modules = array(\n\t\t\tarray('id' => 1,'name' => 'Organization' ,'status' => \"1\")\n\t\t);\n\t\tDB::table('gg_modules')->insert($modules);\n\t}",
"public function action_register() {\n\t\t\t$this->data[] = 0; // record_id - default for increment\n\t\t\t$this->prepareMainData();\n\t\t\t$model = Model::factory($this->modelName)->registerRecord($this->data);\n\t\t\tif ($model) $this->request->redirect($this->redirectURL);\n\t\t\n\t}",
"public function register()\n\t{\n\t\t//validate that all fields are filled and proper\n\t\t$errors = $this->validate();\n\t\tif ($errors != NULL)\n\t\t\treturn $errors;\n\t\t\n\t\t//insert task into database\n\t\t$dbhandle = db_connect();\n\t\t$stmt = $dbhandle->stmt_init();\n\t\t\n\t\t$stmt->prepare(\"INSERT INTO Tasks\n\t\t(\n\t\t\tTitle,\n\t\t\tDescription, \n\t\t\tLocation,\n\t\t\tCategory,\n\t\t\tTags,\n\t\t\tEndDateTime,\n\t\t\tLister,\n\t\t\tNumImages,\n\t\t\tInformation,\n\t\t\tInitialBid,\n\t\t\tActive\n\t\t) \n\t\tVALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1)\");\n\t\t$stmt->bind_param(\"sssisiiisi\", $this->title, $this->description, $this->location, $this->category, $this->tags, $this->enddatetime, $this->userid, $this->numimg, $this->content, $this->price);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\t\n\t\t$this->taskid = $dbhandle->insert_id;\n\t\t\n\t\t//close connection and return 0\n\t\t$stmt->close();\n\t\t$dbhandle->close();\n\t\treturn NULL;\n\t}",
"protected function addModule()\n {\n Mongez::append('modules', strtolower($this->moduleName));\n }",
"public function register()\n {\n foreach ($this->entities as $entity) {\n $this->{'bind' . $entity . 'Repository'}();\n }\n }",
"public function register(): void\n {\n //\n }",
"public function register(): void\n {\n //\n }",
"public function register(): void\n {\n //\n }",
"public function register(): void\n {\n //\n }",
"public function register(): void\n {\n //\n }",
"public function register();",
"public function register();",
"public function register();",
"public function register();"
] |
[
"0.634061",
"0.6225472",
"0.61178863",
"0.6067252",
"0.60478354",
"0.60343164",
"0.59736556",
"0.59259856",
"0.59208995",
"0.5804917",
"0.57988894",
"0.57949036",
"0.5768264",
"0.56873095",
"0.5684337",
"0.56514835",
"0.56473386",
"0.56464285",
"0.56291735",
"0.56133145",
"0.56025445",
"0.5596986",
"0.5596986",
"0.5596986",
"0.5596986",
"0.5596986",
"0.559675",
"0.559675",
"0.559675",
"0.559675"
] |
0.7647842
|
0
|
Notifies the site administrator (via email) of the supplied OmniLog Entry.
|
public function notify_site_admin_of_log_entry(Omnilog_entry $entry)
{
$this->EE->load->helper('text');
$this->EE->load->library('email');
$email = $this->EE->email;
$lang = $this->EE->lang;
$lang->loadfile('omnilog');
if ( ! $entry->is_populated())
{
throw new Exception($lang->line('exception__notify_admin__missing_data'));
}
$webmaster_email = $this->EE->config->item('webmaster_email');
if ($email->valid_email($webmaster_email) !== TRUE)
{
throw new Exception(
$lang->line('exception__notify_admin__invalid_webmaster_email'));
}
$webmaster_name = ($webmaster_name = $this->EE->config->item('webmaster_name'))
? $webmaster_name
: '';
switch ($entry->get_type())
{
case Omnilog_entry::NOTICE:
$lang_entry_type = $lang->line('email_entry_type_notice');
break;
case Omnilog_entry::WARNING:
$lang_entry_type = $lang->line('email_entry_type_warning');
break;
case Omnilog_entry::ERROR:
$lang_entry_type = $lang->line('email_entry_type_error');
break;
default:
$lang_entry_type = $lang->line('email_entry_type_unknown');
break;
}
$subject = ($site_name = $this->EE->config->item('site_name'))
? $lang->line('email_subject') .' (' .$site_name .')'
: $lang->line('email_subject');
$admin_emails = ($admin_emails = $entry->get_admin_emails())
? $admin_emails
: array($webmaster_email);
$message = $lang->line('email_preamble') .NL .NL;
$message .= $lang->line('email_addon_name') .NL
.$entry->get_addon_name() .NL .NL;
$message .= $lang->line('email_log_date') .NL
.date('r', $entry->get_date()) .NL .NL;
$message .= $lang->line('email_entry_type') .NL
.$lang_entry_type .NL .NL;
$message .= $lang->line('email_log_message') .NL
.$entry->get_message() .NL .NL;
$message .= $lang->line('email_log_extended_data') .NL
.$entry->get_extended_data() .NL .NL;
$message .= $lang->line('email_cp_url') .NL
.$this->EE->config->item('cp_url') .NL .NL;
$message .= $lang->line('email_postscript');
$message = entities_to_ascii($message);
$email->from($webmaster_email, $webmaster_name);
$email->to($admin_emails);
$email->subject($subject);
$email->message($message);
if ($email->send() !== TRUE)
{
throw new Exception(
$lang->line('exception__notify_admin__email_not_sent'));
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function notifyOwner()\n {\n global $config, $reefless, $account_info;\n\n $reefless->loadClass('Mail');\n\n $mail_tpl = $GLOBALS['rlMail']->getEmailTemplate(\n $config['listing_auto_approval']\n ? 'free_active_listing_created'\n : 'free_approval_listing_created'\n );\n\n if ($config['listing_auto_approval']) {\n $link = $reefless->getListingUrl(intval($this->listingID));\n } else {\n $myPageKey = $config['one_my_listings_page'] ? 'my_all_ads' : 'my_' . $this->listingType['Key'];\n $link = $reefless->getPageUrl($myPageKey);\n }\n\n $mail_tpl['body'] = str_replace(\n array('{username}', '{link}'),\n array(\n $account_info['Username'],\n '<a href=\"' . $link . '\">' . $link . '</a>',\n ),\n $mail_tpl['body']\n );\n $GLOBALS['rlMail']->send($mail_tpl, $account_info['Mail']);\n }",
"function _notify_users($channel_id, $entry_id, $entry_title)\n\t{\n\t\t// If we have a member group set for this channel\n\t\tif(isset($this->settings['channels']['id_'.$channel_id]['notification_group']))\n\t\t{\n\t\t\t$notification_group = $this->settings['channels']['id_'.$channel_id]['notification_group'];\n\t\t\t\n\t\t\t// Get all members from this group\n\t\t\t$this->EE->load->model('ep_members');\n\t\t\t$notifications = $this->EE->ep_members->get_all_members_from_group($notification_group);\n\t\t\t\n\t\t\t// If we didn't get any members\n\t\t\tif($notifications == FALSE) return;\n\t\t\t\n\t\t\t// Load the email library and text helper\n\t\t\t$this->EE->load->library('email');\n\t\t\t$this->EE->load->helper('text'); \n\n\t\t\t$this->EE->email->wordwrap = true;\n\t\t\t$this->EE->email->mailtype = 'text';\n\t\t\t\n\t\t\t// Email settings\n\t\t\t$review_url = $this->EE->functions->remove_double_slashes($this->EE->config->item('site_url').\"/\".SYSDIR.\"/\".BASE.AMP.\"C=content_publish\".AMP.\"M=entry_form\".AMP.\"channel_id={$channel_id}\".AMP.\"entry_id={$entry_id}\");\n\t\t\t\n\t\t\t$the_message = \"\";\n\t\t\t$the_message .= \"The entry '{$entry_title}' has been submitted for approval.\\n\\nTo review it please log into your control panel\\n\\n\";\n\t\t\t$the_message .= $review_url.\"\\n\";\n\n\t\t\t$the_subject = $this->EE->config->item('site_name').': An entry has been submitted for approval';\n\t\t\t\n\t\t\t$the_from = $this->EE->config->item('webmaster_email');\n\t\t\t\n\t\t\tforeach ($notifications->result_array() as $row)\n\t\t\t{\n\t\t\t\t$this->EE->email->initialize();\n\t\t\t\t$this->EE->email->from($the_from);\n\t\t\t\t$this->EE->email->to($row['email']); \n\t\t\t\t$this->EE->email->subject($the_subject);\n\t\t\t\t$this->EE->email->message(entities_to_ascii($the_message));\n\t\t\t\t$this->EE->email->Send();\n\t\t\t\t\n\t\t\t\t// Logging\n\t\t\t\t$this->action_logger->add_to_log(\"ep_status_transition, METHOD: _notify_users(): Notification email sent to : \".$row['email']);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Logging\n\t\t\t$this->action_logger->add_to_log(\"ep_status_transition, METHOD: _notify_users(): No member group found for channel: \".$channel_id);\n\t\t}\n\t}",
"public function sendUserUpdateNotification(): void\n {\n $this->notify(new VerifyAccountNotification());\n }",
"private function emailAtLogin() {}",
"function onesignin_client_handle_after_update_notification($account) {\n watchdog('onesignin', 'Updating user %name on request of One Signin server.', array('%name' => $account->name), WATCHDOG_INFO);\n onesignin_client_userdata_synchronize($account->server_uid);\n}",
"private function notifyAdmin(): void\n {\n if (!$this->cfg->getAdminEmails())\n return;\n\n $ex = new \\Exception;\n $trace = $ex->getTraceAsString();\n\n // format msg\n $msg = \"Trying to send email with subject: \\\"$this->Subject\\\" \"\n . \"triggered a failover.\\r\\n\\r\\n\"\n . \"Server(s) that failed:\\r\\n\";\n foreach ($this->failedServers as $k => $v)\n $msg .= \"- Server $k $v \\r\\n\";\n $msg .= \"\\r\\nTrace:\\r\\n$trace\\r\\n\\r\\n\"\n . \"Successful failover server:\\r\\n$this->Host\\r\\n\\r\\n\"\n . \"--\\r\\n\"\n . 'Sent from ' . __FILE__ . ' using ' . $this->Host;\n\n $this->FromName = $this->cfg->getNotificationFromEmail();\n $this->From = $this->cfg->getNotificationFromEmail();\n $this->clearAllRecipients();\n\n $adminEmails = $this->cfg->getAdminEmails();\n foreach ($adminEmails as $adminEmail)\n $this->addAddress($adminEmail);\n $this->Subject = $this->cfg->getAppName() . ': SMTP server(s) failed';\n\n $this->Body = $msg;\n\n // send using the last set SMTP server\n $this->send();\n }",
"public function sendEmailVerificationNotification()\n {\n $this->notify(new EmailVerification('admin'));\n }",
"public function sendEmailVerificationNotification()\n {\n $this->notify(new AdminEmailVerificationNotification);\n }",
"function alertAdmin($subj,$msg) {\n global $cfg;\n $to=$cfg?$cfg->getAdminEmail():ADMIN_EMAIL;\n $from=$cfg?$cfg->getAlertEmail():ADMIN_EMAIL;\n //Send alert to admin.\n Misc::sendmail($to,$subj,$msg,$from); \n }",
"function new_user_email_admin_notice()\n {\n }",
"function sendUpdateEmail($email, $registrant)\n{\n $name = $_SESSION['ctst_name'];\n $subject = $name . \" registration information updated.\";\n $mailContent = $registrant['givenName'] . ' ' . $registrant['familyName'];\n $mailContent .= \":\\n\\n\";\n $mailContent .= \"Your information for the \" . $name . \" has been updated.\\n\";\n $mailContent .= \"\\nIf you did not edit your registration information, \" .\n \"please write to the administrator:\\n\";\n $mailContent .= \"mailto:\" . ADMIN_EMAIL . \"?subject=account%20compromised\\n\";\n $mailContent .= \"\\nright away, or simply reply to this note.\\n\";\n $mailContent .= automatedMessage($name);\n $headers = \"From: \" . ADMIN_EMAIL . \"\\r\\n\";\n do_email($email, $subject, $mailContent, $headers);\n}",
"protected function send_core_update_notification_email($item)\n {\n }",
"public function mailAction()\n\t{\n\t\t$log = $this->_initLog();\n\t\t\n if (!$log->getId()) {\n $this->_getSession()->addError(Mage::helper('logging')->__('This log no longer exists.'));\n $this->_redirect('*/*/');\n return;\n }\n\t\t$log->sendLogMail();\n\t\t$this->_redirect('*/*/view', array('id' => $this->getRequest()->getParam('id')));\n\t}",
"function emailRegistrationAdmin() {\n require_once ('com/tcshl/mail/Mail.php');\n $ManageRegLink = DOMAIN_NAME . '/manageregistrations.php';\n $emailBody = $this->get_fName() . ' ' . $this->get_lName() . ' has just registered for TCSHL league membership. Click on the following link to approve registration: ';\n $emailBody.= $ManageRegLink;\n //$sender,$recipients,$subject,$body\n $Mail = new Mail(REG_EMAIL, REG_EMAIL, REG_EMAIL_SUBJECT, $emailBody);\n $Mail->sendMail();\n }",
"public function UpdateEmail()\n\t\t{\n\t\t\tif (!$this->HasPermission()) {\n\t\t\t\t$this->NoPermission();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$from = trim($_POST['fromemail']);\n\t\t\t$to = trim($_POST['toemail']);\n\n\t\t\t$update = array (\n\t\t\t\t'orders' => array (\n\t\t\t\t\t'ordbillemail',\n\t\t\t\t\t'ordshipemail',\n\t\t\t\t),\n\t\t\t\t'customers' => array (\n\t\t\t\t\t'custconemail',\n\t\t\t\t),\n\t\t\t\t'subscribers' => array (\n\t\t\t\t\t'subemail',\n\t\t\t\t),\n\t\t\t);\n\t\t\t$recordsUpdated = 0;\n\n\t\t\tforeach ($update as $table => $fields) {\n\t\t\t\tforeach ($fields as $field) {\n\t\t\t\t\t$updateData = array (\n\t\t\t\t\t\t$field => $to\n\t\t\t\t\t);\n\t\t\t\t\t$restriction = $field .\"='\".$GLOBALS['ISC_CLASS_DB']->Quote($from).\"'\";\n\t\t\t\t\t$GLOBALS['ISC_CLASS_DB']->UpdateQuery($table, $updateData, $restriction);\n\t\t\t\t\t$recordsUpdated += $GLOBALS['ISC_CLASS_DB']->NumAffected();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($recordsUpdated > 1) {\n\t\t\t\t$message = sprintf(GetLang('EmailCheckNumUpdatedPlural'), $recordsUpdated);\n\t\t\t\t$status = MSG_SUCCESS;\n\t\t\t} elseif ($recordsUpdated == 1) {\n\t\t\t\t$message = sprintf(GetLang('EmailCheckNumUpdatedSingular'), $recordsUpdated);\n\t\t\t\t$status = MSG_SUCCESS;\n\t\t\t} else {\n\t\t\t\t$message = GetLang('EmailCheckNoneUpdated');\n\t\t\t\t$status = MSG_ERROR;\n\t\t\t}\n\n\t\t\tFlashMessage($message, $status, 'index.php?ToDo=runAddon&addon=addon_emailchange');\n\t\t}",
"function notifyReg($uName,$eMail) { //notify a new user registration\r\n\tglobal $ax, $set, $today;\r\n\t\t\r\n\t//compose email message\r\n\t$subject = \"{$ax['log_new_reg']}: {$uName}\";\r\n\t$msgBody = \"\r\n<p>{$ax['log_new_reg']}:</p><br>\r\n<table>\r\n\t<tr><td>{$ax['log_un']}:</td><td>{$uName}</td></tr>\r\n\t<tr><td>{$ax['log_em']}:</td><td>{$eMail}</td></tr>\r\n\t<tr><td>{$ax['log_date_time']}:</td><td>\".IDtoDD($today).\" {$ax['at_time']} \".ITtoDT(date(\"H:i\")).\"</td></tr>\r\n</table>\r\n\";\r\n\t//send email\r\n\t$result = sendEml($subject,$msgBody,$set['calendarEmail'],1,0,0);\r\n\treturn $result;\r\n}",
"private function _sendNewStatusUpdateEmailToAdministrators()\n {\n // Get a reference to the Joomla! mailer object\n $mailer = \\JFactory::getMailer();\n\t\t\t\n\t\t\t$config = \\JFactory::getConfig();\n\t\t\t$sender = array( \n\t\t\t $config->get( 'mailfrom' ),\n\t\t\t $config->get( 'fromname' ) \n\t\t\t);\n \n\t\t\t$mailer->setSender($sender);\n\n // Load the category and set the recipient to this category's email address\n\t\t\t// $category = $this->category;\n\t\t\t// $emails = explode(',', $category->email);\n\t\t\t$user = \\JFactory::getUser('admin');\n\t\t\t$mailer->addRecipient($user->email);\n \n // Set the subject\n $subject = \\JFactory::getConfig()->get('sitename') . \": New Status Update ...\";\n\t\t\t$mailer->setSubject($subject);\n\t\t\t$projectId = $this->recordData['hshrndreview_fk_project_id'];\n\t\t\t\n\t\t\t$db = \\JFactory::getDbo();\n\t\t\t//this is just to know whether we are in the user is in the reviewer group or not\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select($db->quoteName(array('name', 'owner')));\n\t\t\t$query->from($db->quoteName('#__hshrndreview_projects'));\n\t\t\t$query->where($db->quoteName('hshrndreview_project_id').\" = \". $projectId);\n\t\t\t$db->setQuery($query);\n\t\t\t$project = $db->loadRow();\n\t\t\t\n\t\t\t$owner = $project['1'];\n\t\t\t//this is just to know whether we are in the user is in the reviewer group or not\n\t\t\t$query2 = $db->getQuery(true);\n\t\t\t$query2->select('title');\n\t\t\t$query2->from($db->quoteName('#__usergroups'));\n\t\t\t$query2->where($db->quoteName('id').\" = \". $owner);\n\t\t\t$db->setQuery($query2)->loadObject();\n\t\t\t$ownerName = $db->loadResult();\n\t\t\t$ownerName = ltrim($ownerName, \"hsgrp_\");\t\t\n\t\t\t\n\t\t\t$submitter = \\JFactory::getUser();\n\t\t\t$submitterName = $submitter->name;\n\t\t\t\n\t\t\t//$ownerName = ltrim($ownerName, \"hsgrp_\");\n\t\t\t\n\t\t\t$body = \"A new status update for project named: \\\"\" . $project['0'] . \"\\\" has been submitted by \" . $submitterName . \"@\" . $ownerName . \" to the HSH project database!\\n\\n Have a nice day - your friendly HSH RnD Review automailer...\";\n\t\t\t$mailer->setBody($body);\n // Send the email\n\t\t\t$send = $mailer->Send();\n\t\t\tif ( $send !== true ) {\n\t\t\t echo 'Error sending email: ' . $send->__toString();\n\t\t\t} else {\n\t\t\t echo 'Mail sent';\n\t\t\t}\n }",
"private function notifyORS() {\r\n require_once('classes/tracking/notifications/Notifications.php');\r\n require_once('classes/tracking/notifications/ORSNotification.php');\r\n\r\n $piDetails = $this->getPIDisplayDetails();\r\n $piName = $piDetails['firstName'] . \" \" . $piDetails['lastName'];\r\n\r\n $subject = sprintf('[TID-%s] Tracking form submitted online [%s]', $this->trackingFormId, $piName);\r\n $emailBody = sprintf('A tracking form was submitted online :\r\n\r\nTracking ID : %s\r\nTitle : \"%s\"\r\nPrincipal Investigator : %s\r\nDepartment : %s\r\n\r\n', $this->trackingFormId, $this->projectTitle, $piName, $piDetails['departmentName']);\r\n\r\n $ORSNotification = new ORSNotification($subject, $emailBody);\r\n try {\r\n $ORSNotification->send();\r\n } catch(Exception $e) {\r\n printf('Error: Unable to send email notification to ORS : '. $e);\r\n }\r\n }",
"public function notifyOwner($member) {\n $to = CSM_EMAIL;\n $subject = 'New membership: ' . show_a_name($member);\n $body = 'Hello ' . CSM_NAME . ', <br><br>'\n . show_a_name($member) . ' has added a new membership plan.<br>'\n . 'Login to your Wordpress account and go to the Coworking Space Manager to see the membership plan.';\n $headers = array('Content-Type: text/html; charset=UTF-8',\n 'From: ' . html_entity_decode(CSM_NAME) . ' <' . CSM_EMAIL . '>'\n );\n\n $mail = wp_mail($to, $subject, $body, $headers);\n }",
"private function sendConfirmationEmail($entry)\n {\n Mail::send(\n 'emails.confirmation',\n array('entry' => $entry),\n function($message) use($entry) {\n $message\n ->to($entry->email, $entry->fullName())\n ->subject('RWC 2015 Competition Entry Confirmation');\n });\n }",
"public static function editActionListener(): void {\n\t\telgg_register_event_handler('update:after', 'group', self::class . '::acceptMembershipRequests');\n\t}",
"public function sendEmailVerificationNotification();",
"public function save_entry_to_log(Omnilog_entry $entry)\n {\n /**\n * This method could conceivably be called when the module is\n * not installed, but the Omnilogger class is present.\n */\n\n if ( ! $this->EE->db->table_exists('omnilog_entries'))\n {\n throw new Exception(\n $this->EE->lang->line('exception__save_entry__not_installed'));\n }\n\n if ( ! $entry->is_populated())\n {\n throw new Exception(\n $this->EE->lang->line('exception__save_entry__missing_data'));\n }\n\n $insert_data = array_merge(\n $entry->to_array(),\n array(\n 'notify_admin' => ($entry->get_notify_admin() === TRUE) ? 'y' : 'n',\n 'site_id' => $this->get_site_id()\n )\n );\n\n $insert_data['admin_emails'] = implode($insert_data['admin_emails'], '|');\n\n $this->EE->db->insert('omnilog_entries', $insert_data);\n\n if ( ! $insert_id = $this->EE->db->insert_id())\n {\n throw new Exception(\n $this->EE->lang->line('exception__save_entry__not_saved'));\n }\n\n $entry->set_log_entry_id($insert_id);\n return $entry;\n }",
"public function sendEmail()\r\n {\r\n\t\t$mail = new UserMails;\r\n\t\t$mail->sendAdminEmail('admin-user', $this->_user);\r\n }",
"function attendeeRegistrationEditNotification($eventID, $userID, $attenID, $status, $eventName, $attenFirstName, $attenLastName) \r\r\n\t{\r\r\n\t\t$result = mysql_query(\"select emailAddress from User where userID = '\".$attenID.\"'\");\r\r\n\t\t$num_rows = mysql_num_rows($result);\r\r\n\t\t\r\r\n\t\tif (!$result) \r\r\n\t\t{\r\r\n\t\t \tthrow new Exception('Could not find email address.');\r\r\n\t\t} \r\r\n\t\telse if ($num_rows == 0) \r\r\n\t\t{\r\r\n\t\t\tthrow new Exception('Could not find the user!');\r\r\n\t\t} \r\r\n\t\telse \r\r\n\t\t{\r\r\n\t\t\t$apostrophe \t\t= array(\"\\'\"); // for fixing apostrophe issue\r\r\n\t\t\t$attenFirstName \t= str_replace($apostrophe, \"'\", $attenFirstName);\r\r\n\t\t\t$attenLastName \t\t= str_replace($apostrophe, \"'\", $attenLastName);\r\r\n\t\t\t$eventName \t\t\t= str_replace($apostrophe, \"'\", $eventName);\r\r\n\t\t\t\r\r\n\t\t \t$row = mysql_fetch_object($result);\r\r\n\t\t\t$email = $row -> emailAddress;\r\r\n\r\r\n\t\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\r\r\n\t\t\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\r\r\n\t\t\t$headers .= 'From: uGather <[email protected]>' . \"\\r\\n\";\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t$sub = \"uGather: \".$attenID.\": Event Registration for \".$eventName.\"\";\r\r\n\t\t\t$mesg = \"<html>\r\r\n\t\t\t\t\t\t<head>\r\r\n\t\t\t\t\t\t\t<title>You have registered for an event!</title>\r\r\n\t\t\t\t\t\t</head>\r\r\n\t\t\t\t\t\t<body>\r\r\n\t\t\t\t\t\t<h2 style=\\\"font-family: 'Trebuchet MS', 'Helvetica Neue', Arial, Sans-serif; font-weight: bold; padding: 10px 0 5px 5px; color: #444; font-size: 2.5em; color: #88AC0B; border-bottom: 1px solid #E4F2C8; letter-spacing: -2px; margin-left: 5px; \\\">uGather Event Registration Change</h2>\r\r\n\t\t\t\t\t\t<p style=\\\"font: 12px/170% 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; color: #6B6B6B; padding: 12px 10px; \\\">Hello, \".$attenFirstName.\" \".$attenLastName.\"! </p>\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t<p style=\\\"font: 12px/170% 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; color: #6B6B6B; padding: 12px 10px; \\\">You have changed your registration status for the event <a href=\\\"http://www.ugather.info/viewEvent.php?eventID=\".$eventID.\"\\\" style=\\\"color: #332616; text-decoration: underline; font-weight: bold; \\\">\".$eventName.\"</a> at <a href=\\\"http://www.ugather.info\\\" style=\\\"color: #332616; text-decoration: underline; font-weight: bold; \\\">uGather</a>. <br />\r\r\n\t\t\t\t\t\tYour registration status for \".$eventName.\" is: \".$status.\". </p>\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t<p style=\\\"font: 12px/170% 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; color: #6B6B6B; padding: 12px 10px; \\\">You can find the event page for \".$eventName.\" here: <a href=\\\"http://www.ugather.info/viewEvent.php?eventID=\".$eventID.\"\\\" style=\\\"color: #332616; text-decoration: underline; font-weight: bold; \\\">view event \".$eventName.\"</a>. You can view all of the attendees to that event here: <a href=\\\"http://www.ugather.info/viewAttendees.php?eventID=\".$eventID.\"\\\" style=\\\"color: #332616; text-decoration: underline; font-weight: bold; \\\">view attendees to \".$eventName.\"</a>. </p>\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t<p style=\\\"font: 12px/170% 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; color: #6B6B6B; padding: 12px 10px; \\\">This is an automatically generated email from <a href=\\\"http://ugather.info\\\" style=\\\"color: #332616; text-decoration: underline; font-weight: bold; \\\">uGather</a>. Please do not respond. Thank you.</p> \r\r\n\t\t\t\t\t\t</body>\r\r\n\t\t\t\t\t\t</html>\";\r\r\n\t\r\r\n\t\t\tif (mail($email, $sub, $mesg, $headers)) \r\r\n\t\t\t{\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t} \r\r\n\t\t\telse \r\r\n\t\t\t{\r\r\n\t\t\t\tthrow new Exception('Could not send email.');\r\r\n\t\t\t}\r\r\n \t}\r\r\n\t}",
"private function sendNotifyEmail(){\n $uS = Session::getInstance();\n $to = filter_var(trim($uS->referralFormEmail), FILTER_SANITIZE_EMAIL);\n\n try{\n if ($to !== FALSE && $to != '') {\n// $userData = $this->getUserData();\n $content = \"Hello,<br>\" . PHP_EOL . \"A new \" . $this->formTemplate->getTitle() . \" was submitted to \" . $uS->siteName . \". <br><br><a href='\" . $uS->resourceURL . \"house/register.php' target='_blank'>Click here to log into HHK and take action.</a><br>\" . PHP_EOL;\n\n $mail = prepareEmail();\n\n $mail->From = ($uS->NoReplyAddr ? $uS->NoReplyAddr : \"[email protected]\");\n $mail->FromName = htmlspecialchars_decode($uS->siteName, ENT_QUOTES);\n $mail->addAddress($to);\n\n $mail->isHTML(true);\n\n $mail->Subject = \"New \" . Labels::getString(\"Register\", \"onlineReferralTitle\", \"Referral\") . \" submitted\";\n $mail->msgHTML($content);\n\n if ($mail->send() === FALSE) {\n return false;\n }else{\n return true;\n }\n }\n }catch(\\Exception $e){\n return false;\n }\n return false;\n }",
"public function NotifyAction()\n {\n $rma = Mage::getModel('ProductReturn/Rma')->load($this->getRequest()->getParam('rma_id'));\n\n try {\n\n\n if (!Mage::helper('ProductReturn/Returnlabel')->isExists($rma))\n throw new Exception($this->__('No return label found'));\n\n Mage::helper('ProductReturn/Returnlabel')->notifyLabel($rma);\n\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Customer successfully notified.'));\n } catch (Exception $ex) {\n Mage::getSingleton('adminhtml/session')->addError($this->__('Unable to notify customer') . ' : ' . $ex->getMessage());\n }\n\n $this->_redirect('ProductReturn/Admin/Edit', array('rma_id' => $rma->getId()));\n }",
"function userNotificationEmail($email, $user)\n{\n\t$module = new sociallogin();\n\t$sub = $module->l('Thank You For Registration', 'sociallogin_functions');\n\t$vars = array('{firstname}' => $user['fname'], '{lastname}' => $user['lname'], '{email}' => $email, '{passwd}' => $user['pass']);\n\t$id_lang = (int)Configuration::get('PS_LANG_DEFAULT');\n\tMail::Send($id_lang, 'account', $sub, $vars, $email);\n}",
"function emailToAdmin($params, $admin='[email protected]'){\r\n\r\n \t$this->email->from($params['email'], $params['firstname'].' '.$params['lastname']);\r\n \t$this->email->to($admin);\r\n \t$this->email->cc('[email protected]');\r\n \t$this->email->bcc('[email protected]');\r\n \t$this->email->subject('A new member has registered');\r\n\r\n \t$message = \"Name: \".$params['firstname'].' '.$params['lastname'].\"\\n\";\r\n \t$message .= \"Business Name: \".$params['businessname'].\"\\n\";\r\n \t$message .= \"Email: \".$params['email'].\"\\n\";\r\n \t$message .= \"Zip Code: \".$params['postalcode'].\"\\n\";\r\n \t$message .= \"Link: \".$params['link'].\"\\n\";\r\n \t$message .= \"Info: \".$params['info'].\"\\n\";\r\n \t$message .= \"Role: \".$params['role'].\"\\n\";\r\n\r\n \t$this->email->message($message);\r\n\r\n \t$res = $this->email->send();\r\n }",
"public function sendEmailVerificationNotification()\n {\n $this->notify(new EmailVerification('networking_agent'));\n }"
] |
[
"0.6174106",
"0.6108426",
"0.5912737",
"0.59057856",
"0.58707",
"0.5854978",
"0.5815234",
"0.58142775",
"0.5786427",
"0.57767206",
"0.5656451",
"0.56507206",
"0.54952914",
"0.54946476",
"0.5439418",
"0.54121095",
"0.53909564",
"0.5358861",
"0.53540134",
"0.5347071",
"0.53255266",
"0.53225553",
"0.5297568",
"0.52897525",
"0.52711195",
"0.526158",
"0.5246877",
"0.5242786",
"0.5242317",
"0.5235806"
] |
0.81138086
|
0
|
Saves the supplied OmniLog Entry to the database.
|
public function save_entry_to_log(Omnilog_entry $entry)
{
/**
* This method could conceivably be called when the module is
* not installed, but the Omnilogger class is present.
*/
if ( ! $this->EE->db->table_exists('omnilog_entries'))
{
throw new Exception(
$this->EE->lang->line('exception__save_entry__not_installed'));
}
if ( ! $entry->is_populated())
{
throw new Exception(
$this->EE->lang->line('exception__save_entry__missing_data'));
}
$insert_data = array_merge(
$entry->to_array(),
array(
'notify_admin' => ($entry->get_notify_admin() === TRUE) ? 'y' : 'n',
'site_id' => $this->get_site_id()
)
);
$insert_data['admin_emails'] = implode($insert_data['admin_emails'], '|');
$this->EE->db->insert('omnilog_entries', $insert_data);
if ( ! $insert_id = $this->EE->db->insert_id())
{
throw new Exception(
$this->EE->lang->line('exception__save_entry__not_saved'));
}
$entry->set_log_entry_id($insert_id);
return $entry;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function save(Entry $entry)\n {\n // Construct the queryBuilder\n $queryBuilder = $this->getQueryBuilder()\n ->insert(\"entry\")\n ->values([\n \"date\" => \"?\",\n \"start\" => \"?\",\n \"end\" => \"?\",\n \"break\" => \"?\",\n \"exp\" => \"?\",\n \"note\" => \"?\",\n \"userid\" => \"?\",\n ])\n ->setParameter(0, $entry->getDate())\n ->setParameter(1, $entry->getStart())\n ->setParameter(2, $entry->getEnd())\n ->setParameter(3, $entry->getBreak())\n ->setParameter(4, $entry->getExp())\n ->setParameter(5, $entry->getNote())\n ->setParameter(6, $entry->getUserId());\n\n // Execute the query\n $queryBuilder->execute();\n }",
"public function save()\n {\n $DB = DB::singleton(dsn());\n\n if ( $this->update ) {\n $SQL = SQL::newUpdate('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addUpdate('entry_' . $column, $this->{$column});\n }\n $SQL->addWhereOpr('entry_id', $this->id);\n $SQL->addWhereOpr('entry_blog_id', $this->blog_id);\n $DB->query($SQL->get(dsn()), 'exec');\n } else {\n $SQL = SQL::newInsert('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addInsert('entry_' . $column, $this->{$column});\n }\n $DB->query($SQL->get(dsn()), 'exec');\n }\n\n EntryHelper::saveColumn($this->units, $this->id, $this->blog_id);\n Common::saveField('eid', $this->id, $this->fields);\n Common::saveFulltext('eid', $this->id, Common::loadEntryFulltext($this->id));\n }",
"public function save( LogEntity $logEntity );",
"public function onSaveEntry(SproutForms_OnSaveEntryEvent $event)\n\t{\n\t\t$this->raiseEvent('onSaveEntry', $event);\n\t}",
"public function postInsert(Model $model, $entry) {\n $logModel = $model->getOrmManager()->getModel(EntryLogModel::NAME);\n $logModel->logInsert($model, $entry);\n }",
"public function log(SihnonFramework_LogEntry $entry) {\n $fields = $entry->fields();\n $types = $entry->types();\n $values = $entry->values();\n \n $bindings = array();\n for ($i = 0, $l = count($fields); $i < $l; ++$i) {\n $type = '';\n switch ($types[$i]) {\n case 'int':\n $type = PDO::PARAM_INT;\n break;\n case 'bool':\n $type = PDO::PARAM_BOOL;\n break;\n default:\n $type = PDO::PARAM_STR;\n break;\n }\n \n $bindings[] = array(\n 'name' => $fields[$i],\n 'value' => $values[$i],\n 'type' => $type, \n );\n }\n \n $field_list = join(', ', $fields);\n $bindings_list = join(', ', array_map(function($value) { return \":{$value}\"; }, $fields));\n \n $this->database->insert(\"INSERT INTO {$this->table} ({$field_list}) VALUES({$bindings_list})\", $bindings);\n }",
"public function saveData( &$entry, $request = 'POST' )\r\n\t{\r\n\t\tif( !( $this->enabled ) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$data = $this->verify( $entry, $request );\r\n\t\t$time = SPRequest::now();\r\n\t\t$IP = SPRequest::ip( 'REMOTE_ADDR', 0, 'SERVER' );\r\n\t\t$uid = Sobi::My( 'id' );\r\n\r\n\t\t/* if we are here, we can save these data */\r\n\t\t/* @var SPdb $db */\r\n\t\t$db =& SPFactory::db();\r\n\r\n\t\t/* collect the needed params */\r\n\t\t$params = array();\r\n\t\t$params[ 'publishUp' ] = $entry->get( 'publishUp' );\r\n\t\t$params[ 'publishDown' ] = $entry->get( 'publishDown' );\r\n\t\t$params[ 'fid' ] = $this->fid;\r\n\t\t$params[ 'sid' ] = $entry->get( 'id' );\r\n\t\t$params[ 'section' ] = Sobi::Reg( 'current_section' );\r\n\t\t$params[ 'lang' ] = Sobi::Lang();\r\n\t\t$params[ 'enabled' ] = $entry->get( 'state' );\r\n\t\t$params[ 'baseData' ] = strip_tags( $db->escape( $data ) );\r\n\t\t$params[ 'approved' ] = $entry->get( 'approved' );\r\n\t\t$params[ 'confirmed' ] = $entry->get( 'confirmed' );\r\n\t\t/* if it is the first version, it is new entry */\r\n\t\tif( $entry->get( 'version' ) == 1 ) {\r\n\t\t\t$params[ 'createdTime' ] = $time;\r\n\t\t\t$params[ 'createdBy' ] = $uid;\r\n\t\t\t$params[ 'createdIP' ] = $IP;\r\n\t\t}\r\n\t\t$params[ 'updatedTime' ] = $time;\r\n\t\t$params[ 'updatedBy' ] = $uid;\r\n\t\t$params[ 'updatedIP' ] = $IP;\r\n\t\t$params[ 'copy' ] = !( $entry->get( 'approved' ) );\r\n\r\n\t\t/* save it */\r\n\t\ttry {\r\n\t\t\t/* Notices:\r\n\t\t\t * If it was new entry - insert\r\n\t\t\t * If it was an edit and the field wasn't filled before - insert\r\n\t\t\t * If it was an edit and the field was filled before - update\r\n\t\t\t * \" ... \" and changes are not autopublish it should be insert of the copy .... but\r\n\t\t\t * \" ... \" if a copy already exist it is update again\r\n\t\t\t * */\r\n\t\t\t$db->insertUpdate( 'spdb_field_data', $params );\r\n\t\t}\r\n\t\tcatch ( SPException $x ) {\r\n\t\t\tSobi::Error( __CLASS__, SPLang::e( 'CANNOT_SAVE_DATA', $x->getMessage() ), SPC::WARNING, 0, __LINE__, __FILE__ );\r\n\t\t}\r\n\r\n\t\t/* if it wasn't edited in the default language, we have to try to insert it also for def lang */\r\n\t\tif( Sobi::Lang() != SOBI_DEFLANG ) {\r\n\t\t\t$params[ 'lang' ] = SOBI_DEFLANG;\r\n\t\t\ttry {\r\n\t\t\t\t$db->insert( 'spdb_field_data', $params, true );\r\n\t\t\t}\r\n\t\t\tcatch ( SPException $x ) {\r\n\t\t\t\tSobi::Error( __CLASS__, SPLang::e( 'CANNOT_SAVE_DATA', $x->getMessage() ), SPC::WARNING, 0, __LINE__, __FILE__ );\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function save(){\r\n\t\t\t$query = DB::connection()->prepare(\r\n\t\t\t\t\"INSERT INTO Logs (comp_id, user_id, datum) \r\n\t\t\t\tVALUES (:comp_id, :user_id, :datum)\"\r\n\t\t\t);\r\n\t\t\t$query->execute(array(\r\n\t\t\t\t'comp_id' \t=>\t$this->comp_id,\r\n\t\t\t\t'user_id'\t=>\t$this->user_id,\r\n\t\t\t\t'datum' \t=>\t$this->datum\r\n\t\t\t));\r\n\t\t}",
"private function saveEntry(): void\n {\n if ($this->isHeader()) {\n $this->processHeader();\n\n return;\n }\n $this->translations->add($this->translation);\n }",
"public function save($log) {\r\r\n if($log->getIdLog() == - 1) return $this->insert($log);\r\r\n else return $this->update($log);\r\r\n }",
"public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function saveToDB()\r\n\t{\r\n\t\t$date = new DateTime();\r\n\t\t$this->timestamp = date('Y-m-d H:i:s',$date->getTimestamp());\r\n\t\t$con = db_connect();\r\n\t\t\r\n\t\t//user, game, timestamp, text, building, card, location, icon\r\n\t\t$this->user!=null ? $userid=$this->user->getUserID() : $userid=null;\r\n\t\t$this->game!=null ? $gameID=$this->game->getGameID() : $gameID=null;\r\n\t\t$this->building!=null ? $buildingID=$this->building->getBuildingID() : $buildingID=null;\r\n\t\t$this->card!=null ? $cardID=$this->card->getCardID() : $cardID=null;\r\n\t\t\r\n\t\t$statement = $con->prepare('Insert into logger (user, game, timestamp, text, building, card, location, icon) values (?,?,?,?,?,?,?,?)');\r\n\t\t$statement->execute(array($userid,$gameID,$this->timestamp,$this->Text,$buildingID,$cardID,$this->location->locationID, $this->icon));\r\n\t\t\r\n\t\t$id = $con->lastInsertId();\r\n\t\t$con = null;\r\n\t\treturn $id;\r\n\t}",
"function __saveLog() {\n $this->__UserLog->save($this->__UserLog->data,false);\n }",
"function saveLog($logRecord, $logID)\n {\n // Define the query to determine whether to update or insert\n $logQuery = (is_null($logID)) ? null : array('id' => $logID);\n \n // Now run the insert/update, returning the ID\n return $this->_upsert($logRecord, $logQuery);\n }",
"public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'author_id' => $this->author_id,\n 'clothingname' => $this->clothingname,\n 'clothingtype' => $this->clothingtype,\n 'tempmin' => $this->tempmin,\n 'tempmax' => $this->tempmax\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function saved(EntryInterface $entry)\n {\n parent::saved($entry);\n\n $this->dispatch(new DumpPages());\n }",
"public function postUpdate(Model $model, $entry) {\n $modelName = $model->getName();\n $id = $entry->getId();\n\n if (isset($this->preUpdateFields[$modelName][$id])) {\n $preUpdateFields = $this->preUpdateFields[$modelName][$id];\n\n unset($this->preUpdateFields[$modelName][$id]);\n if (!$this->preUpdateFields[$modelName]) {\n unset($this->preUpdateFields[$modelName]);\n }\n if (!$this->preUpdateFields) {\n unset($this->preUpdateFields);\n }\n } else {\n $preUpdateFields = null;\n }\n\n $logModel = $model->getOrmManager()->getModel(EntryLogModel::NAME);\n $logModel->logUpdate($model, $entry, $preUpdateFields);\n }",
"public function saving(EntryInterface $entry)\n {\n $this->dispatch(new UnsetHome($entry));\n \n parent::saving($entry);\n }",
"public function save()\n {\n if ($this->id === null) {\n $this->insert();\n } else {\n $this->update();\n }\n }",
"public function onSave()\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $object = $this->form->getData('AgendaEntry');\n \n $this->form->validate(); // form validation\n $object->store(); // stores the object\n $this->form->setData($object); // keep form data\n \n TTransaction::close(); // close the transaction\n $posAction = new TAction(array('AgendaView', 'reload'));\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n $this->form->setData( $this->form->getData() ); // keep form data\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }",
"protected function store($login_log_entity)\n {\n if ($login_log_entity->isStored()) {\n $model = LoginLogModel::find($login_log_entity->id);\n } else {\n $model = new LoginLogModel();\n }\n $model->fill(\n [\n 'user_id' => $login_log_entity->user_id,\n 'type' => $login_log_entity->type,\n 'ip' => $login_log_entity->ip,\n ]\n );\n $model->save();\n $login_log_entity->setIdentity($model->id);\n }",
"protected function saveData()\n {\n $this->beforeSave();\n\n $changed = $this->setReceptionCode(\n $this->formData[$this->receptionCodeItem],\n $this->loader->getCurrentUser()->getUserId()\n );\n\n $this->afterSave($changed);\n\n $this->accesslog->logChange($this->request, null, $this->formData);\n }",
"protected function saveData()\n {\n $this->beforeSave();\n\n $changed = $this->setReceptionCode(\n $this->formData[$this->receptionCodeItem],\n $this->loader->getCurrentUser()->getUserId()\n );\n\n $this->afterSave($changed);\n\n $this->accesslog->logChange($this->request, null, $this->formData);\n }",
"public function save()\n {\n if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }",
"public function store(EntryRequest $request)\n {\n $input = $request->all();\n// dd($input);\n $entry = $this->entryRepository->create($input);\n\n Flash::success(__('cms.entries.saved_success'));\n\n return Input::get('_previous_') ? redirect(Input::get('_previous_')) : redirect(route('cms.entries.index'));\n\n }",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();"
] |
[
"0.7488613",
"0.72743237",
"0.6731139",
"0.65718657",
"0.6520639",
"0.6477418",
"0.62889683",
"0.6205523",
"0.61145264",
"0.60928714",
"0.60826194",
"0.6068859",
"0.605908",
"0.60569924",
"0.59505296",
"0.5909944",
"0.5878335",
"0.5792107",
"0.57316214",
"0.57183766",
"0.5660813",
"0.5656683",
"0.5656683",
"0.56395084",
"0.5617015",
"0.5610451",
"0.5610451",
"0.5610451",
"0.5610451",
"0.5610451"
] |
0.74427384
|
1
|
function createNewEntry Creates a new row entry in the DB table for this object to manage. It also updates the Xlation tabel to mark the new entry as needing translation.
|
function createNewEntry( $doAllowPrimaryKeyUpdate=false, $shouldIgnoreXlation=false )
{
// make sure label is translated into UnicodeEntities
$data = $this->getLabel();
$newData = Unicode_utf8ToUnicodeEntities ($data);
$this->setLabel( $newData );
parent::createNewEntry( $doAllowPrimaryKeyUpdate );
if (!$shouldIgnoreXlation ) {
$currentPageID = $this->getPageID();
$currentKey = $this->getKey();
$currentLanguageID = $this->getLanguageID();
$xlationManager = new RowManager_XLationManager();
// If there are no other pageID + labelKey entries like this one
// then we need to add xlation entries for all other languages.
$condition = 'page_id='.$currentPageID;
if ( $this->isUniqueFieldValue( $currentKey, 'label_key', $condition) ) {
$xlationManager->setLabelID( $this->getID() );
// for each other language in site
$languageManager = new RowManager_LanguageManager();
$languageList = $languageManager->getListIterator();
$languageList->setFirst();
while( $language = $languageList->getNext() ) {
$newLanguageID = $language->getID();
if ( $newLanguageID != $currentLanguageID ) {
// Add Xlation Entry
$xlationManager->setLanguageID( $newLanguageID );
$xlationManager->createNewEntry();
}
} // next language
} else {
// Since there are other label id's, then look to see
// if the current entry can substitute for an xlation request
// for each label with matching PageID & Key
$labelManager = new RowManager_MultilingualLabelManager();
$labelManager->setPageID( $currentPageID );
$labelManager->setKey( $currentKey );
$labelList = $labelManager->getListIterator();
$labelList->setFirst();
while( $label = $labelList->getNext() ) {
// delete any xlation entry with current language_id &
// matching label_id
if ($xlationManager->loadByLabelAndLanguage( $label->getID(), $currentLanguageID ) ) {
$xlationManager->deleteEntry();
}
} // next label
} // end if isUnique
} // end if !shouldIgnoreXlation
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function newEntry(): Translation\n {\n $this->isDisabled = false;\n\n return $this->translation = $this->createTranslation(null, '');\n }",
"public function newEntryModel();",
"public function &make_entry($original, $translation)\n {\n }",
"private function prepForNewEntry()\n {\n $this->id = Helper::makeUuid();\n $locale = $this->request->input('locale');\n\n $this->content = Entry::create($this->slug)\n ->collection($this->collection)\n ->get();\n\n if ($locale !== default_locale()) {\n $this->content->set('title', $this->slug);\n $this->content->published(false);\n $this->content = $this->content->in($locale)->get();\n }\n\n $this->content->published($this->getSubmittedStatus());\n\n $this->content->order(\n $this->getSubmittedOrderKey() ?: $this->getNewEntryOrderKey()\n );\n }",
"function createAtomEntry() {\n\t\t$this->create();\n\t}",
"function createNewEntry( $doAllowPrimaryKeyUpdate=false ) \n { \n\t parent::createNewEntry( $doAllowPrimaryKeyUpdate );\n\t \n\t //$ccTransID = $this->getID(); \n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['reg_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['reg_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['reg_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \n }",
"function createNewEntry( $doAllowPrimaryKeyUpdate=false ) \n { \n\t parent::createNewEntry( $doAllowPrimaryKeyUpdate );\n\t \n\t //$ccTransID = $this->getID(); \n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['registration_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['registration_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['registration_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \n }",
"protected function createEntryRecord() {\n\n\t\t$lot = CqlixHistory::getInstance()->getEntryLotRecord();\n\t\t$modelName = $this->model->getTable()->getModelName();\n\n\t\treturn HistoryEntry::create(array(\n\t\t\t'history_id' => $this->historyRecord->getId(),\n\t\t\t'Lot' => $lot,\n\t\t\t'model' => $modelName,\n\t\t\t'model_id' => $this->model->getPrimaryKeyValue(),\n\t\t\t'operation' => $this->operation,\n\t\t));\n\t}",
"public function actionCreate()\n\t{\n\t\t$model=new Entry;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Entry']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Entry'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"function make_entry()\n\t{\n\t\t//Sprachen raussuchen\n\t\t$this->make_lang();\n\n\t\tif ( $this->checked->submitentry ) {\n\t\t\t//Bilddaten hochladen\n\t\t\t$this->intern_image->upload_picture();\n\t\t\t$this->checked->image_name = $this->content->template['image_name'];\n\t\t\t$this->checked->image_breite = $this->content->template['image_breite'];\n\t\t\t$this->checked->image_hoehe = $this->content->template['image_hoehe'];\n\t\t\t$this->checked->gruppe = $this->content->template['image_gruppe'];\n\t\t\t$this->checked->texte[1]['lang_id'] = 1;\n\t\t\t$this->checked->texte[1]['alt'] = $this->checked->messe_name;\n\t\t\t$this->checked->texte[1]['title'] = '';\n\t\t\t$this->checked->texte[1]['long_desc'] = '';\n\n\t\t\t$this->intern_image->upload_save( 'no' );\n\t\t\t$von_ar = explode( \".\", $this->checked->messe_von );\n\t\t\t$bis_ar = explode( \".\", $this->checked->messe_bis );\n\n\t\t\tif ( is_numeric($von_ar[0]) && is_numeric($von_ar[1]) && is_numeric($von_ar[2]) ) {\n\t\t\t\t$von = @mktime( 0, 0, 0, $von_ar[1], $von_ar[0], $von_ar[2] );\n\t\t\t\t$bis = @mktime( 0, 0, 0, $bis_ar[1], $bis_ar[0], $bis_ar[2] );\n\t\t\t}\n\n\t\t\t//Daten eintragen in Datenbank\n\t\t\t$sql = sprintf( \"INSERT INTO %s SET messe_von='%s', messe_bis='%s', messe_logo='%s', messe_name='%s'\",\n\t\t\t\t$this->cms->tbname['papoo_messe_daten'], $this->db->escape($von), $this->db->\n\t\t\t\tescape($bis), $this->db->escape($this->checked->image_name), $this->db->escape($this->\n\t\t\t\tchecked->messe_name) );\n\t\t\t$this->db->query( $sql );\n\t\t\t$insertid = $this->db->insert_id;\n\t\t\t//Alle Sprachen linkliste_descrip\n\t\t\tforeach ( $this->checked->messe_descrip as $key => $value ) {\n\t\t\t\t$sql = sprintf( \"INSERT INTO %s SET messe_id_id='%s', messe_lang_id='%s', messe_descrip='%s'\",\n\t\t\t\t\t$this->cms->tbname['papoo_messe_daten_lang'], $insertid, $key, $value );\n\t\t\t\t$this->db->query( $sql );\n\t\t\t}\n\t\t\t//Sql Datei erneuern\n\t\t\t#$sql=sprintf(\"SELECT messe_xml_yn FROM %s\",\n\t\t\t#$this->cms->tbname['papoo_messe_pref']\n\t\t\t#\t);\n\t\t\t#\t$this->export_xml=$this->db->get_var($sql);\n\t\t\t#\tif ($this->export_xml==1){\n\t\t\t#\t$this->diverse->make_sql(\"messe\");\n\t\t\t#\t}\n\n\t\t\t$location_url = $_SERVER['PHP_SELF'] . \"?menuid=\" . $this->checked->menuid .\n\t\t\t\t\"&template=\" . $this->checked->template . \"&fertig=drin\";\n\t\t\tif ( $_SESSION['debug_stopallredirect'] ) {\n\t\t\t\techo '<a href=\"' . $location_url . '\">Weiter</a>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\theader( \"Location: $location_url\" );\n\t\t\t}\n\t\t\texit;\n\t\t}\n\t\telse {\n\t\t\t$this->content->template['neuereintrag'] = \"ok\";\n\t\t}\n\n\t\tif ( $this->checked->fertig == \"drin\" ) {\n\t\t\t$this->content->template['eintragmakeartikelfertig'] = \"ok\";\n\t\t}\n\t}",
"private function saveEntry(): void\n {\n if ($this->isHeader()) {\n $this->processHeader();\n\n return;\n }\n $this->translations->add($this->translation);\n }",
"public function add_entry($entry);",
"public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}",
"protected function create() {\n $this->db->insertRow($this->table_name, $this->update);\n storeDbMsg($this->db,\"New \" . $this->form_ID . \" successfully created!\");\n }",
"private function prepForExistingEntry()\n {\n $this->id = $this->request->input('uuid');\n\n $this->content = Entry::find($this->id)->in($this->locale)->get();\n\n $this->content->published($this->getSubmittedStatus());\n\n // Only the default locale can have its order modified\n if (! $this->isLocalized()) {\n // If no order was submitted (in the case of numeric\n // entries), we want to get the existing order key.\n if (! $order = $this->getSubmittedOrderKey()) {\n $order = $this->content->order();\n }\n\n $this->content->order($order);\n }\n }",
"protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }",
"public function newEntry()\n {\n return new Entry;\n }",
"protected function actionNew() {\r\n $strType = $this->getCurObjectClassName();\r\n\r\n if(!is_null($strType)) {\r\n /** @var $objEdit interface_model|class_model */\r\n $objEdit = new $strType();\r\n\r\n\r\n $objForm = $this->getAdminForm($objEdit);\r\n $objForm->getObjSourceobject()->setSystemid($this->getParam(\"systemid\"));\r\n $objForm->addField(new class_formentry_hidden(\"\", \"mode\"))->setStrValue(\"new\");\r\n\r\n return $objForm->renderForm(getLinkAdminHref($this->getArrModule(\"modul\"), \"save\" . $this->getStrCurObjectTypeName()));\r\n }\r\n else\r\n throw new class_exception(\"error creating new entry current object type not known \", class_exception::$level_ERROR);\r\n }",
"function addEntry ($class)\n{\n global $error_detected, $fields, $className;\n\n $label = trim($_POST[$fields[$className]['name']]);\n $field = trim($_POST[$fields[$className]['field']]);\n\n checkFieldValue(\n $class,\n $fields[$className]['name'],\n $label\n );\n checkFieldValue(\n $class,\n $fields[$className]['field'],\n $field\n );\n\n if ( count($error_detected) ) {\n return;\n }\n\n $ret = $class->add($label, $field);\n if ( $ret < 0 ) {\n if ($ret == -1) {\n $error_detected[] = _T(\"- Database error: \").$class->getErrorMessage();\n }\n if ($ret == -2) {\n $error_detected[] = _T(\"- This label is already used!\");\n }\n return;\n }\n\n // User should be able to translate the new labels dynamically.\n addDynamicTranslation($label, $error_detected);\n\n return;\n}",
"public static function createEntry(array $entry)\n {\n return DB::table(static::$schema)->insert($entry);\n }",
"function newEntry( $args = null, $entry = null)\n { \n\t\t// default duration of a new activity\n\t\t$duration = (int)($_SESSION[$this->appName]['preferences']['duration']?$_SESSION[$this->appName]['preferences']['duration']:'3600');\n\n \t// no predefined activity time\n if( is_numeric($args['activity_start']) == true )\n {\n\t\t\t// when a user clicks on the visual calendar\n\t\t\t// the format is number of seconds not string date/time\n\t\t \t$entry['activity_start'] = gmdate( 'Y-m-d H:i:s', $args['activity_start']);\n\t $entry['activity_end'] = gmdate( 'Y-m-d H:i:s', (int)$args['activity_start']+$duration);\n\t unset($args['activity_start']);\n\t }\n\t else if( isset($args['activity_start']) == false )\n\t {\n\t \t// when a new activity is created as a related record\n\t\t\t$start = round((int)(strtotime('+0 hour')/60),-1)*60;\n\t $entry['activity_start'] = gmdate( 'Y-m-d H:i', $start);\n\t $entry['activity_end'] = gmdate( 'Y-m-d H:i', $start+$duration);\n\t\t} \n\t\t\n\t\t$entry['type_id'] = $_SESSION[$this->appName]['preferences']['type_id']?$_SESSION[$this->appName]['preferences']['type_id']:'CA';\n\t\t$entry['status_id'] = $_SESSION[$this->appName]['preferences']['status_id']?$_SESSION[$this->appName]['preferences']['status_id']:'SC';\n $entry['priority_id'] = $_SESSION[$this->appName]['preferences']['priority_id']?$_SESSION[$this->appName]['preferences']['priority_id']:'NO'; \n $entry['reminder_email'] = $_SESSION[$this->appName]['preferences']['reminder_email']?$_SESSION[$this->appName]['preferences']['reminder_email']:''; \n $entry['reminder_popup'] = $_SESSION[$this->appName]['preferences']['reminder_popup']?$_SESSION[$this->appName]['preferences']['reminder_popup']:''; \n\t\t$entry['is_allday'] = 'N';\n\n\t\treturn parent::newEntry( $args, $entry);\n }",
"public function testAddNewEntry()\n {\n $actual = $this->diaryService->addNewEntry($this->entryData);\n $entry = Entry::latest('created_at')->first();\n $expected = [\n 'message' => 'Entry added successfully!',\n 'statusCode' => 201,\n 'data' => null\n ];\n $this->assertEquals($expected, $actual);\n $this->assertDatabaseHas('entries', $entry->toArray());\n }",
"public function create()\n {\n if (Entry::canCreateOrEdit() === false) {\n return Redirect::route('entry.index')\n ->withMessage(\"Sorry, the competition has now started and new entries cannot be created.\");\n }\n\n return View::make('entry.create');\n }",
"public function add_entry($entry)\n {\n }",
"function addEntry($newentry) {\n\t\t$this->data[] = $newentry;\n\t}",
"public function addEntry()\n\t{\n\t\t//Get all data\n\t\t$data = \\Input::all();\n\t\t//Get the user id of the currently logged in user\n\t\t$userId = Sentry::getUser()->id;\n\t\t//Add Data\n\t\t$result = $this->timesheet->addEntry($data,$userId);\n\n\n\t\t//代辦事項\n\t\t$userId = (int) \\Sentry::getUser()->id;\n\t\t$result_todo = $this->timesheet->postTodos($data, $userId);\n\n\t\t$result_calendar = $this->timesheet->addcalendar($data,$userId);\n\n\t\t//Redirect with appropriate message to the user\n\t\tif($result == 'success')\n\t\t{\n\t\t\treturn \\Redirect::to('dashboard/timesheet')->with('status','success')->with('message','Entry Added');\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \\Redirect::to('dashboard/timesheet')->with('status','error')->with('message','Something Went Wrong. Please try again.');\n\t\t}\n\n\t}",
"function create_new() {\n if($this->table_title != '' ) {\n $this->title = 'New ' . $this->table_title .\n $this->makeForm();\n }\n }",
"private function save_entry_and_redirect( Entry $entry, bool $new = false ) {\n\t\t$db_result = $entry->save();\n\n\t\tif ( -1 === $db_result ) {\n\t\t\tAdmin_Page::redirect_and_show_message(\n\t\t\t\tnew Message( Message::ERROR, __( 'Database error.', 'glossary-by-arteeo' ) )\n\t\t\t);\n\t\t} elseif ( 0 === $db_result ) {\n\t\t\tAdmin_Page::redirect_and_show_message(\n\t\t\t\tnew Message( Message::SUCCESS, __( 'No changes have occured.', 'glossary-by-arteeo' ) )\n\t\t\t);\n\t\t} else {\n\t\t\tif ( ! $new ) {\n\t\t\t\tAdmin_Page::redirect_and_show_message(\n\t\t\t\t\tnew Message( Message::SUCCESS, __( 'Entry has been adjusted.', 'glossary-by-arteeo' ) )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tAdmin_Page::redirect_and_show_message(\n\t\t\t\t\tnew Message( Message::SUCCESS, __( 'Entry has been created.', 'glossary-by-arteeo' ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"public function insert_entry()\r\n\t{\r\n\t\t$this->db->insert(\"email_workflow\", $this);\r\n\t}",
"public static function createEntry\n\t(\n\t\t$uniID\t\t\t\t// <int> The UniID that is creating the entry.\n\t,\t$title\t\t\t\t// <str> The title of the entry.\n\t,\t$status = 0\t\t\t// <int> The current status to assign to the entry (e.g. Content::STATUS_DRAFT)\n\t,\t$clearanceView = 0\t// <int> The clearance required to view this entry.\n\t,\t$primeHashtag = \"\"\t// <str> Assigns a primary hashtag, if applicable (\"\" to ignore).\n\t,\t$comments = 4\t\t// <int> The type of comments for this entry (0 is disallow).\n\t,\t$voting = 4\t\t\t// <int> The type of voting to allow for this entry (0 is disallow).\n\t,\t$urlSlug = \"\"\t\t// <str> The URL that you want to enforce in this entry.\n\t)\t\t\t\t\t\t// RETURNS <int> The ID of the entry on success, or 0 on failure.\n\t\n\t// $contentID = ContentForm::createEntry($uniID, $title, $status, [$clearanceView], [$primeHashtag], [$comments], [$voting], [$urlSlug]);\n\t{\n\t\t// Prepare Values\n\t\t$urlSlug = strtolower(Sanitize::variable($urlSlug, \"-/\"));\n\t\t\n\t\tDatabase::startTransaction();\n\t\t\n\t\t// Create the Entry\n\t\tif($pass = Database::query(\"INSERT INTO content_entries (uni_id, url_slug, title, primary_hashtag, status, clearance_view, comments, voting) VALUES (?, ?, ?, ?, ?, ?, ?, ?)\", array($uniID, $urlSlug, $title, $primeHashtag, $status, $clearanceView, $comments, $voting)))\n\t\t{\n\t\t\t// Make sure that the entry ID was retrieved successfully.\n\t\t\tif($contentID = Database::$lastID)\n\t\t\t{\n\t\t\t\t$pass = Database::query(\"INSERT INTO content_by_user (uni_id, content_id) VALUES (?, ?)\", array($uniID, $contentID));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pass = false;\n\t\t\t}\n\t\t\t\n\t\t\t// Set the URL Slug if necessary\n\t\t\tif($pass and $urlSlug)\n\t\t\t{\n\t\t\t\t$pass = Database::query(\"INSERT INTO content_by_url (url_slug, content_id) VALUES (?, ?)\", array($urlSlug, $contentID));\n\t\t\t}\n\t\t}\n\t\t\n\t\tDatabase::endTransaction($pass);\n\t\t\n\t\treturn ($pass ? $contentID : 0);\n\t}"
] |
[
"0.73432726",
"0.6728953",
"0.6613914",
"0.6578059",
"0.6546101",
"0.643803",
"0.6389701",
"0.63536954",
"0.63393366",
"0.6295899",
"0.6177758",
"0.6131409",
"0.6071764",
"0.605169",
"0.6040539",
"0.6022156",
"0.59538317",
"0.5945381",
"0.58692646",
"0.5846234",
"0.58395946",
"0.5819497",
"0.58106154",
"0.5753982",
"0.5727784",
"0.57085204",
"0.5665722",
"0.56000316",
"0.5590668",
"0.5587656"
] |
0.7293108
|
1
|
function getKey Returns the key of this label.
|
function getKey()
{
return $this->getValueByFieldName( 'label_key' );
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public static function getKey();",
"public static function getKey();",
"public function getKey() {}",
"public function getKey() {}",
"public function getKey() {\n\t\treturn $this -> key;\n\t}",
"public function getKey()\n {\n return $this->__get(\"key\");\n }",
"public function getKey()\r\n {\r\n return $this->key;\r\n }",
"public function getKey()\n {\n return $this->get(self::KEY);\n }",
"public function getKey()\n {\n return $this->get(self::KEY);\n }",
"abstract public function getKey();"
] |
[
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83229953",
"0.83080477",
"0.83080477",
"0.8049355",
"0.8049355",
"0.8015908",
"0.79465383",
"0.794322",
"0.79306364",
"0.79306364",
"0.79048145"
] |
0.8509142
|
0
|
function getLabelField Returns the field to use in the label routines.
|
function getLabelField()
{
return "label_label";
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getLabelField() {}",
"function getLabelField() \n {\n return \"No Field Label Marked\";\n }",
"function getLabelField() \n {\n return \"No Field Label Marked\";\n }",
"function getLabelField() \n {\n return \"No Field Label Marked\";\n }",
"function getLabelField() \n {\n return \"No Field Label Marked\";\n }",
"function getLabelField() \n {\n return \"No Field Label Marked\";\n }",
"function getLabelField() \n {\n return \"No Field Label Marked\";\n }",
"function get_field_label($field_instance) {\n return $field_instance['label'];\n }",
"public function getLabel($field){\n\t\treturn $this->labels()[$field] ?? $field;\n\t}",
"public function getLabel($field)\r\n {\r\n return is_array($this->labels) && isset($this->labels[$field]) ? $this->labels[$field] : $field;\r\n }",
"function acf_get_field_label($field, $context = '')\n{\n}",
"function getLabelField()\n {\n return 'person_fname';\n }",
"function getFieldLabel($fieldName){\n\n\t\tif( isset($this->labels[$fieldName]) ) return $this->labels[$fieldName];\n\t\telse return ucwords( str_replace(\"_\", \" \", $fieldName) );\n\n\t}",
"function getLabel() \n {\n return $this->getValueByFieldName( 'label_label' );\n }",
"public function get_field_label() {\n\t\treturn $this->get_field_attr( 'name' );\n\t}",
"function acf_render_field_label($field)\n{\n}",
"function getLabel(){\r\n\t\treturn $this->label;\r\n\t}",
"function labelField($fieldName,$fieldLabel){\n\n\t\t$this->labels[$fieldName] = $fieldLabel;\n\n\t}",
"function getLabel() {\n global $Language;\n if ($this->isLabelMustBeLocalized()) {\n return $Language->getText('plugin_tracker_common_fieldset', $this->label);\n } else {\n return $this->label;\n }\n }",
"function field_views_field_label($field_name) {\n $label_counter = array();\n $all_labels = array();\n // Count the amount of instances per label per field.\n $instances = field_info_instances();\n foreach ($instances as $entity_name => $entity_type) {\n foreach ($entity_type as $bundle) {\n if (isset($bundle[$field_name])) {\n $label_counter[$bundle[$field_name]['label']] = isset($label_counter[$bundle[$field_name]['label']]) ? ++$label_counter[$bundle[$field_name]['label']] : 1;\n $all_labels[$entity_name][$bundle[$field_name]['label']] = TRUE;\n }\n }\n }\n if (empty($label_counter)) {\n return array($field_name, $all_labels);\n }\n // Sort the field lables by it most used label and return the most used one.\n arsort($label_counter);\n $label_counter = array_keys($label_counter);\n return array($label_counter[0], $all_labels);\n}",
"function getFieldLabels( $field ) \n {\n $returnValue = '';\n \n $fieldName = $field->getName();\n \n $label = $field->getTitle();\n if ($label != '') {\n// $label = str_replace( \"'\", \"''\", $label);\n $label = str_replace( '\"', '\\\"', $label);\n $returnValue = ' $labelManager->addLabel( \"[title_'.$fieldName.']\", \"'.$label.'\", \"en\" );';\n \n }\n \n $label = $field->getFormLabel();\n if ($label != '') {\n \n if ( $returnValue != '') {\n $returnValue .= \"\\n\";\n }\n/// $label = str_replace( \"'\", \"''\", $label);\n $label = str_replace( '\"', '\\\"', $label);\n $returnValue .= ' $labelManager->addLabel( \"[formLabel_'.$fieldName.']\", \"'.$label.'\", \"en\" );';\n \n }\n \n $label = $field->getExample();\n if ($label != '') {\n \n if ( $returnValue != '') {\n $returnValue .= \"\\n\";\n }\n// $label = str_replace( \"'\", \"''\", $label);\n $label = str_replace( '\"', '\\\"', $label);\n $returnValue .= ' $labelManager->addLabel( \"[example_'.$fieldName.']\", \"'.$label.'\", \"en\" );';\n\n }\n \n $label = $field->getError();\n if ($label != '') {\n \n if ( $returnValue != '') {\n $returnValue .= \"\\n\";\n }\n/// $label = str_replace( \"'\", \"''\", $label);\n $label = str_replace( '\"', '\\\"', $label);\n $returnValue .= ' $labelManager->addLabel( \"[error_'.$fieldName.']\", \"'.$label.'\", \"en\" );';\n \n }\n \n if ( $returnValue != '') {\n $returnValue .= \"\\n\";\n }\n \n return $returnValue;\n \n }",
"public function get_field_name();",
"public function getLabel()\n\t{\t\t\t\n\t\treturn $this->label;\n\t}",
"function getKeyField() \n {\n return 'label_key';\n }",
"public function get_label();",
"public function get_label();",
"static function getFieldLabel($form, $key)\n { \n // The field really exists?\n if (isset($form[$key])) {\n // A label was define?\n if (!$label = $form->getWidget($key)->getLabel()) {\n $label = $form->getWidgetSchema()->getFormFormatter()->generateLabelName($key);\n }\n\n // Here, take this label\n return $label;\n }\n\n // we could not find the field. humm...\n return null;\n }",
"public function getLabel() {}",
"public function getLabel() {}",
"function getLabelField() \n {\n return \"navbarlink_textKey\";\n }"
] |
[
"0.86258966",
"0.7884744",
"0.7884744",
"0.7884744",
"0.7884744",
"0.7884744",
"0.7884744",
"0.7757584",
"0.76564765",
"0.76393956",
"0.75594556",
"0.74390197",
"0.74184644",
"0.73947835",
"0.7340159",
"0.7120905",
"0.7068261",
"0.7057842",
"0.70411986",
"0.70384055",
"0.70162463",
"0.69915503",
"0.69527483",
"0.6950769",
"0.69428074",
"0.69428074",
"0.68859935",
"0.68699",
"0.68699",
"0.6866937"
] |
0.86252636
|
1
|
function getModDate Returns the Modification Date of this label.
|
function getModDate()
{
return $this->getValueByFieldName( 'label_moddate' );
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getModDate() \r\n { \r\n return $this->_modDate; \r\n }",
"public function getModDate();",
"public function getModate()\n {\n return $this->modate;\n }",
"public function getModificationDate()\n {\n return $this->modificationDate;\n }",
"public function getDateModification()\n {\n return $this->dateModification;\n }",
"public function getModificationDate() {\n return $this->modificationDate;\n }",
"public function get_modification_date()\n {\n return $this->get_default_property(self::PROPERTY_MODIFICATION_DATE);\n }",
"public function getFechaModificacion()\n {\n return $this->fechaModificacion;\n }",
"public function getFechaModificacion()\n {\n return $this->fecha_modificacion;\n }",
"public function getFechaModificacion()\n {\n return $this->fecha_modificacion;\n }",
"public function getModifiedDate()\n\t{\n\t\treturn $this->_mdate;\n\t}",
"public function getModifyDate()\n {\n return $this->modifyDate;\n }",
"public function get_date_modified();",
"public function getLastModificationDateTime() {\n $timestamp = $this->getUpdatedAt();\n // we don't know when the module content is updated, so we \"guess\"\n if ($this->getModule() != '') {\n $timestamp->setDate(date('Y'), date('m'), date('d'));\n }\n return $timestamp;\n }",
"function get_date_mod(){\n\treturn date (\"F d Y H:i:s.\", filemtime(lastModifiedInFolder(ABSPATH . 'wp-content/')));\n}",
"public function getModifiedDate() : \\DateTime {\n return $this->modifiedDate;\n }",
"public function getDateModified() {\n\t\t\treturn $this->date_modified;\n\t\t}",
"function getDateModified() {\n\t\treturn $this->_DateModified;\n\t}",
"public function getFechaModificacionPD( ){\n\t\t \treturn $this->fechaModificacionPD;\n\t\t }",
"public function getDateModified()\n {\n return $this->_DateModified;\n }",
"public function getDateModified()\n {\n return $this->dateModified;\n }",
"public function getModeratorUpdatedDate();",
"public function getdateModifiedAttribute()\n {\n return Carbon::parse($this->date)->translatedFormat('d M Y');\n }",
"public function getModificationDate($asString = true) {}",
"public function getModificationTime()\n {\n return ( $this->mtime ? $this->mtime : self::dosFormatToTimestamp( array( $this->lastModFileTime, $this->lastModFileDate ) ) );\n }",
"function getLastModifiedDate() {\n\t\treturn $this->data_array['last_modified_date'];\n\t}",
"public function getLastMod()\n {\n return $this->lastMod;\n }",
"public function getLastModifiedDate() {\n\t\treturn date(\"d/m/Y\", strtotime($this->lastModifiedDate));\n\t}",
"public function getFechaUltimaModificacion( ){\n\t\t\treturn $this->fechaUltimaModificacion;\n\t\t}",
"public function getModifiedDate()\n {\n $this->modified_date = null;\n\n if ($this->exists === true) {\n } else {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n $this->modified_date =\n $this->temp_files[$this->path]->year . '-' .\n $this->temp_files[$this->path]->month . '-' .\n $this->temp_files[$this->path]->day . ' ' .\n $this->temp_files[$this->path]->time;\n\n return;\n }"
] |
[
"0.83978885",
"0.8278838",
"0.7834415",
"0.7367355",
"0.7334018",
"0.7327672",
"0.72600955",
"0.7175386",
"0.7170219",
"0.7170219",
"0.71176773",
"0.7028842",
"0.6953014",
"0.6945097",
"0.68734163",
"0.6747318",
"0.6694866",
"0.667253",
"0.6654608",
"0.65936154",
"0.6546402",
"0.6519501",
"0.6488956",
"0.6416362",
"0.6414917",
"0.6411221",
"0.6357823",
"0.6338121",
"0.63222307",
"0.6308858"
] |
0.9042308
|
0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.