query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
Operation genericManagerTimeAndAttendanceSmsResetAsyncWithHttpInfo Send PIN Reset SMS
public function genericManagerTimeAndAttendanceSmsResetAsyncWithHttpInfo($business_id, $kiosk_id, $model, string $contentType = self::contentTypes['genericManagerTimeAndAttendanceSmsReset'][0]) { $returnType = ''; $request = $this->genericManagerTimeAndAttendanceSmsResetRequest($business_id, $kiosk_id, $model, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } ); }
[ "public function genericManagerTimeAndAttendanceSmsResetRequest($business_id, $kiosk_id, $model, string $contentType = self::contentTypes['genericManagerTimeAndAttendanceSmsReset'][0])\n {\n\n // verify the required parameter 'business_id' is set\n if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $business_id when calling genericManagerTimeAndAttendanceSmsReset'\n );\n }\n\n // verify the required parameter 'kiosk_id' is set\n if ($kiosk_id === null || (is_array($kiosk_id) && count($kiosk_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $kiosk_id when calling genericManagerTimeAndAttendanceSmsReset'\n );\n }\n\n // verify the required parameter 'model' is set\n if ($model === null || (is_array($model) && count($model) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $model when calling genericManagerTimeAndAttendanceSmsReset'\n );\n }\n\n\n $resourcePath = '/api/v2/business/{businessId}/manager/kiosk/{kioskId}/smsreset';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($business_id !== null) {\n $resourcePath = str_replace(\n '{' . 'businessId' . '}',\n ObjectSerializer::toPathValue($business_id),\n $resourcePath\n );\n }\n // path params\n if ($kiosk_id !== null) {\n $resourcePath = str_replace(\n '{' . 'kioskId' . '}',\n ObjectSerializer::toPathValue($kiosk_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n [],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (isset($model)) {\n if (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the body\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($model));\n } else {\n $httpBody = $model;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function genericManagerTimeAndAttendanceSmsResetWithHttpInfo($business_id, $kiosk_id, $model, string $contentType = self::contentTypes['genericManagerTimeAndAttendanceSmsReset'][0])\n {\n $request = $this->genericManagerTimeAndAttendanceSmsResetRequest($business_id, $kiosk_id, $model, $contentType);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function genericTimeAndAttendanceSmsResetAsyncWithHttpInfo($business_id, $kiosk_id, $model, string $contentType = self::contentTypes['genericTimeAndAttendanceSmsReset'][0])\n {\n $returnType = '';\n $request = $this->genericTimeAndAttendanceSmsResetRequest($business_id, $kiosk_id, $model, $contentType);\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 genericManagerTimeAndAttendanceEmailResetRequest($business_id, $kiosk_id, $model, string $contentType = self::contentTypes['genericManagerTimeAndAttendanceEmailReset'][0])\n {\n\n // verify the required parameter 'business_id' is set\n if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $business_id when calling genericManagerTimeAndAttendanceEmailReset'\n );\n }\n\n // verify the required parameter 'kiosk_id' is set\n if ($kiosk_id === null || (is_array($kiosk_id) && count($kiosk_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $kiosk_id when calling genericManagerTimeAndAttendanceEmailReset'\n );\n }\n\n // verify the required parameter 'model' is set\n if ($model === null || (is_array($model) && count($model) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $model when calling genericManagerTimeAndAttendanceEmailReset'\n );\n }\n\n\n $resourcePath = '/api/v2/business/{businessId}/manager/kiosk/{kioskId}/emailreset';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($business_id !== null) {\n $resourcePath = str_replace(\n '{' . 'businessId' . '}',\n ObjectSerializer::toPathValue($business_id),\n $resourcePath\n );\n }\n // path params\n if ($kiosk_id !== null) {\n $resourcePath = str_replace(\n '{' . 'kioskId' . '}',\n ObjectSerializer::toPathValue($kiosk_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n [],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (isset($model)) {\n if (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the body\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($model));\n } else {\n $httpBody = $model;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function genericTimeAndAttendanceSmsResetWithHttpInfo($business_id, $kiosk_id, $model, string $contentType = self::contentTypes['genericTimeAndAttendanceSmsReset'][0])\n {\n $request = $this->genericTimeAndAttendanceSmsResetRequest($business_id, $kiosk_id, $model, $contentType);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function sendResetPin(Request $request){\n\t\t// validate request\n\t\t$validator=$this->validateMobile($request);\n\t\tif($validator->fails()){\n\t\t\tif($request->expectsJson()){\n\t\t\t\treturn response()->json($validator->errors(),422);\n\t\t\t}\n\t\t\treturn redirect()->back()\n \t\t\t\t\t\t\t ->withInput($request->all('mobile'))\n\t\t\t\t\t\t\t ->withErrors($validator->errors());\n\t\t}\n\n // We will send the password reset PIN to this user. Once we have attempted\n // to send the PIN, we will examine the response then see the message we\n // need to show to the user. Finally, we'll send out a proper response.\n $response = $this->broker()->sendResetPin($request->only('mobile'));\n\n\t\t// succeed\n\t\tif($response == Password::RESET_LINK_SENT){\n\t\t\t$response='passwords.sent_mobile';\n\t\t\treturn $this->sendResetPinResponse($response);\n\t\t}\n\n\t\t//failed\n\t\t$response='passwords.user_mobile';\n\t\treturn $this->sendResetPinFailedResponse($request, $response);\n\t}", "public function resetPasswordAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->resetPasswordRequest($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 sendResetEmail();", "public function requestPasswordResetAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->requestPasswordResetRequest($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 genericManagerTimeAndAttendanceChangePinRequest($kiosk_id, $business_id, $model, string $contentType = self::contentTypes['genericManagerTimeAndAttendanceChangePin'][0])\n {\n\n // verify the required parameter 'kiosk_id' is set\n if ($kiosk_id === null || (is_array($kiosk_id) && count($kiosk_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $kiosk_id when calling genericManagerTimeAndAttendanceChangePin'\n );\n }\n\n // verify the required parameter 'business_id' is set\n if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $business_id when calling genericManagerTimeAndAttendanceChangePin'\n );\n }\n\n // verify the required parameter 'model' is set\n if ($model === null || (is_array($model) && count($model) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $model when calling genericManagerTimeAndAttendanceChangePin'\n );\n }\n\n\n $resourcePath = '/api/v2/business/{businessId}/manager/kiosk/{kioskId}/changepin';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($kiosk_id !== null) {\n $resourcePath = str_replace(\n '{' . 'kioskId' . '}',\n ObjectSerializer::toPathValue($kiosk_id),\n $resourcePath\n );\n }\n // path params\n if ($business_id !== null) {\n $resourcePath = str_replace(\n '{' . 'businessId' . '}',\n ObjectSerializer::toPathValue($business_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml', ],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (isset($model)) {\n if (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the body\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($model));\n } else {\n $httpBody = $model;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function resetpassword()\n {\n $email = $this->request->getProperty('email');\n $result = forgotpasswordtoken::processResetRequest($email);\n $output = array('sentsuccess' => $result);\n $this->output = ($this->outputjson($output));\n }", "public function resetPasswordAsyncWithHttpInfo($token_id)\n {\n $returnType = '\\HubSpot\\Client\\Marketing\\Transactional\\Model\\SmtpApiTokenView';\n $request = $this->resetPasswordRequest($token_id);\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 postTelephonyProvidersEdgesPhonesRebootAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->postTelephonyProvidersEdgesPhonesRebootRequest($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 resetQPayMemberTradPwd(Request $request){\n \n $userId = trim($request->userId);\n \n DB::beginTransaction();\n try {\n\n $nowTimestamp = time(); \n $now = date('Y-m-d H:i:s',$nowTimestamp);\n $updateRs = $this->qpayMemberService->resetTradPassword($userId);\n\n $this->logService\n ->writePasswordLog($userId,\n LogService::PWD_TYPE_QPAY,\n LogService::PWD_ACTION_RESET,\n Auth::user()->row_id,\n $now);\n DB::commit();\n\n } catch (\\Exception $e) {\n DB::rollBack();\n throw $e;\n }\n\n if(is_null($updateRs)){\n $result[\"result_code\"] = ResultCode::_000901_userNotExistError;\n } else if ($updateRs) {\n $result[\"result_code\"] = ResultCode::_1_reponseSuccessful;\n } else {\n $result[\"result_code\"] = ResultCode::_999999_unknownError;\n }\n\n return json_encode($result);\n }", "public function requestPasswordResetRequest($options)\n {\n // unbox the parameters from the associative array\n $user_login = array_key_exists('user_login', $options) ? $options['user_login'] : null;\n\n // verify the required parameter 'user_login' is set\n if ($user_login === null || (is_array($user_login) && count($user_login) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $user_login when calling requestPasswordReset'\n );\n }\n\n $resourcePath = '/user/{user_login}/password/request_reset';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($user_login !== null) {\n $resourcePath = str_replace(\n '{' . 'user_login' . '}',\n ObjectSerializer::toPathValue($user_login),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function customerAccountManagementV1InitiatePasswordResetPutRequest($customerAccountManagementV1InitiatePasswordResetPutBody = null)\n {\n\n $resourcePath = '/V1/customers/password';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($customerAccountManagementV1InitiatePasswordResetPutBody)) {\n $_tempBody = $customerAccountManagementV1InitiatePasswordResetPutBody;\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 (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 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getResetPassword()\n {\n\t\t$http_request = Application::getHTTPRequest();\n if(isset($http_request->getGetData()['token']) && isset($http_request->getGetData()['id']))\n {\n $user_manager = new UserManager;\n $this->response['token_validity'] = $user_manager->testTokenValidity($http_request->getGetData()['id'], $http_request->getGetData()['token']);\n if(isset($this->post_params['reset-password']) && $this->response['token_validity'])\n {\n $this->response['reset_password_error'] = $user_manager->resetPassword(\n\t\t\t\t$http_request->getGetData()['id'],\n\t\t\t\t$http_request->getGetData()['token'],\n\t\t\t\t$this->post_params['password'],\n\t\t\t\t$this->post_params['retype_password']);\n } \n }\n }", "public function resetPasswordAsyncWithHttpInfo($reset_password_request)\n {\n $returnType = '';\n $request = $this->resetPasswordRequest($reset_password_request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function genericManagerTimeAndAttendanceClockOffRequest($kiosk_id, $business_id, $request, string $contentType = self::contentTypes['genericManagerTimeAndAttendanceClockOff'][0])\n {\n\n // verify the required parameter 'kiosk_id' is set\n if ($kiosk_id === null || (is_array($kiosk_id) && count($kiosk_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $kiosk_id when calling genericManagerTimeAndAttendanceClockOff'\n );\n }\n\n // verify the required parameter 'business_id' is set\n if ($business_id === null || (is_array($business_id) && count($business_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $business_id when calling genericManagerTimeAndAttendanceClockOff'\n );\n }\n\n // verify the required parameter 'request' is set\n if ($request === null || (is_array($request) && count($request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $request when calling genericManagerTimeAndAttendanceClockOff'\n );\n }\n\n\n $resourcePath = '/api/v2/business/{businessId}/manager/kiosk/{kioskId}/clockoff';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($kiosk_id !== null) {\n $resourcePath = str_replace(\n '{' . 'kioskId' . '}',\n ObjectSerializer::toPathValue($kiosk_id),\n $resourcePath\n );\n }\n // path params\n if ($business_id !== null) {\n $resourcePath = str_replace(\n '{' . 'businessId' . '}',\n ObjectSerializer::toPathValue($business_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml', ],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (isset($request)) {\n if (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the body\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($request));\n } else {\n $httpBody = $request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ LMS version 1.11git (C) Copyright 20012016 LMS Developers This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place Suite 330, Boston, MA 021111307, USA. /! \brief Function to explode address string to single fields. \param string $address \returns array array with address fields \returns null can't explode string
function parse_address($address) { $address = trim($address); $m = array(); if (!($res = preg_match('/^((?<city>.+),\s?)?(?<street>.+)\s+(?<house>[0-9][0-9a-z]*(?:\/[0-9][0-9a-z]*)?)(?:\s+|\s*(?:\/|m\.?|lok\.?)\s*)(?<flat>[0-9a-z]+)$/i', $address, $m))) { if (!($res = preg_match('/^((?<city>.+),\s?)?(?<street>.+)\s+(?<house>[0-9][0-9a-z]*)$/i', $address, $m))) { $res = preg_match('/^((?<city>.+),\s?)?(?<street>.+)$/i', $address, $m); if (!$res) { return null; } } } $m = array_filter( $m, 'strlen' ); $m = array_filter( $m, 'is_string'); foreach ($m as $k => $v) { if ( is_numeric($k) ) { unset( $m[$k] ); } } return $m; }
[ "function splitAddressString($addressStr)\n{\n $temp = explode(', ', $addressStr);\n $tempLast = array_pop($temp);\n $temp1 = explode('. ', $tempLast);\n $addressArr = array_merge($temp, $temp1);\n return $addressArr;\n}", "public static function splitAddress($address)\n {\n $regex = '\n /\\A\\s*\n (?: #########################################################################\n # Option A: [<Addition to address 1>] <House number> <Street name> #\n # [<Addition to address 2>] #\n #########################################################################\n (?:(?P<A_Addition_to_address_1>.*?),\\s*)? # Addition to address 1\n (?:No\\.\\s*)?\n (?P<A_House_number>\\pN+[a-zA-Z]?(?:\\s*[-\\/\\pP]\\s*\\pN+[a-zA-Z]?)*) # House number\n \\s*,?\\s*\n (?P<A_Street_name>(?:[a-zA-Z]\\s*|\\pN\\pL{2,}\\s\\pL)\\S[^,#]*?(?<!\\s)) # Street name\n \\s*(?:(?:[,\\/]|(?=\\#))\\s*(?!\\s*No\\.)\n (?P<A_Addition_to_address_2>(?!\\s).*?))? # Addition to address 2\n | #########################################################################\n # Option B: [<Addition to address 1>] <Street name> <House number> #\n # [<Addition to address 2>] #\n #########################################################################\n (?:(?P<B_Addition_to_address_1>.*?),\\s*(?=.*[,\\/]))? # Addition to address 1\n (?!\\s*No\\.)(?P<B_Street_name>[^0-9# ]\\s*\\S(?:[^,#](?!\\b\\pN+\\s))*?(?<!\\s)) # Street name\n \\s*[\\/,]?\\s*(?:\\sNo[.:])?\\s*\n (?P<B_House_number>\\pN+\\s*-?[a-zA-Z]?(?:\\s*[-\\/\\pP]?\\s*\\pN+(?:\\s*[\\-a-zA-Z])?)*|\n [IVXLCDM]+(?!.*\\b\\pN+\\b))(?<!\\s) # House number\n \\s*(?:(?:[,\\/]|(?=\\#)|\\s)\\s*(?!\\s*No\\.)\\s*\n (?P<B_Addition_to_address_2>(?!\\s).*?))? # Addition to address 2\n )\n \\s*\\Z/xu';\n\n $result = preg_match($regex, $address, $matches);\n if ($result === 0) {\n throw new \\InvalidArgumentException(sprintf('Address \\'%s\\' could not be splitted into street name and house number', $address));\n } elseif ($result === false) {\n throw new \\RuntimeException(sprintf('Error occurred while trying to split address \\'%s\\'', $address));\n }\n\n if (!empty($matches['A_Street_name'])) {\n return array(\n 'additionToAddress1' => $matches['A_Addition_to_address_1'],\n 'streetName' => $matches['A_Street_name'],\n 'houseNumber' => $matches['A_House_number'],\n 'additionToAddress2' => (isset($matches['A_Addition_to_address_2'])) ? $matches['A_Addition_to_address_2'] : ''\n );\n } else {\n return array(\n 'additionToAddress1' => $matches['B_Addition_to_address_1'],\n 'streetName' => $matches['B_Street_name'],\n 'houseNumber' => $matches['B_House_number'],\n 'additionToAddress2' => isset($matches['B_Addition_to_address_2']) ? $matches['B_Addition_to_address_2'] : ''\n );\n }\n }", "private function addressParser(string $address_string): array {\n\n $address_array = explode(',', $address_string);\n\n $zip_city = explode(' ', trim($address_array[1]));\n\n $address['street'] = $address_array[0];\n $address['zip'] = trim($zip_city[0]);\n $address['city'] = trim($zip_city[1]);\n\n return $address;\n\n }", "function CUSTOM_splitAddress($string) {\n\t$comment = '';\n\t$string = rtrim($string);\n\n\tif (substr($string, -1) !== '>') {\n\t\t$address = $string;\n\t} else {\n\t\t$address = strrchr($string, '<');\n\t\t\n\t\tif ($address === FALSE) {\n\t\t\tCOM_errorLog('CUSTOM_splitAddress: \"<\" not found.');\n\t\t\t$address = $string;\n\t\t} else {\n\t\t\t$comment = rtrim(substr($string, 0, strlen($string) - strlen($address)));\n\t\t\t$address = substr($address, 1, strlen($address) - 2);\n\t\t}\n\t}\n\n\tif (defined('CUSTOM_MAIL_DEBUG')) {\n\t\tCOM_errorLog('CUSTOM_splitAddress: comment=' . $comment . ' address=' . $address);\n\t}\n\n\treturn array($comment, $address);\n}", "private function buildDBAddressParts($address) {\n\t\t$addressParts = array(1 => \"\", 2 => \"\", 3 => \"\");\n\t\t$addressLines = explode(\"\\n\", $address);\n\t\t\n\t\tfor($i = 0; $i < count($addressLines); $i++)\n\t\t{\n\t\t\tif(strlen($addressLines[$i]) > 1)\n\t\t\t{\n\t\t\t\t$addressParts[$i + 1] = $addressLines[$i];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $addressParts;\n\t}", "static function splitStreetAddressNl ( $streetAddress ) {\n $result = array( );\n $result['is_error'] = 0;\n $result['street_name'] = null;\n $result['street_number'] = null;\n $result['street_unit'] = null;\n /*\n * empty array in return if streetAddress is empty\n */\n if ( empty( $streetAddress ) ) {\n return $result;\n }\n $foundNumber = false;\n $parts = explode( \" \", $streetAddress );\n $splitFields = array ( );\n $splitFields['street_name'] = null;\n $splitFields['street_number'] = null;\n $splitFields['street_unit'] = null;\n /*\n * check all parts\n */\n foreach ( $parts as $key => $part ) {\n /*\n * if part is numeric\n */\n if ( is_numeric( $part ) ) {\n /*\n * if key = 0, add to street_name\n */\n if ( $key == 0 ) {\n $splitFields['street_name'] .= $part;\n } else {\n /*\n * else add to street_number if not found, else add to unit\n */\n if ( $foundNumber == false ) {\n $splitFields['street_number'] .= $part;\n $foundNumber = true;\n } else {\n $splitFields['street_unit'] .= \" \".$part;\n }\n }\n } else {\n /*\n * if not numeric and no foundNumber, add to street_name\n */\n if ( $foundNumber == false ) {\n /*\n * if part is first part, set to street_name\n */\n if ( $key == 0 ) {\n $splitFields['street_name'] .= \" \".$part;\n } else {\n /*\n * if part has numbers first and non-numbers later put number\n * into street_number and rest in unit and set foundNumber = true\n */\n $length = strlen( $part );\n if ( is_numeric( substr( $part, 0, 1 ) ) ) {\n for ( $i=0; $i<$length; $i++ ) {\n if ( is_numeric( substr( $part, $i, 1 ) ) ) {\n $splitFields['street_number'] .= substr( $part, $i, 1 );\n $foundNumber = true;\n } else {\n $splitFields['street_unit'] .= substr( $part, $i, 1 );\n }\n }\n } else {\n $splitFields['street_name'] .= \" \".$part;\n }\n }\n } else {\n $splitFields['street_unit'] .= \" \".$part;\n }\n }\n }\n $result['street_name'] = trim( $splitFields['street_name'] );\n $result['street_number'] = $splitFields['street_number'];\n $result['street_unit'] = $splitFields['street_unit'];\n return $result;\n }", "function parse_danish_address($address)\n {\n $regex = '/^([^0-9]*)([0-9]*)\\s*([A-Z]?)[,\\s]*([0-9]*)?(st|kl)?[\\.,\\s]*([a-zæøå]*)?(\\d{0,4})?.*$/mi';\n preg_match_all($regex, $address, $matches);\n $result = array();\n for ($i = 1; $i < count($matches); $i++) {\n if (isset($matches[$i][0])) {\n $result[] = $matches[$i][0];\n }\n }\n $cleaned = array();\n $components = count($result);\n if ($components > 0) {\n $cleaned['street'] = trim($result[0]);\n }\n if ($components > 1) {\n $cleaned['number'] = $result[1];\n }\n if ($components > 2) {\n $cleaned['letter'] = $result[2];\n }\n if ($components > 3) {\n $cleaned['floor'] = $result[3] == '' ? $result[4] : $result[3];\n }\n if ($components > 5) {\n $cleaned['door'] = $result[5];\n }\n foreach ($cleaned as $name => $value) {\n if (is_null($value) || $value == '') {\n unset($cleaned[$name]);\n }\n }\n return $cleaned;\n }", "public function parseAddress(string $address=null) {\n\t\tif($address === null) $address = $this->address();\n\n\t\t$info = array();\n\t\t$aus_state_regex = '(?:ACT|NSW|NT|QLD|SA|TAS|VIC|WA)';\n\n\t\tif (preg_match('/(?s)(.*?)(?-s)\\r?\\n(?:(.*?)\\s+)?((?:A[BL]|B[ABDHLNRST]?|C[ABFHMORTVW]|D[ADEGHLNTY]|E[CHNX]?|F[KY]|G[LUY]?|H[ADGPRSUX]|I[GMPV]|JE|K[ATWY]|L[ADELNSU]?|M[EKL]?|N[EGNPRW]?|O[LX]|P[AEHLOR]|R[GHM]|S[AEGKLMNOPRSTWY]?|T[ADFNQRSW]|UB|W[ACDFNRSV]?|YO|ZE)\\d(?:\\d|[A-Z])? \\d[A-Z]{2})/', $address, $addressParts)) {\n\t\t\t/* UK postcode detected. */\n\t\t\t$info = array('country' => 'uk', 'zip' => $addressParts[3]);\n\t\t\tif (!empty($addressParts[1])) {\n\t\t\t\t$info['street'] = $addressParts[1];\n\t\t\t}\n\t\t\tif (!empty($addressParts[2])) {\n\t\t\t\t$info['city'] = $addressParts[2];\n\t\t\t}\n\t\t} elseif (preg_match('/\\b' . $aus_state_regex . '\\b/', $address)) {\n\t\t\t/* Australian state detected. */\n\t\t\t/* Split out the address, line-by-line. */\n\t\t\t$addressLines = preg_split('/\\r?\\n/', $address);\n\t\t\t$info = array('country' => 'au');\n\t\t\tfor ($i = 0; $i < count($addressLines); $i++) {\n\t\t\t\t/* See if it's the street number & name. */\n\t\t\t\tif (preg_match('/(\\d+\\s*\\/\\s*)?(\\d+|\\d+[a-zA-Z])\\s+([a-zA-Z ]*)/', $addressLines[$i], $lineParts)) {\n\t\t\t\t\t$info['street'] = $addressLines[$i];\n\t\t\t\t\t$info['streetNumber'] = $lineParts[2];\n\t\t\t\t\t$info['streetName'] = $lineParts[3];\n\t\t\t\t}\n\t\t\t\t/* Look for \"Suburb, State\". */\n\t\t\t\tif (preg_match('/([a-zA-Z ]*),?\\s+(' . $aus_state_regex . ')/', $addressLines[$i], $lineParts)) {\n\t\t\t\t\t$info['city'] = $lineParts[1];\n\t\t\t\t\t$info['state'] = $lineParts[2];\n\t\t\t\t}\n\t\t\t\t/* Look for \"State <4 digit postcode>\". */\n\t\t\t\tif (preg_match('/(' . $aus_state_regex . ')\\s+(\\d{4})/', $addressLines[$i], $lineParts)) {\n\t\t\t\t\t$info['state'] = $lineParts[1];\n\t\t\t\t\t$info['zip'] = $lineParts[2];\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif (preg_match('/(?s)(.*?)(?-s)\\r?\\n(.*)\\s*,\\s*(\\w+)\\.?\\s+(\\d+|[a-zA-Z]\\d[a-zA-Z]\\s?\\d[a-zA-Z]\\d)/', $address, $addressParts)) {\n\t\t\t/* American/Canadian address style. */\n\t\t\t$info = array('country' => 'us');\n\t\t\tif (!empty($addressParts[4]) &&\n\t\t\t\tpreg_match('|[a-zA-Z]\\d[a-zA-Z]\\s?\\d[a-zA-Z]\\d|', $addressParts[4])) {\n\t\t\t\t$info['country'] = 'ca';\n\t\t\t}\n\t\t\tif (!empty($addressParts[1])) {\n\t\t\t\t$info['street'] = $addressParts[1];\n\t\t\t}\n\t\t\tif (!empty($addressParts[2])) {\n\t\t\t\t$info['city'] = $addressParts[2];\n\t\t\t}\n\t\t\tif (!empty($addressParts[3])) {\n\t\t\t\t$info['state'] = $addressParts[3];\n\t\t\t}\n\t\t\tif (!empty($addressParts[4])) {\n\t\t\t\t$info['zip'] = $addressParts[4];\n\t\t\t}\n\t\t} elseif (preg_match('/(?:(?s)(.*?)(?-s)(?:\\r?\\n|,\\s*))?(?:([A-Z]{1,3})-)?(\\d{4,5})\\s+(.*)(?:\\r?\\n(.*))?/i', $address, $addressParts)) {\n\t\t\t/* European address style. */\n\t\t\t$info = array();\n\t\t\tif (!empty($addressParts[1])) {\n\t\t\t\t$info['street'] = $addressParts[1];\n\t\t\t}\n\t\t\tif (!empty($addressParts[2])) {\n\t\t\t\tif(@include('Horde/NLS/carsigns.php')) {\n\t\t\t\t\t$country = array_search(strtoupper($addressParts[2]), $carsigns);\n\t\t\t\t\tif ($country) {\n\t\t\t\t\t\t$info['country'] = $country;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($addressParts[5])) {\n\t\t\t\tif(@include('Horde/NLS/countries.php')) {\n\t\t\t\t\t$country = array_search($addressParts[5], $countries);\n\t\t\t\t} else {\n\t\t\t\t\t$country = false;\n\t\t\t\t}\n\t\t\t\tif ($country) {\n\t\t\t\t\t$info['country'] = String::lower($country);\n\t\t\t\t} elseif (!isset($info['street'])) {\n\t\t\t\t\t$info['street'] = trim($addressParts[5]);\n\t\t\t\t} else {\n\t\t\t\t\t$info['street'] .= \"\\n\" . $addressParts[5];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($addressParts[3])) {\n\t\t\t\t$info['zip'] = $addressParts[3];\n\t\t\t}\n\t\t\tif (!empty($addressParts[4])) {\n\t\t\t\t$info['city'] = trim($addressParts[4]);\n\t\t\t}\n\t\t}\n\n\t\treturn $info;\n\t}", "function parseAddress($street_address)\n\t{\n\t\t$address \t\t\t\t\t\t= \t$street_address;\n\t\t$apartment \t\t\t\t\t\t= \t\"\";\n\t\t$offset \t\t\t\t\t\t\t= \tstrlen($street_address);\n\n\t\twhile (($offset = $this->rstrpos($street_address, ' ', $offset)) !== false) \n\t\t{\n\t\t\tif ($offset < strlen($street_address)-1 && is_numeric($street_address[$offset + 1])) \n\t\t\t{\n\t\t\t\t$address \t\t\t\t\t= \ttrim(substr($street_address, 0, $offset));\n\t\t\t\t$apartment \t\t\t\t\t= \ttrim(substr($street_address, $offset + 1));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (empty($apartment) && strlen($street_address) > 0 && is_numeric($street_address[0])) \n\t\t{\n\t\t\t$pos \t\t\t\t\t\t\t= \tstrpos($street_address, ' ');\n\t\t\tif ($pos !== false) \n\t\t\t{\n\t\t\t\t$apartment \t\t\t\t\t= \ttrim(substr($street_address, 0, $pos), \", \\t\\n\\r\\0\\x0B\");\n\t\t\t\t$address \t\t\t\t\t= \ttrim(substr($street_address, $pos + 1));\n\t\t\t}\n\t\t}\n\t\treturn array($address, $apartment);\n\t}", "function splitNameAndAddress($nameAndAddr, &$details) {\n\t\t$name = '';\n\t\t$address = '';\n\n\t\tif (sizeof($nameAndAddr) == 1) {\n\t\t\t//Split the string into two\n\t\t\t$nameAndAddrString = $nameAndAddr[0];\n\t\t\tpreg_match_all(self::STATE_AND_ZIP_REGEX, $nameAndAddrString, $matches, PREG_OFFSET_CAPTURE);\n\t\t\tif ($matches[0][0][1]+strlen($matches[0][0][0]) == strlen($nameAndAddrString)) {\n\t\t\t\t//First two words = name\n\t\t\t\t$split = sscanf($nameAndAddrString,\"%s %s %[^$]\");\n\t\t\t\t$name = $split[0].' '.$split[1];\n\t\t\t\t$address = $split[2];\n\t\t\t} else {\n\t\t\t\t$address = substr($nameAndAddrString, 0, $matches[0][0][1]+strlen($matches[0][0][0]));\n\t\t\t\t$name = substr($nameAndAddrString, $matches[0][0][1]+strlen($matches[0][0][0]));\n\t\t\t}\n\t\t} elseif (sizeof($nameAndAddr) == 2) {\n\t\t\t$containsStateAndZip = preg_match_all(self::STATE_AND_ZIP_REGEX, $nameAndAddr[0]);\n\t\t\tif ($containsStateAndZip) {\n\t\t\t\t$address = $nameAndAddr[0];\n\t\t\t\t$name = $nameAndAddr[1];\n\t\t\t} else {\n\t\t\t\t$address = $nameAndAddr[1];\n\t\t\t\t$name = $nameAndAddr[0];\n\t\t\t}\n\t\t} //TODO: else -> fail\n\n\t\t$details[self::NAME] = $name;\n\t\t$details[self::ADDRESS] = $address;\n\t}", "protected function convertAddressFromStringToArray($address)\r\n {\r\n $address = explode(\"|\", $address);\r\n $data['first_name'] = $address[1];\r\n $data['last_name'] = $address[2];\r\n $data['email'] = $address[3];\r\n $data['phone'] = $address[4];\r\n $data['city'] = $address[5];\r\n $data['zip_code'] = $address[6];\r\n $data['address'] = $address[7];\r\n $data['state'] = $address[8];\r\n $data['country'] = $address[9];\r\n\r\n return $data;\r\n }", "public function parseAddress($address)\n {\n // First, find all mail address\n $j = preg_match_all(\n '/[\\s<]?([\\w\\d\\-_\\.\\+]+@([\\w\\d\\-_]+\\.){1,4}\\w+)[\\s>]?/',\n $address,\n $addressPart\n );\n\n // If got addresses, find names\n if (0 < $j) {\n $addressAr = [];\n $addressPart = $addressPart[1];\n\n for ($i = 0; $i < $j; $i++) {\n // Find from start of address string\n $k = strpos($address, $addressPart[$i]);\n $name = substr($address, 0, $k);\n\n // Prepare for next loop\n $address = substr($address, $k + strlen($addressPart[$i]));\n\n // Cleanup name we got\n $name = trim($name, ' \\t<>;,\"');\n\n $addressAr[$addressPart[$i]] = $name;\n }\n return($addressAr);\n\n } else {\n return [];\n }\n }", "private function buildApplicationAddressParts($address) {\n\t\t$addressLines = preg_split(\"/[\\x0D\\x0A+;,]+/\", $address);\n\t\t\n\t\tfor($i = 0; $i < 3; $i++)\n\t\t{\n\t\t\tif(isset($addressLines[$i]))\n\t\t\t{\n\t\t\t\t$addressParts[$i] = $this->setApplicationValue($addressLines[$i], 40);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$addressParts[$i] = $this->setApplicationValue(\" \", 40);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $addressParts;\n\t}", "function cr_eddirect_prepare_loaded_address_data($address) {\n // Remove elements with no data\n $address = array_filter($address);\n\n // filter out any fields that don't comply to our expected fields and\n // sort the fields into proper address order\n $address_fields = cr_eddirect_get_address_fields();\n $field_keys_to_store = array_keys($address_fields);\n\n // temporary storage for address with unexpected fields stripped out\n $address2 = array();\n\n foreach($field_keys_to_store as $field_key_to_store) {\n if (isset($address[$field_key_to_store])) {\n $address2[$field_key_to_store] = $address[$field_key_to_store];\n }\n }\n\n // put stripped address array back into $address;\n $address = $address2;\n\n // run check_plain on remaining data\n $address = array_map(\"check_plain\", $address);\n return $address;\n}", "function vcard_parse_adr( $adr_string )\n{\n global $_vcard_adr_fields;\n $m=null;\n if( preg_match('/([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*)/', $adr_string, $m ) != 1 ) {\n return NULL;\n }\n\n $out = array();\n $i = 1;\n foreach( $_vcard_adr_fields as $f ) {\n if( $m[$i] ) {\n $out[$f] = $m[$i];\n }\n ++$i;\n }\n return $out;\n}", "function _splitAddresses($address)\n {\n\n if (!empty($this->limit) AND count($this->addresses) == $this->limit) {\n return '';\n }\n\n if ($this->_isGroup($address) && !isset($this->error)) {\n $split_char = ';';\n $is_group = true;\n } elseif (!isset($this->error)) {\n $split_char = ',';\n $is_group = false;\n } elseif (isset($this->error)) {\n return false;\n }\n\n // Split the string based on the above ten or so lines.\n $parts = explode($split_char, $address);\n $string = $this->_splitCheck($parts, $split_char);\n\n // If a group...\n if ($is_group) {\n // If $string does not contain a colon outside of\n // brackets/quotes etc then something's fubar.\n\n // First check there's a colon at all:\n if (strpos($string, ':') === false) {\n $this->error = 'Invalid address: ' . $string;\n return false;\n }\n\n // Now check it's outside of brackets/quotes:\n if (!$this->_splitCheck(explode(':', $string), ':'))\n return false;\n\n // We must have a group at this point, so increase the counter:\n $this->num_groups++;\n }\n\n // $string now contains the first full address/group.\n // Add to the addresses array.\n $this->addresses[] = array(\n 'address' => trim($string),\n 'group' => $is_group\n );\n\n // Remove the now stored address from the initial line, the +1\n // is to account for the explode character.\n $address = trim(substr($address, strlen($string) + 1));\n\n // If the next char is a comma and this was a group, then\n // there are more addresses, otherwise, if there are any more\n // chars, then there is another address.\n if ($is_group && substr($address, 0, 1) == ','){\n $address = trim(substr($address, 1));\n return $address;\n\n } elseif (strlen($address) > 0) {\n return $address;\n\n } else {\n return '';\n }\n\n // If you got here then something's off\n return false;\n }", "function mailparse_rfc822_parse_addresses($addresses)\n{\n}", "function getAddressFromArray($address)\n{\n try {\n $fullAddress = [];\n $response = '';\n foreach ($address as $key => $value) {\n if (!empty($value['meta_value'])) {\n switch ($value['meta_key']) {\n case 'unit':\n $fullAddress[0] = $value['meta_value'];\n break;\n case 'address_1':\n $fullAddress[1] = $value['meta_value'];\n break;\n case 'address_2':\n $fullAddress[2] = $value['meta_value'];\n break;\n case 'city':\n $fullAddress[3] = $value['meta_value'];\n break;\n case 'county':\n $fullAddress[4] = $value['meta_value'];\n break;\n case 'state':\n $fullAddress[5] = $value['meta_value'];\n break;\n case 'zipcode':\n $fullAddress[6] = $value['meta_value'];\n break;\n case 'country':\n $fullAddress[7] = $value['meta_value'];\n break; \n default:\n break;\n }\n }\n }\n\n if (!empty($fullAddress)) {\n ksort($fullAddress);\n $response = ucwords(implode(', ',$fullAddress));\n }\n\n return $response;\n } catch (\\Exception $e) {\n \\Log::error($e);\n }\n}", "function parseAddress($address,$ar=false,$aAddress=array(),$sGroup='',$sHost='',$lookup=false) {\n $aTokens = $this->getAddressTokens($address);\n $sPersonal = $sEmail = $sComment = $sGroup = '';\n $aStack = $aComment = array();\n foreach ($aTokens as $sToken) {\n $cChar = $sToken{0};\n switch ($cChar)\n {\n case '=':\n case '\"':\n case ' ':\n $aStack[] = $sToken;\n break;\n case '(':\n $aComment[] = substr($sToken,1,-1);\n break;\n case ';':\n if ($sGroup) {\n $aAddress[] = $this->createAddressObject($aStack,$aComment,$sEmail,$sGroup);\n $oAddr = end($aAddress);\n if(!$oAddr || ((isset($oAddr)) && !strlen($oAddr->mailbox) && !$oAddr->personal)) {\n $sEmail = $sGroup . ':;';\n }\n $aAddress[] = $this->createAddressObject($aStack,$aComment,$sEmail,$sGroup);\n $sGroup = '';\n $aStack = $aComment = array();\n break;\n }\n case ',':\n $aAddress[] = $this->createAddressObject($aStack,$aComment,$sEmail,$sGroup);\n break;\n case ':':\n $sGroup = trim(implode(' ',$aStack));\n $sGroup = preg_replace('/\\s+/',' ',$sGroup);\n $aStack = array();\n break;\n case '<':\n $sEmail = trim(substr($sToken,1,-1));\n break;\n case '>':\n /* skip */\n break;\n default: $aStack[] = $sToken; break;\n }\n }\n /* now do the action again for the last address */\n $aAddress[] = $this->createAddressObject($aStack,$aComment,$sEmail);\n /* try to lookup the addresses in case of invalid email addresses */\n $aProcessedAddress = array();\n foreach ($aAddress as $oAddr) {\n $aAddrBookAddress = array();\n if (!$oAddr->host) {\n $grouplookup = false;\n if ($lookup) {\n $aAddr = call_user_func_array($lookup,array($oAddr->mailbox));\n if (isset($aAddr['email'])) {\n if (strpos($aAddr['email'],',')) {\n $grouplookup = true;\n $aAddrBookAddress = $this->parseAddress($aAddr['email'],true);\n } else {\n $iPosAt = strpos($aAddr['email'], '@');\n if ($iPosAt === FALSE) {\n $oAddr->mailbox = $aAddr['email'];\n $oAddr->host = FALSE;\n } else {\n $oAddr->mailbox = substr($aAddr['email'], 0, $iPosAt);\n $oAddr->host = substr($aAddr['email'], $iPosAt+1);\n }\n if (isset($aAddr['name'])) {\n $oAddr->personal = $aAddr['name'];\n } else {\n $oAddr->personal = encodeHeader($sPersonal);\n }\n }\n }\n }\n if (!$grouplookup && !strlen($oAddr->mailbox)) {\n $oAddr->mailbox = trim($sEmail);\n if ($sHost && strlen($oAddr->mailbox)) {\n $oAddr->host = $sHost;\n }\n } else if (!$grouplookup && !$oAddr->host) {\n if ($sHost && strlen($oAddr->mailbox)) {\n $oAddr->host = $sHost;\n }\n }\n }\n if (!$aAddrBookAddress && strlen($oAddr->mailbox)) {\n $aProcessedAddress[] = $oAddr;\n } else {\n $aProcessedAddress = array_merge($aProcessedAddress,$aAddrBookAddress);\n }\n }\n if ($ar) {\n return $aProcessedAddress;\n } else {\n if (isset($aProcessedAddress[0]))\n return $aProcessedAddress[0];\n else\n return '';\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
if tosave is set so it the save of the stagingForm wicht this function, I only return the list a fields in error
public function getFields($tosave = null) { $status = $this->getStatus() ; if(!$status) return null ; $fieldsToShow = array(); foreach($status as $key => $value) { if($tosave) { // staging_people and institution_relationship status are updated by a trigger, so we don't care about it here if(!in_array($key,array('people','identifiers','operator','institution_relationship'))) $fieldsToShow[$key] = $value ; } else $fieldsToShow[$key] = array( 'embedded_field' => $this->getFieldsToUseFor($key).'_'.$value, // to TEST 'display_error' => self::$errors[($key=='duplicate'?$key:$value)], 'fields' => $this->getFieldsToUseFor($key)); if($key == 'duplicate') $fieldsToShow[$key]['duplicate_record'] = $value ; } return($fieldsToShow) ; }
[ "public function getSaveErrors()\r\n\t{\r\n\t\treturn $this->saveErrors;\r\n\t}", "private function save_fields()\n\t{\n\t\tforeach($this->errors as $field=>$value)\n\t {\n\t \tif($this->$field instanceof Active_Model \n\t \t\t\t\t\t\t|| is_array($this->$field))\n\t \t{\n\t \t\t$fields = array();\n\n\t \t\tif(is_array($this->$field))\n\t \t\t{\n\t \t\t\t$fields = $this->$field;\n\t \t\t}\n\t \t\telse\t \t\t\n\t \t\t{\n\t \t\t\t$fields[$this->$field->id.'-id'] = $this->$field;\n\t \t\t}\n\n\t \t\tforeach($fields as $key=>$fld)\n\t \t\t{\n\t \t\t\tif($fld instanceof Active_Model)\n\t \t\t\t{\n\t \t\t\t\tif(!$fld->id)\n\t\t\t \t\t{\n\t\t\t \t\t\t$fld->save(); \n\t\t\t \t\t}\n\t\t\t \t\telse\n\t\t\t \t\t{\n\t\t\t \t\t\t$fld->update();\n\t\t\t \t\t}\n\t\t\t \t}\n\n\t\t \t $fields[$key] = $this->clean_field($fld);\n\t\t \t}\n\n\t\t \tif(is_array($this->$field)) \n\t\t \t{\n\t\t \t\t$this->$field = $fields;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\t$this->$field = array_pop($fields);\n\t\t \t}\n\t \t}\n\t }\n\t return $this;\n\t}", "public function save_errors()\n {\n }", "protected function validateSave () {}", "protected function getSaveFormData()\n {\n //uploads\n $modelConfig = $this->model->getConfig();\n if(isset($modelConfig->uploads)) {\n //max file size\n $this->setUploadMaxFilesizeTemplateParameters();\n }\n }", "function onSave()\n {\n try\n {\n // open a transaction with database\n TTransaction::open($this->database);\n\n // get the form data\n $object = $this->form->getData($this->activeRecord);\n\n // validate data\n $this->form->validate();\n\n // stores the object\n $object->store();\n\n // fill the form with the active record data\n $this->form->setData($object);\n\n // close the transaction\n TTransaction::close();\n\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'));\n // reload the listing\n }\n catch (Exception $e) // in case of exception\n {\n // get the form data\n $object = $this->form->getData($this->activeRecord);\n\n // fill the form with the active record data\n $this->form->setData($object);\n\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n\n // undo all pending operations\n TTransaction::rollback();\n }\n }", "public function saveFormaPago(){\n \n $data_insert = [\n 'formapago' =>$this->_formapago,\n \n ];\n return parent::save($data_insert);\n \n }", "function save_form_info($parameters){\n\t\t$debug = $this->debugit(false, $parameters);\n\t\t$copy = $parameters;\n\t\t$number_of_fields\t= $this->check_parameters($parameters,\"number_of_fields\",0);\n\t\t$identifier \t\t= $this->check_parameters($parameters,\"identifier\",0);\n\t\t$form_subject\t\t= $this->check_parameters($parameters,\"form_subject\");\n\t\t/* Starts Enquire Section to get productcode/productname in the email (Balmoral : By Muhammad Imran)*/\n\t\t$prodcode\t\t\t= $this->check_parameters($parameters,\"prodcode\");\n\t\t$prodname\t\t\t= $this->check_parameters($parameters,\"prodname\");\n\t\t/* Ends Enquire Section to get productcode/productname in the email (Balmoral : By Muhammad Imran)*/\n\n\t\t$email_counter \t\t= 0;\n\t\t$confirm\t\t\t= \"\";\n//\taddslashes(fread(fopen($form_data, \"r\"), filesize($form_data)))\n\t\t$sql = \"select * from form_builder_structure where fb_identifier = $identifier and fb_client = $this->client_identifier\";\n\t\tif ($debug) print \"<p><strong>:: \\n\".__FILE__.\" @ \".__LINE__.\" ::</strong><br/>\\n$sql</p>\\n\";\n\t\t$result = $this->call_command(\"DB_QUERY\",Array($sql));\n\t\twhile ($r = $this->call_command(\"DB_FETCH_ARRAY\",Array($result))){\n\t\t\t$action \t\t= $r[\"fb_action\"];\n\t\t\t$xml_structure = $r[\"fb_xml_structure\"];\n\t\t\t$confirm\t\t= trim($r[\"fb_confirm_screen\"]);\n\t\t\t$emailscreen\t= html_entity_decode(html_entity_decode($r[\"fb_emailscreen\"]));\n\t\t\t$label\t\t\t= $r[\"fb_label\"];\n\t\t\t$default_email\t= $r[\"fb_default_email\"];\n\t\t\t$default_subject= $r[\"fb_default_subject\"];\n\t\t\t$destination_url= $r[\"fb_url\"];\t\t\t\n\t\t}\n\t\tif ($debug) print \"<p><strong>:: \\n\".__FILE__.\" @ \".__LINE__.\" ::</strong><br/>\\n$default_email</p>\\n\";\n\t\t$now = $this->libertasGetDate(\"Y/m/d H:i:s\");\n\t\t$sql = \"select * from form_builder_required_fields where fbr_form = $identifier and fbr_client = $this->client_identifier\";\n\t\tif ($debug) print \"<p><strong>:: \\n\".__FILE__.\" @ \".__LINE__.\" ::</strong><br/>\\n$sql</p>\\n\";\n\t\t$result = $this->call_command(\"DB_QUERY\",Array($sql));\n\t\t$required=Array();\n\t\t$required_count=0;\n\t\twhile ($r = $this->call_command(\"DB_FETCH_ARRAY\",Array($result))){\n\t\t\t$required[count($required)]\t\t= $r[\"fbr_index\"];\n\t\t\t$required_count\t\t\t\t\t ++;\n\t\t}\n\t\t$sql = \"select * from form_builder_field_types where fbft_form = $identifier and fbft_client = $this->client_identifier\";\n\t\tif ($debug) print \"<p><strong>:: \\n\".__FILE__.\" @ \".__LINE__.\" ::</strong><br/>\\n$sql</p>\\n\";\n\t\t$result = $this->call_command(\"DB_QUERY\",Array($sql));\n\t\t$fieldlist=Array();\n\t\t$fieldlist_count=0;\n\t\twhile ($r = $this->call_command(\"DB_FETCH_ARRAY\",Array($result))){\n\t\t\t$fieldlist[count($fieldlist)]\t\t= Array($r[\"fbft_field\"],$r[\"fbft_type\"], $this->check_parameters($parameters,$r[\"fbft_field\"]));\n\t\t\t$fieldlist_count\t\t\t\t\t++;\n\t\t}\n\t\t$ok = true;\n\t\tif($destination_url == \"\") {\t\t\t\n\t\t\tfor ($index=0;$index<$required_count;$index++){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif ($this->check_locale_starter($this->check_parameters($parameters,\"field\".$required[$index]))==\"\"){\n\t\t\t\t\t$ok = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tforeach ($parameters as $key => $value) {\n\t\t\t\t$arrofkeys[] = $key;\n\t\t\t}\n\t\t\tfor ($index=0;$index<$required_count;$index++){\n\t\t\t\tif ($this->check_locale_starter($this->check_parameters($parameters,$arrofkeys[$required[$index]+3]))==\"\"){\n\t\t\t\t\t$ok = false;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\tif ($ok){\n\t\t\t$str = \"<form_data identifier='$identifier' submission_time='$now'>\";\n\t\t\t$index =0;\n//\t\t\tprint \"[$fieldlist_count]\";\n\t\t\tforeach($fieldlist as $key => $val ){\n\t\t\t\t$index=$key;\n//\t\t\t\tprint $fieldlist[$index][1];\n\t\t\t\tif ($fieldlist[$index][1] == \"fileupload\"){\n\t\t\t\t\t$field = $this->check_parameters($_FILES,$fieldlist[$index][0],Array());\n\t\t\t\t\t$tmp_name = $this->check_parameters($field,\"tmp_name\");\n\t\t\t\t\t$file_name = $this->check_parameters($field,\"name\");\n\t//\t\t\t\tprint \"\\n\\n<p>[$tmp_name, $file_name]</p>\";\n\t\t\t\t} else if ($fieldlist[$index][1] == \"date_time\"){\n\t\t\t\t\t$fieldy = $this->check_parameters($parameters, $fieldlist[$index][0] . \"_date_year\", \"0000\");\n\t\t\t\t\t$fieldm = $this->check_parameters($parameters, $fieldlist[$index][0] . \"_date_month\", \"00\");\n\t\t\t\t\t$fieldd = $this->check_parameters($parameters, $fieldlist[$index][0] . \"_date_day\", \"00\");\n\t\t\t\t\t$fieldh = $this->check_parameters($parameters, $fieldlist[$index][0] . \"_date_hour\", \"00:00\");\n\t\t\t\t\t$field = $fieldy.\"/\".$fieldm.\"/\".$fieldd.\" \".$fieldh.\":00\";\n\t\t\t\t\t$parameters[$fieldlist[$index][0]] = $field;\n\t\t\t\t\t$str .= '<field name=\"'.$fieldlist[$index][0].'\"><![CDATA['.strip_tags($field).\"]]></field>\";\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\t$field = $this->check_locale_starter($this->check_parameters($parameters,$fieldlist[$index][0],\"\"));\n\t\t\t\t\tif ($field.'' == 'Array'){\n\t\t\t\t\t\tfor ($f_index=0, $max=count($field); $f_index<$max; $f_index++){\n\t\t\t\t\t\t\tif ($field[$f_index]==\"_system_defined_other_\"){\n\t\t\t\t\t\t\t\t$str .= '<field name=\"'.$this->makeCleanOutputforXSL($fieldlist[$index][0]).'\"><![CDATA['.$this->makeCleanOutputforXSL($this->check_parameters($parameters, \"other_entry_\".$fieldlist[$index][0], \"\")).\"]]></field>\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$str .= '<field name=\"'.$this->makeCleanOutputforXSL($fieldlist[$index][0]).'\"><![CDATA['.$this->makeCleanOutputforXSL($field[$f_index]).\"]]></field>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($field==\"_system_defined_other_\"){\n\t\t\t\t\t\t\t$str .= '<field name=\"'.$this->makeCleanOutputforXSL($fieldlist[$index][0]).'\"><![CDATA['.$this->makeCleanOutputforXSL($this->check_parameters($parameters, \"other_entry_\".$fieldlist[$index][0], \"\")).\"]]></field>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$str .= '<field name=\"'.$this->makeCleanOutputforXSL($fieldlist[$index][0]).'\"><![CDATA['.$this->makeCleanOutputforXSL($field).\"]]></field>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$str .= '</form_data>';\n//\t\t\tprint \"<!-- $str -->\";\n//\t\t\t$this->exitprogram();\n\t\t\tif ($action==0 || $action ==1 || $action == 4){\n\t\t\t\t/*\n\t\t\t\t-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\t\t\t\t- EMAIL THE DATA TO THE DESIRED PARTY\n\t\t\t\t-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\t\t\t\t*/\n\t\t\t\t$email\t= Array();\n\t\t\t\t$email_counter =0;\n\t\t\t\tif (is_array($form_subject)){\n\t\t\t\t\t$fs_list = join(\"', '\",$form_subject);\n\t\t\t\t\t$sql\t= \"select * from form_builder_emails where fbe_subject in ('$fs_list') and fbe_client=$this->client_identifier and fbe_form = $identifier\";\n\t\t\t\t\tif ($debug) print \"<p><strong>:: \\n\".__FILE__.\" @ \".__LINE__.\" ::</strong><br/>\\n$sql</p>\\n\";\n\t\t\t\t\t$result\t= $this->call_command(\"DB_QUERY\",Array($sql));\n\t\t\t\t\t$num\t= $this->call_command(\"DB_NUM_ROWS\",Array($result));\n\t\t\t\t\tif ($num==0){\n\t\t\t\t\t\t$email[count($email)]\t= $default_email;\n\t\t\t\t\t\t$form_subject\t\t\t= $default_subject;\n\t\t\t\t\t} else {\n\t\t\t\t\t\twhile ($r = $this->call_command(\"DB_FETCH_ARRAY\",Array($result))){\n//\t\t\t\t\t\t\tif (strlen($email)>0){\n//\t\t\t\t\t\t\t\t$email .= \", \";\t\n//\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$email[count($email)] = $r[\"fbe_email\"];\n\t\t\t\t\t\t\t$email_counter++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$sql\t= \"select * from form_builder_emails where fbe_subject='$form_subject' and fbe_client=$this->client_identifier and fbe_form = $identifier\";\n\t\t\t\t\t$result\t= $this->call_command(\"DB_QUERY\",Array($sql));\n\t\t\t\t\t$num\t= $this->call_command(\"DB_NUM_ROWS\",Array($result));\n\t\t\t\t\tif ($num==0){\n\t\t\t\t\t\t$email[count($email)]\t= $default_email;\n\t\t\t\t\t\t$form_subject\t\t\t= $default_subject;\n\t\t\t\t\t} else {\n\t\t\t\t\t\twhile ($r = $this->call_command(\"DB_FETCH_ARRAY\",Array($result))){\n\t\t\t\t\t\t\t$val = $this->check_parameters($r,\"fbe_email\");\n\t\t\t\t\t\t\tif($val==\"\"){\n\t\t\t\t\t\t\t\t$val = $default_email;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$email[count($email)] = $val;\n\t\t\t\t\t\t\t$email_counter++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($email_counter==0){\n\t\t\t\t\t$email[count($email)]\t= $default_email;\n\t\t\t\t\t$form_subject\t\t\t= $default_subject;\n\t\t\t\t}\n\t\t\t\t//print $sql;\n\t\t\t\t$str = \"<form_submission>\".$str.\"<form_structure>$xml_structure</form_structure></form_submission>\";\n\t\t\t\t/*\n\t\t\t\t-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\t\t\t\t- if the user has defined a Email message to send then fill it in.\n\t\t\t\t-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\t\n\t\t\t\t*/\n\t\t\t\tif(strlen($emailscreen)>0){\n\t\t\t\t\t$xsl_files\t= $this->parent->site_directories[\"XSL_THEMES_DIR\"];\n\t\t\t\t\t$stylesheet = $xsl_files.\"/stylesheets/themes/site_administration/form_builder_email_generator.xsl\";\n\t\t\t\t\t$this->call_command(\"XMLPARSER_LOAD_XML_STR\",array($str));\n\t\t\t\t\t$this->call_command(\"XMLPARSER_LOAD_XSL_FILE\",array($stylesheet));\n\t\t\t\t\t$cmd=strip_tags(str_replace(Array(\"<\".\"\\?\".\"xml version=\\\"1.0\\\"\\?\".\">\"),Array(\"\"),\"\\$l = Array(\".$this->call_command(\"XMLPARSER_TRANSFORM\").\");\"));\n\t\t\t\t\t///print \"<!-- $cmd -->\";\n\t\t\t\t\teval($cmd);\n\t\t\t\t\t$unique_list = Array();\n\t\t\t\t\t$unique_counter=0;\n\t\t\t\t\tfor ($index=0,$m=count($l);$index<$m;$index++){\n\t\t\t\t\t\tif ($unique_counter==0){\n\t\t\t\t\t\t\t$unique_list[0] = Array($l[$index][0],$l[$index][1]);\n\t\t\t\t\t\t\t$unique_counter++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$found=-1;\n\t\t\t\t\t\t\tfor($y = 0 ; $y< count($unique_list); $y++){\n\t\t\t\t\t\t\t\tif ($unique_list[$y][0] == $l[$index][0]){\n\t\t\t\t\t\t\t\t\t$unique_list[$y][1] = $unique_list[$y][1].\", \".$l[$index][1];\n\t\t\t\t\t\t\t\t\t$found=1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($found==-1){\n\t\t\t\t\t\t\t\t$unique_list[count($unique_list)] = Array($l[$index][0],$l[$index][1]);\n\t\t\t\t\t\t\t\t$unique_counter++;\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\tfor($index=0,$m=count($unique_list);$index<$m;$index++){\n\t\t\t\t\t\t$emailscreen = str_replace(Array(\"[[\".str_replace(Array(\"[[quote]]\"),Array(\"\\\"\"),$unique_list[$index][0]).\"]]\"), Array($unique_list[$index][1]), $emailscreen);\t\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t/*\n\t\t\t\t\t-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\t\t\t\t\t- if the user has not filled in a defined email message then send a default formatted one.\n\t\t\t\t\t-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\t\n\t\t\t\t\t*/\n\t\t\t\t\t$xsl_files\t= $this->parent->site_directories[\"XSL_THEMES_DIR\"];\n\t\t\t\t\t$stylesheet = $xsl_files.\"/stylesheets/themes/site_administration/form_builder_default_email_generator.xsl\";\n\t\t\t\t\t\n\t\t\t\t\t$this->call_command(\"XMLPARSER_LOAD_XML_STR\",array($str));\n\t\t\t\t\t$this->call_command(\"XMLPARSER_LOAD_XSL_FILE\",array($stylesheet));\n\t\t\t\t\t$data = $this->call_command(\"XMLPARSER_TRANSFORM\");\n\t\t\t\t\t$emailscreen = str_replace(Array(\"[[returns]]\"), Array(\"\\r\\n\"), substr($data,strlen('<?xml version=\"1.0\"?>')));\n\t\t\t\t}\n\n\t\t\t\t/* Starts Enquire Section to Embedd productcode/productname in the email (Balmoral : By Muhammad Imran)*/\n\t\t\t\tif ($prodcode != \"\"){\n\t\t\t\t\t$prodcode_name = $prodname.\" (\".$prodcode.\")\".\"\\r\\n\";\n\t\t\t\t\t$emailscreen = $prodcode_name.$emailscreen;\n\t\t\t\t\t//echo $emailscreen;die;\n\t\t\t\t}\n\t\t\t\t/* Ends Enquire Section to Embedd productcode/productname in the email (Balmoral : By Muhammad Imran)*/\n\n\t\t\t\t$output = $emailscreen;\n\t\t\t\t$e = Array();\n\t\t\t\tforeach($fieldlist as $key => $val ){\n\t\t\t\t\t$index=$key;\n\t\t\t\t\tif ($fieldlist[$index][1] == \"fileupload\"){\n\t\t\t\t\t\t$field = $this->check_parameters($_FILES,$fieldlist[$index][0],Array());\n\t\t\t\t\t\tif (file_exists($this->check_parameters($field,\"tmp_name\"))){\n\t\t\t\t\t\t\tif ($this->check_parameters($e,\"attachments\",\"__NOT_FOUND__\")==\"__NOT_FOUND__\"){\n\t\t\t\t\t\t\t\t$e[\"attachments\"] =Array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$e[\"attachments\"][count($e[\"attachments\"])] = Array(\n\t\t\t\t\t\t\t\t\"actual_filename\"\t=> $this->check_parameters($field,\"tmp_name\"), \n\t\t\t\t\t\t\t\t\"original_filename\"\t=> $this->check_parameters($field,\"name\"), \n\t\t\t\t\t\t\t\t\"file_size\"\t\t\t=> $this->check_parameters($field,\"size\"), \n\t\t\t\t\t\t\t\t\"mime_type\"\t\t\t=> $this->check_parameters($field,\"type\")\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\tif (is_array($form_subject)){\n\t\t\t\t\t$form_subject =join(\",\", $form_subject);\n\t\t\t\t}\n\t\t\t\tif ($this->parent->domain==\"dev\"){\n//\t\t\t\t\t$e[\"from\"]\t\t= \"info@libertas-solutions.com\";\n\t\t\t\t\t$e[\"from\"]\t\t= \"info@\".$this->parseDomain($this->parent->domain);\n\t\t\t\t} else {\n\t\t\t\t\t$e[\"from\"]\t\t= \"info@\".$this->parseDomain($this->parent->domain);\n\t\t\t\t}\n\t\t\t\t$e[\"format\"]\t= \"plain\";\n\t\t\t\t$e[\"subject\"]\t= $form_subject;\n\t\t\t\t$e[\"body\"]\t\t= str_replace(Array(\"_system_defined_other_\"), Array(\"\"),$output);\n\t\t\t\t$e[\"to\"] \t\t= $email[0];\n\t\t\t\tif ($email_counter > 1){\n\t\t\t\t\t$e[\"cc\"]\t\t= Array();\n\t\t\t\t\tfor ($ccindex=0;$ccindex < $email_counter - 1;$ccindex++){\n\t\t\t\t\t\t$e[\"cc\"][$ccindex] \t= $email[$ccindex+1];\n//\t\t\t\t\t\tprint \"<p>\".$email[$ccindex+1].\"</p>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($debug) print \"<p><strong>:: \\n\".__FILE__.\" @ \".__LINE__.\" ::</strong><br/>\\n\".$email[0].\"</p>\\n\";\n\t\t\t\t$this->call_command(\"EMAIL_QUICK_SEND\",$e);\n/*\t\t\t\tprint \"body [info@\".$this->parseDomain($this->parent->domain).\"][$email][$form_subject][$output]\";\n\t\t\t\tprint $this->call_command(\"EMAIL_QUICK_SEND\",Array(\n\t\t\t\t\t\t\"from\" \t\t=> $e[\"from\"],\n\t\t\t\t\t\t\"subject\"\t=> \"subject\",\n\t\t\t\t\t\t\"body\"\t\t=> \"body [info@\".$this->parent->domain.\"][$email][$form_subject][$output]\",\n\t\t\t\t\t\t\"to\"\t\t=> \"adrian@bloodmoongames.com\",\n\t\t\t\t\t\t\"format\"\t=> \"plain\"\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t*/\n\t\t\t\t/*\n\t\t\t\t\tthank you msg\n\t\t\t\t*/\n\t\t\t}\n\t\t\tif ($action==1 || $action==2){\n\t\t\t\t$debug = false;\n\t\t\t\t/*\n\t\t\t\t-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\t\t\t\t- SAVE THE DATA TO THE SAVE_TABLE\n\t\t\t\t-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\t\t\t\t*/\n\t\t\t\t$now = $this->libertasGetDate(\"Y/m/d H:i:s\");\n\t\t\t\t$sql = \"insert into form_builder_data (fbd_client, fbd_form, fbd_filled_in_by, fbd_submitted) values ($this->client_identifier, $identifier, \".$this->check_parameters($_SESSION,\"SESSION_USER_IDENTIFIER\",-1).\", '$now')\";\n\t\t\t\tif ($debug) {print \"<p>\".__LINE__.\"</p>\\n<p>$sql</p>\\n\\n\";}\n\t\t\t\t$result = $this->call_command(\"DB_QUERY\",Array($sql));\n\t\t\t\t$sql = \"select * from form_builder_data where fbd_client=$this->client_identifier and fbd_form=$identifier and fbd_filled_in_by=\".$this->check_parameters($_SESSION,\"SESSION_USER_IDENTIFIER\",-1).\" and fbd_submitted = '$now';\";\n\t\t\t\tif ($debug) {print \"<p>\".__LINE__.\"</p>\\n<p>$sql</p>\\n\\n\";}\n\t\t\t\t$result = $this->call_command(\"DB_QUERY\",Array($sql));\n\t\t\t\t$link=-1;\n\t\t\t\twhile ($r = $this->call_command(\"DB_FETCH_ARRAY\",Array($result))){\n\t\t\t\t\t$link \t\t= $r[\"fbd_identifier\"];\n\t\t\t\t}\n\t\t\t\tforeach($fieldlist as $key => $val ){\n\t\t\t\t\t$index=$key;\n\t\t\t\t\t$field = $this->check_parameters($parameters,$fieldlist[$index][0],\"\");\n\t\t\t\t\tif ($field.\"\" == \"Array\"){\n\t\t\t\t\t\tfor($option=0,$max = count($field);$option<$max;$option++){\n\t\t\t\t\t\t\tif ($field[$option]!=\"_system_defined_other_\"){\n\t\t\t\t\t\t\t\t$sql = \"insert into form_builder_fields (fbf_client, fbf_link, fbf_field, fbf_value_group) \n\t\t\t\t\t\t\t\t\t\tvalues \n\t\t\t\t\t\t\t\t\t($this->client_identifier, $link, '\".$fieldlist[$index][0].\"', '\".$field[$option].\"')\";\n\t\t\t\t\t\t\t\tif ($debug) {print \"<p>\".__LINE__.\"</p>\\n<p>$sql</p>\\n\\n\";}\n\t\t\t\t\t\t\t\t$this->call_command(\"DB_QUERY\",Array($sql));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($fieldlist[$index][1] == \"fileupload\"){\n\t\t\t\t\t\t\t$f = $this->check_parameters($_FILES, $fieldlist[$index][0], Array());\n\t\t\t\t\t\t\tif (file_exists($this->check_parameters($f, \"tmp_name\"))){\n\t\t\t\t\t\t\t\t$data = addslashes(fread(fopen($f[\"tmp_name\"], \"r\"), filesize($f[\"tmp_name\"])));\n\t\t\t\t\t\t\t\t$sql = \"insert into form_builder_fields (fbf_client, fbf_link, fbf_field, fbf_value, fbf_mime_type) \n\t\t\t\t\t\t\t\t\t\tvalues \n\t\t\t\t\t\t\t\t\t($this->client_identifier, $link, '\".$fieldlist[$index][0].\"', '$data', '\".$this->check_parameters($f,\"type\").\"')\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($debug) {print \"<p>\".__LINE__.\"</p>\\n<p>$sql</p>\\n\\n\";}\n\t\t\t\t\t\t\t$this->call_command(\"DB_QUERY\",Array($sql));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($field!=\"_system_defined_other_\"){\n\t\t\t\t\t\t\t\t$sql = \"insert into form_builder_fields (fbf_client, fbf_link, fbf_field, fbf_value_group) \n\t\t\t\t\t\t\t\t\tvalues \n\t\t\t\t\t\t\t\t($this->client_identifier, $link, '\".$fieldlist[$index][0].\"', '$field')\";\n\t\t\t\t\t\t\t\tif ($debug) {print \"<p>\".__LINE__.\"</p>\\n<p>$sql</p>\\n\\n\";}\n\t\t\t\t\t\t\t\t$this->call_command(\"DB_QUERY\",Array($sql));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// SUBMIT TO A URL AFTER EMAILING CONTENTS\n\t\t\tif ($action==4){\n\t\t\t\tforeach($fieldlist as $key => $val ){\n\t\t\t\t\t$form_data .= $fieldlist[$key][0] .\"=\". urlencode($fieldlist[$key][2]) .\"&\";\n\t\t\t\t}\n\t\t\t\t$form_data = substr($form_data,0,strlen($form_data)-1);\n\t\t\t\theader(\"Location: \".$destination_url.\"?\".$form_data);\n\t\t\t \texit();\t\t\t\t\t\t\t\n\t\t\t}\n//\t\t\t$out =\t\"<text><![CDATA[\".LOCALE_FORM_BUILDER_FORM_SUBMIT.\"]]></text>\";\n\t\t\t$out = \"<module name=\\\"\".$this->module_name.\"\\\" display=\\\"confirm\\\">\";\n\t\t\t$out .= \"<text><![CDATA[<h1 class=\\\"entrylocation\\\"><span>$label</span></h1>]]></text>\";\n\t\t\tif ($confirm==\"\"){\n\t\t\t\t$out .=\t\"<text><![CDATA[\".LOCALE_FORM_BUILDER_FORM_SUBMIT.\"]]></text>\";\n\t\t\t} else {\n\t\t\t\t$out .=\t\"<text><![CDATA[\" . $confirm . \"]]></text>\";\n\t\t\t}\n\t\t\t$out .=\t\"</module>\";\n\t\t} else {\n\t\t\t$out =\"\";\n\t\t\t$str = '<values identifier=\"'.$identifier.'\" submission_time=\"'.$now.'\">';\n\t\t\t\n\t\t\tfor($index=0;$index<count($fieldlist);$index++){\n\t\t\t\t//$field = $this->check_parameters($copy,$fieldlist[$index][0],\"\");\n\t\t//\t\tprint $fieldlist[$index][0].\" = \".$field.\" \".$fieldlist[$index][2].\"<br>\";\n\t\t\t\tif (is_array($fieldlist[$index][2])){\n\t\t\t\t\t$l = count($fieldlist[$index][2]);\n\t\t\t\t\tfor($field_index=0;$field_index<$l;$field_index++){\n\t\t\t\t\t\t$str .= '<field name=\"'.$fieldlist[$index][0].'\"><![CDATA['.$fieldlist[$index][2][$field_index].']]></field>';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$str .= '<field name=\"'.$fieldlist[$index][0].'\"><![CDATA['.$fieldlist[$index][2].']]></field>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$str .= '</values>';\n\t\t\t$out = $this->display_built_form(Array(\"identifier\" => $identifier,\"values\"=>$str));\n\t\t}\n\t\treturn $out;\n\t}", "protected function _saveInfoResult($save) {\n if ($save instanceof EmploymentHistory) {\n \n if (empty($save->company_website)) {\n $websiteText = '';\n } elseif (str_contains($save->company_website, 'https')) {\n $websiteText = str_replace('https://', '', $save->company_website);\n }else if (str_contains($save->company_website, 'http')) {\n $websiteText = str_replace('http://', '', $save->company_website);\n }\n\n $workedDate = ($save->is_current) ? $save->start_date->format('m/Y') . ' - ' . _t('setting.employment.current') : $save->start_date->format('m/Y') . ' - ' . $save->end_date->format('m/Y');\n\n return [\n 'message' => _t('good_job'), \n 'data' => [\n 'id' => $save->id,\n 'name' => $save->company_name,\n 'position' => $save->position,\n 'achievement' => $save->achievement,\n 'date' => $workedDate,\n 'website_text' => $websiteText,\n 'website_href' => $save->company_website\n ]];\n } elseif($save instanceof Education) {\n\n return [\n 'message' => _t('good_job'), \n 'data' => [\n 'id' => $save->id,\n 'name' => $save->college_name,\n 'subject' => $save->subject,\n 'date' => $save->start_date->format('m/Y') . ' - ' . $save->end_date->format('m/Y'),\n 'qualification' => $save->qualification->name,\n 'achievements' => $save->achievements\n ]];\n } elseif($save instanceof UserSkill) {\n return [\n 'message' => _t('good_job'), \n 'data' => [\n 'id' => $save->id,\n 'name' => $save->skill->name,\n 'votes' => $save->votes\n ]];\n } elseif($save instanceof UserProfile) {\n return [\n 'message' => _t('good_job'), \n 'data' => [\n 'socials' => social_profile_list(),\n 'expertise' => ($save->expertise) ? $save->expertise->name : _t('setting.profile.pickexpertise'),\n 'cv_url' => route('front_cv', ['slug' => $save->slug])\n ]];\n }\n elseif($save instanceof User) {\n return [\n 'message' => _t('good_job'),\n 'data' => [\n 'username' => $save->username\n ]];\n }elseif($save instanceof Theme) {\n return [\n 'message' => _t('good_job'), \n 'data' => [\n 'id' => $save->id,\n 'name' => $save->name,\n 'screenshot' => asset(\"uploads/themes/{$save->slug}/screenshot.png\"),\n 'url_details' => route('front_theme_details', ['theme_id' => $save->id]),\n 'desc' => $save->description,\n 'devices' => $save->devices(),\n ]];\n } elseif (true === $save) {\n return ['message' => _t('good_job')];\n } elseif(false !== $save) {\n return ['message' => $save->errors()->first(), _error(), 'code' => 403];\n } else {\n return ['message' => _t('good_job')];\n }\n }", "function checkSaveButtons()\n {\n if ($this->arrTableParameters['savedok'] || $this->arrTableParameters['saveandclosedok']) {\n $tce = GeneralUtility::makeInstance('t3lib_TCEmain');\n $tce->stripslashes_values = 0;\n if (count($this->arrTableParameters['grps'])) {\n $arrSave['grps'] = $this->arrTableParameters['grps'];\n $arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = serialize($arrSave);\n } else {\n $arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = '';\n }\n $tce->start($arrData, array());\n $tce->process_datamap();\n if ($this->arrTableParameters['saveandclosedok']) {\n header('Location: ' . GeneralUtility::locationHeaderUrl($this->arrWizardParameters['returnUrl']));\n exit;\n }\n }\n }", "function rcpaf_fields_to_save_filter() {\n\t$fields_to_save = array(\n\t\t'address_1',\n\t\t'address_2',\n\t\t'city',\n\t\t'state',\n\t\t'postal',\n\t\t'country',\n\t);\n\n\treturn $fields_to_save;\n}", "public function save_fields() {\n\n\t\t$update_array = array(\n\t\t\t'call_id'\t\t\t\t=> $this->call_id, \n\t\t\t'current'\t\t\t\t=> $this->current, \n\t\t\t'updated_by'\t\t\t=> $this->updated_by,\n\t\t\t'tlc_assigned_to'\t\t=> $this->tlc_assigned_to,\n\t\t\t'its_assigned_group'\t=> $this->its_assigned_group,\n\t\t\t'comments'\t\t\t=> $this->comments,\n\t\t\t'datetime_assigned'\t\t=> $this->datetime_assigned,\n\t\t\t'date_assigned'\t\t=> $this->date_assigned,\n\t\t\t'time_assigned'\t\t=> $this->time_assigned,\n\t\t\t'call_status'\t\t\t=> $this->call_status,\n\t\t\t'call_priority'\t\t=> $this->call_priority,\n\t\t);\n\n\t\treturn $update_array;\n\t}", "public static function save_form() {\r\n\t\trequire_once( GFCommon::get_base_path() . '/form_detail.php' );\r\n\t\tGFFormDetail::save_form();\r\n\t}", "function field_save($field_info) {\n\t global $database;\n\n\t $old_field_query = $database->database_query(\"SELECT \".$this->type.\"field_id AS field_id, \".$this->type.\"field_\".$this->type.\"cat_id AS field_cat_id, \".$this->type.\"field_dependency AS field_dependency, \".$this->type.\"field_order AS field_order, \".$this->type.\"field_title AS field_title, \".$this->type.\"field_desc AS field_desc, \".$this->type.\"field_error AS field_error, \".$this->type.\"field_options AS field_options, \".$this->type.\"field_special AS field_special FROM se_\".$this->type.\"fields WHERE \".$this->type.\"field_id='$field_info[field_id]'\");\n\t if($database->database_num_rows($old_field_query) != 0) { $old_field_info = $database->database_fetch_assoc($old_field_query); } else { $old_field_info = \"\"; $old_field_info[field_dependency] = 0; }\n\t if($old_field_info[field_dependency] != 0) { $field_info[field_type] = ($field_info[field_type] == 3) ? 3: 1; $field_info[field_cat_id] = $old_field_info[field_cat_id]; }\n\n\t // FIELD TYPE IS TEXT FIELD\n\t if($field_info[field_type] == \"1\") {\n\t $column_type = \"varchar(250)\";\n\t $column_default = \"default ''\";\n\t $field_info[field_html] = str_replace(\"&gt;\", \"\", str_replace(\"&lt;\", \"\", str_replace(\" \", \"\", $field_info[field_html])));\n\t $suggestions = explode(\"\\r\\n\", $field_info[field_suggestions]);\n\t for($i=0;$i<count($suggestions);$i++) {\n\t if(trim($suggestions[$i]) != \"\") {\n\t $options[] = Array('value'=>$i, 'label'=>$suggestions[$i], 'dependency'=>'0', 'dependent_label'=>'', 'dependent_id'=>'');\n\t }\n\t }\n\n\t // FIELD TYPE IS TEXTAREA\n\t } elseif($field_info[field_type] == \"2\") {\n\t $column_type = \"text\";\n\t $column_default = \"\";\n\t $field_info[field_html] = str_replace(\"&gt;\", \"\", str_replace(\"&lt;\", \"\", str_replace(\" \", \"\", $field_info[field_html])));\n\n\t // FIELD TYPE IS SELECT BOX OR RADIO BUTTONS\n\t } elseif($field_info[field_type] == \"3\" || $field_info[field_type] == \"4\" || $field_info[field_type] == \"6\") {\n\t $field_info[field_html] = \"\";\n\t for($i=0;$i<count($field_info[field_options]);$i++) {\n\t if(trim($field_info[field_options][$i][value]) != \"\" && trim($field_info[field_options][$i][label]) != \"\") {\n\t $set_values[] = $field_info[field_options][$i][value];\n\t $options[] = $field_info[field_options][$i];\n\t if(ereg(\"^[0-9]+$\", $field_info[field_options][$i][value]) === FALSE) { $this->is_error = 146; break; }\n\t } elseif($field_info[field_options][$i][dependent_id] != \"\") {\n\t $dependent_ids[] = $field_info[field_options][$i][dependent_id];\n\t }\n\t }\n \n\t if( !empty($set_values) && $field_info[field_type] == \"6\" ) {\n\t $column_type = \"set('\".implode(\"', '\", $set_values).\"')\";\n\t $column_default = \"\";\n\t } else {\n\t $column_type = \"int(2)\";\n\t $column_default = \"default '-1'\";\n\t }\n\n\t // IF NO OPTIONS HAVE BEEN SPECIFIED\n\t if(count($options) == 0) { $this->is_error = 143; }\n\n\t // FIELD TYPE IS DATE FIELD\n\t } elseif($field_info[field_type] == \"5\") {\n\t $box5_display = \"block\";\n\t $column_type = \"date\";\n\t $column_default = \"default '0000-00-00'\";\n\t $field_info[field_html] = \"\";\n\n\n\t // FIELD TYPE NOT SPECIFIED\n\t } else {\n\t $this->is_error = 85;\n\t }\n\n\t // FIELD TITLE IS EMPTY\n\t if(trim($field_info[field_title]) == \"\" && $old_field_info[field_dependency] == 0) { $this->is_error = 94; }\n\n\t // NO ERROR \n\t if($this->is_error == 0) {\n\n\t // OLD FIELD (SAVE)\n\t if($database->database_num_rows($old_field_query)) { \n\n\t if($old_field_info[field_cat_id] != $field_info[field_cat_id]) {\n\t $field_order_info = $database->database_fetch_assoc($database->database_query(\"SELECT max(\".$this->type.\"field_order) as f_order FROM se_\".$this->type.\"fields WHERE \".$this->type.\"field_dependency='0' AND \".$this->type.\"field_\".$this->type.\"cat_id='$field_info[field_cat_id]'\"));\n\t $field_info[field_order] = $field_order_info[f_order]+1;\n\t } else {\n\t $field_info[field_order] = $old_field_info[field_order];\n\t }\n\n\t SE_Language::edit($old_field_info[field_title], $field_info[field_title]);\n\t SE_Language::edit($old_field_info[field_desc], $field_info[field_desc]);\n\t SE_Language::edit($old_field_info[field_error], $field_info[field_error]);\n\t $database->database_query(\"UPDATE se_\".$this->type.\"fields SET \".$this->type.\"field_\".$this->type.\"cat_id='$field_info[field_cat_id]', \".$this->type.\"field_order='$field_info[field_order]', \".$this->type.\"field_type='$field_info[field_type]', \".$this->type.\"field_style='$field_info[field_style]', \".$this->type.\"field_maxlength='$field_info[field_maxlength]', \".$this->type.\"field_link='$field_info[field_link]', \".$this->type.\"field_required='$field_info[field_required]', \".$this->type.\"field_regex='$field_info[field_regex]', \".$this->type.\"field_html='$field_info[field_html]', \".$this->type.\"field_search='$field_info[field_search]', \".$this->type.\"field_display='$field_info[field_display]', \".$this->type.\"field_special='$field_info[field_special]' WHERE \".$this->type.\"field_id='$field_info[field_id]'\");\n\t $column_name = $this->type.\"value_\".$field_info[field_id];\n\t $database->database_query(\"ALTER TABLE se_\".$this->type.\"values MODIFY $column_name $column_type $column_default\");\n\n\t // ENSURE FIRST DISPLAY NAME GETS CLEARED IF NECESSARY\n\t if($this->type == \"profile\" && $old_field_info[field_special] == 2 && $field_info[field_special] != 2) {\n\t\t$database->database_query(\"UPDATE se_users SET user_fname='' WHERE user_fname<>''\");\n\t // ENSURE LAST DISPLAY NAME GETS CLEARED IF NECESSARY\n\t } elseif($this->type == \"profile\" && $old_field_info[field_special] == 3 && $field_info[field_special] != 3) {\n\t\t$database->database_query(\"UPDATE se_users SET user_lname='' WHERE user_lname<>''\");\n\t }\n\n\t // GET OLD LABEL LANGUAGE VARS\n\t $old_field_options = unserialize($old_field_info[field_options]);\n\t for($o=0;$o<count($old_field_options);$o++) { $old_language_ids[$old_field_options[$o][value]] = $old_field_options[$o][label]; }\n\n\t // EDIT DEPENDENT FIELDS\n\t for($d=0;$d<count($options);$d++) {\n\t if($old_language_ids[$options[$d][value]] != \"\") {\n\t\t $options[$d][label] = SE_Language::edit($old_language_ids[$options[$d][value]], $options[$d][label]);\n\t\t unset($old_language_ids[$options[$d][value]]);\n\t } else {\n\t\t $options[$d][label] = SE_Language::edit(0, $options[$d][label], NULL, LANGUAGE_INDEX_FIELDS);\n\t\t}\n\n\t $dep_field = $database->database_query(\"SELECT \".$this->type.\"field_id AS field_id, \".$this->type.\"field_title AS field_title FROM se_\".$this->type.\"fields WHERE \".$this->type.\"field_id='\".$options[$d][dependent_id].\"'\");\n\n\t if($database->database_num_rows($dep_field) == \"1\") {\n\t $dep_field_info = $database->database_fetch_assoc($dep_field);\n\t if($options[$d][dependency] == \"1\") {\n\t SE_Language::edit($dep_field_info[field_title], $options[$d][dependent_label]);\n\t $database->database_query(\"UPDATE se_\".$this->type.\"fields SET \".$this->type.\"field_\".$this->type.\"cat_id='$field_info[field_cat_id]' WHERE \".$this->type.\"field_id='$dep_field_info[field_id]'\");\n\t } else {\n\t $database->database_query(\"DELETE FROM se_\".$this->type.\"fields, se_languagevars USING se_\".$this->type.\"fields JOIN se_languagevars ON se_\".$this->type.\"fields.\".$this->type.\"field_title=se_languagevars.languagevar_id WHERE \".$this->type.\"field_id='$dep_field_info[field_id]'\");\n\t $column_name = $this->type.\"value_\".$dep_field_info[field_id];\n\t $database->database_query(\"ALTER TABLE se_\".$this->type.\"values DROP COLUMN $column_name\");\n\t }\n\t } else {\n\t if($options[$d][dependency] == \"1\") {\n\t\t $dep_languagevar_id = SE_Language::edit(0, $options[$d][dependent_label], NULL, LANGUAGE_INDEX_FIELDS);\n\t $database->database_query(\"INSERT INTO se_\".$this->type.\"fields (\".$this->type.\"field_\".$this->type.\"cat_id, \".$this->type.\"field_title, \".$this->type.\"field_order, \".$this->type.\"field_type, \".$this->type.\"field_style, \".$this->type.\"field_dependency, \".$this->type.\"field_maxlength, \".$this->type.\"field_link, \".$this->type.\"field_options, \".$this->type.\"field_required, \".$this->type.\"field_regex) VALUES ('$field_info[field_cat_id]', '\".$dep_languagevar_id.\"', '0', '1', '', '$field_info[field_id]', '100', '', '', '0', '')\");\n\t $dep_field_id = $database->database_insert_id();\n\t $options[$d][dependent_id] = $dep_field_id;\n\t $column_name = $this->type.\"value_\".$dep_field_id;\n\t $database->database_query(\"ALTER TABLE se_\".$this->type.\"values ADD $column_name varchar(250) NOT NULL\");\n\t }\n\t }\n\t }\n\n\t // DELETE OLD DEPENDENT FIELDS\n\t for($d=0;$d<count($dependent_ids);$d++) {\n\t $database->database_query(\"DELETE FROM se_\".$this->type.\"fields, se_languagevars USING se_\".$this->type.\"fields JOIN se_languagevars ON se_\".$this->type.\"fields.\".$this->type.\"field_title=se_languagevars.languagevar_id WHERE \".$this->type.\"field_id='$dependent_ids[$d]'\");\n\t $column_name = $this->type.\"value_\".$dependent_ids[$d];\n\t $database->database_query(\"ALTER TABLE se_\".$this->type.\"values DROP COLUMN $column_name\");\n\t }\n\n\t // DELETE OLD LANGUAGE VARS\n if( !empty($old_language_ids) && is_array($old_language_ids) )\n $database->database_query(\"DELETE FROM se_languagevars WHERE languagevar_id IN('\".join(\"', '\", $old_language_ids).\"')\");\n\n\t // INSERT OPTIONS\n\t $field_info[field_options] = $options;\n\t $database->database_query(\"UPDATE se_\".$this->type.\"fields SET \".$this->type.\"field_options='\".serialize($options).\"' WHERE \".$this->type.\"field_id='$field_info[field_id]'\");\n\n\n\t // NEW FIELD (ADD)\n\t } else {\n\n\t $field_order_info = $database->database_fetch_assoc($database->database_query(\"SELECT max(\".$this->type.\"field_order) as f_order FROM se_\".$this->type.\"fields WHERE \".$this->type.\"field_dependency='0' AND \".$this->type.\"field_\".$this->type.\"cat_id='$field_info[field_cat_id]'\"));\n\t $field_order = $field_order_info[f_order]+1;\n\t $field_info[field_title_id] = SE_Language::edit(0, $field_info[field_title], NULL, LANGUAGE_INDEX_FIELDS);\n\t $field_info[field_desc_id] = SE_Language::edit(0, $field_info[field_desc], NULL, LANGUAGE_INDEX_FIELDS);\n\t $field_info[field_error_id] = SE_Language::edit(0, $field_info[field_error], NULL, LANGUAGE_INDEX_FIELDS);\n\t $database->database_query(\"INSERT INTO se_\".$this->type.\"fields (\".$this->type.\"field_\".$this->type.\"cat_id, \".$this->type.\"field_title, \".$this->type.\"field_desc, \".$this->type.\"field_error, \".$this->type.\"field_order, \".$this->type.\"field_type, \".$this->type.\"field_style, \".$this->type.\"field_dependency, \".$this->type.\"field_maxlength, \".$this->type.\"field_link, \".$this->type.\"field_required, \".$this->type.\"field_regex, \".$this->type.\"field_html, \".$this->type.\"field_search, \".$this->type.\"field_display, \".$this->type.\"field_special) VALUES ('$field_info[field_cat_id]', '$field_info[field_title_id]', '$field_info[field_desc_id]', '$field_info[field_error_id]', '$field_order', '$field_info[field_type]', '$field_info[field_style]', '0', '$field_info[field_maxlength]', '$field_info[field_link]', '$field_info[field_required]', '$field_info[field_regex]', '$field_info[field_html]', '$field_info[field_search]', '$field_info[field_display]', '$field_info[field_special]')\");\n\t $field_info[field_id] = $database->database_insert_id();\n\t $column_name = $this->type.\"value_\".$field_info[field_id];\n\t $database->database_query(\"ALTER TABLE se_\".$this->type.\"values ADD $column_name $column_type NOT NULL $column_default\");\n\n\t // ADD DEPENDENT FIELDS\n\t $field_options = \"\";\n\t for($d=0;$d<count($options);$d++) {\n\t\t$label_languagevar_id = SE_Language::edit(0, $options[$d][label], NULL, LANGUAGE_INDEX_FIELDS);\n\t\t$options[$d][label] = $label_languagevar_id;\n\t if($options[$d][dependency] == \"1\") {\n\t\t $dep_languagevar_id = SE_Language::edit(0, $options[$d][dependent_label], NULL, LANGUAGE_INDEX_FIELDS);\n\t $database->database_query(\"INSERT INTO se_\".$this->type.\"fields (\".$this->type.\"field_\".$this->type.\"cat_id, \".$this->type.\"field_title, \".$this->type.\"field_order, \".$this->type.\"field_type, \".$this->type.\"field_style, \".$this->type.\"field_dependency, \".$this->type.\"field_maxlength, \".$this->type.\"field_link, \".$this->type.\"field_options, \".$this->type.\"field_required, \".$this->type.\"field_regex) VALUES ('$field_info[field_cat_id]', '\".$dep_languagevar_id.\"', '$d', '1', '', '$field_info[field_id]', '100', '', '', '0', '')\");\n\t $dep_field_id = $database->database_insert_id();\n\t $options[$d][dependent_id] = $dep_field_id;\n\t $column_name = $this->type.\"value_\".$dep_field_id;\n\t $database->database_query(\"ALTER TABLE se_\".$this->type.\"values ADD $column_name varchar(250) NOT NULL\");\n\t }\n\t }\n\n\t // INSERT OPTIONS\n\t $field_info[field_options] = $options;\n\t $database->database_query(\"UPDATE se_\".$this->type.\"fields SET \".$this->type.\"field_options='\".serialize($options).\"' WHERE \".$this->type.\"field_id='$field_info[field_id]'\");\n\n\t }\n\t }\n\n\t return $field_info;\n\n\t}", "function _save() {\n if(is_array($this->_elements) && (sizeof($this->_elements) > 0)) {\n /* Start sql to create a table for this form */\n $sql = sprintf(\"CREATE TABLE mod_phatform_form_\" . $this->getId() . \"(\n id int(11) NOT NULL PRIMARY KEY,\n user varchar(20) NOT NULL,\n updated int(11) NOT NULL default '0',\n position int(11) NOT NULL default '0',\");\n\n /* Flag used to check if we need to add a comma in the sql statement */\n $flag = FALSE;\n /* Step through this form's elements and add the sql for those columns */\n foreach($this->_elements as $value) {\n if($flag)\n $sql .= ', ';\n\n $elementInfo = explode(':', $value);\n $this->element = new $elementInfo[0]($elementInfo[1]);\n $sql .= $this->element->getLabel() . ' longtext';\n $flag = TRUE;\n }\n $sql .= ')';\n\n if (PHPWS_Error::logIfError(PHPWS_DB::query($sql))) {\n $GLOBALS['CNT_phatform']['message'] = dgettext('phatform', 'Could not save the form. Check error log.');\n return false;\n }\n\n $this->setSaved();\n\n $this->commit();\n\n if (empty($this->_key_id)) {\n $create_key = TRUE;\n } else {\n $create_key = FALSE;\n }\n\n $key = $this->saveKey();\n if ($create_key) {\n $this->commit();\n }\n\n $_SESSION['PHAT_FormManager']->_list();\n } else {\n $error = PHPWS_Error::get(PHATFORM_NEED_ONE_ELEMENT, 'phatform', 'PHAT_Form::_saveSettings()');\n $GLOBALS['CNT_phatform']['message'] = $error->getMessage();\n\n $_REQUEST['PHAT_FORM_OP'] = 'EditAction';\n $_REQUEST['PHAT_Back'] = 1;\n $this->action();\n }\n }", "public function save() {\n\t\t$fields = $this->wire('fields'); \n\t\treturn $fields->save($this); \n\t}", "function protect_fields_save($parameters){\n\t\t$identifier = $this->check_parameters($parameters,\"identifier\",-1);\n\t\tif($identifier ==-1 || $this->manage_database_field_protection == 0){\n\t\t\treturn \"\";\n\t\t}\n\t\t$sql = \"delete from information_field_protection where ifp_client = $this->client_identifier and ifp_list=$identifier\";\n\t\t$this->parent->db_pointer->database_query($sql);\n\t\t$sql= \"select * from information_fields where if_screen=0 and if_list = $identifier and if_client = $this->client_identifier\";\n \t$result = $this->parent->db_pointer->database_query($sql);\n\t while($r = $this->parent->db_pointer->database_fetch_array($result)){\n//\t\t\tprint \"<li>checking \".$r[\"if_name\"].\"</li>\";\n\t\t\t$list = $this->check_parameters($parameters,$r[\"if_name\"]);\n\t\t\tif($list!=\"\"){\n\t\t\t\t$m = count($list);\n//\t\t\t\tprint_r($list);\n\t\t\t\tfor($index = 0; $index < $m;$index++){\n\t\t\t\t\t$sql = \"insert into information_field_protection (ifp_client, ifp_list, ifp_group, ifp_field) values ($this->client_identifier, $identifier, \".$list[$index].\", \".$r[\"if_identifier\"].\")\";\n\t\t\t\t\t$this->parent->db_pointer->database_query($sql);\n\t\t\t\t}\n\t\t\t}\n \t}\n\t $this->parent->db_pointer->database_free_result($result);\n\t\t\n\t\t$out =\"<module name=\\\"\".$this->module_name.\"\\\" display=\\\"form\\\">\";\n\t\t$out .= \"<page_options>\";\n\t\t$out .= \"<header><![CDATA[Field Protection - Saved]]></header>\";\n\t\tif($this->manage_database_list==1){\n\t\t\t$out .= $this->call_command(\"XMLTAG_GENERATE_XML_BUTTON\",Array(\"CANCEL\",$this->module_command.\"LIST\",LOCALE_CANCEL));\n\t\t} else {\n\t\t\t$out .= $this->call_command(\"XMLTAG_GENERATE_XML_BUTTON\",Array(\"NEXT\",\"ENGINE_SPLASH\",LOCALE_CANCEL));\n\t\t}\n\t\t$out .=\"</page_options>\";\n\t\t$out .=\"\t<form name=\\\"process_form\\\" label=\\\"Manage field protection\\\" width=\\\"100%\\\">\";\n\t\t$out .=\"\t\t<page_sections>\";\n\t\t$out .=\"\t\t\t<section label='Confirm'>\";\n\t\t$out .=\"\t\t\t\t<text><![CDATA[Thank you the protection values were set correctly]]></text>\";\n\t\t$out .=\"\t\t\t</section>\";\n\t\t$out .=\"\t\t</page_sections>\";\n\t\t$out .=\"\t</form>\";\n\t\t$out .=\"</module>\";\t\n\t\treturn $out;\n\t}", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward(array(\n 'controller' => \"rewidth_field_mrs\",\n 'action' => 'index'\n ));\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $rewidth_field_mr = RewidthFieldMrs::findFirstByid($id);\n\n if (!$rewidth_field_mr) {\n $this->flash->error(\"項目幅制御が見つからなくなりました。\" . $id);\n\n $this->dispatcher->forward(array(\n 'controller' => \"rewidth_field_mrs\",\n 'action' => 'index'\n ));\n\n return;\n }\n\n if ($rewidth_field_mr->updated !== $this->request->getPost(\"updated\")) {\n $this->flash->error(\"他のプロセスから項目幅制御が変更されたため更新を中止しました。\"\n . $id . \",uid=\" . $rewidth_field_mr->kousin_user_id . \" tb=\" . $rewidth_field_mr->updated .\" pt=\" . $this->request->getPost(\"updated\"));\n\n $this->dispatcher->forward(array(\n 'controller' => \"rewidth_field_mrs\",\n 'action' => 'edit',\n 'params' => array($id)\n ));\n\n return;\n }\n\n $post_flds = [];\n $post_flds = [\"cd\",\n \"name\",\n \"controller_cd\",\n \"gamen_cd\",\n \"riyou_user_id\",\n \"field_cd\",\n \"haba\",\n \"updated\",\n ];\n \n\n $thisPost=[]; // カンマ編集を消すとか日付編集0000-00-00を入れるとか$thisPost[]で行う\n $chg_flg = 0;\n foreach ($post_flds as $post_fld) {\n if ((array_key_exists($post_fld, $thisPost)?$thisPost[$post_fld]:$this->request->getPost($post_fld)) !== $rewidth_field_mr->$post_fld) {\n $chg_flg = 1;\n break;\n }\n }\n if ($chg_flg === 0) {\n $this->flash->error(\"変更がありません。\" . $id);\n\n $this->dispatcher->forward(array(\n \"controller\" => \"rewidth_field_mrs\",\n \"action\" => \"edit\",\n \"params\" => array($rewidth_field_mr->id)\n ));\n\n return;\n }\n\n $this->_bakOut($rewidth_field_mr);\n\n foreach ($post_flds as $post_fld) {\n $rewidth_field_mr->$post_fld = array_key_exists($post_fld, $thisPost)?$thisPost[$post_fld]:$this->request->getPost($post_fld);\n }\n\n if (!$rewidth_field_mr->save()) {\n\n foreach ($rewidth_field_mr->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward(array(\n 'controller' => \"rewidth_field_mrs\",\n 'action' => 'edit',\n 'params' => array($id)\n ));\n\n return;\n }\n\n $this->flash->success(\"項目幅制御の情報を更新しました。\");\n\n $this->dispatcher->forward(array(\n 'controller' => \"rewidth_field_mrs\",\n 'action' => 'edit',\n 'params' => array($rewidth_field_mr->id)\n ));\n }", "public function saveToDB(){\n\t\t\tforeach($this->formFields_ as $formField)\n\t\t\t\t$formField->saveToDB($this->formID(), $this->moduleID());\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add link to Reusable Blocks in admin sidebar
function linked_url() { add_menu_page('linked_url', 'Reusable Blocks', 'read', 'edit.php?post_type=wp_block', '', 'dashicons-text', 30); }
[ "function rb_reusable_blocks_admin_menu() {\n add_menu_page( 'Reusable Blocks', 'Reusable Blocks', 'edit_posts', 'edit.php?post_type=wp_block', '', 'dashicons-update', 2 );\n}", "function register_reusable_blocks_menu_links() {\n global $menu;\n global $submenu;\n\n $menu[30] = array( __('Reusable Blocks'), 'manage_options', 'edit.php?post_type=wp_block', '', 'open-if-no-js menu-top', '', 'dashicons-format-aside' );\n\n $submenu['edit.php?post_type=wp_block'][] = array(__('View All'), 'manage_options', 'edit.php?post_type=wp_block');\n $submenu['edit.php?post_type=wp_block'][] = array(__( 'New Block'), 'manage_options', 'post-new.php?post_type=wp_block');\n\n\n}", "public function addReusableBlocks(): void\n\t{\n\t\t\\add_menu_page(\n\t\t\t\\esc_html__('Blocks', 'eightshift-libs'),\n\t\t\t\\esc_html__('Blocks', 'eightshift-libs'),\n\t\t\tself::REUSABLE_BLOCKS_CAPABILITY,\n\t\t\t'edit.php?post_type=wp_block',\n\t\t\t'', // @phpstan-ignore-line\n\t\t\t'dashicons-editor-table',\n\t\t\t4\n\t\t);\n\t}", "public function thm_add_reusable_blocks_menu() {\n\t\tadd_menu_page(\n\t\t\t__( 'Reusable Blocks', 'evt' ),\n\t\t\t'Reusable Blocks',\n\t\t\t'edit_posts',\n\t\t\t'edit.php?post_type=wp_block',\n\t\t\t'',\n\t\t\t'data:image/svg+xml;base64,'.base64_encode('<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\"><path fill=\"black\" d=\"M5 7v3l-2 1.5V5h11V3l4 3.01L14 9V7H5zm10 6v-3l2-1.5V15H6v2l-4-3.01L6 11v2h9z\"></path></svg>'),\n\t\t\t59\n\t\t);\n\t}", "public function admin_manage_ad_blocks_page()\n\t{\n\t\t// set up the vars\n\t\t$instance = naked_ad_blocks::get_instance();\n\t\t$ad_blocks = $instance->get_ad_blocks();\n\t\t$vars = $this->_get_template_vars( 'ad_block' );\n\t\textract( $vars );\n\n\t\t$tpl_path = dirname(__DIR__) . '/views/ad_blocks.php';\n\t\tinclude( $tpl_path );\n\t}", "function glutenblocks_register_block_glutenblocks_listlink() {\n register_block_type(\n 'glutenblocks/listlink',\n [\n 'style' => 'glutenblocks-style',\n 'editor_script' => 'glutenblocks',\n 'editor_style' => 'glutenblocks-editor',\n ]\n );\n}", "public function admin_menu() {\n // add_menu_page(\n // __('Reusable Blocks', 'vfwp'),\n // __('Reusable Blocks', 'vfwp'),\n // 'edit_pages',\n // 'edit.php?post_type=wp_block',\n // '',\n // 'dashicons-layout',\n // 20\n // );\n add_submenu_page(\n 'edit.php',\n __('Reusable Blocks', 'vfwp'),\n __('Reusable Blocks', 'vfwp'),\n 'edit_posts',\n 'edit.php?post_type=wp_block'\n );\n add_submenu_page(\n 'edit.php?post_type=page',\n __('Reusable Blocks', 'vfwp'),\n __('Reusable Blocks', 'vfwp'),\n 'edit_pages',\n 'edit.php?post_type=wp_block'\n );\n }", "protected function adminSidebarLink()\n {\n $lowSinName = strtolower($this->argument('name'));\n $lowName = strtolower($this->argument('name').'s');\n $title = $this->getTitleName().'s';\n\n $path = base_path('resources/views/admin/includes/sidebar/management.blade.php');\n $delimiter = '{{--END OF MANAGEMENT LINKS - DO NOT REMOVE/MODIFY THIS COMMENT--}}';\n $content = file_get_contents($path);\n\n // What to add\n $link = '@if(authorized(\\''.$lowSinName.'_index\\'))';\n $link .= \"\\n\\t\".'<li class=\"{{ activeRoute(\\'admin.'.$lowName.'.index\\') }}\">';\n $link .= \"\\n\\t\\t\".'<a href=\"{{ route(\\'admin.'.$lowName.'.index\\') }}\">';\n $link .= \"\\n\\t\\t\\t\".'<i class=\"ion ion-bug\" aria-hidden=\"true\"></i>';\n $link .= \"\\n\\t\\t\\t\".'<span> '.$title.'</span>';\n $link .= \"\\n\\t\\t\".'</a>';\n $link .= \"\\n\\t\".'</li>';\n $link .= \"\\n\".'@endif';\n\n\n // Add the link\n $endOfPos = strpos($content, $delimiter);\n $pre = substr($content, 0, $endOfPos);\n $post = substr($content, $endOfPos, strlen($content));\n\n file_put_contents($path, $pre.$link.\"\\n\\n\".$post);\n\n $this->info('Added sidebar link in the admin panel');\n }", "public function admin_blocks_page() {\n\n\t\tif (isset($_GET['settings-updated'])) {\n\t\t\tadd_settings_error('cortex_messages', 'cortex_message', __('Settings Saved', 'cortex'), 'updated');\n \t\t}\n\n\t\t$list = new CortexBlockList();\n\t\t$list->prepare_items();\n\n\t\tCortex::render_template('cortex-admin-blocks-page.php', array('list' => $list));\n\t}", "public function admin_blocks_page() {\n\n\t\tif (isset($_GET['settings-updated'])) {\n\t\t\tadd_settings_error( 'cortex_messages', 'cortex_message', __('Settings Saved', 'cortex'), 'updated');\n \t\t}\n\n\t\t$list = new CortexBlockTemplateList();\n\t\t$list->prepare_items();\n\n\t\tCortex::render('cortex-admin-blocks-page.twig', array('list' => $list));\n\t}", "function add_block_admin_bar_menu_items( \\WP_Admin_Bar $wp_admin_bar ) {\n\t$wp_admin_bar->add_menu(\n\t\t[\n\t\t\t'parent' => 'new-content',\n\t\t\t'id' => 'new-wp_block',\n\t\t\t'title' => __( 'Reusable Block', 'altis-reusable-blocks' ),\n\t\t\t'href' => admin_url( 'post-new.php?post_type=wp_block' ),\n\t\t]\n\t);\n}", "public function display_admin_block() {\n\t\tglobal $page, $user;\n\t\t$html = \"\n\t\t\tAdd a folder full of images; any subfolders will have their names\n\t\t\tused as tags for the images within.\n\t\t\t<br>Note: this is the folder as seen by the server -- you need to\n\t\t\tupload via FTP or something first.\n\n\t\t\t<p>\".make_form(make_link(\"bulk_add\")).\"\n\t\t\t\t<table class='form'>\n\t\t\t\t\t<tr><th>Folder</th><td><input type='text' name='dir' size='40'></td></tr>\n\t\t\t\t\t<tr><td colspan='2'><input type='submit' value='Add'></td></tr>\n\t\t\t\t</table>\n\t\t\t</form>\n\t\t\";\n\t\t$page->add_block(new Block(\"Bulk Add\", $html));\n\t}", "function handcrafted_proxy_admin_menu_block_page() {\n $item = menu_get_item();\n if ($content = system_admin_menu_block($item)) {\n $output = theme('admin_block_content', ['content' => $content]);\n }\n else {\n $output = t('You do not have any administrative items.');\n }\n return $output;\n}", "public function admin_new_ad_block_page()\n\t{\n\t\t// set up the vars\n\t\t$vars = $this->_get_template_vars( 'ad_block' );\n\t\textract( $vars );\n\n\t\t// get the view\n\t\t$tpl_path = dirname(__DIR__) . '/views/edit_ad_block.php';\n\t\tinclude( $tpl_path );\n\t}", "function oese_acf_init_tile_links_block(){\n if (function_exists('acf_register_block')){\n // register a tile link block\n acf_register_block(array(\n 'name' => 'tile-link',\n 'title' => __('Tile Links'),\n 'description' => __('A tile link block.'),\n 'render_callback' => 'oese_tile_link_block_render_callback',\n 'category' => 'oese-block-category',\n 'icon' => 'admin-links',\n 'keywords' => array( 'tile link', 'link' ),\n 'enqueue_style' => get_stylesheet_directory_uri() . '/css/block/tile-link.css',\n 'example' => array(\n 'attributes' => array(\n 'mode' => 'preview',\n 'data' => array(\n 'tile_links' => array(\n 'tile_link_title' => \"Lorem Ipsum\",\n 'tile_link_url' => \"https://example.com\",\n 'external_link' => \"True\",\n 'width' => \"full\"\n )\n )\n )\n )\n ));\n }\n}", "public function testThemeAdminLink() {\n $this->drupalPlaceBlock('help_block', ['region' => 'help']);\n $theme_admin = $this->drupalCreateUser([\n 'administer blocks',\n 'administer themes',\n 'access administration pages',\n ]);\n $this->drupalLogin($theme_admin);\n $this->drupalGet('admin/appearance');\n $this->assertSession()->pageTextContains('You can place blocks for each theme on the block layout page');\n $this->assertSession()->linkByHrefExists('admin/structure/block');\n }", "public function display_admin_block() {\n\t\tglobal $page, $user;\n\t\t$html = \"\n\t\t\tAdd images from a csv. Images will be tagged and have their\n\t\t\tsource and rating set (if \\\"Image Ratings\\\" is enabled)\n\t\t\t<br>Specify the absolute or relative path to a local .csv file. Check <a href=\\\"\" . make_link(\"ext_doc/bulk_add_csv\") . \"\\\">here</a> for the expected format.\n\n\t\t\t<p>\".make_form(make_link(\"bulk_add_csv\")).\"\n\t\t\t\t<table class='form'>\n\t\t\t\t\t<tr><th>CSV</th><td><input type='text' name='csv' size='40'></td></tr>\n\t\t\t\t\t<tr><td colspan='2'><input type='submit' value='Add'></td></tr>\n\t\t\t\t</table>\n\t\t\t</form>\n\t\t\";\n\t\t$page->add_block(new Block(\"Bulk Add CSV\", $html));\n\t}", "function register_block_core_comment_edit_link()\n {\n }", "function render_block_core_home_link($attributes, $content, $block)\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test get one genre
public function testRetrieveGenre(): void { $genre = ['name' => 'Action','tmdb_id' => 1]; $genre = $this->repository->store($genre); $genre = $this->repository->find($genre->id); $this->assertIsObject($genre); $this->assertEquals('Action', $genre->name); }
[ "public function getGenre(){}", "public function getGenre(){\n return $this->film['genre'];\n }", "public function test_can_view_the_page_of_a_single_genre(){\n $this->withoutExceptionHandling();\n $track = factory(Track::class)->create();\n\n // Go to the artist spesific URL\n $response = $this->get(route(\"genre.show\", $track->genre_id))->assertStatus(200);\n\n // Assert it exists, assert can see the track\n $response->assertSee($track->genre->name);\n }", "public function getGenre(){\n return $this->genre;\n }", "public function get_genre()\n {\n return $this->_genre;\n }", "public function getGenre()\n {\n return $this->genre;\n }", "function genres () {\n if (empty($this->moviegenres)) {\n if ($this->page[\"Title\"] == \"\") $this->openpage (\"Title\");\n if (preg_match_all(\"/\\<a href=\\\"\\/genre\\/(.*?)\\\">(.*?)<\\/a>/\",$this->page[\"Title\"],$matches))\n $this->moviegenres = $matches[2];\n }\n return $this->moviegenres;\n }", "function trouvegenre($genre){\n\n $file_db=new Connextion();\n\t $file_db->connection();\n\n $requete='SELECT idGenre FROM genre WHERE nomGenre=:genre';\n\n $result=$file_db->getfile_db()->prepare($requete);\n $result->bindParam(':genre',$genre);\n $result->execute();\n\n foreach($result as $r){\n return $r['idGenre'];\n }\n }", "function tmdb_get_by_genre($genre){\n\t$url = \"http://api.themoviedb.org/3/discover/movie?&with_genres\".$genre;\n\t$res = curl_tmdb($url);\n\n\treturn json_decode($res);\n}", "function genre( $genre = null)\r\n\t{\r\n\t\t$genres = $this->Genre->load();\r\n\t\t$tracks = $this->Track->byGenre($genre);\r\n\t\t\r\n\t\t$this->set('genres', $genres);\r\n\t\t$this->set('tracks', $tracks);\r\n\t}", "public function testAddGetGenres()\n {\n $genre = new Genre(['slug' => 'action']);\n self::assertInstanceOf(Film::class, $this->film->addGenre($genre));\n\n $genres = $this->film->getGenres();\n self::assertInstanceOf(Collection::class, $genres);\n self::assertCount(1, $genres);\n self::assertInstanceOf(Genre::class, $genres->first());\n self::assertEquals($genre->getSlug(), $genres->first()->getSlug());\n\n return $genre;\n }", "public function getnomGenre(){\n return $this->nomGenre;\n }", "public function getRandomGenre()\n {\n $genres = $this->getAllGenresRandomOrder();\n return reset($genres);\n\n }", "public function getNomgenre()\n {\n return $this->nomgenre;\n }", "public function getGenres($genre){\n\t\t$data['genre_name'] = $genre;\n\t\t//Get Genre list from database\n\t\t$genre_list \t\t= Genres::lists('genre_name');\n\t\t//Check and see if Genre is in Genre list. If it doesn't, redirect to error page\n\t\tif (!in_array($genre, $genre_list)) {\n\t\t\treturn Redirect::to('error');\n\t\t}\n\t\telse {\t\t\n\t\t\t//Get Genre information\n\t\t\t$data['genre_cover'] = Comicbooks::genres($genre)\n\t\t\t\t\t\t\t\t\t ->select('cover_image')\n\t\t\t\t\t\t\t\t\t ->orderBy('comicdb_books.created_at', 'desc')\n\t\t\t\t\t\t\t\t \t ->distinct()->get();\n\t\t\t$data['genre_works'] = Comicbooks::genres($genre)\n\t\t\t\t\t\t\t\t\t \t\t ->select('book_name')\n\t\t\t\t\t\t\t\t\t\t\t ->orderBy('comicdb_books.created_at', 'desc')\n\t\t\t\t\t\t\t\t\t\t\t ->distinct()->get();\n\t\t}\n\t\t$this->layout->content = View::make('genre', $data);\n\t}", "public function getGenreId()\r\n {\r\n\r\n return $this->_tags['genre'];\r\n\r\n }", "function genreFilm(){\n\t\t$bdd = connectbdd();\n\t\t$requete = $bdd -> query('SELECT nomGenre FROM film JOIN est JOIN genre ON (film.idFilm = est.idFilm AND est.idGenre = genre.idGenre) WHERE nomFilm LIKE \"Le Roi Lion\"');\n\n\t\twhile ($data = $requete -> fetch())\n\t\t{\n\n\t\t\techo '<h3>'.$data['nomGenre'].'</h3>';\n\t\t}\n\t}", "public function GetGenreById(int $genreId) : Genre\n {\n }", "function check_genre( $genre ) {\n\t$sql = \"SELECT * FROM mr_genres WHERE genre_name LIKE '%$genre%'\";\n\t$res = mysql_query( $sql );\n\n\tif ( mysql_num_rows( $res ) > 0 ) {\n\t\treturn TRUE;\n\t} else {\n\t\treturn FALSE;\n\t}\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Leases a room to a user and persists the information
public function letRoom() { $data = $this->validate(['user_id' => ['bail', 'required', 'numeric']]); /** @var Room */ $room = Room::find($this->roomId); if ($room) { $room->users()->attach($data['user_id']); $this->reset(['label', 'description', 'cost', 'roomId', 'user_id']); $this->emit('hideLetRoomModal'); } }
[ "public function restored(ReservationRoom $ReservationRoom)\n {\n //\n }", "public function enter_room()\n\t{\n\t\t$room_id = $this->get_field(\"room_id\");\n\t\t$username = $this->get_field(\"username\");\n\t\t$this->CHESS->enter_room($room_id, $username);\n\t}", "public function unlock()\n {\n $this->locked_by_id = null;\n $this->locked_until = null;\n $this->save();\n }", "public function restore(User $user, UserMeetingRoom $model)\n {\n return false;\n }", "public function leave_room($a)\n {\n //file_put_contents(\"test.txt\",serialize(print_r($a,true)),FILE_APPEND);\n $this->db->query(\"DELETE from chatroom where id=? AND chatterid<> 0 AND chatterid = ?\", $a['roomid'], $a['chatterid']);\n //$sql = sprintf(\"SELECT cu.email, cu.chatterid, status FROM `chatroom` cr, chatuser cu WHERE cu.chatterid = cr.chatterid AND cr.id = '%s'\",$a['roomid']);\n\n //when someone leaves the room let's update the time to any other user so that the send.php will pick up on the change\n $this->db->query(\"UPDATE `chatroom` set time = ? WHERE id = ? and chatterid = 0\", time(), $a['roomid']);\n }", "public function leaveRoom($request, $response) {\n if (!isset($_SESSION['user'])) {\n // impossible due to the RestMiddleware\n return $response;\n }\n // Get Room\n $room = Room::find($request->getParam('roomId'));\n\n $user = $room->members()->find($_SESSION['user']);\n if (is_null($user)) {\n return $response->withJson(json_encode([\n 'reason' => 'You are not a member of the room.'\n ]), 409);\n } else {\n $room->users()->updateExistingPivot($_SESSION['user'], ['status' => -1]);\n return $response->withJson($room);\n }\n }", "public function unlock()\n\t{\n\t\t$data = array(\n\t\t\t\"locked\"=>0,\n\t\t\t\"locked_at\" => null,\n\t\t\t\"locked_by\" => null,\n\t\t\t\"locked_reason\" => null\n\t\t);\n\t\t$result = $this->user_model->update($this->client_id, $this->input->post(\"user_id\", true), $data);\n\t\t\n\t\t$this->setData($result);\n\t\t$this->render('admin/user/user_list', E_RENDERMODE::JSON);\n\t}", "public function clearRoom(){\n\t\t\t$query = \"DELETE FROM room\";\n\t\t\t$this->query($query);\n\t\t}", "public function remove_loged_user()\n {\n global $engine;\n $query = \"DELETE FROM \" . $this->table_loged_in . \" WHERE id_user=\" . $engine->users->active_user->get_id() . \" LIMIT 1;\";\n $engine->dbase->insertQuery($query);\n unset($_SESSION['users']);\n }", "public function saveNewRoom($newRoom);", "public function deleteRoom()\n {\n\n $room = Room::find($this->roomId);\n\n if ($room) {\n\n $room->delete();\n\n $this->reset(['label', 'description', 'cost', 'roomId']);\n \n $this->emit('hideDeleteRoomModal');\n } \n }", "public function leaveRoom($room, $uid) {\n $this->T('members')->where('room', $room)->where('uid', $uid)->deleteMany();\n //if no members, room deleted...\n $data = $this->T(\"members\")->selectExpr('count(id)', 'total')->where('room', $room)->findOne();\n if($data && $data->total === 0) {\n $this->T('rooms')->where('name', $room)->deleteMany();\n }\n }", "public function remove_loged_user()\n {\n global $engine;\n $query = \"DELETE FROM \" . $this->table_loged_in . \" WHERE id_user=\" .\n (int)$this->get_id() . \" LIMIT 1;\";\n $engine->dbase->insertQuery($query);\n unset($_SESSION['users']);\n }", "function dropRoom($roomId){\n $sql = \"drop table TEMP_ROOM_\".$roomId.\";\";\n $dataProcessor = new DataProcessor();\n $dataProcessor -> execute_dml($sql);\n $sql = \"update T_ROOM_MDL set ROOM_TP = NULL,PLAYER_NUM = NULL,GAME_MODE = NULL,\";\n $sql .= \"WORD_MODE = NULL,PASSWORD = NULL,STATUS = 'N',OWNER = NULL,RESULT = NULL,WORD_ID = NULL \";\n $sql .= \"where ID = ?\";\n $dataProcessor -> ownerLeftRoom($sql,$roomId);\n $dataProcessor -> conn_close();\n\n }", "private function release_locked_account()\n\t{\n\t\t$this->db->update($this->table_user, \n\t\t\t['login_try' => 0, 'account_locked_until' => null], \n\t\t\t['login_try >' => 0, 'account_locked_until <' => date('Y-m-d H:i:s')]\n\t\t);\n\t}", "public function add_room(){\r\n\t\t\r\n\t\t$id = $this->id;\r\n\t\t$connect = true;\r\n\t\t\r\n\t\tinclude \"main.php\";\r\n\t\t\r\n\t\t$_SESSION['query_error'] = \"\";\r\n\t\t\r\n\t\t$connection->query(\"UPDATE $this->tbl_name SET available=0 WHERE r_number='$this->start' AND residence='$this->residence' \", true);\t\t\r\n\t\t\t\r\n\t\tif($_SESSION['query']){\r\n\t\t\tdie ('<div class=\"alert alert-success alert-bold-border fade in alert-dismissable\">\r\n\t\t\t <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>\r\n\t\t\t <strong>SUCCESS: </strong><br> Room specially reserved! .\r\n\t\t\t</div>');\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "function hipchat_rules_delete_user_from_room_action($room_id_or_name, $user_id_or_email) {\n hipchat_delete_user_from_room($room_id_or_name, $user_id_or_email);\n}", "public function remove() {\n\t\t$this->remove_room($this->data['rid']);\n\t\t$this->data = [];\n\t}", "public function updateRoom()\n {\n $data = $this->validate();\n\n $room = Room::find($this->roomId);\n\n if ($room) {\n\n $room->update($data);\n\n $this->reset(['label', 'description', 'cost', 'roomId']);\n \n $this->emit('hideUpsertRoomModal');\n }\n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Send the file needed to register the service under Windows XP
function send_reg_file() { global $CONFIG, $HTTP_SERVER_VARS, $PHP_SELF; header("Content-Type: application/octet-stream"); $time_stamp = time(); header("Content-Disposition: attachment; filename=cpg_".$time_stamp.".reg"); $lines[] = 'Windows Registry Editor Version 5.00'; $lines[] = ''; //$lines[] = '[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\PublishingWizard\PublishingWizard\Providers\CopperminePhotoGallery]'; $lines[] = '[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\PublishingWizard\PublishingWizard\Providers\\'. $CONFIG['gallery_name'] .']'; $lines[] = '"displayname"="' . $CONFIG['gallery_name'] . '"'; $lines[] = '"description"="' . $CONFIG['gallery_description'] . '"'; $lines[] = '"href"="' . "http://" . $HTTP_SERVER_VARS['HTTP_HOST'] . $PHP_SELF . '?cmd=publish"'; $lines[] = '"icon"="' . "http://" . $HTTP_SERVER_VARS['HTTP_HOST'] . '/favicon.ico"'; print join("\r\n", $lines); print "\r\n"; exit; }
[ "function sendFileCmd($file = \"factura.txt\") {\n /* $LineaComando = \"Comando.bat\";\n $fp2 = fopen(\"C:\\Tools\\\\\" . $LineaComando, \"w\");\n $sentencia = \"C:\\Tools\\wspooler.exe -{$this->NamePort} -z -f C:\\Tools\\\\{$file}\";\n $write = fputs($fp2, $sentencia);\n fclose($fp2);\n exec(\"cmd /C start C:\\Tools\\\\{$LineaComando}\"); */\n\n exec(\"cmd /C start C:\\Tools\\wspooler.exe -{$this->NamePort} -z -f C:\\Tools\\\\{$file}\");\n\n $rep = \"\";\n $file_resp = explode(\".\", $file);\n $repuesta = file(\"C:\\Tools\\{$file_resp[0]}.ans\");\n $lineas = count($repuesta);\n for ($i = 0; $i < $lineas; $i++) {\n $resp = $repuesta[$i];\n }\n return $resp;\n }", "public function startService() {\n\t\t$this->updateUnitFiles(\"enable\");\n\t}", "public function installService()\n {\n if ($this->winsw->installed()) {\n $this->winsw->uninstall();\n }\n\n $this->winsw->install([\n 'PHP_PATH' => $this->findPhpPath(),\n 'PHP_PORT' => $this->configuration->get('php_port', PhpCgi::PORT),\n ]);\n\n $this->winsw->restart();\n }", "public function getServicesFile()\n {\n return isset($_SERVER['GUZZLE_SERVICE_FILE'])\n ? $_SERVER['GUZZLE_SERVICE_FILE']\n : __DIR__ . DIRECTORY_SEPARATOR . 'services.xml';\n }", "function ppm_register_file($path)\n{\n ProcessSlave::$slave->registerFile($path);\n}", "public function installService()\n {\n $this->uninstall();\n\n $this->winsw->install(static::SERVICE, [\n 'NGINX_PATH' => realpath(__DIR__.'/../../bin/nginx'),\n ]);\n }", "public function operatingSystemServicePack();", "function do_remote_register($task, $file) {\n $ret = create_file(\n $task->remote_site, $task->remote_store, $file->name, $file->type,\n $file->obs_id, $file->size, $file->md5\n );\n if (!$ret->success) {\n task_update_error($task->id, $ret->message);\n exit(1);\n }\n if (DEBUG_COPY) {\n echo \"remote register finished\\n\";\n }\n}", "public function buat_service_gammu()\n\t{\n\t\t// $path = \"C:\\xampp\\htdocs\\posotv.org\\app\\third_party\\bin\\\";\n\n\t\texec(FCPATH.'app/third_party/gammu/bin/gammu-smsd -c smsdrc –s',$return);\n\t}", "function sysCallRegister ($app, $service) {\r\n // they are prepared to receive. This function adds the named srvice\r\n // to the list of those accepted by the application app.\r\n $_SESSION['apps'][$app]['syscall'] .= ', ' . strtolower ($service); \t \r\n }", "public function pushfile()\n {\n try {\n $this->app['monolog']->addInfo(\n 'Start SynchronizeServer PUSH', array('method' => __METHOD__, 'line' => __LINE__)\n );\n $zip_files = $this->listOutbox(true); // get files in outbox\n $this->app['monolog']->addDebug(\n print_r( $zip_files,1 )\n );\n $this->app['monolog']->addInfo(sprintf(\n 'requested file: [%s]', $_GET['f']\n ));\n if(in_array($_GET['f'],$zip_files)) {\n $path = $this->app['utils']->sanitizePath(sprintf('%s/outbox/%s', SYNCDATA_PATH, $_GET['f']));\n $this->app['monolog']->addDebug(sprintf(\n 'check if file exists: %s', $path\n ));\n if(file_exists($path)) {\n $this->app['monolog']->addInfo(sprintf(\n 'sending file [%s]', $path\n ));\n $fh = fopen($path,'r');\n if (isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'], \"MSIE\"))\n \t{\n \t header('Content-Type: \"application/octet-stream\"');\n \t header('Content-Disposition: attachment; filename=\"'.basename($path).'\"');\n \t header('Expires: 0');\n \t header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n \t header(\"Content-Transfer-Encoding: binary\");\n \t header('Pragma: public');\n \t header(\"Content-Length: \".filesize($path));\n \t}\n \telse\n \t{\n \t header('Content-Type: \"application/octet-stream\"');\n \t header('Content-Disposition: attachment; filename=\"'.basename($path).'\"');\n \t header(\"Content-Transfer-Encoding: binary\");\n \t header('Expires: 0');\n \t header('Pragma: no-cache');\n \t header(\"Content-Length: \".filesize($path));\n \t}\n \tfpassthru($fh);\n \tfclose($fh);\n } else {\n $this->app['monolog']->addInfo(\n '!!!no such file!!!'\n );\n }\n } else {\n $this->app['monolog']->addInfo(\n '!!!no such file!!!'\n );\n }\n } catch (\\Exception $e) {\n throw new \\Exception($e);\n }\n }", "function cmd_registerService($clientStream,$server,$appId){\n\t\tif(! is_numeric($appId) ){\n\t\t\treturn 'bad command argument';\n\t\t}\n\t\tif( !empty( $this->appServices[$appId] )){\n\t\t\treturn \"service($appId) already registered\";\n\t\t}\n\t\t$this->appServices[$appId] = $server->getPeername($clientStream);\n\t\t//$this->serviceBroadcast($appId,'service ready',$server);\n\t\treturn 'registered';\n\t}", "public function installService()\n {\n if ($this->winsw->installed()) {\n $this->winsw->uninstall();\n }\n\n $this->winsw->install([\n 'PHP_PATH' => $this->findPhpPath(),\n 'PHP_XDEBUG_PORT' => $this->configuration->get('php_xdebug_port', PhpCgiXdebug::PORT),\n ]);\n\n $this->winsw->restart();\n }", "function Service_create() {\n\n global $Service_path, $Service_directory;\n\n // Set default timezone (required by date functions)\n date_default_timezone_set('UTC');\n\n // Convert all errors into exceptions (including E_NOTICE and E_STRICT)\n // Errors suppressed with @ are not handled (even if they're fatal!)\n set_error_handler(function ($errno, $errstr, $errfile, $errline) {\n if (error_reporting() !== 0) { // not suppressed by @ operator\n throw new ErrorException($errstr, 0, $errno, $errfile, $errline);\n }\n });\n\n // Get service path\n $Service_path = @$_GET['servicePath'];\n if (!$Service_path) { // no service specified\n exit('<center><pre style=\"margin-top:3em; font-size:22px\">... FJS Web Server ...</pre></center>');\n }\n\n // Get service directory\n $Service_directory = strstr($Service_path, '/', TRUE) ?: NULL;\n }", "function install_mysql_service(){\r\n global $us_mysql_bin;\r\n global $us_mysql_service_name;\r\n global $usf_my_ini;\r\n\r\n $MySQL_exe = get_mysql_exe();\r\n// $cmd = \"$us_mysql_bin/$MySQL_exe --install $us_mysql_service_name --defaults-file=$usf_my_ini\";\r\n $cmd = \"$us_mysql_bin/$MySQL_exe --install $us_mysql_service_name \";\r\n exec($cmd,$dummy,$return); // Install service \r\n set_mysql_tracker('service'); // Set tracker to 'service' Prevents \r\n}", "public function createFSService();", "function sendShareXConfig()\n{\n global $HTTP_PROTO;\n $host = $_SERVER[\"HTTP_HOST\"];\n $filename = $host.\".sxcu\";\n $content = <<<EOT\n{\n \"Name\": \"$host\",\n \"DestinationType\": \"ImageUploader, FileUploader\",\n \"RequestType\": \"POST\",\n \"RequestURL\": \"$HTTP_PROTO://$host/\",\n \"FileFormName\": \"file\",\n \"ResponseType\": \"Text\"\n}\nEOT;\n header(\"Content-type: application/octet-stream\");\n header('Content-Disposition: attachment; filename=\"'.$filename.'\"');\n header(\"Content-Length: \".strlen($content));\n print($content);\n}", "public function getSystemInfo()\n {\n $filePath = $this->controller->getSystemInfo();\n\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header(\n 'Content-Disposition: attachment; filename=' . CoreDebugController::SYSTEM_INFO_FILE_NAME\n );\n header('Expires: 0');\n header('Cache-Control: must-revalidate');\n header('Pragma: public');\n header('Content-Length: ' . filesize($filePath));\n readfile($filePath);\n\n http_response_code(200);\n die();\n }", "function start_update_download($fname , $fpath)\n {\n $fname = urldecode($fname);\n $fpath = urldecode($fpath);\n \n $filecontent = '';\n $dest_path = '/run/shm/temp/software';\n $url = $fpath;\n \n if ( !file_exists($dest_path) ) {\n mkdir($dest_path);\n }\n \n if ( !copy($url, $dest_path . \"/\" . $fname) ) {\n echo \"failed to copy $file...\\n\";\n \n } else {\n echo \"SUCCESS\";\n \n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Reset the transformation url of this Filelink. Call this function if you are calling multiple transformations on the same filelink without using the transform method.
public function resetTransform() { $this->transform_url = null; }
[ "protected function _clearLinkFileName () {\n\n $this->_file = null;\n\n }", "protected function initTransformUrl()\n {\n if (!$this->transform_url) {\n // security in a different format for transformations\n $security_str = $this->security ?\n sprintf('/security=policy:%s,signature:%s',\n $this->security->policy,\n $this->security->signature\n ) : '';\n\n $this->transform_url = sprintf($this->hostname() . '%s/%s',\n $security_str,\n $this->handle);\n }\n }", "public function resetResourceURL()\n {\n $this->resourceURL = null;\n }", "protected function reinitialiseUrl(): void\n {\n if ($this->url\n && $this->url->scheme === 'blob'\n && $this->url->cannotBeABaseUrl\n ) {\n // Terminate these steps\n return;\n }\n\n $this->setURL();\n }", "public function reset_Url () {\r\n\t\t$this ->getSoapClient () \r\n\t\t\t->__setLocation ();\r\n\t\treturn $this;\r\n\t}", "public function transform()\r\n {\r\n // get file signatures and cache path / uri\r\n $fileName = TB_Util::crcFile($this->getPath()) . '.' . pathinfo($this->getPath(), PATHINFO_EXTENSION);\r\n $signature = TB_Util::crc(serialize($this->transformations));\r\n $cachePath = TB_Util::getCachePath('media-images/' . $signature . '/' . $fileName);\r\n $cacheUrl = TB_Util::getCacheUri('media-images/' . $signature . '/' . $fileName);\r\n\r\n // todo remove\r\n TB_Util_Filesystem::delete($cachePath);\r\n\r\n // if cache file already exists, bail early\r\n if(TB_Util_Filesystem::isFile($cachePath)) {\r\n return $cacheUrl;\r\n }\r\n\r\n // prepare the cache dir\r\n TB_Util_Filesystem::createDirectoryRecursive(dirname($cachePath));\r\n\r\n // init the editor\r\n $this->setEditor(wp_get_image_editor($this->getPath()));\r\n\r\n // apply transformations\r\n /** @var TB_Image_Transformation $transformation */\r\n foreach($this->transformations as $transformation) {\r\n $transformation->apply($this);\r\n }\r\n\r\n $result = $this->getEditor()->save($cachePath);\r\n if(is_wp_error($result)) {\r\n throw new Exception($result->get_error_message());\r\n }\r\n\r\n // cleanup & result\r\n $this->setEditor(null);\r\n return $cacheUrl;\r\n }", "function clearTemporaryLink()\n {\n $this->_temporaryLink = null;\n return $this;\n }", "public function resetLabelLink() {\n\t\t$this->content_label_to_data = null;\n\t}", "public function resetViewTransformers()\n {\n $this->viewTransformers = array();\n\n return $this;\n }", "function reset()\n {\n $this->closeFile();\n $this->fileName = null;\n parent::reset();\n }", "public function resetOriginal()\n {\n $this->set('is_original', 0)->save();\n }", "public function resetModelTransformers(): static;", "public function resetViewTransformers(): static;", "public function reset() {\n $this->_path = array();\n }", "public function setCompressedFileUrlPath() {\n\t\t$this->compressedFileUrlPath = $this->urlPathArray['scheme'] . '://' . $this->urlPathArray['host'] . \"/imageCompress/compressed/\" . $this->randomCompressedName;\n\t}", "public function reset() {\r\n $this->zip->unchangeAll();\r\n }", "function reset() {\n unset($this->_sections);\n unset($this->_params);\n unset($this->_fileFullPath);\n }", "public function reset()\n\t{\n\t\t$this->resetPointer();\n\t\t$this->stream_string = '';\n\t}", "public function resetRotation() : void\r\n {\r\n if ($this->isRotated) {\r\n $tmp = $this->height;\r\n $this->height = $this->width;\r\n $this->width = $tmp;\r\n $this->isRotated = false;\r\n }\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fim da function apoioitemAlterar ====================================================== //
public function apoioItemAlterarMenu() { $this->validaAutenticacao(); $this->view->erroApoio = 0; // Buscar o nome da RA e a uf $dadosItem_alterar = Container::getModel('TbItemSuprimt'); $dadosItem_alterar->__set('cd_item', $_POST['item_escolhido']); $dadosItem_alterar->getDadosItemAll2(); $this->view->dadosItem_escolhida = array( 'cd_item_a_alterar' => $dadosItem_alterar->__get('cd_item') , 'nome_item_a_alterar' => $dadosItem_alterar->__get('nome_item') , 'cd_evento_a_alterar' => $dadosItem_alterar->__get('evento')); $this->render('apoioItemAlterarMenu'); // */ }
[ "public function testeAlterarItem(){\r\n\t\t\r\n\t\tglobal $tabItens;\r\n\r\n\t\t//Novos dados\r\n\t\t$dadosForm = [\"identificador2\", \"marca2\", \"titulo2\", \"descricao2\", \"caracteristicas2\", 1, 1, \"CCCCCC\", \"FFCCEE\", \"enderFoto.jpg\"];\r\n\r\n\t\t$this->idItem = incluirItem($this->mysqli, $this->dadosForm)[1];\r\n\r\n\t\t//Assert\r\n\t\t$this->assertEquals(\"sucesso\", alterarItem($this->mysqli, $this->idItem, $dadosForm));\r\n\t}", "function modItem ( $nomListe, $idItem ) {\n global $errs ;\n global $options ;\n $req = new clResultQuery ;\n // Récupération des anciennes informations de l'item à modifier.\n $param['cw'] = \"WHERE iditem='\".$idItem.\"'\" ;\n $res1 = $req -> Execute ( \"Fichier\", \"getListesItems\", $param, \"ResultQuery\" ) ;\n // Récupération de tous les autres items.\n $param['cw'] = \"WHERE nomliste='\".addslashes($nomListe).\"'\" ;\n $res2 = $req -> Execute ( \"Fichier\", \"getListesItems\", $param, \"ResultQuery\" ) ;\n // Vérification de la présence d'un item portant le nouveau nom.\n $param['cw'] = \"WHERE nomliste='\".addslashes($nomListe).\"' and nomitem='\".addslashes(stripslashes($_POST['nomItemF'])).\"' and iditem!='$idItem'\" ;\n $res3 = $req -> Execute ( \"Fichier\", \"getListesItems\", $param, \"ResultQuery\" ) ;\n // Vérification que l'item existe.\n if ( $res1['INDIC_SVC'] > 0 ) {\n // Vérification d'un changement de nom.\n if ( $res1['nomitem'][0] != $_POST['nomItemF'] ) {\n\t// Nouveau nom libre ou pas.\n\tif ( $res3['INDIC_SVC'][2] == 0 ) {\n\t // Nouveau nom correct.\n\t if ( eregi ( \"[0-9a-zA-Z]\", $_POST['nomItemF'] ) ) {\n\t // Mise à jour du nom de l'item dans la base.\n\t $data['nomitem'] = $_POST['nomItemF'] ;\n\t $requete = new clRequete ( BASEXHAM, \"listes\", $data ) ;\n\t eko ( $requete->updRecord ( \"iditem='\".$idItem.\"'\" ) ) ;\n\t // Message d'information.\n\t $this->infos .= \"L'item \\\"\".$res1['nomitem'][0].\"\\\" de la liste \\\"\".stripslashes($nomListe).\"\\\" a changé de nom : \\\"\".stripslashes($_POST['nomItemF']).\"\\\".<br />\" ;\n\t } else {\n\t // Message d'erreur.\n\t $this->erreurs .= \"Le nom choisi ne doit pas être vide.\" ;\n\t }\n\t} else {\n\t // Message d'erreur.\n\t $this->erreurs .= \"Le nom choisi pour l'item \\\"\".$res1['nomitem'][0].\"\\\" de la liste \\\"\".stripslashes($nomListe).\"\\\" est déjà utilisé. \n La modification est annulée.<br />\" ;\n\t}\n }\n // On vérifie si le type de la destination attendue a changé.\n if ( $res1['localisation'][0] != (isset($_POST['typeF'])?$_POST['typeF']:'') ) {\n\t$data2['localisation'] = (isset($_POST['typeF'])?$_POST['typeF']:'') ;\n\t$requete = new clRequete ( BASEXHAM, \"listes\", $data2 ) ;\n\t$requete->updRecord ( \"iditem='\".$res1['iditem'][0].\"'\" ) ;\n\t// Message d'information.\n\t$this->infos .= \"L'item \\\"\".$res1['nomitem'][0].\"\\\" de la liste \\\"\".stripslashes($nomListe).\"\\\" a changé de type.<br />\" ;\n }\n \tif ( $nomListe == 'Destinations attendues' ) {\n \t\t$data2['libre'] = $_POST['destpmsi'].$_POST['ori'] ;\n \t\t$requete = new clRequete ( BASEXHAM, \"listes\", $data2 ) ;\n \t\t$requete->updRecord ( \"iditem='\".$res1['iditem'][0].\"'\" ) ;\n \t} else {\n\t // On vérifie si le champs libre a été changé.\n\t if ( strcmp ( $res1['libre'][0] , (isset($_POST['libreF'])?$_POST['libreF']:'') ) ) {\n\t\t\t$data2['libre'] = $_POST['libreF'] ;\n\t\t\t$requete = new clRequete ( BASEXHAM, \"listes\", $data2 ) ;\n\t\t\tif ( $options -> getOption ( $nomListe.\" Id\" ) OR $nomListe == \"Médecins\" OR $nomListe == \"I.D.E.\" ) {\n\t\t\t if ( eregi ( \"[0-9a-zA-Z]\", $_POST['libreF'] ) ) {\n\t\t\t $requete->updRecord ( \"iditem='\".$res1['iditem'][0].\"'\" ) ;\n\t\t\t // Message d'information.\n\t\t\t $this->infos .= \"L'item \\\"\".$res1['nomitem'][0].\"\\\" de la liste \\\"\".stripslashes($nomListe).\"\\\" a changé d'identifiant.<br />\" ;\n\t\t\t } else {\n\t\t\t $this->erreurs .= \"L'identifiant ne peut pas être vide. Ce champs ne sera pas modifié.<br />\" ;\n\t\t\t }\n\t\t\t}\n\t\t }\n\t }\n // On vérifie si l'item a changé de position ou non.\n if ( $res1['iditem'][0] != $_POST['placerF'] ) {\n\t// Suppression du rang actuel et décalage du rang des autres items.\t\n\t$rang = $res1['rang'][0] ;\n\t$param['cw'] = \"WHERE rang>'$rang' and nomliste='\".addslashes(stripslashes($nomListe)).\"'\" ;\n\t$res4 = $req -> Execute ( \"Fichier\", \"getListesItems\", $param, \"ResultQuery\" ) ;\n\tfor ( $i = 0 ; isset ( $res4['iditem'][$i] ) ; $i++ ) {\n\t $data3['rang'] = $res4['rang'][$i] - 1 ;\n\t $requete = new clRequete ( BASEXHAM, \"listes\", $data3 ) ;\n\t $requete->updRecord ( \"iditem='\".$res4['iditem'][$i].\"'\" ) ;\n\t}\n\t// Calcul du rang suivant.\n\tif ( $_POST['placerF'] ) {\n\t $param['cw'] = \"WHERE iditem='\".$_POST['placerF'].\"' and nomliste='\".addslashes(stripslashes($nomListe)).\"'\" ;\n\t $res6 = $req -> Execute ( \"Fichier\", \"getListesItems\", $param, \"ResultQuery\" ) ;\t\n\t $rang = $res6['rang'][0] + 1 ;\n\t} else $rang = 1 ;\n\t// Décalage de tous les items d'un rang.\n\t$param['cw'] = \"WHERE rang>='$rang' and nomliste='\".addslashes(stripslashes($nomListe)).\"'\" ;\n\t$res5 = $req -> Execute ( \"Fichier\", \"getListesItems\", $param, \"ResultQuery\" ) ;\n\tfor ( $i = 0 ; isset ( $res5['iditem'][$i] ) ; $i++ ) {\n\t $data4['rang'] = $res5['rang'][$i] + 1 ;\n\t $requete = new clRequete ( BASEXHAM, \"listes\", $data4 ) ;\n\t $requete->updRecord ( \"iditem='\".$res5['iditem'][$i].\"'\" ) ;\n\t}\n\t// Mise à jour du rang de l'item.\n\tif ( $_POST['placerF'] ) $data5['rang'] = $res6['rang'][0] + 1 ;\n\telse $data5['rang'] = 1 ;\n\t$requete = new clRequete ( BASEXHAM, \"listes\", $data5 ) ;\n\t$requete->updRecord ( \"iditem='\".$res1['iditem'][0].\"'\" ) ;\n\t// Message d'information.\n\t$this->infos .= \"L'item \\\"\".$res1['nomitem'][0].\"\\\" de la liste \\\"\".stripslashes($nomListe).\"\\\" a changé de position.<br />\" ;\n }\n } else {\n // Signalement d'une erreur si l'item à modifier n'existe pas.\n $this->erreurs .= \"L'item ne peut pas être modifié (id=\\\"$idItem\\\") car il n'existe pas.\" ;\n $errs->addErreur ( \"clListesGenerales : L'item ne peut pas être modifié (id=\\\"$idIditem\\\") car il n'existe pas.\" ) ;\n }\n }", "public function alterar(){\n\t}", "public function update() {\r\n\tItem::$rawItems[$this->idItem]['amount'] = $this->amount;\r\n\tItem::$rawItems[$this->idItem]['priece'] = $this->priece;\r\n\tItem::$rawItems[$this->idItem]['name'] = $this->name;\r\n}", "protected static function actualizar_item_modelo($datos){\r\n\t\t\t$sql=mainModel::conectar()->prepare(\"UPDATE item SET item_codigo=:Codigo, item_nombre=:Nombre,item_tipo=:Tipo, item_stock=:Stock, item_estado=:Estado,item_detalle=:Detalle WHERE item_id=:ID\");\r\n\t\t\t$sql->bindParam(\":Codigo\",$datos['Codigo']);\r\n\t\t\t$sql->bindParam(\":Nombre\",$datos['Nombre']);\r\n\t\t\t$sql->bindParam(\":Tipo\",$datos['Tipo']);\r\n\t\t\t$sql->bindParam(\":Stock\",$datos['Stock']);\r\n\t\t\t$sql->bindParam(\":Estado\",$datos['Estado']);\r\n\t\t\t$sql->bindParam(\":Detalle\",$datos['Detalle']);\r\n\t\t\t$sql->bindParam(\":ID\",$datos['ID']);\r\n\r\n\t\t\t$sql->execute();\r\n\r\n\t\t\treturn $sql;\r\n\r\n\t\t}", "public function alterar()\n {\n }", "function deleteExtraEnPartido( $tipo, $partidoId, $itemToDelete ) {\n $connection = connectDB();\n $partido = getPostsFromDeportesById( $partidoId, 'partidos' );\n\n switch ($tipo) {\n case 'gol':\n $extras1 = explode(',', $partido['goles_id1']);\n $extras2 = explode(',', $partido['goles_id2']);\n\n if ( ($clave = array_search($itemToDelete, $extras1)) !== false ) {\n unset($extras1[$clave]);\n }\n \n if ( ($clave = array_search($itemToDelete, $extras2)) !== false ) {\n unset($extras2[$clave]);\n }\n \n $extras1 = implode(',', $extras1);\n $extras2 = implode(',', $extras2);\n\n $query = \"UPDATE partidos SET goles_id1='\".$extras1.\"', goles_id2='\".$extras2.\"' WHERE id='\".$partidoId.\"' LIMIT 1\";\n\n break;\n\n case 'amonestacion':\n $extras1 = explode(',', $partido['amonestaciones_id1']);\n $extras2 = explode(',', $partido['amonestaciones_id2']);\n\n if ( ($clave = array_search($itemToDelete, $extras1)) !== false ) {\n unset($extras1[$clave]);\n }\n \n if ( ($clave = array_search($itemToDelete, $extras2)) !== false ) {\n unset($extras2[$clave]);\n }\n \n $extras1 = implode(',', $extras1);\n $extras2 = implode(',', $extras2);\n\n $query = \"UPDATE partidos SET amonestaciones_id1='\".$extras1.\"', amonestaciones_id2='\".$extras2.\"' WHERE id='\".$partidoId.\"' LIMIT 1\";\n\n break;\n\n case 'contenido':\n\n $query = \"UPDATE partidos SET contenido_id='' WHERE id='\".$partidoId.\"' LIMIT 1\";\n\n break;\n \n }\n\n $updatePost = mysqli_query($connection, $query); \n\n if ( ! $updatePost ) {\n $respuesta = 'error';\n } else {\n $respuesta = 'ok';\n }\n\n //cierre base de datos\n\tmysqli_close($connection);\n return $respuesta;\n\n}", "public function testUpdateBundleItem()\n {\n }", "function excluirItem($dados,$id_item) {\n $this->db->where('id_item', $id_item);\n $this->db->update('item', $dados);\n }", "function editarProducto($db, $id,$data) {\n //Modifica el producto (viene del ABM)\n $nombre = mysqli_real_escape_string($db, $data['nombre']);\n $detalle = mysqli_real_escape_string($db, $data['detalle']);\n $categoria = mysqli_real_escape_string($db, $data['idcategoria']);\n // si se seleccionó un nuevo archivo de imagen hay que subirlo y cambiar el campo en la base\n // si no se seleccionó otro archivo o hay algún error en la subida, queda el mismo que antes\n $foto = mysqli_real_escape_string($db, $data['foto']);\n if (isset($_FILES['NUEVAFOTO']) && $_FILES['NUEVAFOTO']['name'] != \"\"){\n $fichero_subido = 'img/' . basename($_FILES['NUEVAFOTO']['name']);\n if (move_uploaded_file($_FILES['NUEVAFOTO']['tmp_name'], $fichero_subido)) {\n $foto = mysqli_real_escape_string($db, $_FILES['NUEVAFOTO']['name']);\n }\n }\n $es_oferta = (isset($data['es_oferta']) && $data['es_oferta'] == \"on\") ? 1 : 0;\n $precio = mysqli_real_escape_string($db, $data['precio']);\n $es_visible = (isset($data['es_visible']) && $data['es_visible'] == \"on\") ? 1 : 0;\n \n $query = \"\n UPDATE productos SET nombre = '$nombre',\n detalle = '$detalle',\n precio = $precio,\n idcategoria = $categoria,\n foto = '$foto',\n es_oferta = $es_oferta ,\n es_visible = $es_visible \n where id = $id \";\n //echo $query;die; \n // Ejecutamos el query.\n // Como la consulta es un UPDATE, mysqli_query retorna true o false.\n return mysqli_query($db, $query);\n}", "protected function editar()\n {\n }", "function atualizar_conteudo_elemento_bloco(){\n\n// globals\nglobal $idioma;\n\n// dados de formulario\n$id = remove_html($_REQUEST['id']);\n$tipo_elemento = remove_html($_REQUEST['tipo_elemento']);\n$valor = remove_html($_REQUEST['valor']);\n$nome_usuario = remove_html($_REQUEST['nome_usuario']);\n$data = remove_html($_REQUEST['data']);\n\n// tipo de elemento\nswitch($tipo_elemento){\n\ncase $idioma[73]:\n$tabela = TABELA_COMUNICADO;\n$campo_tabela = \"conteudo='$valor'\";\nbreak;\n\ncase $idioma[74]:\n$tabela = TABELA_TELEFONES_UTEIS;\n$campo_tabela = \"conteudo='$valor'\";\nbreak;\n\ncase $idioma[79]:\n$tabela = TABELA_DIRECAO;\n$campo_tabela = \"conteudo='$valor'\";\nbreak;\n\t\n};\n\n// query\n$query = \"update $tabela set $campo_tabela where id='$id';\";\n\n// comando executa\ncomando_executa($query);\n\n}", "function alterarCarta($carta, $idCarta, $conn){\n if($carta->getImagem() == ''){\n $sql = \"UPDATE carta SET Nome='\" . $carta->getNome() . \"',Descricao='\" . $carta->getDescricao() . \"' WHERE IdCarta =\" . $idCarta;\n }else{\n $sql = \"UPDATE carta SET Nome='\" . $carta->getNome() . \"',Descricao='\" . $carta->getDescricao() . \"',Imagem='\" . $carta->getImagem() . \"' WHERE IdCarta =\" . $idCarta;\n }\n if($conn->query($sql) == TRUE){\n return \"Carta atualizada com sucesso!\\nVoltando para o menu\";\n } else {\n return \"Erro de alteração:\".$conn->error;\n }\n }", "public function updateItem()\n {\n $this->addSellIn(-1);\n\n if ($this->isExpiredItem()) {\n $this->addQuality(-2);\n } else {\n $this->addQuality(-1);\n }\n }", "public function alterar($id,$dados){\n $produto = $this->dao->buscarPorId($id);//busca o produto no banco para em seguida ser alterado\n if(!empty($dados['nome'])){//caso nome nao estiver vazia\n $produto->setNome($dados['nome']);//altera o nome no banco de dados\n }\n if(!empty($dados['preco'])){//caso prešo nao estiver vazia\n $produto->setPreco($dados['preco']);//altera o prešo no banco de dados\n }\n if(!empty($dados['quantidade'])){//caso quantidade nao estiver vazia\n $produto->setQuantidade($dados['quantidade']);//altera a quantidade no banco de dados\n } \n return $this->dao->alterar($produto);//chama o metodo que altera produto no banco\n }", "public function alterar(){\n $id = $_GET[\"arg0\"];\n \n $contatoDao = new ContatoDAO();\n $contato = $contatoDao->getContato($id);\n \n $dado[\"id\"] = $contato->getId(); // estou trazendo o id pq na function update nao esta pegando o id pelo GET\n \n // MANDANDO PARA VIEW\n $dado[\"nomeCompleto\"] = $contato->getNomeCompleto();\n $dado[\"email\"] = $contato->getEmail();\n $dado[\"assunto\"] = $contato->getAssunto();\n $dado[\"mensagem\"] = $contato->getMensagem(); //nao esta carregando\n \n $this->view->renderizar(\"header\");\n \n $this->view->interpolar(\"contatoAlterar\",$dado);\n \n $this->view->renderizar(\"footer\");\n \n }", "final protected function modificarArticulo(){\n\t\tif($this->articulo != null){\n\t\t\tthrow new Exception('Articulo sin datos');\n\t\t}\n\t\tDataAccess::update($this->articulo);\t\n\t}", "public function editItem($input){\n\t\treturn $this->items->where('id', $input['id'])->update($input);\n\t}", "function editItem($accountId, $calendarId, $itemId, $type, $name, $note, $reminder, $location, $colour, array $args = array()){\n\n if (hasCalendarPermission($accountId, $calendarId, 'update') &&\n\t\t\t$accountId && $calendarId && $itemId && $type){\n\n global $conn;\n \t//print_r($args);\n //echo \"<br> ******* Editing item with Id = \" . $itemId . \" ******* <br>\";\n\n \t// Checking for query onto Items -----------------------------------------\n\n $query = \"UPDATE Items SET \";\n $params = array();\n\n if ($name){\n \tarray_push($params, \"name = '$name'\");\n }\n\n if ($note){\n \tarray_push($params, \"note = '$note'\");\n }\n\n if ($reminder){\n \tarray_push($params, \"reminder = '$reminder'\");\n }\n\n if ($location){\n \tarray_push($params, \"location = '$location'\");\n }\n\n // Note that colour will ALWAYS be a param,\n // so even if there is no change, it will trigger\n // the query.\n if ($colour){\n \tarray_push($params, \"colour = '$colour'\");\n }\n\n \tif (!empty($params)){\n\t // Adding commas in the right places:\n\t for ($i = 0; $i < count($params)-1; $i++){\n\t $query .= $params[$i] . \", \";\n\t }\n\t $query .= $params[count($params)-1] . \" WHERE itemId = $itemId;\";\n\n\t //echo(\"RESULTING QUERY: \" . $query);\n\t mysqli_query($conn, $query);\n\t\t\t//echo(mysqli_error($conn));\n\n\t $query_success = checkUpdateSuccess($conn, $query);\n\n\t if (!$query_success) {return false;}\n\t } // end if(!empty($params))\n\n\t // Checking for query onto EventItems/TaskItems --------------------------\n\n if ($type){\n\n \t$type_params = array();\n\n\t if ($type == 'event'){\n\t \t$type_query = \"UPDATE EventItems SET \";\n\t\t if (isset($args['startDate'])){\n\t\t $startDate = $args['startDate'];\n\t\t array_push($type_params, \"startDate = '$startDate'\");\n\t\t }\n\n\t\t if (isset($args['endDate'])){\n\t\t $endDate = $args['endDate'];\n\t\t array_push($type_params, \"endDate = '$endDate'\");\n\t\t }\n\t \t}\n\t \telse if ($type == 'task'){\n\t \t\t$type_query = \"UPDATE TaskItems SET \";\n\t \t\tif (isset($args['dueDate'])){\n\t\t $dueDate = $args['dueDate'];\n\t\t array_push($type_params, \"dueDate = '$dueDate'\");\n\t\t }\n\n\t\t if (isset($args['completionDate'])){\n\t\t $completionDate = $args['completionDate'];\n\t\t array_push($type_params, \"completionDate = '$completionDate'\");\n\t\t }\n\t \t}\n\n\t \tif (!empty($type_params)){\n\t\t \t//Adding commas in the right places:\n\t\t for ($i = 0; $i < count($type_params)-1; $i++){\n\t\t $type_query .= $type_params[$i] . \", \";\n\t\t }\n\t\t $type_query .= $type_params[count($type_params)-1] . \" WHERE itemId = $itemId;\";\n\n\t\t //echo(\"RESULTING QUERY: \" . $type_query);\n\t\t mysqli_query($conn, $type_query);\n\n\t\t return checkUpdateSuccess($conn, $type_query);\n\t\t }\n\t \telse {return true;} // end if($type_query)\n\t }\n\t else {return true;} // end if($type)\n }\n else{\n echo \"<br> !!!!!! COULD NOT Update Item with ItemId = \" . $itemId . \" !!!!!! <br>\";\n return false;\n }\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resolves a Compleet\Matcher instance for the supplied type.
protected function matcher($type) { if ( !is_null($this->matcher) && $this->matcher->getType() == $type ) return $this->matcher; $this->matcher = $this->getCompleetObject('Compleet\Matcher', $type); return $this->matcher; }
[ "public function make($type)\n {\n if ($instance = array_get($this->resolved, $type)) {\n return $instance;\n }\n\n return $this->build($type);\n }", "public function getMatcher()\n {\n if (!$this->matcher) {\n if ($cache = $this->getCache('%s/%s.matcher.cache')) {\n\n $class = sprintf('UrlMatcher%s', $cache['key']);\n\n if (!$cache['fresh']) {\n $options = ['class' => $class, 'base_class' => $this->options['matcher']];\n $this->writeCache($cache['file'], (new PhpMatcherDumper($this->getRouteCollection()))->dump($options));\n }\n\n require_once $cache['file'];\n\n $this->matcher = new $class($this->context);\n\n } else {\n\n $class = $this->options['matcher'];\n\n $this->matcher = new $class($this->getRouteCollection(), $this->context);\n }\n }\n\n return $this->matcher;\n }", "public function fetchByType($type)\n {\n if (! $this->hasType($type)) {\n throw new Exception\\ResolverTypeNotFoundException();\n }\n\n $resolvers = new self();\n\n foreach ($this as $resolver) {\n if ($resolver instanceof $type) {\n $resolvers->attach($resolver);\n }\n }\n\n if (1 === count($resolvers)) {\n return $resolvers->queue->extract();\n }\n\n return $resolvers;\n }", "public function getMatcher()\n {\n if (null !== $this->matcher) {\n return $this->matcher;\n }\n\n return $this->matcher = new $this->options['matcher_class']($this->getRouteCollection(), $this->controllers, $this->container);\n }", "private function findResolver($type)\n {\n foreach ($this->resolvers as $resolver) {\n if ($resolver->hasType($type)) {\n return $resolver;\n }\n }\n\n return null;\n }", "public function getMatcher()\n {\n if (null !== $this->matcher) {\n return $this->matcher;\n }\n\n if (null === $this->options['cache_dir'] || null === $this->options['matcher_cache_class']) {\n return $this->matcher = new $this->options['matcher_class']($this->getEmoticonCollection());\n }\n\n $class = $this->options['matcher_cache_class'];\n $cacheFile = $this->options['cache_dir'].'/'.$class.'.php';\n $cache = new ConfigCache($cacheFile, $this->options['debug']);\n if (!$cache->isFresh($class)) {\n $dumper = new $this->options['matcher_dumper_class']($this->getEmoticonCollection());\n\n $options = array(\n 'class' => $class,\n 'base_class' => $this->options['matcher_base_class'],\n );\n\n $cache->write($dumper->dump($options), $this->getEmoticonCollection()->getResources());\n }\n\n require_once $cacheFile;\n\n return $this->matcher = new $class();\n }", "public function findByType($type);", "public function getMatcher(): UrlMatcherInterface;", "static function getFinder($type)\n {\n //Tweak the PEAR path from Models to Mappers\n //Since the directory structure will trip\n //up the mapping to the correct directory\n //for locating the various mapper classes\n $pearSegments = explode('_', $type);\n $pearSegments[2] = \"Mappers\";\n $tweakedType = implode('_', $pearSegments);\n $mapper = \"{$tweakedType}Mapper\";\n if (class_exists($mapper)) {\n return new $mapper();\n }\n throw new Local_Exceptions_AppException(__METHOD__ . \" says that we have an unknown mapper: $mapper\");\n }", "public function resolve(string $type, string $code): string;", "public function getMatcher(): UrlMatcherInterface\n {\n if (null !== $this->matcher) {\n return $this->matcher;\n }\n return $this->matcher = new NodeUrlMatcher(\n $this->context,\n $this->em,\n $this->themeResolver,\n $this->stopwatch,\n $this->logger,\n $this->preview\n );\n }", "public function resolve($type)\n {\n if (!is_string($type)) {\n throw new InvalidArgumentException(\n 'Can not resolve class ident: type must be a string'\n );\n }\n\n // Normalize requested type with prefix / suffix, if applicable.\n $type = $this->prefix . $type . $this->suffix;\n\n $capitalizeNext = function (&$i) {\n $i = ucfirst($i);\n };\n\n $capitals = $this->capitals;\n foreach ($capitals as $cap) {\n $expl = explode($cap, $type);\n array_walk($expl, $capitalizeNext);\n $type = implode($cap, $expl);\n }\n\n $replacements = $this->replacements;\n foreach ($replacements as $rep => $target) {\n $type = str_replace($rep, $target, $type);\n }\n\n $class = '\\\\' . trim($type, '\\\\');\n\n return $class;\n }", "protected function _createDefaultMatcher(): MatcherInterface\n {\n return new Matcher();\n }", "public function resolveType(string $type): ?GraphQLType;", "protected function getRouter_MatcherService()\n {\n $this->services['router.matcher'] = $instance = new \\Symfony\\Cmf\\Component\\Routing\\NestedMatcher\\NestedMatcher($this->get('router.route_provider'));\n\n $instance->setFinalMatcher($this->get('router.matcher.final_matcher'));\n $instance->addRouteFilter($this->get('content_type_header_matcher'), 0);\n $instance->addRouteFilter($this->get('accept_header_matcher'), 0);\n\n return $instance;\n }", "public function findByType($type)\n {\n return $this->find(array('type' => $type));\n }", "public function provider()\n {\n if (!$this->object->getValue()) {\n return null;\n }\n\n /* @var \\Anomaly\\VideoFieldType\\Matcher\\Contract\\MatcherInterface $matcher */\n $matcher = dispatch_now(new GetMatcher($this->object->getValue()));\n\n return $matcher->getProvider();\n }", "public function getMatcher()\n {\n if (is_null($this->matcher)) {\n $this->matcher = new UrlMatcher($this->getRouteCollection(), $this->getContext());\n }\n\n return $this->matcher;\n }", "public function getProvider($type);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get medication that were prescribed for a prescription
public function GetMedicationForPrescription($prescriptionId) { $query = " SELECT med.medicationId, med.name, med.description, pmd.unit, pmd.dosage FROM medication med LEFT JOIN prescription_medication_drug pmd ON med.medicationId = pmd.medicationId WHERE pmd.prescriptionId = ? ORDER BY med.createdate "; //prepare query statement $stmt = $this->conn->prepare($query); //Execute query $stmt->execute(array($prescriptionId)); $result = $stmt->fetchAll(PDO::FETCH_ASSOC); return $result; }
[ "public function getMedicationDispense()\n {\n return $this->MedicationDispense;\n }", "public function getRecommedations()\n {\n return $this->recommedations;\n }", "function wcb_the_speaker() {\n\t$query = wcb_speaker_query();\n\treturn $query->the_post();\n}", "public function prescriptions()\n {\n return $this->hasMany('App\\Prescription', 'patient_id', 'id');\n }", "public function getPrescriptions() {\n return $this->hasMany(Prescription::className(), ['patient_id' => 'id']);\n }", "public function getPrescriptionStatus();", "public function medication_get(){\n\t\ttry {\n\t\t\t$medications = $this->PM->getMedications($this->input->get('patient_id'));\n\t\t\t$this->response(array(\n\t\t\t\t'status' => 'TRUE',\n\t\t\t\t'medications' => $medications,\n\t\t\t));\n\t\t}catch(Exception $e){\n\t\t\t$this->response(array(\n\t\t\t\t'status' => 'FALSE',\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t));\n\t\t}\n\t}", "public function getMedicamentos()\n {\n return $this->medicamentos;\n }", "public function getPublishingPrinciples();", "public function getMedida1()\n {\n return $this->medida1;\n }", "public function prescriptions()\n {\n return $this->hasMany(Prescription::class);\n }", "public function getSpech()\n {\n return $this->spech;\n }", "public function getMedida() {\n return $this->iMedida;\n }", "function Inscriptions_Noof_Presents($inscription=array())\n {\n if (empty($inscription))\n {\n return $this->Language_Message(\"Inscriptions_NoPresents_Message\");\n }\n \n return\n $this->ParticipantsObj()->Sql_Select_NHashes\n (\n $this->UnitEventWhere\n (\n array\n (\n \"Friend\" => $inscription[ \"Friend\" ],\n \"Presence\" => 2,\n )\n )\n );\n }", "public function getSpeechTranscriptions()\n {\n return $this->speech_transcriptions;\n }", "public function prescriptions()\n {\n return $this->hasManyThrough( Prescription::class, Appointment::class);\n }", "public function getprescriptionId()\n {\n return $this->prescription_id;\n }", "public function getMed_cuit()\n {\n return $this->med_cuit;\n }", "public static function getMedicals() {\n\t\t/**\n\t\t * array all medical sets\n\t\t */\n\t\t$medicals = array ();\n\t\t\n\t\t$medical1 = new Medical ();\n\t\t$medical1->setIdMedical(1);\n\t\t$medical1->setBenefit(\"bloating\");\n\t\t$medicals [$medical1->getIdMedical ()] = $medical1;\n\t\t\n\t\t$medical2 = new Medical();\n\t\t$medical2->setIdMedical(2);\n\t\t$medical2->setBenefit(\"vomiting\");\n\t\t$medicals [$medical2->getIdMedical ()] = $medical2;\n\t\t\n\t\t$medical3 = new Medical();\n\t\t$medical3->setIdMedical(3);\n\t\t$medical3->setBenefit(\"headache\");\n\t\t$medicals [$medical3->getIdMedical ()] = $medical3;\n\t\t\n\t\treturn $medicals;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
To show the list of movement in "historic" Page
public function list() { $mouvements = Movement::join('articles', 'movements.article_id', '=', 'articles.id') ->join('movement_types', 'movement_types.id', '=', 'movements.movement_type_id') ->select('articles.name as articleName', 'movements.quantity', 'movements.date_time', 'movement_types.name') ->orderBy('date_time') ->get(); return view('historic', [ 'mouvements' => $mouvements, ]); }
[ "private function loan_history_list(){\n $results = $this->dt->loan_history_list();\n echo $results;\n }", "public function indexHistoric()\n {\n $events = Event::with('contact')->historic()->orderBy('start', 'desc')->paginate(15);\n\n return view('event.index', ['events' => $events, 'title' => 'Past Events', 'show_locations' => false]);\n }", "public function DisplayHistory();", "public function booking_history()\n {\n\t\t\t$data[\"activetab\"]=\"bookinghistory\";\n $data[\"pageTitle\"]=\"Booking History\";\n $data[\"pageclass\"] = \"booking_history listingpage\";\n $data[\"bookings\"] = $this->BookingModel->getBookinghistory();\n\n $this->loadView('booking/booking_history/booking_history',$data);\n }", "public function all_history_teaching(){\n $data= array(\n 'post'=>$this->mTeaching->get_teaching_history()\n );\n master_view(\"backend/teaching/history_teaching\",$data);\n }", "public function getHistory() {\n $rentalModel = new RentalModel($this->db);\n\n try {\n $rentals = $rentalModel->getAll();\n } catch (\\Exception $e) {\n $properties = ['errorMessage' => 'Error getting rental history.'];\n return $this->render('error.twig', $properties);\n }\n\n $properties = [\"rentals\" => $rentals];\n return $this->render('history.twig', $properties);\n }", "public function historyAction() {\n $jobRepo = $this->get('job.repository');\n $scheduler = $this->get('scheduler.scheduler');\n \n $jobs = array();\n \n // Try to find the jobs of current user, if he is authenticated and not anonymous\n if ($this->get('security.context')->getToken() && $this->get('security.context')->isGranted('IS_AUTHENTICATED_FULLY'))\n $jobs = $jobRepo->getJobsForUser($this->get('security.context')->getToken()->getUsername(), $this->container->getParameter('scheduler.history_length'));\n \n return $this->render('GenouestSchedulerBundle:Scheduler:history.html.twig', array('jobs' => $jobs, 'scheduler' => $scheduler));\n }", "public function history()\n {\n $member = Security::getCurrentUser();\n $list = PaginatedList::create(\n $member->HistoricInvoices(),\n $this->owner->getRequest()\n );\n\n $this\n ->owner\n ->customise([\n \"Title\" => _t('Orders.OrderHistory', 'Order History'),\n \"MenuTitle\" => _t('Orders.OrderHistory', 'Order History'),\n \"Content\" => $this->owner->renderWith(\n \"SilverCommerce\\\\OrdersAdmin\\\\Includes\\\\OrdersList\",\n [\"List\" => $list]\n )\n ]);\n\n $this->owner->extend(\"updateHistoricOrders\", $orders);\n\n return $this\n ->owner\n ->renderWith([\n 'AccountController_history',\n AccountController::class . '_history',\n 'AccountController',\n AccountController::class,\n 'Page'\n ]);\n }", "function historia()\n {\n\t\t$pagina=$this->load_template('History of Bolivia');\t\t\t\t\n\t\t$html = $this->load_page('app/views/default/modules/m.historia.php');\n\t\t$pagina = $this->replace_content('/\\#CONTENIDO\\#/ms' ,$html , $pagina);\n\t\t$this->view_page($pagina);\n }", "public function guest_history()\n\t{\n\t $requested_mod = $this->uri->segment(2).'/'.$this->uri->segment(3);\n\t\n\t\tif(!$this->acl->hasPermission($requested_mod))\n\t\t{\n\t\t\tredirect('admin/dashboard');\n\t\t}\n\n\t\tif($this->session->userdata('logged_in_user')->sb_hotel_id !=0)\n\t\t{\n\t\t\t$this->data['title'] = 'Arrivals';\n\t\t\t$this->data['guest_list']\t= $this->Guest_model->get_guest_data($this->session->userdata('logged_in_user')->sb_hotel_id);\n\t\t\t$this->template->load('page_tpl', 'hotel_guest_arrivals_vw',$this->data);\n\t\t}\n\t}", "public function getLoanHistory() {\r\n\t\r\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $airplaneHistories = $em->getRepository('FlightsBundle:AirplaneHistory')->findAll();\n\n return $this->render('airplanehistory/index.html.twig', array(\n 'airplaneHistories' => $airplaneHistories,\n ));\n }", "public function Lista() {\n $sql = \"SELECT id,id_reserva,total_pagar,estado,descripcion from historial_pago where estado='pagado'\";\n $this->objCon->Execute($sql);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MccASMemberBundle:History')->findAll();\n\n return $this->render('MccASMemberBundle:History:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function history()\n {\n if(!Auth::user()->isAdmin()) {\n abort(402, \"Nope.\");\n }\n\n $services = Service::whereDate('date', '<=', Carbon::now())->where('client_id', '=', Auth::user()->currentclient_id)\n ->orderBy('date', 'desc')->with('openpositions')\n ->with('positions.qualification')\n ->with('positions.user')\n ->paginate(30);\n\n $user = User::where(['id' => Auth::user()->id])->with('qualifications')->first();\n $isAdmin = $user->isAdmin();\n $servicesHoliday = $user->services_inHolidayList();\n\n return view('service.history', compact('services', 'user', 'servicesHoliday', 'isAdmin'));\n }", "public function listHistory(): array;", "static public function wpp_ajax_show_xml_imort_history() {\n global $wpdb;\n\n $imported = $wpdb->get_results( \"SELECT post_title, post_id, meta_value FROM {$wpdb->postmeta} pm LEFT JOIN {$wpdb->posts} p ON pm.post_id = p.ID WHERE meta_key = 'wpp_import_time' AND meta_value != '' AND post_title IS NOT NULL ORDER BY meta_value DESC LIMIT 0, 500\" );\n\n echo \"<ol style='padding-left: 10px;'>\";\n foreach( $imported as $object )\n echo '<li><a href=\"' . get_permalink( $object->post_id ) . '\">' . $object->post_title . '</a> Edit: <a href=\"' . get_edit_post_link( $object->post_id ) . ' \">( ' . $object->post_id . ' )</a> - ' . human_time_diff( $object->meta_value ) . ' ago</li>';\n echo \"</ol>\";\n\n die();\n }", "public function listAction()\n {\n try {\n\n $pageNumber = $this->getParam($this->navigationParamName, null);\n\n // Get key that define what type of chronicles to display\n $key = $this->getParam(\"pageKey\", self::PAGE_KEY_ANY_GROUPS);\n\n // Get 100 last chronicles from cache\n switch ($key) {\n case self::PAGE_KEY_ANY_GROUPS :\n $chronicles = ChronicleSvc::getInstance()->getLastChronicles(100);\n break;\n case self::PAGE_KEY_BLOGGERS :\n $chronicles = ChronicleSvc::getInstance()->getLastChronicles(100, GroupTypes::BLOGGER);\n break;\n case self::PAGE_KEY_BOOKSTORES :\n $chronicles = ChronicleSvc::getInstance()->getLastChronicles(100, GroupTypes::BOOK_STORE);\n break;\n }\n\n // Add all chronicle actions common items to model view\n $this->addCommonItemsToModelView();\n\n // Add chronicles list action common items to model view\n $this->addCommonListItemsToModelView($key, $chronicles, $pageNumber, null, null, null);\n } catch (\\Exception $e) {\n Trace::addItem(sprintf(\"Une erreur s'est produite dans \\\"%s->%s\\\", TRACE : %s\\\"\", get_class(), __FUNCTION__, $e->getTraceAsString()));\n $this->forward(\"error\", \"error\", \"default\");\n }\n }", "public function get_history()\r\n\t\t{\r\n\t\t\t$userID = $this->input->post('u_id');\r\n\t\t\t$month = $this->input->post('month');\r\n\t\t\t$year = $this->input->post('year');\r\n\t\t\t$this->db->order_by('start_date', 'ASC');\r\n\r\n\t\t\t$result = $this->admin_model->getmemberHistory($userID,$year,$month);\r\n\r\n\r\n\t\t\tforeach ($result as $row){\r\n\t\t\t\techo Date(\"F d\", strtotime($row[\"start_date\"])) . ',' . Date(\"F d\", strtotime($row[\"end_date\"])) . ',' . $row[\"required_hours\"] . ',' . $row[\"completed_hours\"] . ',' . $row[\"hours_given\"] . ',' . $row[\"hours_received\"] . ',' . $row[\"history_id\"] . '~' ; \r\n\t\t\t}\r\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Method: Language::getDefaultLanguage( $conn ) Description: By providing $conn (MySqli connection), it returns the default Language object
public static function getDefaultLanguage($conn) { $lang = new self(); $result = $conn->query("SELECT * FROM language lang INNER JOIN config conf ON conf.config_value = lang.lang_code WHERE conf.config_key = 'MAIN_LANGUAGE'"); if ($record = $result->fetch_assoc()) { $lang->loadByData($record['lang_id'], $record['lang_name'], $record['lang_code']); return $lang; } }
[ "public function getDefaultLanguage();", "public static function find_default()\n\t{\n\t\t// All available languages\n\t\t$available_languages = Lang::available_languages();\n\n\t\t// Look for language cookie first\n\t\tif ($lang = Cookie::get(Lang::$cookie))\n\t\t{\n\t\t\tif (isset($available_languages[$lang]))\n\t\t\t{\n\t\t\t\t// Valid language found in cookie\n\t\t\t\treturn $lang;\n\t\t\t}\n\n\t\t\t// Delete cookie with invalid language\n\t\t\tCookie::delete(Lang::$cookie);\n\t\t}\n\n\t\t// Parse HTTP Accept-Language headers\n\t\tforeach (Request::accepted_languages() as $lang => $quality)\n\t\t{\n\t\t\tif (isset($available_languages[$lang]))\n\t\t\t{\n\t\t\t\t// Return the first language found (the language with the highest quality)\n\t\t\t\treturn $lang;\n\t\t\t}\n\t\t}\n\n\t\t// Return the hard-coded default language as final fallback\n\t\treturn Lang::$default;\n\t}", "function myLanguage () {\n\t\tif ($this->iExist()) :\n\t\t\t$r = $mysqli->query(\"SELECT language FROM students WHERE student_id = \".$this->myID().\" LIMIT 1\") or die( $mysqli->error );\n\t\t\t$row = $r->fetch_array(MYSQLI_ASSOC);\n\t\t\treturn $row['language'];\n\t\telse:\n\t\t\treturn NULL;\n\t\tendif;\n\t}", "public function getLangDefault(): string;", "public static function getDefaultLanguage()\n {\n if(isset($_SESSION['site']['default_localization'])){\n return $_SESSION['site']['default_localization'];\n }else{\n return 'en_US';\n }\n }", "public function getDefaultLanguage() {\n return $this->defaultLang;\n }", "function get_default_language() {\n $default = $this->options[DEFAULT_LANG];\n if (!isset(transposh_consts::$languages[$default])) {\n if (defined('WPLANG') && isset(transposh_consts::$languages[WPLANG])) {\n $default = WPLANG;\n } else {\n $default = \"en\";\n }\n }\n return $default;\n }", "public function default_language() {\n\t\treturn $this->_config->get('default');\n\t}", "function hypha_getDefaultLanguage() {\n\t\tglobal $hyphaXml;\n\t\treturn $hyphaXml->documentElement->getAttribute('defaultLanguage');\n\t}", "function default_lang()\n\t{\n\t\tglobal $CFG;\n\t\t$lang = array_search($CFG->config['language'], $this->languages);\n\t\treturn $lang;\n\t}", "private function fetchSrpLanguageByStockAdminDefaultLanguage(): \\Sportisimo\\Erp\\Model\\Core\\Entities\\Language\r\n {\r\n if ($this->defaultSrpAdminLanguage !== null)\r\n {\r\n return $this->defaultSrpAdminLanguage;\r\n }\r\n\r\n $defaultAdminLanguage = $this->context->getDefaultAdminLanguage();\r\n\r\n $this->defaultSrpAdminLanguage = new \\Sportisimo\\Erp\\Model\\Core\\Entities\\Language($this->srpDatabase, null, $defaultAdminLanguage->getCode());\r\n\r\n return $this->defaultSrpAdminLanguage;\r\n }", "public static function switchLanguageToDefault()\n\t{\n\t\treturn self::switchLanguage();\n\t}", "function getDefaultLocale()\n {\n return $this->getLanguagesArray()[0][0];\n }", "function getCurrentLanguage(){\n\t$default_language = 'en';\n\t\n\tif(isset($_SESSION['language'])){\n\t\treturn $_SESSION['language'];\n\t}else{\n\t\treturn $default_language;\n\t}\n}", "public static function getDefaultLanguage()\n\t{\n\t\treturn ivXml::readFromFile(self::_getDefaultLanguageFile());\n\t}", "public function get_defualt_lang(){\n\t\treturn 1;\n\t\t//for get lang id by default =1\n/* $query = $this->db->get_where($this->_table_name, array('default' => 1), 1);\n \n if ($query->num_rows() > 0)\n {\n return $query->row()->id;\n }\n else\n {\n\t return 2;\n }*/\n }", "private static function getCurrentLang() {\n if (isset($_GET['setlang'])) {\n return $_GET['setlang'];\n } elseif (isset($_GET['lang'])) {\n return $_GET['lang'];\n } elseif (isset($_COOKIE['language'])) {\n return $_COOKIE['language'];\n } else {\n return return_i18n_default_language();\n }\n }", "private function get_language()\n {\n // For user implementation\n }", "public function getLanguage();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Imp. 23/08/21, Carlos, Para el filtro de mostrar Asesores de ventas en prospectos (solo ocurre en el caso Super Admin, direccion, redes)
static public function opcionAsesoresProspectos(){ $userC = JFactory::getUser(); $groups = JAccess::getGroupsByUser($userC->id, false); $options = array(); $db = JFactory::getDbo(); $tbl_users = $db->getPrefix().'users'; $tbl_user_usergroup_map = $db->getPrefix().'user_usergroup_map'; $tbl_sasfe_datos_catalogos = $db->getPrefix().'sasfe_datos_catalogos'; $queryIdGteVentas = ""; // if(in_array("19", $groups) || in_array("11", $groups)){ if(in_array("11", $groups)){ $queryIdGteVentas = ' AND usuarioIdGteJoomla= '.$userC->id; } $options[] = JHtml::_('select.option', '', "Agentes (Todos)"); // Solo obtener aquellos asesores del propio gerente if($queryIdGteVentas!=""){ $query = " SELECT * FROM $tbl_sasfe_datos_catalogos WHERE catalogoId=3 AND activo='1' AND nombre !='' AND usuarioIdJoomla IS NOT NULL $queryIdGteVentas ORDER BY nombre ASC "; // echo $query; // exit(); $db->setQuery($query); $db->query(); $rows = $db->loadObjectList(); foreach($rows as $item){ $options[] = JHtml::_('select.option', $item->usuarioIdJoomla, $item->nombre); } } return $options; }
[ "function filterProvereniSignali($spodelenie)\n{\n\t# IAG\n\tif(strlen($spodelenie == 1) && $spodelenie = 1)\n\t{\n\t\t$where = \"1 = 1 AND r.proveren = 1\";\n\t}\n\t\n\t# DGS\n\tif(strlen($spodelenie) == 5)\n\t{\n\t\t$where = \"s.pod_id = \".$spodelenie.\" AND r.proveren = 1\";\n\t}\n\n\t# RDG\n\tif(strlen($spodelenie) == 3 && $spodelenie > 100 && $spodelenie < 117)\t\n\t{\n\t\t$where = \"s.glav_pod = \".$spodelenie.\" AND r.proveren = 1\";\n\t}\n\t\n\t# DP\n\tif(strlen($spodelenie) == 3 && $spodelenie > 200 && $spodelenie < 207)\t\n\t{\n\t\t$where = \"dgs.DP_ID = \".$spodelenie.\" AND r.proveren = 1\";\n\t}\n\t\t\n\treturn $where;\n}", "protected function getFilter()\n {\n \t$filtros = \" 1 = 1 \";\n if (Session::getInstance()->get($this->namefilter)!=\"\") {\n $filters =(object)Session::getInstance()->get($this->namefilter);\n if ($filters->contenidos_fecha != '') {\n $filtros = $filtros.\" AND contenidos_fecha LIKE '%\".$filters->contenidos_fecha.\"%'\";\n }\n if ($filters->contenidos_seccion != '') {\n $filtros = $filtros.\" AND contenidos_seccion ='\".$filters->contenidos_seccion.\"'\";\n }\n if ($filters->contenidos_estado != '') {\n $filtros = $filtros.\" AND contenidos_estado ='\".$filters->contenidos_estado.\"'\";\n }\n if ($filters->contenidos_titulo != '') {\n $filtros = $filtros.\" AND contenidos_titulo LIKE '%\".$filters->contenidos_titulo.\"%'\";\n }\n\t\t}\n return $filtros;\n }", "public function ListarProyectosInvestigadorPrincipalAdmin(){\n $this->ConectarBD();\n $sql= $this->mysqli->query(\"SELECT * FROM proyecto p, docente_proyecto dp WHERE p.CodigoProy = dp.CodigoProy AND dp.TipoParticipacionProy = 'Investigador Principal'ORDER BY p.AnhoInicioProy DESC\");\n\n return $sql;\n }", "public function filterProspectAction(Request $request)\n {\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$user = $this->get('security.context')->getToken()->getUser();\n\t\t$userId = $user->getId();\n $postdata = $request->query->all();\n\n if (!isset($postdata['property_value_min'])) $postdata['property_value_min'] = 0;\n if (!isset($postdata['property_value_max'])) $postdata['property_value_max'] = 10000000; //10000000;\n\n if (!isset($postdata['ltv_min'])) $postdata['ltv_min'] = 0;\n if (!isset($postdata['ltv_max'])) $postdata['ltv_max'] = 100; //100;\n\n if (!isset($postdata['loan_age_min'])) $postdata['loan_age_min'] = 0;\n if (!isset($postdata['loan_age_max'])) $postdata['loan_age_max'] = 10; //10;\n\n\t\tif (!isset($postdata['income_min'])) $postdata['income_min'] = 0;\n if (!isset($postdata['income_max'])) $postdata['income_max'] = 5000000; //5000000;\n\n if (!isset($postdata['property_owned_min'])) $postdata['property_owned_min'] = 1;\n if (!isset($postdata['property_owned_max'])) $postdata['property_owned_max'] = 10; //10;\n\n if (!isset($postdata['age_min'])) $postdata['age_min'] = 18; //18;\n if (!isset($postdata['age_max'])) $postdata['age_max'] = 70; //70;\n\n\t\tif (!isset($postdata['assets_min'])) $postdata['assets_min'] = 0;\n if (!isset($postdata['assets_max'])) $postdata['assets_max'] = 10000000; //10000000;\n\n\t\tif (!isset($postdata['debt_min'])) $postdata['debt_min'] = 0;\n if (!isset($postdata['debt_max'])) $postdata['debt_max'] = 5000000; //5000000;\n\n\t\tif (!isset($postdata['certainty'])) $postdata['certainty'] = 0;\n\t\tif (!isset($postdata['sector'])) $postdata['sector'] = 0;\n\n\t\tif ($postdata['sector'] == 0) {\n\t\t\t$property_data = $em->getRepository('RefiBundle:Transactions')->filterProspectsBySector(0, $userId);\n\t\t} else {\n\t\t\t$property_data = $em->getRepository('RefiBundle:Transactions')->filterProspectsBySector(1, $postdata['sector']);\n\t\t}\n\t\t\n\t\t$perfect_score = 100;\n\t\t$sector = array();\n\t\tforeach($property_data as $key => $val) {\n\t\t\t$score = 0;\n\t\t\t\n\t\t\tif($postdata['property_value_min'] == $postdata['property_value_max'] && ($val['average_price'] >= $postdata['property_value_min'] || $val['average_newprice'] >= $postdata['property_value_min'])) {\n\t\t\t\t$score++;\n\t\t\t} else {\n\t\t\t\tif(($val['average_price'] >= $postdata['property_value_min'] && $val['average_price'] <= $postdata['property_value_max']) || ($val['average_newprice'] >= $postdata['property_value_min'] && $val['average_newprice'] <= $postdata['property_value_max']))\n\t\t\t\t\t$score++;\n\t\t\t}\n\n\t\t\tif($postdata['ltv_min'] == $postdata['ltv_max'] && $val['average_ltv'] >= $postdata['ltv_min']) {\n\t\t\t\t$score++;\n\t\t\t} else {\n\t\t\t\tif($val['average_ltv'] >= $postdata['ltv_min'] && $val['average_ltv'] <= $postdata['ltv_max'])\n\t\t\t\t\t$score++;\n\t\t\t}\n\n\t\t\tif($postdata['loan_age_min'] == $postdata['loan_age_max'] && $val['average_loan_age'] >= $postdata['loan_age_min']) {\n\t\t\t\t$score++;\n\t\t\t} else {\n\t\t\t\tif($val['average_loan_age'] >= $postdata['loan_age_min'] && $val['average_loan_age'] <= $postdata['loan_age_max'])\n\t\t\t\t\t$score++;\n\t\t\t}\n\n\t\t\t// if($postdata['income_min'] == $postdata['income_max'] && $val['average_income'] >= $postdata['income_min']) {\n\t\t\t\t// $score++;\n\t\t\t// } else {\n\t\t\t\t// if($val['average_income'] >= $postdata['income_min'] && $val['average_income'] <= $postdata['income_max'])\n\t\t\t\t\t// $score++;\n\t\t\t// }\n\n\t\t\tif($postdata['property_owned_min'] == $postdata['property_owned_max'] && $val['average_assets_owned'] >= $postdata['property_owned_min']) {\n\t\t\t\t$score++;\n\t\t\t} else {\n\t\t\t\tif($val['average_assets_owned'] >= $postdata['property_owned_min'] && $val['average_assets_owned'] <= $postdata['property_owned_max'])\n\t\t\t\t\t$score++;\n\t\t\t}\n\n\t\t\tif($postdata['assets_min'] == $postdata['assets_max'] && ($val['average_assets_owned'] * $val['average_newprice']) >= $postdata['assets_min']) {\n\t\t\t\t$score++;\n\t\t\t} else {\n\t\t\t\tif(($val['average_assets_owned'] * $val['average_newprice']) >= $postdata['assets_min'] && ($val['average_assets_owned'] * $val['average_newprice']) <= $postdata['assets_max'])\n\t\t\t\t\t$score++; \n\t\t\t}\n\n\t\t\tif($postdata['age_min'] == $postdata['age_max'] && $val['average_prospect_age'] >= $postdata['age_min']) {\n\t\t\t\t$score++;\n\t\t\t} else {\n\t\t\t\tif($val['average_prospect_age'] >= $postdata['age_min'] && $val['average_prospect_age'] <= $postdata['age_max'])\n\t\t\t\t\t$score++;\n\t\t\t}\n\n\t\t\t$debt = ($val['average_ltv'] / 100) * $val['average_price'];\n\t\t\tif($postdata['debt_min'] == $postdata['debt_max'] && $debt >= $postdata['debt_min']) {\n\t\t\t\t$score++;\n\t\t\t} else {\n\t\t\t\tif($debt >= $postdata['debt_min'] && $debt <= $postdata['debt_max'])\n\t\t\t\t\t$score++;\n\t\t\t}\n\n\t\t\t$temp_score = (int) (($score / 7) * 100);\n // #solution 1 ------\n\t\t\tif(isset($temp[$val['urakey']]['num_prospects']))\n\t\t\t\t$temp[$val['urakey']]['num_prospects'] += 1;\n\t\t\telse\n\t\t\t\t$temp[$val['urakey']]['num_prospects'] = 1;\n\n\t\t\tif(isset($temp[$val['urakey']]['perfect_score'])) {\n\t\t\t\tif($temp_score >= $perfect_score) {\n\t\t\t\t\t$temp[$val['urakey']]['perfect_score']++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif($temp_score >= $perfect_score) {\n\t\t\t\t\t$temp[$val['urakey']]['perfect_score'] = 1;\n\t\t\t\t} else {\n\t\t\t\t\t$temp[$val['urakey']]['perfect_score'] = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$temp_property_score = round(($temp[$val['urakey']]['perfect_score'] / $temp[$val['urakey']]['num_prospects']) * 100, 0);\n\t\t \n\t\t\tif(isset($temp_sector_score[$val['sector']])) {\n\t\t\t\t$temp_sector_score[$val['sector']] += $temp_property_score;\n\t\t\t} else {\n\t\t\t\t$temp_sector_score[$val['sector']] = $temp_property_score;\n\t\t\t}\n\n\t\t\t$sector[$val['sector']]['name'] = !empty($val['sector_name']) ? $val['sector_name'] : \"Temporary Sector Name\";\n\t\t\t$sector[$val['sector']]['sector_code'] = $val['sector'];\n\t\t\t$sector[$val['sector']]['longitude'] = $val['pr_long'];\n\t\t\t$sector[$val['sector']]['latitude'] = $val['pr_lat'];\n\t\t\t$sector[$val['sector']]['sector_score'] = 0;\n\t\t\t$sector[$val['sector']]['total_sector_prospects'] = 0;\n\n\t\t\t$sector[$val['sector']]['properties'][$val['urakey']]['longitude'] = $val['longitude'];\n\t\t\t$sector[$val['sector']]['properties'][$val['urakey']]['latitude'] = $val['latitude'];\n\t\t\t$sector[$val['sector']]['properties'][$val['urakey']]['property_score'] = $temp_property_score;\n\t\t\t$sector[$val['sector']]['properties'][$val['urakey']]['total_property_prospects'] = $temp[$val['urakey']]['perfect_score'];\n\n\t\t\tif($temp_score >= $perfect_score) {\n\t\t\t\t$sector[$val['sector']]['properties'][$val['urakey']]['prospects'][]['prospect_id'] = $val['prospectId'];\n\t\t\t}\n\t\t \t\n\t\t /* // #solution 2 ------\n\t\t\tif(isset($temp[$val['urakey']]['num_prospects'])) {\n\t\t\t\t$temp[$val['urakey']]['num_prospects'] += 1;\n\t\t\t\t$temp[$val['urakey']]['temp_score'] += $temp_score;\n\t\t\t} else {\n\t\t\t\t$temp[$val['urakey']]['num_prospects'] = 1;\n\t\t\t\t$temp[$val['urakey']]['temp_score'] = $temp_score;\n\t\t\t}\t\t\t\t\n\n\t\t\t$temp_property_score = $temp[$val['urakey']]['temp_score'] / $temp[$val['urakey']]['num_prospects'];\n\n\t\t\t$sector[$val['sector']]['name'] = !empty($val['sector_name']) ? $val['sector_name'] : \"Temporary Sector Name\";\n\t\t\t$sector[$val['sector']]['sector_code'] = $val['sector'];\n\t\t\t$sector[$val['sector']]['longitude'] = $val['pr_long'];\n\t\t\t$sector[$val['sector']]['latitude'] = $val['pr_lat'];\n\t\t\t$sector[$val['sector']]['sector_score'] = 0;\n\t\t\t$sector[$val['sector']]['total_sector_prospects'] = 0;\n\n\t\t\t$sector[$val['sector']]['properties'][$val['urakey']]['longitude'] = $val['longitude'];\n\t\t\t$sector[$val['sector']]['properties'][$val['urakey']]['latitude'] = $val['latitude'];\n\t\t\t$sector[$val['sector']]['properties'][$val['urakey']]['property_score'] = $temp_property_score;\n\t\t\t$sector[$val['sector']]['properties'][$val['urakey']]['total_property_prospects'] = $temp[$val['urakey']]['num_prospects'];\n\t\t\t\n\t\t\t$sector[$val['sector']]['properties'][$val['urakey']]['prospects'][$temp[$val['urakey']]['num_prospects'] - 1]['prospect_id'] = $val['prospectId'];\n\t\t\t$sector[$val['sector']]['properties'][$val['urakey']]['prospects'][$temp[$val['urakey']]['num_prospects'] - 1]['prospect_score'] = $temp_score;\n\t\t */\n\t\t}\n\n\t\tforeach($sector as $keys => $vals) {\n\t\t\t$temp_score = 0; $ctr = 0; $temp_prospects = 0;\n\t\t\tforeach($vals['properties'] as $keyp => $valp) {\n\t\t\t\tif($valp['property_score'] < $postdata['certainty'] || ($postdata['certainty'] == 0 && $valp['property_score'] <= $postdata['certainty'])) {\n\t\t\t\t\tunset($sector[$keys]['properties'][$keyp]);\n\t\t\t\t} else {\n\t\t\t\t\t$temp_prospects += $valp['total_property_prospects'];\n\t\t\t\t\t$temp_score++;\n\t\t\t\t}\n\t\t\t\t$ctr++;\n\t\t\t}\n\t\t\t$sector[$keys]['sector_score'] = round(($temp_score / $ctr) * 100, 0);\n\t\t\t$sector[$keys]['total_sector_prospects'] = $temp_prospects;\n\t\t}\n\n\t\t$response = new Response(json_encode($sector));\n $response->headers->set('Content-Type', 'application/json');\n\n return $response;\n }", "public function reporte1($pos)\n {\n //declarando variables del filtro\n $accioncentralizada=\"\";\n $accespecifica=\"\";\n $proyecto=\"\";\n $proyectoespecifica=\"\";\n $materiales=\"\";\n $unidades=\"\";\n $partida=\"\"; \n\n //print_r($pos); exit();\n //verificacion de filtros acciones centrales\n if($pos['accion_centralizada']!='-1')\n {\n if($pos['accion_centralizada']!='x999')\n {\n $accioncentralizada=\" and a.id=\".$pos['accion_centralizada'];\n }\n \n\n if(isset($pos['acc_especifica']) && $pos['acc_especifica']!='x999' && $pos['acc_especifica']!='')\n {\n $accespecifica=\" and b.id=\".$pos['acc_especifica'];\n }\n }\n else\n {\n $accioncentralizada=\" and a.id=-1 \";\n }\n //verificacion de filtros proyectos\n if($pos['proyectos']!='-1')\n {\n if($pos['proyectos']!='x999')\n {\n $proyecto=\" and a.id=\".$pos['proyectos'];\n }\n \n if(isset($pos['proyectos_especifica']) && $pos['proyectos_especifica']!='x999' && $pos['proyectos_especifica']!='')\n {\n $proyectoespecifica=\" and b.id=\".$pos['proyectos_especifica'];\n }\n }\n else\n {\n $proyecto=\" and a.id=-1 \";\n }\n\n //verificando Filtros de materiales o servicios\n if($pos['materiales-servicios']!='x999')\n {\n $materiales=\" and f.id=\".$pos['materiales-servicios'];\n }\n\n //verificando Filtros de unidad ejecutora\n if($pos['unidadessejecutoras']!='x999')\n {\n $unidades=\" and i.id=\".$pos['unidadessejecutoras'];\n }\n\n //filtro partida\n if(isset($pos['partida']) && $pos['partida']!=\"\")\n {\n $array_partida=explode(\",\", $pos['partida']);\n $partida=\" and (\";\n foreach ($array_partida as $key => $value) \n {\n $partida.= \"concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) like '%\".$value.\"%' || \";\n }\n $partida=substr($partida, 0, -3);\n $partida.=\") \";\n }\n\n //construyendo el query\n //Agrupar por partida\n if(isset($pos['partida_agrupar']))\n {\n $sql=\"\n\n select a.cod_proyecto_central, a.nombre_proyecto_central, a.cod_especifica, a.nombre_especifica, a.nombre_unidad_ejecutora, a.partida, \n sum(a.trim1) as trim1,\n format(sum(a.total_trim1),2,'de_DE') as total_trim1, \n sum(a.trim2) as trim2, \n format(sum(a.total_trim2),2,'de_DE') as total_trim2, \n sum(a.trim3) as trim3, \n format(sum(a.total_trim3),2,'de_DE') as total_trim3, \n sum(a.trim4) as trim4, \n format(sum(a.total_trim4),2,'de_DE') as total_trim4, \n format(sum(a.total_iva),2, 'de_DE') as total_iva, \n format(sum(a.total), 2, 'de_DE') as total \n from \n ( \n\n select a.codigo_accion as cod_proyecto_central, a.nombre_accion as nombre_proyecto_central, b.cod_ac_espe as cod_especifica, b.nombre as nombre_especifica, concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) as partida, i.nombre as nombre_unidad_ejecutora,\n (e.enero+e.febrero+e.marzo) as trim1, \n ((e.enero+e.febrero+e.marzo) * e.precio) as total_trim1, \n (e.abril+e.mayo+e.junio) as trim2, \n ((e.abril+e.mayo+e.junio) * e.precio) as total_trim2, \n (e.julio+e.agosto+e.septiembre) as trim3, \n ((e.julio+e.agosto+e.septiembre) * e.precio) as total_trim3, \n (e.octubre+e.noviembre+e.diciembre) as trim4, \n ((e.octubre+e.noviembre+e.diciembre) * e.precio) as total_trim4, \n (round((((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio)/e.iva))) as total_iva, \n (((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio) + round((((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio)/e.iva))) as total \n from \n accion_centralizada as a \n inner join accion_centralizada_accion_especifica as b on a.id=b.id_ac_centr \n inner join accion_centralizada_ac_especifica_uej as c on b.id=c.id_ac_esp \n inner join accion_centralizada_asignar as d on c.id=d.accion_especifica_ue \n inner join accion_centralizada_pedido as e on d.id=e.asignado \n inner join materiales_servicios as f on e.id_material=f.id \n inner join unidad_medida as g on f.unidad_medida=g.id \n inner join presentacion as h on f.presentacion=h.id \n inner join unidad_ejecutora as i on c.id_ue=i.id \n where 1=1 \n \".$accioncentralizada.$accespecifica.$materiales.$unidades.$partida.\"\n\n union all\n\n SELECT a.codigo_proyecto as cod_proyecto_central, a.nombre as nombre_proyecto_central, b.codigo_accion_especifica as cod_especifica, b.nombre as nombre_especifica, concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) partida, i.nombre as nombre_unidad_ejecutora, \n (d.enero+d.febrero+d.marzo) as trim1, \n ((d.enero+d.febrero+d.marzo) * d.precio) as total_trim1, \n (d.abril+d.mayo+d.junio) as trim2, \n ((d.abril+d.mayo+d.junio) * d.precio) as total_trim2, \n (d.julio+d.agosto+d.septiembre) as trim3, \n ((d.julio+d.agosto+d.septiembre) * d.precio) as total_trim3, \n (d.octubre+d.noviembre+d.diciembre) as trim4, \n ((d.octubre+d.noviembre+d.diciembre) * d.precio) as total_trim4, \n (((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio)/d.iva) as total_iva, \n (((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio) + round((((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio)/d.iva))) as total \n FROM proyecto as a \n inner join proyecto_accion_especifica as b on a.id=b.id_proyecto \n inner join proyecto_usuario_asignar as c on b.id=c.accion_especifica_id \n inner join proyecto_pedido as d on c.id=d.asignado \n inner join materiales_servicios as f on d.id_material=f.id \n inner join unidad_medida as g on f.unidad_medida=g.id \n inner join presentacion as h on f.presentacion=h.id \n inner join unidad_ejecutora as i on b.id_unidad_ejecutora=i.id \n where 1=1 \n \".$proyecto.$proyectoespecifica.$materiales.$unidades.$partida.\"\n\n ) \n as a \n where a.cod_proyecto_central is not null group by a.partida \n \"; \n }\n else\n {\n $sql=\"\n\n select a.cod_proyecto_central, a.nombre_proyecto_central, a.cod_especifica, a.nombre_especifica, a.nombre_unidad_ejecutora, a.partida, a.material, a.unidad_medida, a.presentacion, a.precio, a.iva, a.trim1, a.total_trim1, a.trim2, a.total_trim2, a.trim3, a.total_trim3, a.trim4, a.total_trim4, format(a.total_iva,2, 'de_DE') as total_iva, format(a.total, 2, 'de_DE') as total\n from \n (\n select a.codigo_accion as cod_proyecto_central, a.nombre_accion as nombre_proyecto_central, b.cod_ac_espe as cod_especifica, b.nombre as nombre_especifica, concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) partida, f.nombre as material, g.unidad_medida as unidad_medida, h.nombre as presentacion, e.precio,\n e.iva, i.nombre as nombre_unidad_ejecutora,\n (e.enero+e.febrero+e.marzo) as trim1, ((e.enero+e.febrero+e.marzo) * e.precio) as total_trim1, \n (e.abril+e.mayo+e.junio) as trim2, \n ((e.abril+e.mayo+e.junio) * e.precio) as total_trim2, \n (e.julio+e.agosto+e.septiembre) as trim3, \n ((e.julio+e.agosto+e.septiembre) * e.precio) as total_trim3, \n (e.octubre+e.noviembre+e.diciembre) as trim4, \n ((e.octubre+e.noviembre+e.diciembre) * e.precio) as total_trim4,\n round((((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio)/e.iva)) as total_iva,\n ((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio) + round((((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio)/e.iva)) as total\n from accion_centralizada as a\n inner join accion_centralizada_accion_especifica as b on a.id=b.id_ac_centr \n inner join accion_centralizada_ac_especifica_uej as c on b.id=c.id_ac_esp \n inner join accion_centralizada_asignar as d on c.id=d.accion_especifica_ue \n inner join accion_centralizada_pedido as e on d.id=e.asignado\n inner join materiales_servicios as f on e.id_material=f.id\n inner join unidad_medida as g on f.unidad_medida=g.id\n inner join presentacion as h on f.presentacion=h.id\n inner join unidad_ejecutora as i on c.id_ue=i.id\n where\n 1=1\n \".$accioncentralizada.$accespecifica.$materiales.$unidades.$partida.\" \n\n\n union all\n\n SELECT a.codigo_proyecto as cod_proyecto_central, a.nombre as nombre_proyecto_central, b.codigo_accion_especifica as cod_especifica, b.nombre as nombre_especifica, concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) partida, f.nombre as material, g.unidad_medida as unidad_medida, h.nombre as presentacion, d.precio,\n d.iva, i.nombre as nombre_unidad_ejecutora,\n (d.enero+d.febrero+d.marzo) as trim1, ((d.enero+d.febrero+d.marzo) * d.precio) as total_trim1, \n (d.abril+d.mayo+d.junio) as trim2, \n ((d.abril+d.mayo+d.junio) * d.precio) as total_trim2, \n (d.julio+d.agosto+d.septiembre) as trim3, \n ((d.julio+d.agosto+d.septiembre) * d.precio) as total_trim3, \n (d.octubre+d.noviembre+d.diciembre) as trim4, \n ((d.octubre+d.noviembre+d.diciembre) * d.precio) as total_trim4,\n (((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio)/d.iva) as total_iva,\n ((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio) + round((((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio)/d.iva)) as total\n FROM proyecto as a\n inner join proyecto_accion_especifica as b on a.id=b.id_proyecto\n inner join proyecto_usuario_asignar as c on b.id=c.accion_especifica_id\n inner join proyecto_pedido as d on c.id=d.asignado\n inner join materiales_servicios as f on d.id_material=f.id\n inner join unidad_medida as g on f.unidad_medida=g.id\n inner join presentacion as h on f.presentacion=h.id\n inner join unidad_ejecutora as i on b.id_unidad_ejecutora=i.id\n where\n 1=1\n \".$proyecto.$proyectoespecifica.$materiales.$unidades.$partida.\"\n\n ) as a\n where a.cod_proyecto_central is not null order by partida\n \n \";\n\n }\n\n \n //print_r($sql); exit();\n //Arreglo para el DataProvider\n $query = Yii::$app->db->createCommand($sql)->queryAll();\n //DataProvider\n $dataProvider = new ArrayDataProvider([\n 'allModels' => $query,\n ]);\n return $dataProvider;\n }", "public function filterAction()\n {\n $authenticatedUser = $this->communityUserService->getCommunityUser();\n $this->view->assign('kantons', $authenticatedUser->getPartyAdminAllowedCantons());\n $this->view->assign('demand', $this->getDemandFromSession(true));\n $statusFilters = array(\n 'active' => LocalizationUtility::translate('panelInvitations.filter.status.active', 'easyvote_education'),\n 'pending' => LocalizationUtility::translate('panelInvitations.filter.status.pending', 'easyvote_education'),\n 'archived' => LocalizationUtility::translate('panelInvitations.filter.status.archived',\n 'easyvote_education'),\n );\n $this->view->assign('statusFilters', $statusFilters);\n }", "public function getPunto_venta()\r\n {\r\n $criteria= new CDbCriteria();\r\n $criteria->condition='activo=0'; //Cargo de preventista\r\n //$criteria->condition='t.id not in (SELECT empleado_id FROM tbl_user WHERE 1 )';\r\n \r\n $lista= $this->model()->findAll($criteria); \r\n $resultados = array();\r\n foreach ($lista as $list){\r\n $resultados[] = array(\r\n 'id'=>$list->id,\r\n 'text'=> $list->punto_venta .' ('.$this->_tipo[$list->tipo].')' \r\n ); \r\n \r\n }\r\n return $resultados;\r\n }", "public function get_empresasProspectos() {\n\n $sql = \"SELECT N1.* FROM (\n SELECT\n cp.skProspecto AS id, CONCAT(cp.sNombreContacto,' - Prospecto') AS nombre\n FROM cat_prospectos cp\n WHERE cp.skEstatus = 'NU'\n UNION \n SELECT\n es.skEmpresaSocio AS id, CONCAT(e.sNombre,' (',e.sRFC,') - Cliente') AS nombre\n FROM rel_empresasSocios es\n INNER JOIN cat_empresas e ON e.skEmpresa = es.skEmpresa\n WHERE es.skEstatus = 'AC' AND e.skEstatus = 'AC' AND es.skEmpresaTipo IN ('CLIE') \"; \n\n \n $sql .= \" ) AS N1 \";\n \n\n if (isset($this->vent['sNombre']) && !empty(trim($this->vent['sNombre']))) {\n $sql .= \" WHERE N1.nombre LIKE '%\" . trim($this->vent['sNombre']) . \"%' \";\n }\n\n $sql .= \" ORDER BY N1.nombre ASC \";\n \n \n $result = Conn::query($sql);\n if (!$result) {\n return FALSE;\n }\n $records = Conn::fetch_assoc_all($result);\n utf8($records);\n return $records;\n }", "function especieMostrarRegistrosNuevos($criterio) {\n// 1: nuevos Reg Venezuela, 2: nuevos Reg PNALR, 3: Mar caribe\n\t\t\n\t\t$donde = \" nuevo_registro = $criterio OR nuevo_registro_mostrar = $criterio \";\n\t\t\n\t\tif (isset($_SESSION[\"autenticado\"]) and ( ($_SESSION[\"perfil\"]==0) or ($_SESSION[\"perfil\"]==1) ) ) {\n\t\t// ESTE CASO aplica para mostrar registros de nivel superior, perfil admin e investigador\n\t\t\n\t\t\tif ($criterio == 1) // $criterio = 1 Venezuela, incluye los del Mar Caribe\n\t\t\t\t{ $donde = \" nuevo_registro = $criterio OR nuevo_registro = 3 or \n\t\t\t\t\t\t\t\t\t nuevo_registro_mostrar = $criterio OR nuevo_registro_mostrar = 3\"; } \n\t\t\telseif ($criterio == 2) // $criterio = 2 PNALR, incluye Venezuela y el Mar Caribe\n\t\t\t\t{ $donde = \" nuevo_registro = $criterio OR nuevo_registro = 1 OR nuevo_registro = 3 OR \n\t\t\t\t\t\t\t\t\t nuevo_registro_mostrar = $criterio OR nuevo_registro_mostrar = 1 OR \n\t\t\t\t\t\t\t\t\t nuevo_registro_mostrar = 3\"; } \n\t\t\t\telseif ($criterio == 3) // $criterio = 3 Mar Caribe\n\t\t\t\t{ $donde = \" nuevo_registro = $criterio OR nuevo_registro_mostrar = $criterio \"; } \t\t\n\t\t\n\t\t} else { // esta opción aplica para mostrar lo específicamente solicitado\n\t\t\n\t\t\t\tif ($criterio == 1) // $criterio = 2 Venezuela, incluye los del Mar Caribe\n\t\t\t\t{ $donde = \" nuevo_registro = $criterio OR nuevo_registro_mostrar = $criterio\"; } \n\t\t\telseif ($criterio == 2) // $criterio = 2 PNALR, incluye Venezuela y el Mar Caribe\n\t\t\t\t{ $donde = \" nuevo_registro = $criterio OR nuevo_registro_mostrar = $criterio \"; } \n\t\t\t\telseif ($criterio == 3) // $criterio = 3 Mar Caribe\n\t\t\t\t{ $donde = \" nuevo_registro = $criterio OR nuevo_registro_mostrar = $criterio \"; } \t\t\n\t\t\n\t\t}// enf if verificación perfil\n\n\t\t$query = \"SELECT DISTINCT especies_id, nuevo_registro, nuevo_registro_mostrar, genero, \n\t\t\t\t\t\t\t\t\tepiteto_especifico, epiteto_varietal, epiteto_forma \n\t\t\t\t\t\t\tFROM colecciones \n\t\t\t\t\t\t\tWHERE $donde \n\t\t\t\t\t\t\tORDER BY genero\"; \n\t\t\t\t\t\t\t// solo se consultan las especie REPORTADAS como Registros Nuevos\n\t\t\t\t\t\t\t\n\t\t$res = ejecutarQuerySQL($query);\n\t\t\t\nreturn $res;\n}", "protected function listarInvitacionProyecto()\n {\n\n\t\t$estadoInvitacion= '';\t\t\n\t\tif($this->getRequestParameter('estado')!='')\n\t\t{\n\t\t$estadoInvitacion= $this->getRequestParameter('estado');\t\t\n\t\t}\n\t\t//consultamos a la bd\n\t\t$conexion = new Criteria();\n\t\t$conexion->add(AgilhuParticipantePeer::USU_ID,$this->getUser()->getAttribute('idUsuario')); \n\t\tif($estadoInvitacion!='')\n\t\t{\n\t\t$conexion->add(AgilhuParticipantePeer::ESTADO,$estadoInvitacion); \n\t\t}\n\n\t\t$cantidad_invitaciones= AgilhuParticipantePeer::doCount($conexion);\n\t\t$conexion->setLimit($this->getRequestParameter('limit'));\n\t\t$conexion->setOffset($this->getRequestParameter('start'));\n\t\t$invitaciones= AgilhuParticipantePeer::doSelectJoinAgilhuProyecto($conexion);\t\t\n\t\t\n\t\t$pos = 0;\n\t\t$datos;\n\t\tforeach ($invitaciones As $invitacion)\n\t\t{\n\t\t//datos de invitacion y rol\n\t $datos[$pos]['usuinvitado']=''.$invitacion->getUsuId();\n\t\t$datos[$pos]['estadoinvitacion']=$invitacion->getEstado();\n\t\t$datos[$pos]['rolproyectoinvitado']=$this->getNombreRolProyecto($invitacion->getRopId());\t\t\n\t\t$datos[$pos]['ropid']=$invitacion->getRopId();\n $datos[$pos]['proid']=$invitacion->getProId();\n $datos[$pos]['invcreated']=$invitacion->getCreatedAt();\n //datos del proyecto\n\t\t$datos[$pos]['pronom']=$invitacion->getAgilhuProyecto()->getProNombre();\n\t\t$datos[$pos]['prosigla']=$invitacion->getAgilhuProyecto()->getProNombreCorto();\n\t\t$datos[$pos]['proarea']=$invitacion->getAgilhuProyecto()->getProAreaAplicacion();\n\t\t$creador=$invitacion->getAgilhuProyecto()->getUsuId();\n\t\t$datos[$pos]['procreador']=$this->getNombreCreadorProyecto($creador);\n\t\t$datos[$pos]['profechaini']=$invitacion->getAgilhuProyecto()->getProFechaInicio();\n\t\t$datos[$pos]['profechafin']=$invitacion->getAgilhuProyecto()->getProFechaFinalizacion();\n\t\t$datos[$pos]['proestado']=$invitacion->getAgilhuProyecto()->getProEstado();\n\t\t$datos[$pos]['prodescripcion']=$invitacion->getAgilhuProyecto()->getProDescripcion();\n\t\t$datos[$pos]['prologo']=$invitacion->getAgilhuProyecto()->getProLogo();\n\t\t\n\t\t$pos++;\n\t\t}\n\t\tif($pos>0){\n \n\t\t\t$jsonresult = json_encode($datos);\n\t\t\treturn '({\"total\":\"'.$cantidad_invitaciones.'\",\"results\":'.$jsonresult.'})';\n\t\t}\n\t\telse {\n\n\t\t\treturn '({\"total\":\"0\", \"results\":\"\"})';\n\t\t} \n\treturn '({\"total\":\"0\", \"results\":\"\"})';\n }", "public function applyFiltersOnHateoas()\n {\n // Not needed in your don't have any hateoas\n }", "function formFilter()\n {\n \tglobal $conf, $langs;\n\n \t$langs->load(\"companies\");\n\n $sql = \"SELECT sp.poste, count(distinct(sp.email)) AS nb\";\n $sql.= \" FROM \".MAIN_DB_PREFIX.\"socpeople as sp\";\n $sql.= \" LEFT JOIN \".MAIN_DB_PREFIX.\"societe as s ON s.rowid = sp.fk_soc\";\n $sql.= \" WHERE sp.entity IN (\".getEntity('societe', 1).\")\";\n $sql.= \" AND sp.email != ''\"; // Note that null != '' is false\n $sql.= \" AND sp.no_email = 0\";\n $sql.= \" AND (sp.poste IS NOT NULL AND sp.poste != '')\";\n $sql.= \" GROUP BY sp.poste\";\n $sql.= \" ORDER BY sp.poste\";\n\n $resql = $this->db->query($sql);\n\n $s='';\n $s.='<select name=\"filter\" class=\"flat\">';\n $s.='<option value=\"all\"></option>';\n if ($resql)\n {\n $num = $this->db->num_rows($resql);\n $i = 0;\n while ($i < $num)\n {\n $obj = $this->db->fetch_object($resql);\n $s.='<option value=\"'.$obj->poste.'\">'.$obj->poste.' ('.$obj->nb.')</option>';\n $i++;\n }\n }\n $s.='</select>';\n return $s;\n }", "protected function filter() \n {\n // \n }", "function estadosEcidades2()\r\n {\r\n \r\n \t$this->selecao = $this->conn->query(\"SELECT * FROM preciso_profissional WHERE profissao_profissional like'%$this->encontre%' and cidade_profissional ='$this->cidade' and estado_profissional ='$this->estado'\")or die(\"erro\");\r\n\t \r\n $this->resultadPesquisa2();\r\n\r\n \r\n }", "function Show_ofertas_propuestas_pareja1($login){\n \n //Se buscan todos los enfrentamientos de una pareja como pareja1\n $sql = \"SELECT \n HD.fecha,\n HD.id AS 'hueco_id',\n CAMP.id AS 'campeonato_id',\n CAMP.nombre as 'campeonato_nombre',\n CAT.genero,\n CAT.nivel,\n E.id AS 'enfrentamiento_id',\n H.hora_inicio,\n H.hora_fin,\n (SELECT capitan FROM ENFRENTAMIENTO E, PAREJA P WHERE E.PAREJA_1 = P.id AND capitan = '$login' GROUP BY capitan) AS 'capitan pareja 1',\n G.nombre AS 'grupo_nombre',\n E.PAREJA_1 AS pareja_id,\n E.PAREJA_2 AS id_pareja2,\n P.capitan AS capitan_oponente\n \n FROM\n CAMPEONATO CAMP,\n CATEGORIA CAT,\n GRUPO G,\n ENFRENTAMIENTO E,\n HORARIO H,\n HUECO_DISPONIBLE HD,\n PAREJA P\n\n WHERE \n HD.HORARIO_id = H.id\n AND HD.ENFRENTAMIENTO_id = E.id\n AND E.GRUPO_id = G.id\n AND G.CAMPEONATO_id = CAMP.id\n AND G.CATEGORIA_id = CAT.id\n AND E.PAREJA_2 = P.id\n AND E.PAREJA_1 IN (SELECT id FROM PAREJA WHERE capitan = '$login')\n AND E.id IN (SELECT ENFRENTAMIENTO_id\n FROM HUECO_DISPONIBLE\n WHERE PAREJA_id IN (SELECT id FROM PAREJA WHERE capitan = '$login'))\n GROUP BY E.id, P.id\n \";\n\n if (!$resultado = $this->mysqli->query($sql)){ \n $this->respuesta[\"text\"] = \"No se ha podido conectar con la base de datos\";\n $this->respuesta[\"type\"] = false;\n return $this->respuesta;\n }\n else{ \n return $resultado;\n }\n }", "public function consultarSolicitudesReporte($arrFiltro = array(), $onlyData = false) {\n $con = \\Yii::$app->db_captacion;\n $con1 = \\Yii::$app->db_academico;\n $con2 = \\Yii::$app->db;\n $con3 = \\Yii::$app->db_facturacion;\n $estado = 1;\n\n if (isset($arrFiltro) && count($arrFiltro) > 0) {\n if ($arrFiltro['search'] != \"\") {\n $str_search = \"(per.per_pri_nombre like :search OR \";\n $str_search .= \"per.per_seg_nombre like :search OR \";\n $str_search .= \"per.per_pri_apellido like :search OR \";\n $str_search .= \"per.per_cedula like :search) AND \";\n }\n\n if ($arrFiltro['f_ini'] != \"\" && $arrFiltro['f_fin'] != \"\") {\n $str_search .= \"sins.sins_fecha_solicitud >= :fec_ini AND \";\n $str_search .= \"sins.sins_fecha_solicitud <= :fec_fin AND \";\n }\n if ($arrFiltro['estadoSol'] != \"\" && $arrFiltro['estadoSol'] > 0) {\n $str_search .= \"sins.rsin_id = :estadosol AND \";\n }\n if ($arrFiltro['unidad'] != \"\" && $arrFiltro['unidad'] > 0) {\n $str_search .= \"sins.uaca_id = :unidad AND \";\n }\n if ($arrFiltro['modalidad'] != \"\" && $arrFiltro['modalidad'] > 0) {\n $str_search .= \"sins.mod_id = :modalidad AND \";\n }\n if ($arrFiltro['carrera'] != \"\" && $arrFiltro['carrera'] > 0) {\n $str_search .= \"sins.eaca_id = :carrera AND \";\n }\n }\n\n $sql = \"SELECT\n lpad(sins_id,4,'0') as num_solicitud,\n sins_fecha_solicitud as fecha_solicitud, \n per.per_cedula as per_dni,\n concat(per.per_pri_nombre ,' ', ifnull(per.per_seg_nombre,' ')) as per_nombres,\n concat(per.per_pri_apellido ,' ', ifnull(per.per_seg_apellido,' ')) as per_apellidos,\n concat(pges.per_pri_nombre, ' ', pges.per_pri_apellido) as Agente,\n uaca.uaca_nombre,\n ifnull((select ming.ming_alias \n from \" . $con->dbname . \".metodo_ingreso as ming \n where sins.ming_id = ming.ming_id AND\n ming.ming_estado = :estado AND\n ming.ming_estado_logico = :estado),'NA') as ming_nombre,\n eac.eaca_nombre as carrera,\n rsol.rsin_nombre as estado, \n case when ifnull((select opag_estado_pago\n from \" . $con3->dbname . \".orden_pago op\n where op.sins_id = sins.sins_id\n and op.opag_estado = :estado and op.opag_estado_logico = :estado),'N') = 'N' then 'No generado'\n when (select opag_estado_pago\n from \" . $con3->dbname . \".orden_pago op\n where op.sins_id = sins.sins_id\n and op.opag_estado = :estado and op.opag_estado_logico = :estado) = 'P' then 'Pendiente' \n else 'Pagado' end as pago\n FROM \n \" . $con->dbname . \".solicitud_inscripcion as sins\n INNER JOIN \" . $con->dbname . \".interesado as inte on sins.int_id = inte.int_id \n INNER JOIN \" . $con2->dbname . \".persona as per on inte.per_id = per.per_id \n INNER JOIN \" . $con1->dbname . \".unidad_academica as uaca on sins.uaca_id = uaca.uaca_id \n INNER JOIN \" . $con1->dbname . \".modalidad as m on sins.mod_id = m.mod_id\n INNER JOIN \" . $con->dbname . \".res_sol_inscripcion as rsol on rsol.rsin_id = sins.rsin_id \n INNER JOIN \" . $con1->dbname . \".estudio_academico as eac on eac.eaca_id = sins.eaca_id \n LEFT JOIN \" . $con2->dbname . \".usuario as uges on uges.usu_id = sins.sins_usuario_ingreso \n LEFT JOIN \" . $con2->dbname . \".persona as pges on pges.per_id = uges.per_id \n WHERE \n $str_search \n sins.sins_estado_logico=:estado AND\n sins.sins_estado=:estado AND \n inte.int_estado_logico=:estado AND\n inte.int_estado=:estado AND \n per.per_estado_logico=:estado AND\t\t\t\t\t\t\n per.per_estado=:estado AND\n uaca.uaca_estado = :estado AND\n uaca.uaca_estado_logico = :estado AND \n m.mod_estado = :estado AND \n m.mod_estado_logico = :estado AND\n rsol.rsin_estado = :estado AND\n rsol.rsin_estado_logico = :estado AND \n eac.eaca_estado=:estado AND\n eac.eaca_estado_logico=:estado \";\n $sql .= \" ORDER BY fecha_solicitud DESC\";\n\n $comando = $con->createCommand($sql);\n $comando->bindParam(\":estado\", $estado, \\PDO::PARAM_STR);\n\n if (isset($arrFiltro) && count($arrFiltro) > 0) {\n $search_cond = \"%\" . $arrFiltro[\"search\"] . \"%\";\n $comando->bindParam(\":search\", $search_cond, \\PDO::PARAM_STR);\n $fecha_ini = $arrFiltro[\"f_ini\"] . \" 00:00:00\";\n $fecha_fin = $arrFiltro[\"f_fin\"] . \" 23:59:59\";\n\n if ($arrFiltro['f_ini'] != \"\" && $arrFiltro['f_fin'] != \"\") {\n $comando->bindParam(\":fec_ini\", $fecha_ini, \\PDO::PARAM_STR);\n $comando->bindParam(\":fec_fin\", $fecha_fin, \\PDO::PARAM_STR);\n }\n $estadoSol = $arrFiltro[\"estadoSol\"];\n if ($arrFiltro['estadoSol'] != \"\" && $arrFiltro['estadoSol'] > 0) {\n $comando->bindParam(\":estadosol\", $estadoSol, \\PDO::PARAM_INT);\n }\n $unidad = $arrFiltro[\"unidad\"];\n if ($arrFiltro['unidad'] != \"\" && $arrFiltro['unidad'] > 0) {\n $comando->bindParam(\":unidad\", $unidad, \\PDO::PARAM_INT);\n }\n $modalidad = $arrFiltro[\"modalidad\"];\n if ($arrFiltro['modalidad'] != \"\" && $arrFiltro['modalidad'] > 0) {\n $comando->bindParam(\":modalidad\", $modalidad, \\PDO::PARAM_INT);\n }\n $carrera = $arrFiltro[\"carrera\"];\n if ($arrFiltro['carrera'] != \"\" && $arrFiltro['carrera'] > 0) {\n $comando->bindParam(\":carrera\", $carrera, \\PDO::PARAM_INT);\n }\n }\n $resultData = $comando->queryAll();\n $dataProvider = new ArrayDataProvider([\n 'key' => 'id',\n 'allModels' => $resultData,\n 'pagination' => [\n 'pageSize' => Yii::$app->params[\"pageSize\"],\n ],\n 'sort' => [\n 'attributes' => [\n 'num_solicitud',\n 'fecha_solicitud',\n 'per_dni',\n 'per_pri_nombre',\n 'per_seg_nombre',\n 'per_pri_apellido',\n 'per_seg_apellido',\n 'nint_nombre',\n 'ming_nombre',\n 'per_nombres',\n 'per_apellidos',\n ],\n ],\n ]);\n if ($onlyData) {\n return $resultData;\n } else {\n return $dataProvider;\n }\n }", "public function getByFilter($filter)\n {\n $filter_view = json_decode($filter);\n\n $search = $filter_view->search;\n\n $solicitud = Solicitud::join('cliente', 'solicitud.idcliente', '=', 'cliente.idcliente')\n ->join('persona', 'cliente.idpersona', '=', 'persona.idpersona');\n\n if ($filter_view->estado == 2) {\n $solicitud = $solicitud->where('estadoprocesada', false);\n } elseif ($filter_view->estado == 1) {\n $solicitud = $solicitud->where('estadoprocesada', true);\n }\n\n if ($filter_view->tipo == 1) {\n $solicitud = $solicitud->selectRaw('\n *, (SELECT idsolicitudotro FROM solicitudotro WHERE solicitudotro.idsolicitud = solicitud.idsolicitud) AS solicitudotro \n ')->whereRaw('idsolicitud IN (SELECT idsolicitud FROM solicitudotro)');\n } elseif ($filter_view->tipo == 2) {\n $solicitud = $solicitud->selectRaw('\n *, (SELECT idsolicitudmantenimiento FROM solicitudmantenimiento WHERE solicitudmantenimiento.idsolicitud = solicitud.idsolicitud) AS solicitudmantenimiento \n ')->whereRaw('idsolicitud IN (SELECT idsolicitud FROM solicitudmantenimiento)');\n } elseif ($filter_view->tipo == 3) {\n $solicitud = $solicitud->selectRaw('\n *, (SELECT idsolicitudcambionombre FROM solicitudcambionombre WHERE solicitudcambionombre.idsolicitud = solicitud.idsolicitud) AS solicitudcambionombre \n ')->whereRaw('idsolicitud IN (SELECT idsolicitud FROM solicitudcambionombre)');\n } elseif ($filter_view->tipo == 4) {\n $solicitud = $solicitud->selectRaw('\n *, (SELECT idsolicitudservicio FROM solicitudservicio WHERE solicitudservicio.idsolicitud = solicitud.idsolicitud) AS solicitudservicio \n ')->whereRaw('idsolicitud IN (SELECT idsolicitud FROM solicitudservicio)');\n } elseif ($filter_view->tipo == 5) {\n $solicitud = $solicitud->selectRaw('\n *, (SELECT idsolicitudsuministro FROM solicitudsuministro WHERE solicitudsuministro.idsolicitud = solicitud.idsolicitud) AS solicitudsuministro \n ')->whereRaw('idsolicitud IN (SELECT idsolicitud FROM solicitudsuministro)');\n } else {\n $solicitud = $solicitud->selectRaw('\n *,\n (SELECT idsolicitudotro FROM solicitudotro WHERE solicitudotro.idsolicitud = solicitud.idsolicitud) AS solicitudotro,\n (SELECT idsolicitudcambionombre FROM solicitudcambionombre WHERE solicitudcambionombre.idsolicitud = solicitud.idsolicitud) AS solicitudcambionombre,\n (SELECT idsolicitudmantenimiento FROM solicitudmantenimiento WHERE solicitudmantenimiento.idsolicitud = solicitud.idsolicitud) AS solicitudmantenimiento,\n (SELECT idsolicitudsuministro FROM solicitudsuministro WHERE solicitudsuministro.idsolicitud = solicitud.idsolicitud) AS solicitudsuministro,\n (SELECT idsolicitudservicio FROM solicitudservicio WHERE solicitudservicio.idsolicitud = solicitud.idsolicitud) AS solicitudservicio\n ');\n }\n\n if ($search != null) {\n $solicitud->whereRaw(\"(persona.lastnamepersona ILIKE '%\" . $search . \"%' OR persona.namepersona ILIKE '%\" . $search . \"%')\");\n }\n\n return $solicitud->orderBy('fechasolicitud', 'asc')->paginate(10);\n\n }", "function get_listado_540($filtro=array())\n\t{\n $udia=dt_mocovi_periodo_presupuestario::ultimo_dia_periodo_anio($filtro['anio']);\n $pdia=dt_mocovi_periodo_presupuestario::primer_dia_periodo_anio($filtro['anio']);\n\t\t$es_presupuestando=dt_mocovi_periodo_presupuestario::es_periodo_presupuestando($filtro['anio']);\n \n //que sea una designacion vigente, dentro del periodo actual o anulada cuando le setean el hasta con el dia anterior al desde\n\t\t$where=\" WHERE ((desde <= '\".$udia.\"' and (hasta >= '\".$pdia.\"' or hasta is null)) or (hasta is not null and desde>hasta and \".$filtro['anio'].\"=extract(year from hasta)))\";\n //cuando selecciona caracter:R tipo: normal, anuladas:no y tilde todos,periodo presupuestando entonces trae todos los regulares a pesar de tener tkd\n if (!(isset($filtro['especial']) and $filtro['especial']==1 and isset($filtro['uni_acad']) and $filtro['caracter']=='R' and isset($filtro['tipo_desig']) and $filtro['tipo_desig']==1 and\n !isset($filtro['estado']) and $filtro['anulada']=='no' and $es_presupuestando)){\n $where.=\" AND nro_540 is null\";//solo lo aplica cuando no se cumple la condicion tilde todos, caracter: R tipo:normal, anuladas:no, periodo presupuestando\n }\n \n $where2=\"\"; \n if (isset($filtro['anulada'])) {\n switch ($filtro['anulada']) {\n case 'no':$where.= \" AND not (hasta is not null and hasta<desde) \";break;\n case 'si':$where.= \" AND (hasta is not null and hasta<desde) \";break; \n default:\n break;\n }\n\t\t}\n \n\t\tif (isset($filtro['uni_acad'])) {\n\t\t\t$where.= \" AND uni_acad = \".quote($filtro['uni_acad']);\n\t\t}\n if (isset($filtro['caracter'])) {\n switch ($filtro['caracter']) {\n case 'I':$where.= \" AND (carac ='Interino' or carac ='Otro' or carac ='Suplente')\";break;\n case 'R':$where.= \" AND carac ='Regular'\";break; \n }\n\t\t}\n if (isset($filtro['id_programa'])) {\n \t$where.= \" AND id_programa=\".$filtro['id_programa'];\n\t\t}\n if (isset($filtro['tipo_desig'])) {\n \t$where.= \" AND tipo_desig=\".$filtro['tipo_desig'];\n\t\t}\n if (isset($filtro['estado'])) {\n if($filtro['estado']=='A'){\n $where2.= \" WHERE (estado='\".$filtro['estado'].\"' or estado='R')\";\n }else{\n $where2.= \" WHERE estado='\".$filtro['estado'].\"'\";\n }\n \n }\n \n //me aseguro de colocar en estado B todas las designaciones que tienen baja\n $sql2=\" update designacion a set estado ='B' \"\n . \" where estado<>'B' and uni_acad=\".quote($filtro['uni_acad'])\n .\" and exists (select * from novedad b\n where a.id_designacion=b.id_designacion \n and (b.tipo_nov=1 or b.tipo_nov=4))\";\n toba::db('designa')->consultar($sql2);\n //designaciones sin licencia UNION designaciones c/licencia sin norma UNION designaciones c/licencia c norma UNION reservas\n $sql=$this->armar_consulta($pdia, $udia, $filtro['anio']);\n \n $sql= \"select * from (\"\n .\"select distinct b.id_designacion,docente_nombre,legajo,nro_cargo,anio_acad, b.desde, b.hasta,cat_mapuche, cat_mapuche_nombre,cat_estat,dedic,carac,id_departamento, id_area,id_orientacion, uni_acad,emite_norma, nro_norma,b.tipo_norma,b.nro_540,b.observaciones,id_programa,programa,porc,costo_diario,check_presup,licencia,dias_des,dias_lic,case when (dias_des-dias_lic)>=0 then case when tipo_desig=2 then costo_reserva(b.id_designacion,(dias_des*costo_diario*porc/100),\".$filtro['anio'].\") else ((dias_des-dias_lic)*costo_diario*porc/100) end else 0 end as costo\"\n . \",case when b.estado<>'B' then case when t_no.id_novedad is null then b.estado else 'L' end else 'B' end as estado \"//si tiene una baja o renuncia coloca B. Si tiene una licencia sin goce o cese coloca L\n . \" from (\"\n . \" select a.tipo_desig,a.id_designacion,a.docente_nombre,a.legajo,a.nro_cargo,a.anio_acad,a.desde,a.hasta,a.cat_mapuche,a.cat_mapuche_nombre,a.cat_estat,a.dedic,a.carac,a.id_departamento,a.id_area,a.id_orientacion,a.uni_acad,a.emite_norma,a.nro_norma,a.tipo_norma,a.nro_540,a.observaciones,a.estado,id_programa,programa,porc,a.costo_diario,a.check_presup,licencia,a.dias_des,a.dias_lic\"\n . \" from (\".$sql.\") a\"\n . $where\n .\") b \"\n . \" LEFT JOIN novedad t_no ON (b.id_designacion=t_no.id_designacion and (t_no.tipo_nov=2 or t_no.tipo_nov=5) and (t_no.desde<='\".$udia.\"' and (t_no.hasta>='\".$pdia.\"' or t_no.hasta is null)))\"\n .\")c $where2\"\n . \" order by programa,docente_nombre\"; \n \n $ar = toba::db('designa')->consultar($sql);\n \n $datos = array();\n \n $band=$this->en_rojo($filtro['anio']);\n \n if($band){//si gaste mas de lo que tengo\n toba::notificacion()->agregar('USTED ESTA EN ROJO','error'); \n }\n else{\n for ($i = 0; $i < count($ar) ; $i++) {\n \t$datos[$i] = array(\n\t\t\t\t\t'id_designacion' => $ar[$i]['id_designacion'] ,\n\t\t\t\t\t'docente_nombre' => $ar[$i]['docente_nombre'] ,\n 'desde' => $ar[$i]['desde'] ,\n 'hasta' => $ar[$i]['hasta'] ,\n 'cat_mapuche' => $ar[$i]['cat_mapuche'] ,\n 'cat_estat' => $ar[$i]['cat_estat'] ,\n 'dedic' => $ar[$i]['dedic'] ,\n 'carac' => $ar[$i]['carac'] ,\n 'uni_acad' => $ar[$i]['uni_acad'] ,\n 'id_departamento' => $ar[$i]['id_departamento'] ,\n 'id_area' => $ar[$i]['id_area'] ,\n 'id_orientacion' => $ar[$i]['id_orientacion'] ,\n 'id_programa' => $ar[$i]['id_programa'] ,\n 'programa' => $ar[$i]['programa'] ,\n 'costo' => $ar[$i]['costo'] ,\n 'porc' => $ar[$i]['porc'] ,\n 'legajo' => $ar[$i]['legajo'] ,\n 'estado' => $ar[$i]['estado'] ,\n 'dias_lic' => $ar[$i]['dias_lic'] ,\n 'i' => $i,\n\t\t\t\t);\n\t\t\t}\n \n }\n return $datos;\n \n\t}", "public function searchSolicitudAction(){\n\n $aulasActivas = Aulas::find(\"id_estado=1\");\n $aulasSinAsignar = Aulas::find(\"id_estado=6\");\n $this->view->atendidas = $aulasActivas; \n $this->view->pendientes = $aulasSinAsignar; \n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TXT should be unquoted and unescaped
public function testDecodeTxt() { $this->assertEquals('hello "world" \\', DNSContent::decode('"hello \"world\" \\\\"', 'TXT', 'example.com.')); }
[ "public function testEncodeTxt() {\n\t\t$this->assertEquals('\"hello \\\"world\\\" \\\\\\\\\"', DNSContent::encode('hello \"world\" \\\\', 'TXT', 'example.com.'));\n\t}", "function caEscapeForDelimitedOutput($ps_text) {\n\t\treturn '\"'.str_replace(\"\\\"\", \"\\\"\\\"\", $ps_text).'\"';\n\t}", "function txt_form2raw($t=\"\")\n\t{\n\t\t$t = str_replace( \"&#036;\", '$' , $t);\n\t\t$t = str_replace( \"&#092;\", '\\\\', $t );\n\t\t\n\t\treturn $t;\n\t}", "function txt_raw2form($t=\"\")\n\t{\n\t\t$t = str_replace( '$', \"&#036;\", $t);\n\t\t\t\n\t\tif ( $this->get_magic_quotes )\n\t\t{\n\t\t\t$t = stripslashes($t);\n\t\t}\n\t\t\n\t\t$t = preg_replace( \"/\\\\\\(?!&amp;#|\\?#)/\", \"&#092;\", $t );\n\t\t\n\t\t//---------------------------------------\n\t\t// Make sure macros aren't converted\n\t\t//---------------------------------------\n\t\t\n\t\t$t = preg_replace( \"/<{(.+?)}>/\", \"&lt;{\\\\1}&gt;\", $t );\n\t\t\n\t\treturn $t;\n\t}", "function txt_raw2form($t = \"\")\n\t{\n\t\t$t = str_replace('$', \"&#036;\", $t);\n\n\t\t$t = preg_replace(\"/\\\\\\(?!&amp;#|\\?#)/\", \"&#092;\", $t);\n\n\t\treturn $t;\n\t}", "function getEscaped( $text )\n\t{\n\t\treturn sqlite_escape_string($text);\n\t}", "public function getThatDamnTXT(){\n\n\t\t$filename = 'Fattura_' . $this->invoice->number . '-conadfile.txt';\n\n\t\theader( \"Content-type: text/plain\" );\n\t\theader( \"Content-Disposition: attachment; filename=\" . $filename );\n\n\t\techo $this->txt;\n\n\t}", "function LoadTxt($fn)\r\n{\r\n\r\n\t$filepath = str_replace(\"\\\\\\\\\",\"\\\\\",dirname(ewScriptFileName()));\r\n\t// Get text file content\r\n\tif (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\r\n\t\t$filepath .= \"\\\\\" . $fn;\r\n\t} else {\r\n\t\t$filepath .= \"/\" . $fn;\t\t\r\n\t}\r\n\t$fobj = fopen ($filepath , \"r\");\r\n\treturn fread ($fobj, filesize ($filepath));\r\n\r\n}", "function text2bdd($text)\n{\n\treturn addslashes($text);\n}", "function read_file($path) {\n $text = file_get_contents($path);\n $text = htmlspecialchars($text);\n return $text;\n }", "function CHECK_db2text($val)\n{\n\t$val=(string)$val;\n\n\t$val = stripslashes($val);\n\n\treturn($val);\n}", "private function readTXT($file){\n $content = file_get_contents($file);\n return $content;\n }", "#[@test, @expect('lang.FormatException')]\n public function unterminatedQuote() {\n $this->newReader('\"Unterminated;Karlsruhe;76131')->read();\n }", "function scrubText($text){\n\t $scrubbedText = str_replace(\"'\", \"\", $text);\n\t $scrubbedText = str_replace('\"', '', $scrubbedText);\n\t $scrubbedText = str_replace(\"\\\\\", \"-\", $scrubbedText);\n\t return $scrubbedText;\n\t}", "private function mysql_protect($txt) \n\t\t{\n\t\t\t$txt = $this->link_mt->real_escape_string($txt);\n\t\t\treturn $txt;\n\t\t}", "function strip_quote_tags( $txt=\"\" )\n\t{\n\t\treturn preg_replace( \"#\\[QUOTE(=.+?,.+?)?\\].+?\\[/QUOTE\\]#ism\", \"\", $txt );\n\t}", "function onair_File_Get_Contents_Utf8($fn)\n{\n $oa_filecontent = onair_GetModuleOption('isostyle_txtfile');\n $content = file_get_contents($fn);\n $content = str_replace('_', ' ', $content); // replace underline with space\n $content = str_replace('.mp3', '', $content); // removes Extensions\n $content = str_replace('.wav', '', $content); // removes Extensions\n $content = preg_replace('/\\s\\s+/', ' ', $content);\n $content = strtolower($content); // Make all letters lowercase\n\n return mb_convert_encoding($content, 'UTF-8', mb_detect_encoding($content, $oa_filecontent, true));\n}", "public function text($file,$vars=array(),$brackets='{}');", "private function escapeText($text)\n {\n \t$cleanedText = htmlspecialchars($text);\n \treturn str_replace(\"'\", \"\\'\", $cleanedText);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests command with no options.
public function testEmpty() { $this->assertCommand('[]', 'options'); }
[ "public function testSingleFlag()\n {\n $this->assertCommand('{\"debug\":true,\"echo\":true}', 'options --debug --echo');\n }", "public function testOptionsUnknownCommand() {\n\t\t$result = $this->CommandTask->options('pie');\n\n\t\t$expected = array(\n\t\t\t'--help',\n\t\t\t'-h',\n\t\t\t'--verbose',\n\t\t\t'-v',\n\t\t\t'--quiet',\n\t\t\t'-q'\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}", "public function test_noarguments() {\n $cli = new finish();\n $this->set_expected_cli_exception(cli_exception::ERROR_PARAMETER_MISSING);\n $this->execute($cli);\n }", "public function testExecuteWithoutCommands()\n {\n $output = $this->executeCommand($this->command, $this->commandName);\n\n $this->assertRegExp('/Nothing to do/', $output);\n }", "public function testCommandHasNoArguments()\n {\n $oCompareApp = new CompareApplication();\n $oDefinition = $oCompareApp->getDefinition();\n $iArgumentCount = $oDefinition->getArgumentCount();\n $this->assertEquals(0, $iArgumentCount);\n }", "public function testNotValidOption(){\n\n\t\t$search = new Searcher();\n\t\t$result = $search->execSearch( \"php\", \"yolo\", \"yolo\" );\n\n\t\t$this->assertEquals( $result, false );\n\t}", "public function testSubCommandsNoArguments() {\n\t\t$this->Shell->runCommand('subCommands', array());\n\t\t$output = $this->Shell->stdout->output;\n\n\t\t$expected = '';\n\t\t$this->assertEquals($expected, $output);\n\t}", "public function testMatchCommandNoMatch() : void\n {\n $command = $this->parser->matchCommand(\"nomatch\", $this->commands);\n\n $this->assertNull($command);\n }", "public function testGenerateEmptyCommand()\n {\n $executable = 'fakecutable';\n $builder = $this->createTestInstance($executable);\n $this->assertSame($executable, $builder->getCommand());\n }", "function test_apertium_command() {\n\tglobal $config;\n\t\n\t$command_to_test = array($config['apertium_command'], $config['apertium_unformat_command']);\n\t$return = TRUE;\n\tforeach ($command_to_test as $command) {\n\t\tif (!test_command($command)) {\n\t\t\techo $command;\n\t\t\t$return = FALSE;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\t\t\t\n\treturn $return;\n}", "public function testGettingNonExistentOption()\n {\n $this->expectException(InvalidArgumentException::class);\n $this->command->getOption('fake');\n }", "public function testExecuteWithEmptyUsername(){\n\n $kernel = $this->createKernel();\n $kernel->boot();\n\n $application = new Application( $kernel );\n $application->add( new GuardianFetchCommand() );\n\n $command = $application->find( 'app:guardian:fetch' );\n $commandTester = new CommandTester( $command );\n\n $this->setExpectedException( 'Symfony\\Component\\Console\\Exception\\RuntimeException', 'Not enough arguments (missing: \"username\").' );\n\n $commandTester->execute(array( 'command' => $command->getName() ) );\n\n }", "public function testCheckWhenCommandLineOptionIsSet()\n {\n $runtestsConfiguration = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-z', '1'));\n \n $this->assertEquals(extension_loaded('pcntl'), $this->preCondition->check($runtestsConfiguration));\n }", "public function testGetOptionsException()\n {\n $this->command = new Command();\n $this->command->setHelp('Help');\n $this->command->getOption('HHHHHH');\n }", "public function testCommandIsValid()\n {\n $this->assertInstanceOf('doq\\Command\\LogsCommand', $this->app->get(self::COMMAND_NAME) );\n }", "public function testExecuteShouldNotOverrideCommandWithNull()\n {\n $builder = new Builder;\n\n $builder->command('echo Hello, World');\n $this->assertEquals('echo Hello, World', $builder->process()->getCommandLine());\n\n $builder->execute();\n $this->assertEquals('echo Hello, World', $builder->process()->getCommandLine());\n }", "public function testCommandIsValid()\n {\n $this->assertInstanceOf('doq\\Command\\StartCommand', $this->app->get(self::COMMAND_NAME) );\n }", "public function testCommandsAreDisabled()\n {\n $content = static::runCommand([\n 'command' => 'apisearch:create-index',\n 'app-name' => 'main',\n 'index' => 'default',\n '--env' => 'prod',\n '-v' => true,\n ]);\n\n $this->assertTrue(\n false !== strpos($content, 'There are no commands defined in the \"apisearch\" namespace')\n );\n }", "public function testExecuteWithNoOutput()\n {\n $this->loadDataFixtures();\n\n $output = $this->executeCommand(\n $this->command,\n $this->commandName,\n array(\n '--no-output' => true\n )\n );\n $this->assertEquals('', $output);\n $output = $this->executeCommand($this->command, $this->commandName);\n $this->assertRegExp('/Nothing to do/', $output);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If speech recognition is enabled & was successful, the extract text will be returned.
public function getParsedText () { return $this->recognition; }
[ "public function extractText(){\n switch($this->file_extension){\n case 'doc':\n case 'docx':\n $this->extractWord();\n break;\n case 'xls':\n case 'xlsx':\n $this->extractExcel();\n break;\n case 'ppt':\n case 'pptx':\n $this->extractPowerPoint();\n break;\n case 'pdf':\n $this->extractPDF();\n break;\n case 'png':\n case 'tif':\n case 'jpg':\n $this->extractImage();\n break;\n default:\n break;\n }\n $this->cleanUp();\n return $this->getText();\n }", "public function getTextToSpeech()\n {\n return $this->text_to_speech;\n }", "public function convertTextToSpeech($text);", "function getSpeechToText($inputFilePath) {\n $config = $this->configFactory->get('ezcontent_smart_article.settings');\n $baseRequestUrl = self::API_ENDPOINT . '?key=' . $config->get('gcp_speech_to_text_key');\n $inputData = base64_encode(file_get_contents($inputFilePath));\n $formParams = [\n \"config\" => [\n \"enableAutomaticPunctuation\" => true,\n \"encoding\" => \"FLAC\",\n \"languageCode\" => \"en-US\"\n ],\n \"audio\" => [\n \"content\" => $inputData\n ]\n ];\n $response = $this->httpClient->post($baseRequestUrl, [\n 'verify' => true,\n 'body' => json_encode($formParams),\n 'headers' => [\n 'Content-type' => 'application/json',\n 'Accept' => 'application/json'\n ],\n ])->getBody()->getContents();\n $responseArray = json_decode($response);\n //@todo Google Speech-To-Text provides different alternative. Can we extract more ?\n return $responseArray->results[0]->alternatives[0]->transcript ?? '';\n }", "public function extractText()\n {\n $numOfArgs = func_get_args();\n switch (count($numOfArgs)) {\n case 1:\n $imageFileName = $numOfArgs[0];\n $strURI = Product::$baseProductUri . '/ocr/' . $imageFileName . '/recognize?useDefaultDictionaries=true';\n $signedURI = Utils::sign($strURI);\n $responseStream = Utils::processCommand($signedURI, 'GET', '', '');\n $json = json_decode($responseStream);\n return $json;\n break;\n case 2:\n $imageFileName = $numOfArgs[0];\n $folder = $numOfArgs[1];\n if ($folder === '' || $folder === null) {\n $strURI = Product::$baseProductUri . '/ocr/' . $imageFileName . '/recognize';\n } else {\n $strURI = Product::$baseProductUri . '/ocr/' . $imageFileName . '/recognize?folder=' . $folder;\n }\n $signedURI = Utils::sign($strURI);\n $responseStream = Utils::processCommand($signedURI, 'GET', '', '');\n $json = json_decode($responseStream);\n return $json;\n break;\n case 3:\n $stream = $numOfArgs[0];\n $language = $numOfArgs[1];\n $useDefaultDictionaries = $numOfArgs[2];\n $strURI = Product::$baseProductUri . '/ocr/recognize?language=' . $language . '/recognize' . '&useDefaultDictionaries=';\n $strURI .= ($useDefaultDictionaries) ? 'true' : 'false';\n $signedURI = Utils::sign($strURI);\n $responseStream = Utils::processCommand($signedURI, 'POST', '', $stream);\n $json = json_decode($responseStream);\n return $json;\n break;\n case 4:\n $imageFileName = $numOfArgs[0];\n $folder = $numOfArgs[1];\n $language = $numOfArgs[2];\n $useDefaultDictionaries = $numOfArgs[3];\n if ($folder === '' || $folder === null) {\n\n $strURI = Product::$baseProductUri . '/ocr/' . $imageFileName . '/recognize?language=' . $language . '&useDefaultDictionaries=';\n $strURI .= ($useDefaultDictionaries) ? 'true' : 'false';\n } else {\n\n $strURI = Product::$baseProductUri . '/ocr/' . $imageFileName . '/recognize?language=' . $language . '&useDefaultDictionaries=';\n $strURI .= ($useDefaultDictionaries) ? 'true' : 'false';\n $strURI .= '&folder=' . $folder;\n }\n $signedURI = Utils::sign($strURI);\n $responseStream = Utils::processCommand($signedURI, 'GET', '', '');\n $json = json_decode($responseStream);\n return $json;\n break;\n case 8:\n $imageFileName = $numOfArgs[0];\n $language = $numOfArgs[1];\n $useDefaultDictionaries = $numOfArgs[2];\n $x = $numOfArgs[3];\n $y = $numOfArgs[4];\n $height = $numOfArgs[5];\n $width = $numOfArgs[6];\n $folder = $numOfArgs[7];\n $strURI = Product::$baseProductUri;\n $strURI .= '/ocr/';\n $strURI .= $imageFileName;\n $strURI .= '/recognize?language=';\n $strURI .= $language;\n $strURI .= (($x >= 0 && $y >= 0 && $width > 0 && $height > 0) ? '&rectX=' . $x . '&rectY=' . $y . '&rectWidth=' . $width . '&rectHeight=' . $height : '');\n $strURI .= '&useDefaultDictionaries=';\n $strURI .= (($useDefaultDictionaries) ? 'true' : 'false');\n $strURI .= (($folder === '') ? '' : '&folder=' . $folder);\n $signedURI = Utils::sign($strURI);\n $responseStream = Utils::processCommand($signedURI, 'GET', '', '');\n $json = json_decode($responseStream);\n return $json;\n break;\n default :\n return 'Wrong numbers of arguments';\n break;\n }\n }", "public function getRecognitionResult()\n {\n return $this->recognition_result;\n }", "private function extractWord(){\n \n $cmd = $this->setHome()\n . $this->cdToFolder()\n . 'libreoffice --invisible --headless --convert-to txt:Text ' . escapeshellcmd($this->file_basename);\n exec($cmd);\n if(File::exists($this->storage_path . $this->file_name . '.txt')){\n File::move($this->storage_path . $this->file_name . '.txt', $this->storage_path . 'output.txt');\n }\n $this->parseText();\n }", "private function recognizeTextFromImage($filePath)\n {\n $tesseract = new \\TesseractOCR($filePath);\n $tesseract->lang('rus');\n return $tesseract->run();\n }", "public function extractWordInfo() {\n\t\t$text = $this->json['parse']['wikitext']['*'];\n\t\t$start = strpos($text, 'Морфологические и синтаксические свойства');\t\n\t\tif ($start !== false) {\n\t\t\t$text = explode('{{', substr($text, $start));\n\t\t\t$text = explode('}}', $text[1]);\n\t\t\t$text = explode('|', $text[0]);\n\t\t\t\n\t\t\t//echo('[[<pre>' . print_r($text, 1) . '</pre>]]');\n\t\t\t$this->baseForms = array();\n\n\t\t\tforeach ($text as $str) {\n\t\t\t\t$res = preg_match_all('/основа(.?)=(.*)/si', $str, $matches);\n\t\t\t\tif ($res) {\n\t\t\t\t\t$this->baseForms[] = $matches[2][0];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$text = explode(' ', $text[0]);\n\t\t\t\n\t\t\t$this->declensionType = $text[count($text) - 1];\n\t\t\t\n\t\t\tif ($text[0] == 'сущ') {\n\t\t\t\t$this->gender = $text[2];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->gender = false;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$this->baseForms = false;\n\t\t\t$this->declensionType = false;\n\t\t\t$this->gender = false;\n\t\t}\n\t}", "public function textToSpeech($message);", "public function readText()\n {\n $this->num_hits = 0;\n // No need to read text. Any identity input to Tally\n // increments the tally.\n\n $keywords = $this->agent_keywords;\n\n /*\n if ($this->agent_command == null) {\n return false;\n } else {\n\n\n }\n*/\n //$this->input = $input;\n\n $haystack = strtolower($this->nom_input);\n $pieces = explode(\" \", strtolower($this->nom_input));\n\n // So this is really the 'sms' section\n // Keyword\n if (count($pieces) == 1) {\n if ($this->nom_input == $this->agent) {\n //$this->readVariables();\n return;\n }\n }\n\n //$this->thing->log( $this->agent_prefix . 'extract variable and number.' );\n $this->extractVariable($this->subject);\n $this->extractNumber($this->subject);\n\n foreach ($pieces as $key => $piece) {\n foreach ($keywords as $command) {\n if (strpos(strtolower($piece), $command) !== false) {\n switch ($piece) {\n /*\nTurn this off Mar 17 2018. Causes a conflict\nwith the start agent. And doesn't seem to be necessary\n case 'start':\n $needle = \"start\";\n $this->thing->log( $this->agent_prefix . 'processing new variables.', \"INFORMATION\" );\n $right_of_needle = ltrim(substr($this->nom_input, strpos($this->nom_input, $needle)+strlen($needle)));\n//var_dump($right_of_needle);\n $pairs = array();\n\n\n preg_match_all('/[A-Za-z0-9\\.]+(?: [A-Za-z0-9\\.]+)?/',\n $right_of_needle,$pairs);\n $pairs = $pairs[0];\n foreach ($pairs as $key=>$pair) {\n\n $words = explode(\" \", strtolower($pair));\n\n $name = $words[0];\n $value = $words[1];\n\n $this->newVariable($name,$value);\n }\n return;\n*/\n\n case 'plus':\n case 'add':\n case '+':\n if (\n isset($this->number) and isset($this->variable)\n ) {\n $this->thing->log(\n $this->agent_prefix .\n 'adding number to variable.',\n \"INFORMATION\"\n );\n $this->addVariable(\n $this->variable,\n $this->number\n );\n return;\n }\n\n case 'minus':\n case 'subtract':\n case 'less':\n case '-':\n if (\n isset($this->number) and isset($this->variable)\n ) {\n $this->thing->log(\n $this->agent_prefix .\n 'adding number to variable.',\n \"INFORMATION\"\n );\n $this->addVariable(\n $this->variable,\n $this->number\n );\n return;\n }\n\n case 'increment':\n if (isset($this->variable)) {\n $this->thing->log(\n $this->agent_prefix .\n 'incrementing variable.',\n \"INFORMATION\"\n );\n $this->incrementVariable($this->variable);\n return;\n }\n\n case 'equals':\n case 'is':\n case '=':\n if (\n isset($this->number) and isset($this->variable)\n ) {\n $this->thing->log(\n $this->agent_prefix .\n 'setting ' .\n $this->variable .\n ' to ' .\n $this->number .\n '.',\n \"INFORMATION\"\n );\n\n $this->setVariable(\n $this->variable,\n $this->number\n );\n return;\n }\n\n case 'add':\n case \"&\":\n if (isset($this->variable)) {\n $this->thing->log(\n $this->agent_prefix .\n 'adding variable \"' .\n $this->variable .\n '\".',\n \"INFORMATION\"\n );\n $right_of_is = ltrim(\n strrchr($this->nom_input, \" is \")\n );\n\n $this->setVariable(\n $this->variable,\n $right_of_is\n );\n return;\n }\n\n case 'memory':\n //$t = $this->thing->db->length();\n //var_dump($t);\n\n return;\n\n default:\n }\n }\n }\n }\n\n $this->thing->log($this->agent_prefix . ' did no operation.', \"DEBUG\");\n }", "public static function isTextAvailable(): bool\n\t{\n\t\tif (!Loader::includeModule('ai'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$engine = Engine::getByCategory('text', new Context('landing', ''));\n\t\tif (!$engine)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (new Tuning\\Manager())->getItem(self::TUNING_CODE_TEXT)->getValue();\n\t}", "public function getSpeechAdaptationInfo()\n {\n return $this->speech_adaptation_info;\n }", "public function grabTexts () {\n\t\t//1. Find all text() nodes among the descendants of current node, using the \"texts_query\".\n\t\t$texts = $this->findNodes($this->texts_query);\n\t\t$correspondences = array();\n\t\techo UserInterface::GRAB_TEXTS_HELP;\n\t\tUserInterface::pressEnter();\n\t\t//2. For each of these text nodes:\n\t\tforeach ($texts as $index => $t) {\n\t\t\t$index++;\n\t\t\t//Make sure that all html entities are encoded in UTF-8\n\t\t\t$text = html_entity_decode(trim($t->nodeValue), ENT_XHTML, \"UTF-8\");\n\t\t\t//Check that the text is not in the list of stop-words (to ignore \"print\", \"add to favourites\" and such)\n\t\t\tif ($text AND !in_array(strtolower($text), $this->stop_list)) {\n\t\t\t\techo \"\\n\\nTEXT (\" . $index . \"): \" . $text . \"\\n\";\n\t\t\t\t//Ask the user if this particular text corresponds to any course values that they would want to grab\n\t\t\t\t$option = UserInterface::askForSetReply('ASSIGN_COURSE_OPTION_TO_TEXT', array(\"a\" => \"add regex\", \"0\" => \"none\") + $this->course_options + array(\"c\" => \"cancel\"), true);\n\t\t\t\t//Option \"a\" stands for adding new regular expression queries in addition to xpath queries.\n\t\t\t\t//This allows to account for such cases when the same piece of text contains several pieces of relevant information, such as:\n\t\t\t\t//\"(term: spring) This is an introductory course to Accounting!\"\n\t\t\t\t//Since \"term\" and \"description\" are separate course properties, we might want to write several regular expressions to account for that fact\n\t\t\t\t//This loop allows the user to create an array of regular expressions, that looks something like this:\n\t\t\t\t//[\"term\" => '/^(?<term>.*) term/, \"description\" => '/\\) (?<description>.*)$/']\n\t\t\t\tswitch ($option) {\n\t\t\t\t\tcase 'c':\n\t\t\t\t\t\tbreak 2;\n\t\t\t\t\tcase 'a':\n\t\t\t\t\t\techo \"\\n\\nTEXT (\" . $index . \"): \" . $text . \"\\n\";\n\t\t\t\t\t\t//ask the user which course property they want to add a regex for\n\t\t\t\t\t\t$add = UserInterface::askForSetReply('ASSIGN_COURSE_OPTION_TO_REGEX', array(\"s\" => \"stop adding regex\") + $this->course_options, true);\n\t\t\t\t\t\t$regs = array();\n\t\t\t\t\t\t//option \"s\" is \"stop adding regex for this particular piece of text -- either because the user has added all they wanted or because they're sick of trying to make it work\"\n\t\t\t\t\t\twhile ($add != \"s\") {\n\t\t\t\t\t\t\techo \"\\n\\nTEXT (\" . $index . \"): \" . $text . \"\\n\";\n\t\t\t\t\t\t\t$regex_works = 0;\n\t\t\t\t\t\t\t//Asks the user for a regex, then tests it against the string using method checkRegEx\n\t\t\t\t\t\t\twhile (!$regex_works) {\n\t\t\t\t\t\t\t\t$regex = UserInterface::askForInput('ASSIGN_REGEX');\n\t\t\t\t\t\t\t\t$regex_works = $this->checkRegEx($regex, $text, $this->course_options[$add]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//If user was satisfied with how their regex worked, then add this regex to the list of queries\n\t\t\t\t\t\t\tif ($regex_works == \"y\") {\n\t\t\t\t\t\t\t\t$regs[$this->course_options[$add]] = $regex;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\techo \"\\n\\nTEXT (\" . $index . \"): \" . $text . \"\\n\";\n\t\t\t\t\t\t\t$add = UserInterface::askForSetReply('ASSIGN_COURSE_OPTION_TO_REGEX', array(\"s\" => \"stop adding regex\") + $this->course_options, true);\n\t\t\t\t\t\t} //add the resulting array of regular expressions to the correspondences\n\t\t\t\t\t\t$correspondences[$index] = $regs;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '0':\n\t\t\t\t\t\t$correspondences[$index] = \"none\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$correspondences[$index] = $this->course_options[$option];\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\tif ($option == \"a\") {\n\n\t\t\t\t//if user chose something other than \"a\", then just save that decision to the correspondences\n\t\t\t\t} else if (!$option) {\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t}*/\n\t\t\t}\n\t\t}\n\t\t//save the resulting array for posteriority\n\t\t$this->correspondences = $correspondences;\n\t\tprint_r($this->correspondences);\n\t}", "private function receiveVoice($object){\n $content = $object->Recognition;\n $result = $this->transmitText($object, $content);\n return $result;\n }", "function parse_GetRecognizeResult($response)\n {\n $response_xml = simplexml_load_string($response);\n $ready = $response_xml->xpath(\".//int_response\");\n \n if (count($ready) == 0)\n return false;\n \n $result['ready'] = (trim($ready[0]) == '0');\n\n // If not ready yet, stop parsing at 'ready'\n if (!$result['ready'])\n return $result;\n \n $matching_persons = $response_xml->xpath(\".//faces_matches/FaceRecognizeInfo/matches/PersonMatchInfo\");\n if (count($matching_persons) == 0)\n { \n $this->logger(\"No matching persons found for image!\");\n return false;\n }\n foreach($matching_persons as $matching_person)\n {\n $person_name = trim($matching_person->person_name);\n $confidence = trim($matching_person->confidence);\n $result[\"matches\"][$person_name] = $confidence;\n }\n return $result;\n }", "public function send()\n {\n return $this->callCodApi('/texttospeech/send', $this->getData());\n }", "function parse_GetRecognizeResult($response)\n {\n $response_xml = simplexml_load_string($response);\n $ready = $response_xml->xpath(\".//int_response\");\n if (count($ready) == 0)\n return false;\n \n $result['ready'] = (trim($ready[0]) == '0');\n\n // If not ready yet, stop parsing at 'ready'\n if (!$result['ready'])\n return $result;\n \n $matching_persons = $response_xml->xpath(\".//faces_matches/FaceRecognizeInfo/matches/PersonMatchInfo\");\n if (count($matching_persons) == 0)\n { \n $this->logger(\"No matching persons found for image!\");\n return false;\n }\n foreach($matching_persons as $matching_person)\n {\n $person_name = trim($matching_person->person_name);\n $confidence = trim($matching_person->confidence);\n $result[\"matches\"][$person_name] = $confidence;\n }\n return $result;\n }", "public function getSpeechContext()\n {\n return $this->speech_context;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays a form to create a new HomeSlideGallery entity.
public function newAction() { $entity = new HomeSlideGallery(); $form = $this->createCreateForm($entity); return $this->render('ZeteqFrontBundle:HomeSlideGallery:new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), )); }
[ "public function newAction()\n {\n $entity = $this->getGalleryService()->create();\n $form = $this->createForm(new GalleryType(), $entity);\n\n return $this->render('FightmasterGalleryBundle:Gallery:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function newAction()\n {\n $entity = new Gallery();\n $form = $this->createForm(new GalleryType(), $entity);\n\n return $this->render('ACInst3MediaBundle:Gallery:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function actionCreate()\n {\n $model = new Gallery();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create',\n [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Gallery();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->gallery_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Galleries();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = $this->module->manager->createGallery(['scenario' => 'create']);\n\n $model->loadDefaultValues();\n\n if ($model->load(\\Yii::$app->request->post()) && $model->create()) {\n \\Yii::$app->getSession()->setFlash('gallery.success', \\Yii::t('gallery', 'Gallery has been created'));\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model\n ]);\n }", "public function actionCreate()\n {\n $model = new Gallery();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function createAction()\n {\n $entity = new VideoGallery();\n $request = $this->getRequest();\n $form = $this->createForm(new VideoGalleryType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('videogallery_admin'));\n \n }\n\n return $this->render('ImiBorbasVideoGalleryBundle:VideoGallery:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function create()\n {\n return view('admin.galleries.create');\n }", "public function newAction()\n {\n $entity = new GalleryItem();\n $form = $this->createForm(new GalleryItemType(), $entity);\n\n return array('entity' => $entity, 'form' => $form->createView());\n }", "public function actionCreate()\n {\n $model = new Gallery();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if (isset($_SESSION['gallery'])) {\n\t\t\t\tYii::$app->session->setFlash('success', 'Галерея создана. Можно её наполнять содержимым в режиме редактирования.');\n\t\t\t\tswitch ($_SESSION['gallery']['type']) {\n\t\t\t\t\tcase Gallery::GALLERY_ANIMAL:\n\t\t\t\t\t\t$url = 'animals';\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Gallery::GALLERY_USER:\n\t\t\t\t\t\t$url = 'family';\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault: $url = 'index';\n\t\t\t\t}\n\t\t\t\treturn $this->redirect([$url]);\n\t\t\t} else {\n\t\t\t\tYii::$app->session->setFlash('error', 'Галерея создана. Можно её наполнять содержимым в режиме редактирования.');\n\t\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t\t}\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new GalleryMedias;\n\n if ($model->load(Yii::$app->request->post())) {\n $language = Language::find()->where(['default' => 1])->one();\n $model->language = $language->id;\n if ($model->save()) {\n $model->saveImage('image');\n return $this->redirect([\n 'view',\n 'id' => $model->id\n ]);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\r\n {\r\n $model = new GalleryAlbum();\r\n $model->loadDefaultValues();\r\n $model->automaticTranslationSaving = true;\r\n\r\n if($model->load(Yii::$app->request->post()) && $model->save()) {\r\n $model->saveImages();\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n }\r\n else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n $form = new HomeImageForm();\n if ($form->load(Yii::$app->request->post()) && $form->validate()) {\n try {\n $model = $this->service->create($form);\n return $this->redirect(['view', 'id' => $model->id]);\n }catch (\\RuntimeException $e) {\n Yii::$app->session->setFlash('danger', $e->getMessage());\n }\n }\n\n return $this->render('create', [\n 'model' => $form,\n ]);\n }", "public function actionCreate()\n {\n $model = new Gallery();\n\n if ($model->load(Yii::$app->request->post())) \n {\n /* Gets the image instance and uploads image to the specified directory\n * and then saves the model data */\n \n $image = UploadedFile::getInstance($model, 'image'); \n \n $image->saveAs('uploads/' . $image->baseName . '.' . $image->extension);\n $model->image = $image->baseName . '.' . $image->extension;\n \n $model->save();\n \n return $this->redirect(['view', 'id' => $model->id]);\n \n } \n else \n {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function newAction()\n {\n $entity = new Album();\n $form = $this->createForm(new AlbumType(), $entity);\n\n return $this->render('CollectifGalleryBundle:Album:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new PictureSlideshow();\n $form = $this->createForm(new PictureSlideshowType(), $entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function createAction()\n {\n $entity = new GalleryItem();\n $originalImages = Util::asArray($entity->getImages());\n\n $request = $this->getRequest();\n $form = $this->createForm(new GalleryItemType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $this->updateReferences($entity);\n\n Util::syncItems($em, $originalImages, $entity->getImages());\n\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('admin_galleryitem_show', array('id' => $entity->getId())));\n\n }\n\n return array('entity' => $entity, 'form' => $form->createView());\n }", "public function newAction()\n {\n $entity = new Slideshow();\n $form = $this->createCreateForm($entity);\n\n return $this->render('SruCoreBundle:BackOffice/Slideshow:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets query for [[Libro]].
public function getLibro() { return $this->hasOne(Libro::className(), ['id' => 'libro_id']); }
[ "public function getLibro()\n {\n return $this->hasOne(Libros::className(), ['id' => 'libro_id']);\n }", "public function &getListaLibri() {\n $libri = array();\n $query = \"select IdLibro, Titolo, Prezzo, NomeAutore, CognomeAutore, Genere from Libro\";\n \n $mysqli = Db::getInstance()->connectDb();\n if (!isset($mysqli)) {\n error_log(\"[getListaLibri] impossibile inizializzare il database\");\n $mysqli->close();\n return $libri;\n }\n $result = $mysqli->query($query);\n if ($mysqli->errno > 0) {\n error_log(\"[getListaLibri] impossibile eseguire la query\");\n $mysqli->close();\n return $libri;\n }\n\n while ($row = $result->fetch_array()) {\n $libri[] = self::creaLibriDaArray($row);\n }\n\n $mysqli->close();\n return $libri;\n }", "public function getQuery();", "function ConsultaLibro (&$res, $ISBN){\n\t\t$res = mysql_query('SELECT libro.ISBN, libro.Titulo, autor.NombreApellido, libro.CantidadPaginas, libro.Precio, idioma.Descripcion as Idioma, libro.Fecha, disponibilidad.Descripcion as Disponibilidad, libro.Visible as Estado, libro.Hojear AS Indice\n\t\t\t\t\t\tFROM libro, autor, idioma, disponibilidad\n\t\t\t\t\t\tWHERE autor.Id_Autor = libro.Id_Autor\n\t\t\t\t\t\tAND idioma.Id_Idioma = libro.Id_Idioma\n\t\t\t\t\t\tAND disponibilidad.Id_Disponibilidad = libro.Id_Disponibilidad\n\t\t\t\t\t\tAND libro.ISBN=' .$ISBN);\n\t}", "public abstract function get_query();", "public static function BuscarLibro($conexion, $codigo) {\n $resultado = \"\";\n if (isset($conexion)) {\n try {\n $sql = \"SELECT\nlibros.titulo,\nlibros.fecha_publicacion,\nCONCAT(autores.nombre,' ',autores.apellido) as autor,\nlibros.foto as foto\nFROM\nlibros\nINNER JOIN movimiento_autores ON movimiento_autores.codigo_libro = libros.codigo_libro\nINNER JOIN autores ON movimiento_autores.codigo_autor = autores.codigo_autor\nWHERE\nlibros.codigo_libro ='$codigo' and libros.estado=0\";\n\n $resultado = $conexion->query($sql);\n } catch (PDOException $ex) {\n print 'ERROR: ' . $ex->getMessage();\n }\n }\n return $resultado;\n }", "function getLibelOperation($type_op) { //Renvoie le libellé dun operation\n\tglobal $dbHandler,$global_id_agence;\n\t$db = $dbHandler->openConnection();\n\t\n\t$sql=\"SELECT traduction from ad_cpt_ope a, ad_traductions b where a.libel_ope = b.id_str and categorie_ope in (2,3) and type_operation = $type_op ;\";\n\t\n\t$result = $db->query($sql);\n\tif (DB :: isError($result)) {\n\t\t$dbHandler->closeConnection(false);\n\t\tsignalErreur(__FILE__, __LINE__, __FUNCTION__, $result->getMessage());\n\t}\n\t$dbHandler->closeConnection(true);\n\t$retour = $result->fetchrow();\n\treturn $retour[0];\n}", "public function printQueryLibrary()\n {\n\n\t $querylibrary = simplexml_load_file(REFERENCE_COMPONENT_QUERY_LIB);\n\t foreach ($querylibrary->query as $query)\n\t\t {\n\t\t printf(\"Query Id : %s\\n\", $query['id']);\n\t\t printf(\"Query Title : %s\\n\", $query->title);\n\t\t printf(\"Query Content: %s\\n\", $query->content);\n\t }\n return null;\n\t}", "function rpl_query_type(){}", "public function getQueryType();", "protected function getQuery() {\n return $this->container\n ->get('entity_type.manager')\n ->getStorage('sparql_test')\n ->getQuery();\n }", "function get_lista_libros($mysqli, $id=-1) {\r\n\t\t$sql=\"SELECT id,titulo FROM Libro\";\r\n\t\tif ($id!=-1){\r\n\t\t\t$sql=\"SELECT id,titulo FROM Libro WHERE id_autor=$id\";\r\n\t\t}\r\n\t\tif ($resultado = $mysqli->query($sql))\r\n\t\t{\r\n\t\t\tif ($mysqli->error)\r\n\t\t\t{\r\n\t\t\t\techo \"Error al consultar: \" . $mysqli->error;\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\twhile ($fila = $resultado->fetch_assoc()) {\t\r\n\t\t\t\t\t$final[] = $fila;\r\n\t\t\t\t}\r\n\t\t\t\t$resultado->free();\r\n\t\t\t\treturn $final;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function glossaire_query_tab() {\r\n\t// interrogation personnalisee de la base\r\n\tif(defined('_GLOSSAIRE_QUERY')) {\r\n\t\t$res = array();\r\n\t\t$fetch = function_exists('sql_fetch')?'sql_fetch':'spip_fetch_array';\r\n\t\t$query = spip_query(_GLOSSAIRE_QUERY);\r\n\t\twhile($r = $fetch($query)) $res[] = $r;\r\n\t\treturn $res;\r\n\t}\r\n\treturn sql_allfetsel('id_mot,titre,texte,descriptif', 'spip_mots', 'type='.glossaire_groupes(), '', 'id_mot ASC');\r\n}", "public function getRuoli(){\n try{\n $query = $this->_connection->prepare('SELECT * FROM ruolo');\n $query->execute();\n return $query->fetchAll();\n }catch (Exception $e){\n $_SESSION['warning'] = $e->getCode() . \" - \" . $e->getMessage();\n header('Location: ' . URL . 'warning');\n exit();\n }\n }", "public function printQueryLibrary()\n {\n\n\t $querylibrary = simplexml_load_file(TRANSACTION_COMPONENT_QUERY_LIB);\n\t foreach ($querylibrary->query as $query)\n\t\t {\n\t\t printf(\"Query Id : %s\\n\", $query['id']);\n\t\t printf(\"Query Title : %s\\n\", $query->title);\n\t\t printf(\"Query Content: %s\\n\", $query->content);\n\t }\n return null;\n\t}", "function getLibellEcriture($id_libel_ecriture) { //Renvoie le libellé dun ecriture/op divers\n\tglobal $dbHandler,$global_id_agence;\n\t$db = $dbHandler->openConnection();\n\n\t$sql=\"SELECT traduction from ad_traductions where id_str = $id_libel_ecriture ;\";\n\t\n\t$result = $db->query($sql);\n\tif (DB :: isError($result)) {\n\t\t$dbHandler->closeConnection(false);\n\t\tsignalErreur(__FILE__, __LINE__, __FUNCTION__, $result->getMessage());\n\t}\n\t$dbHandler->closeConnection(true);\n\t$retour = $result->fetchrow();\n\treturn $retour[0];\n}", "public function getBaseQuery();", "public function chercheCorres($orth, $lg){\r\n\t\t// check the parameters\r\n\t\t$err = 0;\r\n\t\t\r\n\t\tif(!is_string($orth)){\r\n\t\t\t$err++;\r\n\t\t\t$message['Erreur '.$err] = 'Paramètre invalide, le paramètre $orth doit être du type String. Donné : '.gettype($orth).'.';\r\n\t\t}\r\n\t\tif(!is_string($lg)){\r\n\t\t\t$err++;\r\n\t\t\t$message['Erreur '.$err] = 'Paramètre invalide, le paramètre $lg doit être du type String. Donné : '.gettype($lg).'.';\r\n\t\t}\r\n\t\t\r\n\t\tif($err > 0){\r\n\t\t\t$message['origine'] = 'Méthode chercheCorres';\r\n\t\t\treturn $message;\r\n\t\t}\r\n\t\t\r\n\t\t// build the request\r\n\t\t$query= 'SELECT distinct ?item WHERE{ \r\n\t\t {?item ?label \"'.$orth.'\"@'.$lg.'}.\r\n\t\t ?article schema:about ?item .\r\n\t\t {?article schema:inLanguage \"fr\"} UNION {?article schema:inLanguage \"oc\"} UNION {?article schema:inLanguage \"en\"}.\r\n\t\t SERVICE wikibase:label { bd:serviceParam wikibase:language \"oc, fr, en\". } \r\n\t\t}';\r\n\r\n\t\t$url=\"https://query.wikidata.org/sparql?format=json&query=\".urlencode($query);\r\n\r\n\r\n\t\t$curl_handle=curl_init();\r\n\t\tcurl_setopt($curl_handle, CURLOPT_URL, $url);\r\n\t\tcurl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 10);\r\n\t\tcurl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 3);\r\n\t\tcurl_setopt($curl_handle, CURLOPT_USERAGENT, 'Test Wikidata');\r\n\t\t$json = curl_exec($curl_handle);\r\n\r\n\t\tcurl_close($curl_handle);\r\n\r\n\t\t$parsed_json = json_decode($json, $assoc = true);\r\n\r\n\t\t$results=$parsed_json['results']['bindings'];\r\n\r\n\t\t$listItem = array();\r\n\t\tforeach($results as $res){\r\n\t\t\t$listItem[] = str_replace('http://www.wikidata.org/entity/', '', $res['item']['value']);\r\n\t\t}\r\n\t\t\r\n\t\treturn $listItem;\r\n\t}", "public function buildQuery();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Tests the getPassportDivisionName method.
public function testGetPassportDivisionName(): void { $this->assertTrue(method_exists(Webbankir::class, 'getPassportDivisionName')); }
[ "private function getPassportDivisionName(string $passport_division_code)\n {\n try {\n $response = $this->http_client->get(\"passport/division_code/{$passport_division_code}\", [\n 'headers' => [\n 'Authorization' => \"Bearer {$this->token}\",\n ],\n ]);\n\n if ($response->getStatusCode() === 200) {\n $stream = $response->getBody();\n $stream->rewind();\n $result = json_decode($stream->getContents(), true);\n\n return $result['data']['value'];\n }\n } catch (Exception $e) {\n $this->sendAlarmByTelegramBot($e);\n }\n\n return false;\n }", "public function getPassportDivisionCode(): ?string\n {\n return $this->passport_division_code;\n }", "public function getBossPassportDivisionCode(): ?string\n {\n return $this->boss_passport_division_code;\n }", "public function testGetAuthorizationDivision()\n {\n }", "public function testTeamMembersIdPortalsGet()\n {\n\n }", "public function testGetDistrictForUser()\n {\n }", "public function testGetName()\n {\n echo 'Test GetName' . \"\\n\";\n $user = self::getUser('teamowner@team.com');\n $this->assertEquals('teamowner', $user->getName());\n }", "function grabDivision(){\n\t\t$division = $_GET['viewDivisionOptionsId'];\n\n\t\tif ($division == 0){\n\t\t\t$division = \"all\";\n\t\t}\n\t\treturn $division;\n\t}", "public function getDepartmentNameLegal();", "public function testGetGroupByName()\n {\n $this->assertSame(1, $this->repository->getByName('Admin')->id);\n $this->assertSame(4, $this->repository->getByName('Subadmin')->id);\n }", "public function testGetPassport()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testCampaignsAbsplitNameGet()\n {\n }", "public function testTeamsIdPortalsNkDesignFoldersPost()\n {\n\n }", "public function testTeamsIdPortalsNkTemplateFoldersGet()\n {\n\n }", "public function testGetDistrictForDistrictAdmin()\n {\n }", "public function testGetDistrictForSchoolAdmin()\n {\n }", "public function testTeamsIdPortalsNkPortalMembersFkGet()\n {\n\n }", "function testGetTeamName(){\n $Matches = $this->executeQuery('select name from tbl_team where team_id='.$_GET['team_id']);\n $teamName = isset($Matches[0]['name'])?$Matches[0]['name']:'';\n\n $player = new Player();\n\n $this->assertEquals($teamName,$player->getTeamName($_GET['team_id']));\n }", "public function testComputerName()\n {\n $diceGame = new DiceGame();\n $this->assertInstanceOf(\"\\Chai17\\Dice\\DiceGame\", $diceGame);\n $diceGame->setComputerName(\"Calvin\");\n $res = $diceGame->getComputerName();\n $exp = \"Calvin\";\n $this->assertEquals($exp, $res);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Clear Data Admin
function kreate_clear_data(){ $data_admin_page = add_management_page( "Kreate Clear Data", "Kreate Clear Data", "manage_options", "-kreate_clear_data", "display_clear_data_page" ); add_action("admin_head-" . $data_admin_page, "add_externals"); }
[ "public function clearStoredData();", "public function actionClear()\n {\n $this->optionsComponent->resetDb();\n }", "public static function clear_data() {\n delete_transient('nn_tech_data');\n delete_transient('nn_tech_data_query');\n }", "public function getClear()\n {\n\n UserData::clearData();\n\n redirect(\n action('\\Project\\Controllers\\Admin\\Account\\Dashboard'),\n array('notice' => _('User data cleared.'))\n );\n\n }", "function clearAdmin() {\r\n\t\tunset($_SESSION['adminAccount']);\r\n\t\tunset($_SESSION['adminID']);\r\n\t}", "public function clearAction() {\n $queryCollection = Mage::getResourceModel('oggetto_dbprofiler/query_collection');\n\n foreach ($queryCollection as $query) {\n $query->delete();\n }\n }", "public function deleteAllData() {\n\t\t$this->_DataStorage->deleteAllData();\n\t}", "public function admin_reset() {\n\t\t$this->request->onlyAllow('post');\n\n\t\t$this->Log->deleteAll('1 = 1');\n\t\t$this->redirect(array('action' => 'index'));\n\t}", "public function clearAdminUsers()\n\t{\n\t\t$this->collAdminUsers = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function clear() {\n \n # For admins (user_id = 0)\n if ($this->user->user_id == 0) {\n\n # Clear out all contents of the Posts DB \n # (but don't DELETE the table structure)\n DB::instance(DB_NAME)->query('TRUNCATE TABLE posts'); \n }\n\n # For everyone who is not an admin\n else {\n\n # Hide all contents of the Posts DB prior to the current time\n # by setting the clear time in the user's profile\n\n # Set up a query to update the clear time in the user's profile\n $_POST['cleared'] = Time::now();\n $condition = 'WHERE user_id = '.$this->user->user_id;\n\n # Update the user's clear field in the users table\n DB::instance(DB_NAME)->update('users', $_POST, $condition);\n }\n\n # Redisplay the posts listing\n Router::redirect('/posts/');\n \n }", "public function clear(): void\n {\n $app = App::get();\n $list = $app->data->getList()\n ->filterBy('key', '.temp/cache/', 'startWith');\n foreach ($list as $item) {\n $app->data->delete($item->key);\n };\n }", "function reset_data() {\n global $ft;\n $tables = array('dupeids', 'summary', 'stats', 'killers', 'killitems', 'favorites', 'killcache');\n foreach ($tables as $t) {\n $ft->dbh->_do_query(\"DELETE FROM tbl:$t\");\n }\n }", "public function clearData()\n {\n foreach ($this->fields as $field) {\n $field->clearData();\n }\n }", "public function clearIndex() {\n\t\t$db = ConnectionManager::getDataSource($this->useDbConfig);\n\t\t$db->truncate($db->fullTableName($this));\n\t}", "private function emptyDb()\n {\n \n $res = $this->ask('You want to delete all data ? ( yes || no )');\n \n if ( $res == 'yes' ){\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Review::truncate();\n Product::truncate();\n User::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n \n $this->info('All data was deleted!');\n }\n }", "public function clear() {\n\t\t$this->_data->clear();\n\t}", "public function clearResources() {\n $db = Zend_Registry::get('dbAdapter');\n $db->delete('admin_access_rights', 'groupId = ' . $this->getId());\n }", "public function clearData() {\n $this->viewData = array();\n }", "public function purge_data(){\n\t \t\techo \"keck\";\n\t \t\t$this->purge_table(\"user\");\n\t \t\t$this->purge_table(\"tribe\");\n\t \t\t$this->purge_table(\"tribe_user\");\n\t \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make the current user an admin
public function makeAdmin() { $this->is_admin = "1"; $this->save(); }
[ "public function amLoggedInAsAdmin() {\n\t\t$this->loginAsAdmin();\n\t}", "public function grantRoleAdmin()\n {\n $this->isAdmin = true;\n }", "public function isAdmin();", "function isAdmin() {\n \n if ($this->user_type == 'Admin') {\n return true;\n }\n return false;\n }", "public function isAdmin()\n {\n return $this->isLoggedIn() && $this->getCurrentUser()->is_admin;\n }", "public function isAdministrator();", "public static function isAdmin();", "function acf_current_user_can_admin() {}", "public function action_promote_admin()\n\t{\n\t\t$user = ORM::factory('User', $this->request->param('id'));\n\n\t\tif ( ! $user->is_admin())\n\t\t{\n\t\t\t$user->add('roles', ORM::factory('Role', array('name' => 'admin')));\n\t\t}\n\n\t\treturn $this->_flash_success('Member promoted to admin.', 'admin/member/info/'.$user->id);\n\t}", "private function isAdmin()\n {\n return \\Bouncer::is($this->user())->an('admin');\n }", "public function admin()\n {\n if (!isset($_SESSION['UserID']))\n redirect('Login/logout');\n $user = new User_model;\n if (!$user->loadPropertiesFromPrimaryKey($_SESSION['UserID']))\n redirect('Login/logout');\n if ($user->isAdmin())\n $this->load->view('MainPages/admin_main_page', array('user'=>$user));\n else\n index();\n }", "function isAdmin() {\n return ($this->user_type=='admin');\n }", "function is_admin()\n {\n //is a user logged in?\n\n //if so, check admin status\n\n //returns true/false\n\n }", "public function setAdmin(User $user);", "public function isAdmin() {\n\t\treturn ($this->currentUser['isAdmin']) ? true : false;\n\t}", "function isAdmin() {\n if ($user = $this->currentUser()) {\n return $user->admin;\n }\n return FALSE;\n }", "function check_user_admin() {\n\tglobal $is_user_admin;\n\tglobal $current_user;\n\tif(in_array('administrator', $current_user->roles)) {\n\t\t$is_user_admin = true;\n\t} else {\n\t\t$is_user_admin = false;\n\t}\n}", "function isAdmin(){\r\n\r\n\t\tif($this->user_type == 'Admin'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function requireAdmin() {\r\n requireLogin();\r\n if(USER_PRIVILEGES != 2) {\r\n redirectToRoot();\r\n }\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'getTelephonyProvidersEdgesTrunkswithrecording'
protected function getTelephonyProvidersEdgesTrunkswithrecordingRequest($trunkType = null) { $resourcePath = '/api/v2/telephony/providers/edges/trunkswithrecording'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // query params if ($trunkType !== null) { $queryParams['trunkType'] = ObjectSerializer::toQueryValue($trunkType); } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; if($headers['Content-Type'] === 'application/json') { // \stdClass has no __toString(), so we should encode it manually if ($httpBody instanceof \stdClass) { $httpBody = \GuzzleHttp\json_encode($httpBody); } // array has no __toString(), so we should encode it manually if(is_array($httpBody)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); } } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $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 ); }
[ "protected function getTelephonyProvidersEdgesTrunkRequest($trunkId)\n {\n // verify the required parameter 'trunkId' is set\n if ($trunkId === null || (is_array($trunkId) && count($trunkId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $trunkId when calling getTelephonyProvidersEdgesTrunk'\n );\n }\n\n $resourcePath = '/api/v2/telephony/providers/edges/trunks/{trunkId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($trunkId !== null) {\n $resourcePath = str_replace(\n '{' . 'trunkId' . '}',\n ObjectSerializer::toPathValue($trunkId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 }", "protected function getTelephonyProvidersEdgesAvailablelanguagesRequest()\n {\n\n $resourcePath = '/api/v2/telephony/providers/edges/availablelanguages';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\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 }", "protected function getTelephonyProvidersEdgesTrunkbasesettingsRequest($pageNumber = '1', $pageSize = '25', $sortBy = 'name', $sortOrder = 'ascending', $recordingEnabled = null, $ignoreHidden = null, $managed = null, $expand = null, $name = null)\n {\n\n $resourcePath = '/api/v2/telephony/providers/edges/trunkbasesettings';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($pageNumber !== null) {\n $queryParams['pageNumber'] = ObjectSerializer::toQueryValue($pageNumber);\n }\n // query params\n if ($pageSize !== null) {\n $queryParams['pageSize'] = ObjectSerializer::toQueryValue($pageSize);\n }\n // query params\n if ($sortBy !== null) {\n $queryParams['sortBy'] = ObjectSerializer::toQueryValue($sortBy);\n }\n // query params\n if ($sortOrder !== null) {\n $queryParams['sortOrder'] = ObjectSerializer::toQueryValue($sortOrder);\n }\n // query params\n if ($recordingEnabled !== null) {\n $queryParams['recordingEnabled'] = ObjectSerializer::toQueryValue($recordingEnabled);\n }\n // query params\n if ($ignoreHidden !== null) {\n $queryParams['ignoreHidden'] = ObjectSerializer::toQueryValue($ignoreHidden);\n }\n // query params\n if ($managed !== null) {\n $queryParams['managed'] = ObjectSerializer::toQueryValue($managed);\n }\n // query params\n if (is_array($expand)) {\n $queryParams['expand'] = $expand;\n } else\n if ($expand !== null) {\n $queryParams['expand'] = ObjectSerializer::toQueryValue($expand);\n }\n // query params\n if ($name !== null) {\n $queryParams['name'] = ObjectSerializer::toQueryValue($name);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 }", "protected function getTelephonyProvidersEdgeTrunksRequest($edgeId, $pageNumber = '1', $pageSize = '25', $sortBy = 'name', $sortOrder = 'ascending', $trunkBaseId = null, $trunkType = null)\n {\n // verify the required parameter 'edgeId' is set\n if ($edgeId === null || (is_array($edgeId) && count($edgeId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $edgeId when calling getTelephonyProvidersEdgeTrunks'\n );\n }\n\n $resourcePath = '/api/v2/telephony/providers/edges/{edgeId}/trunks';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($pageNumber !== null) {\n $queryParams['pageNumber'] = ObjectSerializer::toQueryValue($pageNumber);\n }\n // query params\n if ($pageSize !== null) {\n $queryParams['pageSize'] = ObjectSerializer::toQueryValue($pageSize);\n }\n // query params\n if ($sortBy !== null) {\n $queryParams['sortBy'] = ObjectSerializer::toQueryValue($sortBy);\n }\n // query params\n if ($sortOrder !== null) {\n $queryParams['sortOrder'] = ObjectSerializer::toQueryValue($sortOrder);\n }\n // query params\n if ($trunkBaseId !== null) {\n $queryParams['trunkBase.id'] = ObjectSerializer::toQueryValue($trunkBaseId);\n }\n // query params\n if ($trunkType !== null) {\n $queryParams['trunkType'] = ObjectSerializer::toQueryValue($trunkType);\n }\n\n // path params\n if ($edgeId !== null) {\n $resourcePath = str_replace(\n '{' . 'edgeId' . '}',\n ObjectSerializer::toPathValue($edgeId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 }", "protected function getTelephonyProvidersEdgesTrunkMetricsRequest($trunkId)\n {\n // verify the required parameter 'trunkId' is set\n if ($trunkId === null || (is_array($trunkId) && count($trunkId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $trunkId when calling getTelephonyProvidersEdgesTrunkMetrics'\n );\n }\n\n $resourcePath = '/api/v2/telephony/providers/edges/trunks/{trunkId}/metrics';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($trunkId !== null) {\n $resourcePath = str_replace(\n '{' . 'trunkId' . '}',\n ObjectSerializer::toPathValue($trunkId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 }", "protected function getTelephonyProvidersEdgesExtensionRequest($extensionId)\n {\n // verify the required parameter 'extensionId' is set\n if ($extensionId === null || (is_array($extensionId) && count($extensionId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $extensionId when calling getTelephonyProvidersEdgesExtension'\n );\n }\n\n $resourcePath = '/api/v2/telephony/providers/edges/extensions/{extensionId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($extensionId !== null) {\n $resourcePath = str_replace(\n '{' . 'extensionId' . '}',\n ObjectSerializer::toPathValue($extensionId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 }", "protected function getTelephonyProvidersEdgesTrunksMetricsRequest($trunkIds)\n {\n // verify the required parameter 'trunkIds' is set\n if ($trunkIds === null || (is_array($trunkIds) && count($trunkIds) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $trunkIds when calling getTelephonyProvidersEdgesTrunksMetrics'\n );\n }\n\n $resourcePath = '/api/v2/telephony/providers/edges/trunks/metrics';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($trunkIds !== null) {\n $queryParams['trunkIds'] = ObjectSerializer::toQueryValue($trunkIds);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 }", "protected function getTelephonyProvidersEdgesLineRequest($lineId)\n {\n // verify the required parameter 'lineId' is set\n if ($lineId === null || (is_array($lineId) && count($lineId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $lineId when calling getTelephonyProvidersEdgesLine'\n );\n }\n\n $resourcePath = '/api/v2/telephony/providers/edges/lines/{lineId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($lineId !== null) {\n $resourcePath = str_replace(\n '{' . 'lineId' . '}',\n ObjectSerializer::toPathValue($lineId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 getTelephonyProvidersEdgesTrunkswithrecordingAsync($trunkType = null)\n {\n return $this->getTelephonyProvidersEdgesTrunkswithrecordingAsyncWithHttpInfo($trunkType)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "protected function getCollectingReceivedVehiclesRequest($request = null)\n {\n\n $resourcePath = '/WasteRegister/WreckWasteRecordCard/v1/Kepw/collectingReceivedVehicle/search';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($request)) {\n $_tempBody = $request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getTelephonyProvidersEdgesPhoneRequest($phoneId)\n {\n // verify the required parameter 'phoneId' is set\n if ($phoneId === null || (is_array($phoneId) && count($phoneId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $phoneId when calling getTelephonyProvidersEdgesPhone'\n );\n }\n\n $resourcePath = '/api/v2/telephony/providers/edges/phones/{phoneId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($phoneId !== null) {\n $resourcePath = str_replace(\n '{' . 'phoneId' . '}',\n ObjectSerializer::toPathValue($phoneId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 getIncomingEdges();", "function createEdgeGatewayParams($edgeGatewayName, $extNetRef)\n{\n global $gateway, $netmask, $startAddress, $endAddress, $adminVdcObj;\n\n $params=new VMware_VCloud_API_GatewayType();\n $params->set_Name($edgeGatewayName);\n\n $gatcon=new VMware_VCloud_API_GatewayConfigurationType();\n $gatcon->setGatewayBackingConfig(\"compact\");\n $gatinter=new VMware_VCloud_API_GatewayInterfaceType();\n $gatinter->setDisplayName(\"gateway interface\");\n\n $gatinter->setNetwork($extNetRef);\n $gatinter->setInterfaceType(\"uplink\");\n $subnetparttype=new VMware_VCloud_API_SubnetParticipationType();\n $subnetparttype->setGateway($gateway);\n $subnetparttype->setNetmask($netmask);\n\n\n $ipRanges = new VMware_VCloud_API_IpRangesType();\n $ipRange = new VMware_VCloud_API_IpRangeType();\n $ipRange->setStartAddress($startAddress);\n $ipRange->setEndAddress($endAddress);\n $ipRanges->addIpRange($ipRange);\n $subnetparttype->setIpRanges($ipRanges);\n $gatinter->addSubnetParticipation($subnetparttype);\n $gatinter->setUseForDefaultRoute(true);\n\n $gatinfaces=new VMware_VCloud_API_GatewayInterfacesType();\n $gatinfaces->addGatewayInterface($gatinter);\n $gatcon->setGatewayInterfaces($gatinfaces);\n $gatcon->setHaEnabled(true);\n $gatcon->setUseDefaultRouteForDnsRelay(true);\n\n // Firewall Service\n $gatewayFeatures = new VMware_VCloud_API_GatewayFeaturesType();\n $firewallService = new VMware_VCloud_API_FirewallServiceType();\n $firewallService->setIsEnabled(true);\n $firewallService->setDefaultAction(\"drop\");\n $firewallService->setLogDefaultAction(false);\n $gatewayFeatures->addNetworkService($firewallService);\n\n // NAT Service\n $natService = new VMware_VCloud_API_NatServiceType();\n $substr = substr(strrchr($endAddress, \".\"), 1);\n $intval = intval($substr)+3;\n $strpos = strpos($endAddress, $substr);\n $substring = substr($endAddress,0 , $strpos);\n $externalIp = $substring . $intval;\n $natService->setExternalIp($externalIp);\n $natService->setIsEnabled(false);\n $gatewayFeatures->addNetworkService($natService);\n\n // DHCP Service\n $dhcpService = new VMware_VCloud_API_DhcpServiceType();\n $dhcpService->setIpRange($ipRange);\n $dhcpService->setIsEnabled(true);\n $dhcpService->setPrimaryNameServer(\"r2\");\n $dhcpService->setSubMask($netmask);\n $dhcpService->setDefaultLeaseTime(3600);\n $dhcpService->setMaxLeaseTime(7200);\n $gatewayFeatures->addNetworkService($dhcpService);\n\n // LoadBalancer Service\n $loadBalancer = new VMware_VCloud_API_LoadBalancerServiceType();\n\n $pool = new VMware_VCloud_API_LoadBalancerPoolType();\n $pool->setDescription(\"Pool Desc\");\n $pool->setName(\"PoolName\");\n $pool->setOperational(true);\n\n $lBPoolHealthCheck = new VMware_VCloud_API_LBPoolHealthCheckType();\n $lBPoolHealthCheck->setHealthThreshold(\"2\");\n $lBPoolHealthCheck->setUnhealthThreshold(\"3\");\n $lBPoolHealthCheck->setInterval(\"5\");\n $lBPoolHealthCheck->setMode(\"HTTP\");\n $lBPoolHealthCheck->setTimeout(\"15\");\n\n $lBPoolMember = new VMware_VCloud_API_LBPoolMemberType();\n $substr = substr(strrchr($startAddress, \".\"), 1);\n $intval = intval($substr)+3;\n $strpos = strpos($startAddress, $substr);\n $substring = substr($startAddress,0 , $strpos);\n $lbPoolIp = $substring . $intval;\n $lBPoolMember->setIpAddress($lbPoolIp);\n $lBPoolMember->setWeight(\"1\");\n\n $lBPoolServicePort = new VMware_VCloud_API_LBPoolServicePortType();\n $lBPoolServicePort->setIsEnabled(true);\n $lBPoolServicePort->setAlgorithm(\"ROUND_ROBIN\");\n $lBPoolServicePort->setHealthCheckPort(\"80\");\n $lBPoolServicePort->addHealthCheck($lBPoolHealthCheck);\n $lBPoolServicePort->setProtocol(\"HTTP\");\n $lBPoolServicePort->setPort(\"80\");\n\n $pool->addServicePort($lBPoolServicePort);\n\n $pool->addMember($lBPoolMember);\n $loadBalancer->addPool($pool);\n\n $loadBalancerVirtualServer = new VMware_VCloud_API_LoadBalancerVirtualServerType();\n $loadBalancerVirtualServer->setDescription(\"desc\");\n $loadBalancerVirtualServer->setIsEnabled(true);\n $substr = substr(strrchr($startAddress, \".\"), 1);\n $intval = intval($substr)+4;\n $strpos = strpos($startAddress, $substr);\n $substring = substr($startAddress,0 , $strpos);\n $lbvirtualServerIp = $substring . $intval;\n $loadBalancerVirtualServer->setIpAddress($lbvirtualServerIp);\n $loadBalancerVirtualServer->setName(\"VirtualServerName\");\n $loadBalancerVirtualServer->setPool(\"PoolName\");\n $loadBalancerVirtualServer->setLogging(true);\n $loadBalancerVirtualServer->setInterface($extNetRef);\n\n $lBVirtualServerServiceProfile = new VMware_VCloud_API_LBVirtualServerServiceProfileType();\n $lBVirtualServerServiceProfile->setProtocol(\"HTTP\");\n $lBVirtualServerServiceProfile->setPort(\"80\");\n $lBVirtualServerServiceProfile->setIsEnabled(true);\n\n $lBPersistence = new VMware_VCloud_API_LBPersistenceType();\n $lBPersistence->setCookieMode(\"INSERT\");\n $lBPersistence->setCookieName(\"CookieName\");\n $lBPersistence->setMethod(\"COOKIE\");\n $lBVirtualServerServiceProfile->setPersistence($lBPersistence);\n $loadBalancerVirtualServer->addServiceProfile($lBVirtualServerServiceProfile);\n\n $loadBalancer->addVirtualServer($loadBalancerVirtualServer);\n $loadBalancer->setIsEnabled(true);\n $gatewayFeatures->addNetworkService($loadBalancer);\n\n // Static Routing Service\n $staticRouting = new VMware_VCloud_API_StaticRoutingServiceType();\n $staticRouting->setIsEnabled(true);\n $staticRoute = new VMware_VCloud_API_StaticRouteType();\n $substr = substr(strrchr($endAddress, \".\"), 1);\n $intval = intval($substr)+2;\n $strpos = strpos($endAddress, $substr);\n $substring = substr($endAddress, 0, $strpos);\n $nextHopeIp = $substring . $intval;\n $staticRoute->setName(\"RouteName\");\n $subStringArray = explode('.', $endAddress);\n $networkIp = $subStringArray[0] . '.' . $subStringArray[1] . \".2.0/24\";\n $staticRoute->setNetwork($networkIp);\n $staticRoute->setNextHopIp($nextHopeIp);\n $staticRoute->setGatewayInterface($extNetRef);\n $staticRoute->setInterface(\"External\");\n $staticRouting->addStaticRoute($staticRoute);\n $gatewayFeatures->addNetworkService($staticRouting);\n\n $gatcon->setEdgeGatewayServiceConfiguration($gatewayFeatures);\n $params->setConfiguration($gatcon);\n return $params;\n}", "function createGatewaysRequest()\n\t{\n\t\t$request \t\t\t\t\t\t\t= \t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t\t\t\t\t\t<gateways ua=\"' . $this->plugin_name . ' ' . $this->version \t\t\t\t. '\">\n\t\t\t\t\t\t\t\t\t\t\t\t <merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<account>' . $this->xmlEscape($this->merchant['account_id']) \t. '</account>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_id>' . $this->xmlEscape($this->merchant['site_id']) \t\t. '</site_id>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) \t. '</site_secure_code>\n\t\t\t\t\t\t\t\t\t\t\t\t </merchant>\n\t\t\t\t\t\t\t\t\t\t\t\t <customer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<country>' . $this->xmlEscape($this->customer['country']) \t\t. '</country>\n\t\t\t\t\t\t\t\t\t\t\t\t </customer>\n\t\t\t\t\t\t\t\t\t\t\t\t</gateways>';\n\n\t\treturn $request;\n\t}", "protected function createKeokReceivedRequest($request = null)\n {\n\n $resourcePath = '/WasteRegister/MunicipalWasteRecordCard/v1/Keok/received';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($request)) {\n $_tempBody = $request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getTelephonyProvidersEdgesExtensionsRequest($pageSize = '25', $pageNumber = '1', $sortBy = 'number', $sortOrder = 'ascending', $number = null)\n {\n\n $resourcePath = '/api/v2/telephony/providers/edges/extensions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($pageSize !== null) {\n $queryParams['pageSize'] = ObjectSerializer::toQueryValue($pageSize);\n }\n // query params\n if ($pageNumber !== null) {\n $queryParams['pageNumber'] = ObjectSerializer::toQueryValue($pageNumber);\n }\n // query params\n if ($sortBy !== null) {\n $queryParams['sortBy'] = ObjectSerializer::toQueryValue($sortBy);\n }\n // query params\n if ($sortOrder !== null) {\n $queryParams['sortOrder'] = ObjectSerializer::toQueryValue($sortOrder);\n }\n // query params\n if ($number !== null) {\n $queryParams['number'] = ObjectSerializer::toQueryValue($number);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 }", "protected function getTelephonyProvidersEdgesLinebasesettingRequest($lineBaseId)\n {\n // verify the required parameter 'lineBaseId' is set\n if ($lineBaseId === null || (is_array($lineBaseId) && count($lineBaseId) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $lineBaseId when calling getTelephonyProvidersEdgesLinebasesetting'\n );\n }\n\n $resourcePath = '/api/v2/telephony/providers/edges/linebasesettings/{lineBaseId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($lineBaseId !== null) {\n $resourcePath = str_replace(\n '{' . 'lineBaseId' . '}',\n ObjectSerializer::toPathValue($lineBaseId),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 }", "protected function searchKeokReceivedRequest($request = null)\n {\n\n $resourcePath = '/WasteRegister/MunicipalWasteRecordCard/v1/Keok/received/search';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($request)) {\n $_tempBody = $request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "private function _convertDescribeCustomerGateways($request) {\n \n $parameters = array();\n $parameters['Action'] = 'DescribeCustomerGateways';\n foreach ($request->getCustomerGatewayId() as $customerGatewayIddescribeCustomerGatewaysRequestIndex => $customerGatewayIddescribeCustomerGatewaysRequest) {\n $parameters['CustomerGatewayId' . '.' . ($customerGatewayIddescribeCustomerGatewaysRequestIndex + 1)] = $customerGatewayIddescribeCustomerGatewaysRequest;\n }\n foreach ($request->getFilter() as $filterdescribeCustomerGatewaysRequestIndex => $filterdescribeCustomerGatewaysRequest) {\n if ($filterdescribeCustomerGatewaysRequest->isSetName()) {\n $parameters['Filter' . '.' . ($filterdescribeCustomerGatewaysRequestIndex + 1) . '.' . 'Name'] = $filterdescribeCustomerGatewaysRequest->getName();\n }\n foreach ($filterdescribeCustomerGatewaysRequest->getValue() as $valuefilterIndex => $valuefilter) {\n $parameters['Filter' . '.' . ($filterIndex + 1) . '.' . 'Value' . '.' . ($valuefilterIndex + 1)] = $valuefilter;\n }\n\n }\n\n return $parameters;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for replaceExtensionsV1beta1NamespacedDeployment .
public function testReplaceExtensionsV1beta1NamespacedDeployment() { }
[ "public function testCreateExtensionsV1beta1NamespacedDeployment()\n {\n\n }", "public function testReadExtensionsV1beta1NamespacedDeployment()\n {\n\n }", "public function testListExtensionsV1beta1NamespacedDeployment()\n {\n\n }", "public function testPatchNamespacedDeployment()\n {\n }", "public function testReplaceExtensionsV1beta1NamespacedReplicaSet()\n {\n\n }", "public function testCreateExtensionsV1beta1DeploymentForAllNamespaces()\n {\n\n }", "public function testDeleteNamespacedDeployment()\n {\n }", "public function testPatchNamespacedDeploymentScale()\n {\n }", "public function testWatchExtensionsV1beta1NamespacedDeploymentList()\n {\n\n }", "public function testPatchExtensionsV1beta1NamespacedIngress()\n {\n\n }", "public function testDeleteAppsV1beta1NamespacedDeployment()\n {\n\n }", "public function testReplaceExtensionsV1beta1NamespacedNetworkPolicy()\n {\n\n }", "public function testReplaceNamespacedReplicationController()\n {\n }", "public function testDeleteAppsV1beta1CollectionNamespacedDeployment()\n {\n\n }", "public function testCreateNamespacedDeploymentConfig()\n {\n\n }", "public function testReplaceNamespacedPersistentVolumeClaim()\n {\n }", "public function testReplaceAppsV1beta1NamespacedStatefulSet()\n {\n\n }", "public function testReplaceCoreV1NamespacedPod()\n {\n\n }", "public function testReplaceNamespacedServiceAccount()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is the topic a sticky or super sticky?
function bbp_is_topic_sticky($topic_id = 0, $check_super = \true) { }
[ "function bbp_is_topic_super_sticky($topic_id = 0)\n{\n}", "function bp_the_topic_is_sticky() {\n\techo bp_get_the_topic_is_sticky();\n}", "function is_sticky() {\n\tglobal $discussion;\n\treturn $discussion['sticky'];\n}", "public function is_sticky(){\n return $this->sticky==\"Yes\" ? true : false;\n }", "function canSticky()\n{\n\treturn $this->esoTalk->user and $this->esoTalk->user[\"moderator\"];\n}", "public function is_sticky() {\n return $this->settings->is_sticky();\n }", "public function sticky(): bool\n {\n return ($this->getValue('type')=='sticky');\n }", "function sticky() {\n\t\treturn is_sticky( $this->_post->ID );\n\t}", "public function isSticky()\n\t{\n\t\treturn $this->_getData('is_sticky');\n\t}", "public function isSticky() {\n\t\treturn $this->sticky;\n\t}", "public function hasTopic(): bool;", "public function hasTopic() : bool;", "function extant_is_sticky() {\n\n\tif ( is_singular() || is_paged() )\n\t\treturn false;\n\n\tif ( function_exists( 'ccp_is_project_archive' ) && ccp_is_project_archive() && ccp_is_project_sticky() )\n\t\treturn true;\n\n\telse if ( is_home() && is_sticky() )\n\t\treturn true;\n\n\treturn false;\n}", "function bbp_is_topic_tag()\n{\n}", "function bbp_is_single_user_topics()\n{\n}", "private function is_dita_topic() {\n $current_page = $this->node->type;\n if ($current_page == SHAREPOINT_CONTENT_TYPE_PAGES) {\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "function bbp_is_topic_open($topic_id = 0)\n{\n}", "function RT_has_sticky_post() {\n\n\t/**\n\t * Sticky Post Filter\n\t * @return bool\n\t */\n\treturn apply_filters( 'RT_has_sticky_post', (bool) ( is_sticky() && is_home() && ! is_paged() ) );\n\n}", "public function toggleStickinessObject()\n\t{\n\t\tglobal $ilAccess;\n\t\t\n\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t{\n\t\t\tif ($this->objCurrentTopic->isSticky())\n\t\t\t{\n\t\t\t\t$this->objCurrentTopic->unmakeSticky();\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->objCurrentTopic->makeSticky();\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->viewThreadObject();\n\t\t\n\t\treturn true;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The function team_members_total returns total number of user's team members
function team_members_total() { // Get codeigniter object instance $CI = get_instance(); // Load Team Model $CI->load->model('team'); // Count total number of team's members and return return $CI->team->get_members($CI->user_id); }
[ "public function getTeamMembersCount() {\n return $this->members()->count();\n }", "public function memberCount() {\n $tm = new TeamsMembers;\n $members = $tm->where('team_id', '=', $this->id)->get();\n\n return count($members);\n }", "public function getTotalUsersCount(){\n\t\treturn number_format(Member::get()->count());\n\t}", "function get_total_members(&$return_total, $groups_data)\n{\n\tglobal $db;\n\t$return_total = 0;\n\t$member_counts = array();\n\t\n\t//populate the $return_ary with basic group_ids\n\tforeach ($groups_data as $group_row)\n\t{\t\t\n\t\t$member_counts[$group_row['group_id']] = array();\t\t\n\t}\n\t\n\t//get all the users and increment the group counter\t\n\t$sql = 'SELECT COUNT(u.user_id) AS count, g.group_id AS g_id, g.group_name AS g_name \n\t\t\t\tFROM ' . USERS_TABLE . ' u, ' . GROUPS_TABLE . ' g \n\t\t\t\tWHERE u.group_id = g.group_id\n\t\t\t\t\tAND u.user_id <> ' . ANONYMOUS . '\n\t\t\t\tGROUP BY g_id';\n\t$result = $db->sql_query($sql);\n\twhile ($current_group = $db->sql_fetchrow($result))\n\t{\n\t\t$member_counts[$current_group['g_id']] = $current_group['count'];\n\t\t$return_total += $current_group['count'];\t\t\n\t}\n\t$db->sql_freeresult($result);\n\t\t\n\treturn $member_counts;\n}", "protected function getTotalMemberCount() {\n $output = executeQuery(\"admin.getMemberCount\");\n return $output->data->count;\n }", "function flat_sassy_boots_bp_get_total_member_count() {\n\t\treturn apply_filters( 'bp_get_total_member_count',bp_core_get_total_member_count() );\n\t}", "public function getTotalUsers() {\n $total = 0;\n foreach($this->getRegions() as $region) {\n if($region->getTotalUsers() < 0) {\n $users = 0;\n } else {\n $users = $region->getTotalUsers();\n }\n $total += $users;\n }\n return $total;\n }", "public function getTotalParticipants() {\n\t\t\t//DB Query\n\t\t\t$this->db->select('COUNT(*) AS totalParticipants');\n \t\t$this->db->from('participants');\n\n\t\t //Execute Query\n\t\t $query = $this->db->get();\n\t\t $result = $query->result_array();\n\t\t \n\t\t \t//Return Result\n\t\t return $result[0]['totalParticipants'];\n\t\t}", "public static function allInterestedMembersCount()\n {\n $members = 0;\n $teams = static::all();\n if ( ! $teams->isEmpty()) {\n foreach ($teams as $team) {\n $members += $team->interestedMembers()->count();\n }\n }\n return $members;\n }", "public function getTotalAmount()\n {\n return $this->members->totalAmount([1]);\n }", "function getNumMembers(){\n if($this->num_members < 0){\n $q = \"SELECT * FROM \".TBL_USERS;\n $result = $this->query($q);\n $this->num_members = $this->num_rows($result);\n }\n return $this->num_members;\n }", "public function getMemberCount() {\n return count($this->data->members);\n }", "function getNumMembers()\n\t{\n\t\tif($this->num_members < 0)\n\t\t{\n\t\t\t$q = \"SELECT * FROM \".TBL_USERS;\n\t\t\t$result = mysql_query($q, $this->connection);\n\t\t\t$this->num_members = mysql_numrows($result);\n\t\t}\n\t\treturn $this->num_members;\n\t}", "function getNumMembers(){\n\t\tif($this->num_members < 0){\n\t\t\t$q = \"SELECT * FROM \".TBL_USERS;\n\t\t\t$result = mysql_query($q, $this->connection);\n\t\t\t$this->num_members = mysql_numrows($result);\n\t\t}\n\t\treturn $this->num_members;\n\t}", "function mysql_get_totalmembers(){\n\t$result = mysql_query(\"SELECT * FROM `members` WHERE 1\");\n\t$totalmembers = mysql_num_rows($result);\n\treturn $totalmembers;\n}", "public function getTotalFreeMembers(){\n \n try {\n $select = $this->select()\n ->from($this,array(\"freetotal\"=>\"COUNT(user_id)\"))\n ->where('customer_status = ?',3)\n ->where('customer_status = ?',2)\n ->where('customer_status = ?',9);\n $result = $this->getAdapter()->fetchRow($select);\n \n \n \n if ($result){\n return $result;\n }\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n } \n \n \n \n }", "function getNumMembers(){\r\n if($this->num_members < 0){\r\n $result = $this->connection->query(\"SELECT username FROM \".TBL_USERS);\r\n $this->num_members = $result->rowCount(); \r\n }\r\n return $this->num_members;\r\n }", "function CountTeamFamilyMembers($TeamID) {\n\tif($TeamID>0) {\n\t\t$sql=@mysql_query(\"SELECT a.member_id FROM members AS a, members_history AS b WHERE a.member_id=b.member_id AND b.team_id='\".$TeamID.\"' AND b.is_paid='Y' AND a.m_status='1' AND a.is_family='Y'\");\n\t\twhile($row=@mysql_fetch_array($sql)) {\n\t\t\t$NumberFamily+=MySQLResult(\"SELECT count(*) FROM members_family WHERE member_id='\".$row[\"member_id\"].\"'\");\n\t\t}\n\t}\nreturn $NumberFamily;\n}", "public function totalUsers()\n {\n return $this->count();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates, via PATCH, the application with the given Id.
public function patchApplication($applicationId, $request) { return $this->start()->uri("/api/application") ->urlSegment($applicationId) ->bodyHandler(new JSONBodyHandler($request)) ->patch() ->go(); }
[ "public function update($id, UpdateAppRequest $request)\n\t{\n\t\t$app = App::findOrFail($id);\n\n $request = $this->saveFiles($request);\n\n\t\t$app->update($request->all());\n\n\t\treturn redirect()->route(config('quickadmin.route').'.app.index');\n\t}", "public function updateApp($idApp, $params)\n {\n return $this->app(RequestManager::PUT, $idApp, $params);\n }", "public function actionAppUpdate(){\r\n\r\n\t\t$app_id = $_POST['app_id'];\r\n\t\t$appInfo = AppInfo::model()->findByAttributes(array(\"app_id\"=>$app_id));\r\n\r\n\t\tif($appInfo == null){\r\n\t\t\t$response_message = \"app_id does not exist.\";\r\n\t\t\tself::terminate(-1, $response_message, APIConstant::APP_DETAILS_NOT_FOUND);\r\n\t\t}\r\n\r\n\t\t$current_app_version = $_POST['AppInfo']['current_app_version'];\r\n\t\t$os_type = $_POST['AppInfo']['os_type'];\r\n\t\t$os_version = $_POST['AppInfo']['os_version'];\r\n\t\t$latest_version = $_POST['AppInfo']['latest_version'];\r\n\t\t$latest_version_url = $_POST['AppInfo']['latest_version_url'];\r\n\t\t$upgrade_status = $_POST['AppInfo']['upgrade_status'];\r\n\r\n\t\t$appInfo->current_app_version = $current_app_version;\r\n\t\t$appInfo->os_type = $os_type;\r\n\t\t$appInfo->os_version = $os_version;\r\n\t\t$appInfo->latest_version = $latest_version;\r\n\t\t$appInfo->latest_version_url = $latest_version_url;\r\n\t\t$appInfo->upgrade_status = $upgrade_status;\r\n\r\n\t\t$response_message = \"\";\r\n\r\n\t\tif($appInfo->update()){\r\n\t\t\t$response_message = \"You have successfully updated app version $app_id.\";\r\n\t\t\tself::success($response_message);\r\n\t\t}else{\r\n\t\t\t$response_message = \"Problem updating app version.\";\r\n\t\t\tself::terminate(-1, $response_message, APIConstant::ERROR_UPDATING_APP_VERSION);\r\n\t\t}\r\n\r\n\t\t$this->renderPartial('/default/defaultView', array('content' => $content));\r\n\r\n\t}", "public function update($id, UpdatejobapplicationRequest $request)\n {\n $jobapplication = $this->jobapplicationRepository->find($id);\n\n if (empty($jobapplication)) {\n Flash::error('Jobapplication not found');\n\n return redirect(route('jobapplications.index'));\n }\n\n $jobapplication = $this->jobapplicationRepository->update($request->all(), $id);\n\n Flash::success('Jobapplication updated successfully.');\n\n return redirect(route('jobapplications.index'));\n }", "public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->application_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->application_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update($id)\n\t{\n\t\t$leaveapplication = Leaveapplication::findOrFail($id);\n\n\t\t$validator = Validator::make($data = Input::all(), Leaveapplication::$rules,Leaveapplication::$messages);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tLeaveapplication::amendLeaveApplication($data, $id);\n\n\t\treturn Redirect::to('leavemgmt');\n\t}", "public function testUpdateAction()\n {\n /** @var Slim\\Http\\Response $response */\n $response = $this->runApp('PATCH', '/example/exists');\n $this->assertEquals(200, $response->getStatusCode());\n\n /** @var Slim\\Http\\Response $response */\n $response = $this->runApp('PUT', '/example/exists');\n $this->assertEquals(200, $response->getStatusCode());\n\n /** @var Slim\\Http\\Response $response */\n $response = $this->runApp('PATCH', '/example/not-found');\n $this->assertEquals(404, $response->getStatusCode());\n\n /** @var Slim\\Http\\Response $response */\n $response = $this->runApp('PUT', '/example/not-found');\n $this->assertEquals(404, $response->getStatusCode());\n }", "public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->loan_application_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function showUpdate($id){\n\t\tif( Auth::user()->login_type <= 3 ){\n\t\t\t$app = Apps::where( \"id\", $id )->first();\n\t\t\tif( !is_null($app) ){\n\t\t\t\treturn view(\"project.edit-app\")->with('app', $app);\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn redirect()->to(\"404notfound\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\treturn view(\"errors.404\");\n\t}", "public function update(Request $request, string $id)\n {\n $shelf = Bookshelf::visible()->findOrFail($id);\n $this->checkOwnablePermission('bookshelf-update', $shelf);\n\n $requestData = $this->validate($request, $this->rules()['update']);\n $bookIds = $request->get('books', null);\n\n $shelf = $this->bookshelfRepo->update($shelf, $requestData, $bookIds);\n\n return response()->json($shelf);\n }", "public function update($id, Request $request)\n {\n try {\n \n $data = $this->getData($request);\n \n $ear = Ear::findOrFail($id);\n $ear->update($data);\n\n return redirect()->route('ears.ear.index')\n ->with('success_message', 'Ear was successfully updated!');\n\n } catch (Exception $exception) {\n\n return back()->withInput()\n ->withErrors(['unexpected_error' => 'Unexpected error occurred while trying to process your request!']);\n } \n }", "public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->leaveApplicationID]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function testUpdateApplication()\n {\n $this->assertTrue($this->setup->updateApplication($this->application));\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->appointment_id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function postEdit(Request $request) {\n \n $this->validate(\n $request,\n [\n 'name' => 'required|min:2',\n 'acronym' => 'required|min:2',\n 'description' => 'required|min:4',\n ]\n );\n\n $app = \\App\\Application::find($request->id);\n $app->name = $request->name;\n $app->description = $request->description;\n $app->acronym = $request->acronym;\n\n $app->save();\n\n \\Session::flash('flash_message','Your application was updated.');\n\n return redirect('/applications/edit/'.$request->id);\n }", "public function patchApplicationRole($applicationId, $roleId, $request)\n {\n return $this->start()->uri(\"/api/application\")\n ->urlSegment($applicationId)\n ->urlSegment(\"role\")\n ->urlSegment($roleId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->patch()\n ->go();\n }", "public function update_api_app() {\n \n (new MidrubBaseAdminCollectionSettingsHelpers\\Oauth)->update_api_app();\n \n }", "public function update (Request $request, $id)\n {\n $fruit = Fruit::find($id);\n $success->update($request->all());\n return Response::json(['updated' => success]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Defines an alias. $aliasClass must be a subtype (extend or implement) $handlingClass; otherwise you will run into trouble. Aliases can only be one level deep, i.e. aliasClass > handlingClass is supported, but aliasClass > anotherAliasClass > handlingClass is not.
public static function addAliasFor($handlingClass, $aliasClass) { self::$aliases[$handlingClass] = $aliasClass; }
[ "public function alias($alias, $class)\n\t{\n\t\tclass_alias($class, $alias);\n\t}", "public function setAlias($class, $alias)\n {\n $this->aliases[$alias] = $this->normalize($class);\n }", "public static function add_alias($alias, $class)\n\t{\n\t\tstatic::$aliases[strtolower($alias)] = $class;\n\t}", "private function setAlias($alias)\n {\n $this->alias = $alias;\n }", "public static function create_alias_class($class)\n\t{\n\t\tclass_alias(static::$aliases[strtolower($class)], $class);\n\t}", "public function alias($alias, $binding);", "private function loadAlias($class, $alias, $real)\n {\n if ($class === $alias) {\n return class_alias($real, $alias);\n }\n }", "public function alias($abstract, $alias);", "public function setAlias(string $alias)\n\t{\n\t\t$this->addKeyValue('alias', $alias); \n\n\t}", "public function setAlias(string $alias): void\n {\n $this->alias = $alias;\n }", "public function alias($original, $aliasOrAliases);", "public function setAlias(string $alias)\n\t{\n\t\t$this->alias=$alias; \n\t\t$this->keyModified['alias'] = 1; \n\n\t}", "public function alias(string $class, string ...$aliases): self\n {\n foreach ($aliases as $alias) {\n $this->aliases[$alias] = $class;\n }\n return $this;\n }", "public function alias(string $alias, string $id);", "public function alias(string $alias, string $query)\n {\n $this->alias[$alias] = $query;\n }", "public function test__AttachClassAliases() {\n\t\t// Verify class is not aliased\n\t\tverify( class_exists( \"Foo\" ) )->false();\n\n\t\t// Set up class aliases\n\t\t$this->_utils->getRestfulRecord()->classAliases = array(\n\t\t\t\"RestfulRecord\\RestfulRecord\" => \"Foo\",\n\t\t);\n\n\t\t// Attach aliases\n\t\t$this->_utils->attachClassAliases();\n\n\t\t// Verify class is aliased\n\t\tverify( class_exists( \"Foo\" ) )->true();\n\t}", "public function setAlias($alias, $path);", "private function setAliases() {\n foreach ( $this->class_aliases as $alias => $class ) {\n if ( ! class_exists( $alias ) ) {\n class_alias( $class, $alias );\n }\n }\n }", "public function setAlias(string $alias){ $this->tableAlias = $alias; }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Links a product color.
public function linkProductColor(&$params){ $settings = []; Settings::read($settings); $rc = false; // Пряжа "ALIZE Кашмира" 141 королевский синий if (preg_match('/\".+\"\s+(\d+)\s+(.+)/', $params['nameFull'], $matches)){ $colorCode = 0; $colorName = ''; if (count($matches) == 3){ $colorCode = $matches[1]; $colorName = $matches[2]; } if ($cat = Category::findOne($params['idCategory'])){ if ($cat->isProduct){ echo "111: found category == ".$cat->name."\n"; if ($productParent = Product::findOne($cat->idProduct)){ echo "333: found productParent == ".$productParent->name." colorCode == ".$colorCode."\n"; //if (!($product = Product::find()->where(['colorCode' => $colorCode, 'idParent' => $productParent->id])->one())){ if (!($product = Product::find()->where(['id1C' => $params['idProduct'] ])->one())){ unset($product); $product = new Product(); $product->initNew(); echo "555 add product \n"; echo $params['nameFull']."\n"; } $product->idParent = $productParent->id; $product->id1C = $params['idProduct']; $product->name = $params['nameKassa']; $product->nameFull = $params['nameFull']; $product->colorCode = $colorCode; $product->colorName = $colorName; $product->idManufacturer = $params['idManufacturer']; if (empty($product->idManufacturer)){ $product->idManufacturer = $settings['idManufacturerEmpty']; } $product->idCategory = $cat->idParent; $product->idCountry = $params['idCountry']; foreach ($params['aProp'] as $key => $value){ switch ($key){ case 'цвет': $product->colorName = $value; break; case 'состав': $product->content = $value; break; } } // print_r($product); if (!$product->save()){ echo "Product: ".print_r($product->errors); } $rc = true; } } } } return $rc; }
[ "function pl_link_color(){\n\t\n\t$color = ( pl_check_color_hash( ploption( 'linkcolor' ) ) ) ? pl_hash_strip( ploption( 'linkcolor' ) ) : '225E9B';\n\t\n\treturn $color;\t\n}", "function test_named_link_color_support()\n {\n }", "public function viewProductLink()\n {\n return base_url(\"product/view/{$this->produceCode}\");\n }", "public function getProductLinkAction();", "public function getProductLabelColor();", "public function getProductLink()\n {\n return $this->getUrl('catalog/product/view/');\n }", "public function getProductColors()\n {\n return $this->hasMany(ProductColors::class, ['color_id' => 'id']);\n }", "function obtenerColorProducto($idProducto,$colorId=\"pa_color\"){\n\t\t$db = obtenerBaseDeDatosSecundaria();\n\t\t$sentencia = $db->prepare(\"SELECT * FROM wp_woocommerce_order_itemmeta WHERE order_item_id = ? AND meta_key = ?\");\n\t\t$sentencia->execute([$idProducto,$colorId]);\n\t\treturn $sentencia->fetchall(PDO::FETCH_OBJ);\n\t}", "public function addColorsToProductList(&$products) {\n\n if (!is_array($products) || !count($products) || !file_exists(_EPH_THEME_DIR_ . 'product-list-colors.tpl')) {\n return;\n }\n\n $productsNeedCache = [];\n\n foreach ($products as &$product) {\n\n if (!$this->isCached(_EPH_THEME_DIR_ . 'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']))) {\n $productsNeedCache[] = (int) $product['id_product'];\n }\n\n }\n\n unset($product);\n\n $colors = false;\n\n if (count($productsNeedCache)) {\n $colors = Product::getAttributesColorList($productsNeedCache);\n }\n\n Tools::enableCache();\n\n foreach ($products as &$product) {\n $tpl = $this->context->smarty->createTemplate(_EPH_THEME_DIR_ . 'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']));\n\n if (isset($colors[$product['id_product']])) {\n $tpl->assign(\n [\n 'id_product' => $product['id_product'],\n 'colors_list' => $colors[$product['id_product']],\n 'link' => $this->context->link,\n 'img_col_dir' => _THEME_COL_DIR_,\n 'col_img_dir' => _EPH_COL_IMG_DIR_,\n ]\n );\n }\n\n if (!in_array($product['id_product'], $productsNeedCache) || isset($colors[$product['id_product']])) {\n $product['color_list'] = $tpl->fetch(_EPH_THEME_DIR_ . 'product-list-colors.tpl', $this->getColorsListCacheId($product['id_product']));\n } else {\n $product['color_list'] = '';\n }\n\n }\n\n Tools::restoreCacheSettings();\n }", "public function getURL()\n {\n return '/product/'.$this->getIdentifier();\n }", "public function Product_color_delete($Product_color_page_url) {\n\t\t$product_color_id = $_REQUEST['cid'];\n\t\t// Check Reminder Exist or Not Exist Under This Product_color //\n\n\t\t\t$Product_color_delete = $this->db->delete(\"product_color_tbl\", array(\"product_color_id\" => $product_color_id));\n\t\t\tif ($Product_color_delete['affectedRow'] > 0) {\n\t\t\t\t$_SESSION['Product_color_msg'] = messagedisplay('Product_color details deleted successfully', 1);\n\t\t\t} else {\n\t\t\t\t$_SESSION['Product_color_msg'] = messagedisplay('Nothing is deleted successfully', 2);\n\t\t\t}\n\t\t\n\t\theader('location: ' . $Product_color_page_url);\n\t\texit();\n\t}", "function woocommerce_template_loop_product_link_open() {\n global $product;\n\n $link = apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product );\n\n //echo '<a href=\"' . esc_url( $link ) . '\" class=\"woocommerce-LoopProduct-link woocommerce-loop-product__link\">';\n }", "public function getProductLinks();", "public function colors()\n {\n return $this->belongsToMany(Color::class, 'product_attributes', 'product_id', 'color_id');\n }", "protected function writeColors($product)\n {\n if(!empty($this->fields['colors']) && $color = $product->getAttributeText($this->fields['colors'])) {\n $this->xml->push('colors');\n $this->xml->element('color', $this->xml->encloseCData($color));\n $this->xml->pop();\n }\n }", "public function productDetailsAction()\n {\n $vars['productId'] = $this->route['id'];\n $vars['product'] = $this->model->getById($vars['productId']);\n $vars['colors'] = $this->model->getAvailableColors($vars['productId']);\n $this->view->render('Riding Gear', $vars);\n }", "protected function writeColors($product)\n {\n Varien_Profiler::start(\"export_product_writeColors\");\n if(!empty($this->fields['colors']) && $color = $product->getAttributeText($this->fields['colors'])) {\n $this->xml->push('colors');\n $this->xml->element('color', $this->xml->encloseCData($color));\n $this->xml->pop();\n }\n Varien_Profiler::stop(\"export_product_writeColors\");\n }", "function getAllProductsColorByProductId($product_id)\n{\n $query=\"select product_id,product_color_id,product_color_name,product_color_image,product_color_display_image,createdAt,updatedAt,isActive,product_color_description from incre_product_colors where product_id=$product_id\";\n $result=mysql_query($query) or die(mysql_error());\n return $result;\n}", "function ProdLink($prod)\n\t{\n\n\t\t/*Edited by WAS33M*/\t$prod = GetClass(\"ISC_CHANGEURLBYWAS33M\")->GetProductUrl($prod); /*Edited*/\n\t\tif ($GLOBALS['EnableSEOUrls'] == 1) {\n\t\t\t//return sprintf(\"%s/%s/%s.html\", GetConfig('ShopPathNormal'), PRODUCT_LINK_PART, MakeURLSafe($prod));\n return sprintf(\"%s/%s/%s\", GetConfig('ShopPathNormal'), PRODUCT_LINK_PART, MakeURLSafe($prod));\n\t\t} else {\n\t\t\treturn sprintf(\"%s/products.php?product=%s\", GetConfig('ShopPathNormal'), MakeURLSafe($prod));\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if the NewRelic PHP extension is loaded
public static function hasNewRelic(): bool { return extension_loaded('newrelic'); }
[ "public function hasNewRelic() {\n\t\treturn extension_loaded('newrelic');\n\t}", "protected function isNewRelicEnabled()\n {\n return (bool) extension_loaded(self::NEWRELIC_EXTENSION_NAME);\n }", "public function is_extension_installed()\n {\n return function_exists(\"pg_connect\");\n }", "function checkExtensionLoad($name)\n{\n if (extension_loaded($name)) {\n return true;\n }\n return false;\n}", "public static function isModuleLoaded()\n {\n return extension_loaded('redis');\n }", "public static function thereAreInstalledExtensions()\n {\n $pool = apply_filters('allex_addons', [], 'upstream');\n\n foreach ($pool as $addon) {\n if (file_exists(ABSPATH . 'wp-content/plugins/' . $addon['slug'] . '/' . $addon['slug'] . '.php')) {\n return true;\n }\n }\n\n return false;\n }", "private function _extension_installed()\n {\n return true;\n }", "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}", "public function testIfNeededExtensionsAreLoaded()\n {\n $needed = \\P7TriviaGame\\Core\\System::REQUIRED_PECL_LIB;\n\n for($i=0;$i<count($needed);$i++) {\n $this->assertTrue(in_array($needed[$i], get_loaded_extensions() ));\n }\n\n }", "private function checkExtensionLoaded() {\n\t\tif (!extension_loaded('curl') ) {\n\t\t\techo \"===========================================\\n\";\n\t\t\techo \"curl extension is required!\\n\";\n\t\t\techo \"===========================================\\n\";\n\t\t\texit;\n\t\t}\t\n\t}", "public function isExtensionLoaded($ext='gd') { \n return extension_loaded($ext); \n }", "function extension_loaded($name)\n{\n if ($name === 'gmp' && SignerTest::$disableGmp) {\n return false;\n }\n\n return \\extension_loaded($name);\n}", "public static function isInstalled(): bool\n {\n return class_exists('Nyholm\\\\Psr7\\\\Factory\\\\Psr17Factory')\n && class_exists('Nyholm\\\\Psr7Server\\\\ServerRequestCreator');\n }", "function should_load() {\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\n\t\treturn is_plugin_active( 'foogallery/foogallery.php' );\n\t}", "public static function iconv_loaded(): bool\n {\n return \\extension_loaded('iconv');\n }", "function i3d_framework_extension_exists() { return true; }", "function iconv_loaded()\n{\n static $flag = null;\n\n if ($flag === null)\n {\n $flag = extension_loaded('iconv');\n }\n\n return $flag;\n}", "public function isInstalled(): bool\n {\n return extension_loaded('swoole') || extension_loaded('openswoole');\n }", "protected function crc32cExtensionLoaded()\n {\n return extension_loaded('crc32c');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Import airports and routes
public function import() { $cities = City::get(); $airportsFile = fopen(database_path('/data/airports.txt'), "r"); $routesFile = fopen(database_path('/data/routes.txt'), "r"); while (!feof($airportsFile)) { $data = explode(",", fgets($airportsFile)); foreach ($cities as $city) { if (isset($data[2])) { if ($city->name == trim($data[2], '"') && $city->country == trim($data[3], '"')) { Airport::updateOrCreate([ 'airport_id' => $data[0], ], [ 'airport_id' => $data[0], 'name' => trim($data[1], '"'), 'city' => trim($data[2], '"'), 'country' => trim($data[3], '"'), 'iata' => $data[4] != '\N' ? trim($data[4], '"') : null, 'icao' => $data[5] != '\N' ? trim($data[5], '"') : null, 'latitude' => $data[6], 'longitude' => $data[7], 'altitude' => $data[8], 'timezone' => $data[9], 'dst' => trim($data[10], '"'), 'tz' => trim($data[11], '"'), 'type' => trim($data[12], '"'), 'source' => trim($data[13], '"'), ]); } } } } $airports = Airport::get(); while (!feof($routesFile)) { $data = explode(",", fgets($routesFile)); foreach ($airports as $airport) { if (isset($data[3])) { if ($data[3] == $airport->airport_id) { Route::updateOrCreate([ 'source_airport_id' => $data[3], 'destination_airport' => $data[4], ], [ 'iata' => $data[0], 'airline_id' => $data[1], 'source_airport' => $data[2], 'source_airport_id' => $data[3], 'destination_airport' => $data[4], 'destination_airport_id' => $data[5] != '\N' ? $data[5] : null, 'codeshare' => $data[6], 'stops' => $data[7], 'equipment' => $data[8], 'price' => $data[9], ]); } } } } fclose($airportsFile); fclose($routesFile); }
[ "protected function importFlights()\n {\n $this->comment('--- FLIGHT SCHEDULE IMPORT ---');\n\n $count = 0;\n foreach ($this->readRows('schedules') as $row) {\n $airline_id = $this->getMapping('airlines', $row->code);\n\n $flight_num = trim($row->flightnum);\n\n $attrs = [\n 'dpt_airport_id' => $row->depicao,\n 'arr_airport_id' => $row->arricao,\n 'route' => $row->route ?: '',\n 'distance' => round($row->distance ?: 0, 2),\n 'level' => $row->flightlevel ?: 0,\n 'dpt_time' => $row->deptime ?: '',\n 'arr_time' => $row->arrtime ?: '',\n 'flight_time' => $this->convertDuration($row->flighttime) ?: '',\n 'notes' => $row->notes ?: '',\n 'active' => $row->enabled ?: true,\n ];\n\n try {\n $flight = Flight::updateOrCreate(\n ['airline_id' => $airline_id, 'flight_number' => $flight_num],\n $attrs\n );\n } catch (\\Exception $e) {\n //$this->error($e);\n }\n\n $this->addMapping('flights', $row->id, $flight->id);\n\n // TODO: deserialize route_details into ACARS table\n\n if ($flight->wasRecentlyCreated) {\n $count++;\n }\n }\n\n $this->info('Imported '.$count.' flights');\n }", "protected function processImport() {\n $routes_csv = resource_path( 'flight-datasets/routes.csv' );\n $handle = fopen( $routes_csv, 'r' );\n\n while ( ( $data = fgetcsv( $handle, 0, ',' ) ) !== FALSE ) {\n $entry = $this->csvLine( $data );\n\n if ( $this->isValidEntry( $entry ) ) {\n $this->batchEntry( $entry );\n }\n\n $this->maybeBatchInsert();\n }\n\n $this->maybeBatchInsert( 1 );\n\n fclose( $handle );\n }", "public function import()\n {\n foreach (Venue::getAllForDomain('eventbrite.com') as $venue) {\n $this->importFromVenue($venue);\n }\n }", "abstract public function import();", "public function initAirports()\n\t{\n\t\t$this->collAirports = array();\n\t}", "public static function import() {\n $count = 0;\n $records = array();\n foreach (self::getSources() as $source) {\n $items = self::readFile($source['path']);\n\n foreach ($items as $item) {\n $item['active'] = true;\n $item['id'] = ++$count;\n $item['name'] = $source['name'];\n $item['type'] = $source['type'];\n $records[$count] = $item;\n }\n }\n self::saveRecords($records);\n }", "public function import()\n\t{\n\t\t$this->import_temp_orders();\n\t\t/*$this->import_recurring();*/\n\t\t\n\t\t//$this->import_coupon();\n\t}", "public function import()\n {\n $importer = app('importers-'.$this->type);\n\n // Delete events from previous imports.\n $this->events()->delete();\n\n // Retrieve and store events from calendar.\n $this->events()->saveMany($importer->get($this->url, $this->start_date, $this->end_date));\n }", "protected abstract function doImport();", "public function import()\n {\n \n }", "public static function import()\n\t{\n\t\tforeach (func_get_args() as $path)\n\t\t{\n\t\t\t$_path = rtrim($path, '/') . '/';\n\t\t\tself::$_imports[$_path] = $_path;\n\t\t}\n\t}", "public function importImapApplications()\n {\n\n }", "public function register_importer_routes() {\r\r\n\t\tregister_rest_route(\r\r\n\t\t\tWizard::REST_NAMESPACE, '/import-sample-data/', array(\r\r\n\t\t\t\t'methods' => 'POST',\r\r\n\t\t\t\t'callback' => array( $this, 'pre_import' ),\r\r\n\t\t\t)\r\r\n\t\t);\r\r\n\t}", "public function import()\n {\n }", "public static function import($file){\n if(is_readable($file)){\n require_once($file);\n } else {\n throw new RouteException('Failed to import route. Does it exist?');\n }\n }", "private function importRoutes()\n {\n\n $this->cleanRoutes()->map(function ($route) {\n return SeoManager::updateOrCreate(['uri' => (string)$route],\n [\n 'uri' => (string)$route,\n 'url' => (string)$route,\n 'title' => str_replace('/', ' ', (string)$route),\n 'params' => $this->getParamsFromURI($route),\n 'keywords' => [],\n 'title_dynamic' => []\n ]);\n });\n\n return SeoManager::all();\n }", "private function collect(){\n $table = include __DIR__.'/../../config/router.php';\n foreach ($table as $modulePointer){\n \n if(!array_key_exists('module', $modulePointer) || !array_key_exists('prefix', $modulePointer)){\n throw new \\Exception('Please check the correct syntax of modules_routes.php keys \"module\" or \"prefix\" is missing !');\n }\n \n $module = $modulePointer['module'];\n $prefix = ($modulePointer['prefix'] == '/') ? '' : $modulePointer['prefix'];\n $routesFile = CrossRoadsRooter::getRoutesFiles($module);\n\n foreach ($routesFile as $name => $route){\n $this->routes->addRoute(new Route(\n $name,\n $prefix.$route['pattern'],\n $route['command']\n ));\n }\n }\n \n }", "public function populateAirport($airport) {\n\n\t\t// Build $url\n\t\tif(mb_strlen($airport)==3) {\n\t\t\t$url = $this->url.\"?iata=\".$airport;\n\t\t} elseif(mb_strlen($airport)==4) {\n\t\t\t$url = $this->url.\"?icao=\".$airport;\n\t\t} else {\n\t\t\t$this->_logError(__FUNCTION__, \"Invalid airport code: \".$airport);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Run Service\n\t\t$rc = $this->_APICall($url);\n\t\tif($rc==false) {\n\t\t\t$this->_logError(__FUNCTION__, \"API Call Failed\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// $this->fillRecord();\n\t\t$this->response = json_decode($this->response, true);\n\t\t\n\t\t// No airport found\n\t\tif(isset($this->response['error'])) {\n\t\t\tif(isset($this->response['error']['text']))\n\t\t\t\t$desc = $this->response['error']['text'];\n\t\t\telse\n\t\t\t\t$desc = \"airport [\".$airport.\"] not found\";\n\t\t\t$this->_logError(__FUNCTION__, $desc);\n\t\t\treturn false;\n\t\t}\n\t\t$record = array(\n\t\t\t$this->response['id'],\n\t\t\t$this->response['iata'],\n\t\t\t$this->response['icao'],\n\t\t\t$this->response['name'],\n\t\t\t$this->response['location'],\n\t\t\t$this->response['street_number'],\n\t\t\t$this->response['street'],\n\t\t\t$this->response['city'],\n\t\t\t$this->response['country'],\n\t\t\t$this->response['postal_code'],\n\t\t\t$this->response['phone'],\n\t\t\t$this->response['latitude'],\n\t\t\t$this->response['longitude'],\n\t\t\t$this->response['uct'],\n\t\t\t$this->response['website']\n\t\t);\n\t\t$this->fillRecord($record);\n\n\t}", "public function run()\n {\n Excel::import(new AppointmentsImport, 'appointments.csv');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to retrieve the project score min.
public function get_score_min() { return $this->score_min; }
[ "public function getMinScore()\n {\n return $this->minScore;\n }", "public function get_min_score_if_attempted() {\n return $this->min_score_if_attempted;\n }", "function GetMin() {\r\n\t\treturn $this->min;\r\n\t}", "public function getMin(){\n return $this->distribution->getMin();\n }", "public function getMinimum();", "public function min()\n {\n $collection = $this->getSortedCollection();\n\n return $collection->first();\n }", "public function getDefaultMin()\r\n {\r\n return $this->defaultMin;\r\n }", "public function getLowestPrice()\n {\n $min_result = $this->_db->fetchRow(\"SELECT MIN(price_total) as min_price FROM pmt2core_cheapest_price_speed INNER JOIN pmt2core_media_objects ON pmt2core_cheapest_price_speed.id_media_object = pmt2core_media_objects.id WHERE pmt2core_media_objects.visibility = 30\");\n return !is_null($min_result) ? $min_result->min_price : null;\n }", "function minScore() {\r\n }", "public function getMin()\n {\n return $this->options['min'];\n }", "public function getMinNumber()\n {\n return $this->minNumber;\n }", "public function min()\n {\n return min($this->a);\n }", "public function get_min()\r\n\t{\r\n\t\treturn $this->get_attr('min');\r\n\t}", "public function getMin() {\n\t\treturn $this->options ['min'];\n\t}", "function GetMinVal() {\n return $this->scale[0];\n }", "function bhk_min() \n\t{\n\t\t$query = \"SELECT min(bhk) min FROM properties\";\n\t\t$result = mysql_query($query);\n\t\tif(mysql_num_rows($result) > 0) \n\t\t{\n\t\t\t$row = mysql_fetch_array($result);\n\t\t\treturn $row['min'];\n\t\t}\n\t\telse return 0;\n\t}", "public function getXMin()\n {\n return $this->get(self::X_MIN);\n }", "function GetMinVal()\n {\n return $this->scale[0];\n }", "function getPositionMin(){\n $select = $this->createQueryBuilder('s');\n $select\n ->select('MIN(s.position)');\n return $select->getQuery()->getSingleScalarResult();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets a new cONNUMBER
public function setCONNUMBER($cONNUMBER) { $this->cONNUMBER = $cONNUMBER; return $this; }
[ "private function setNumber($number)\n {\n $this->number = $number;\n }", "function set_invoice_number(){\n if (!isset($this->number)) {\n $this->set('number', $this->get_default_invoice_number());\n }\n }", "function setNumPlaca($NumPlaca) {\r\n $this->NumPlaca = $NumPlaca;\r\n }", "protected function assignVatNumber()\n {\n }", "function setNumber($value) {\n return $this->setFieldValue('number', $value);\n }", "public function setContractNumber($value)\n {\n return $this->set(self::CONTRACTNUMBER, $value);\n }", "public function setNum(int $num)\n {\n $this->num = $num;\n }", "function set_CreditCardNumber($number)\r\n{\r\n\t$this->CreditCardNumber = $number;\r\n}", "public function setReferenceNumberAttribute($value)\n {\n $this->attributes['reference_number'] = self::cleanReferenceNumber($value);\n }", "public function setNum(?int $num)\n {\n $this->num = $num;\n }", "function setPhoneNumberCustomer($arg) {\n\t\t$this->multipay->setPhoneNumberCustomer($arg);\n\t}", "public function testSetNumeroPj() {\n\n $obj = new DevisCommercialEntetes();\n\n $obj->setNumeroPj(10);\n $this->assertEquals(10, $obj->getNumeroPj());\n }", "function set_invoice_number($number='')\n\t{\n\t\t$this->invoice_number = $number;\n\t\treturn true;\n\t}", "public function setNumber(?NumberColumn $value): void {\n $this->getBackingStore()->set('number', $value);\n }", "public function setCourseNumber(?string $value): void {\n $this->getBackingStore()->set('courseNumber', $value);\n }", "public function setTicketNumber($val)\n {\n $this->_propDict[\"ticketNumber\"] = $val;\n return $this;\n }", "public function setCustomerPhone()\n\t{\n\t\t// Ensure we have an argument to work with\n\t\tif (func_num_args()<1)\n\t\t{\n\t\t\t$this->error[]=\"Invalid number of arguments in function '\".__FUNCTION__.\"()'\";\n\t\t\treturn;\n\t\t}\n\t\t$value=func_get_arg(0);\n\t\t$this->phoneNumber = $this->dom->createElement('phoneNumber',substr($value,0,25));\n\t\treturn;\n\t}", "function setNota_num($inota_num = '')\n {\n // adminto ',' como separador decimal.\n $inota_num = str_replace(\",\", \".\", $inota_num);\n $this->inota_num = $inota_num;\n }", "public function setCardNumber($number)\n\t {\n\t \t if(is_null($this->token)) {\n\t \t $number = $this->validateCardNumber($number);\n\t \t\t if($number) {\n\t \t\t \t$this->json['params'][$this->account]['number'] = $number;\n\t \t\t }\n\t \t }\n\t \t\treturn $this;\n\t }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The method returns a list of names to skip checking ['name1','name2',..]
abstract public function getNamesToSkip(): array;
[ "abstract public function skipNames();", "public function provideInvalidNames()\n {\n $names[][] = \"\";\n $names[][] = \" \";;\n $names[][] = \"foobar \";\n $names[][] = \" foobar \";\n $names[][] = \" foobar\";\n\n return $names;\n }", "function exclude_names()\r\n\t{\r\n\t\t$input_name = strtolower($this->input->post('auction_name',TRUE));\r\n\t\tif($input_name=='bidwarz' || $input_name=='bidwarzlive'){\r\n\t\t\t$this->form_validation->set_message('exclude_names', 'You cannot use \"'.$input_name.'\" for auction name');\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 hasExcludeByName();", "function getIgnoreList($selectedattributename)\n {\n $attributes = $this->m_node->getAttributes();\n\n $attribnames = array();\n foreach ($attributes as $attr)\n {\n $attribnames[] = $attr->fieldName();\n }\n\n // remove the selected attribute from all the available attributes,\n // and we have a list of attributes that we can ignore.\n return array_diff($attribnames, array($selectedattributename));\n }", "public function getInvalidUsernames()\n {\n return collect([\n '-bar-baz',\n 'ab',\n null,\n '',\n 'a',\n 'ab*',\n '😂',\n '😉👏🐝🎉',\n ])->map(function ($value) {\n return [$value];\n })->all();\n }", "function getExcludedSearchStringbyName($name)\n{\n $searchString = \"\";\n\n if (isset($_POST[$name]) && $_POST[$name] == \"Exclude\") {\n // loop to retrieve checked values\n $searchString .= $name . \"=0 AND \";\n }\n return $searchString;\n}", "public static function getSmartExcludesByModelName($name)\n {\n return GeneralUtility::trimExplode(',', (string)ReflectionUtility::getFirstTagValue($name, 'smartExclude'), true);\n }", "public function getSkipNamingValidation()\n {\n return $this->skip_naming_validation;\n }", "public function setSkipClassNameCheck($nameList) {\n $this->skipClassList = $nameList;\n }", "public static function provideInvalidElementNames()\n {\n $return = static::provideNonStrings();\n $return[] = [''];\n return $return;\n }", "private function getAllowedBypassUsernames(): array\n {\n $allowedUsernames = $this->scopeConfigInterface->getValue(self::XML_PATH_ALLOWED_BYPASS_USERNAMES);\n if (empty($allowedUsernames)) {\n $allowedUsernames = [];\n }\n return $allowedUsernames;\n }", "function filterBikeListByName($myList,$loginName) {\n $result = array();\n foreach ($myList as $key => $instance) {\n $verifyName = $instance->name;\n if(strtolower($loginName) === strtolower($verifyName)) {\n $sn = $instance->serialnumber;\n $result[$sn] = $instance;\n }\n }\n return $result;\n }", "public static function getNamePossibilities($name)\n {\n $nameParts = explode(' ', $name);\n $listOfSuffixes = ['II', 'III', 'IV', 'V', 'Jr', 'Sr', 'MD', 'PhD', 'DO', 'RN'];\n $nameParts = array_diff($nameParts, $listOfSuffixes);\n // array of name arrays where name array[0] = first name and [1] = last name\n $nameOptions = [];\n if (count($nameParts) == 2) {\n $flname[0] = $nameParts[0];\n $flname[1] = $nameParts[1];\n array_push($nameOptions, $flname);\n } else {\n $middleName = null;\n for ($i = 0; $i < count($nameParts); $i++) {\n if (strlen($nameParts[$i]) == 1) {\n $middleName = $i;\n break;\n }\n }\n // if middle initial exists split first and last name by its position\n if (!is_null($middleName)) {\n $first = array_slice($nameParts, 0, $middleName);\n $flname[0] = implode(' ', $first);\n $last = array_slice($nameParts, $middleName + 1);\n $flname[1] = implode(' ', $last);\n array_push($nameOptions, $flname);\n } else {\n // find all first last name combinations\n for ($i = 1; $i < count($nameParts); $i++) {\n $first = array_slice($nameParts, 0, $i);\n $flname[0] = implode(' ', $first);\n $last = array_slice($nameParts, $i);\n $flname[1] = implode(' ', $last);\n array_push($nameOptions, $flname);\n }\n }\n }\n return $nameOptions;\n }", "function filterOutEmpty($unicorns)\n{\n $unicorns = array_filter($unicorns, function ($unicorn) {\n return $unicorn->name !== \"\";\n });\n return $unicorns;\n}", "function nonBlacklistedDistunguishednameArray($array,$refused=\"\"){\n $cleanArray = array();\n foreach ($array as $dn) {\n if(blacklistedDistinguishedname($dn,$refused)==FALSE){\n array_push($cleanArray,$dn);\n }\n }\n return $cleanArray;\n}", "function getValidItemNames($validateItemNamesResults)\n{\n $results = array();\n foreach ($validateItemNamesResults as $pair_name_valid) {\n $item_name = $pair_name_valid[0];\n $valid = $pair_name_valid[1];\n if ($valid) {\n $results[] = $item_name; # append to the end of the array\n }\n }\n\n return $results;\n}", "public function setExcludeByName($excludeByName);", "public function withoutName($name)\n {\n return $this->filter(function (SplFileInfo $current) use ($name) {\n if ($name == $current->getBasename()) {\n return false;\n }\n\n $path_name = str_replace('\\\\', '/', $current->getPathname());\n $glob = array_map(function ($string) {\n return str_replace('\\\\', '/', $string);\n }, glob($current->getPath().'/'.$name));\n\n if (in_array($path_name, $glob)) {\n return false;\n }\n\n set_error_handler(function () {\n return true;\n });\n\n $preg_pattern = '/'.trim($name, '/#').'/';\n\n if (preg_match($preg_pattern, $current->getBasename())) {\n return false;\n }\n\n set_error_handler(null);\n\n return true;\n });\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Dummy constructor to avoid object factory initialization problems.
public function __construct() { // dummy constructor }
[ "final private function __construct() {}", "private function __construct (){}", "public function newInstanceWithoutConstructor()\n {\n }", "protected function __construct()\n {\n // prevents class from direct initialization (singleton)\n }", "abstract protected function __construct();", "public static function makeConstructor()\r\n {\r\n return self::makePublicConstructor();\r\n }", "public function __construct() {\n\n\t\t$this->_keychainService = implementationKeychainService_Dummy::getInstance();\n\t\t$this->_keyService = implementationKeyService_Dummy::getInstance();\n\t}", "public function constructReturnNullIfNoConstructorIsSet()\n {\n $this->assertNull(Registry::construct('Registry test'));\n $this->assertNull(Registry::constructArray('Registry test'));\n }", "public function constructorWithNoArgs() {\n $fieldMediator = new MockFieldMediatorForConstructorOnly();\n $this->assertInstanceOf('EntityXliff\\Drupal\\Utils\\DrupalHandler', $fieldMediator->getHandler());\n }", "public function newInstanceWithoutConstructor();", "public static function createDummy(): static {\n\t\t/** @noinspection PhpIncompatibleReturnTypeInspection */\n\t\treturn PHP::createDummy(static::class);\n\t}", "public function __construct() {\n // The local stream wrapper needs no initialization at this point.\n }", "private final function __construct() { /* Class is a utility class */ }", "public function getConstructor()\n {\n }", "public function testConstructorWithoutValue()\n {\n $cookie = new Cookie('name');\n }", "private function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tif ( empty( self::$_instance ) )\r\n\t\t\t\tself::$_instance = $this;\r\n\t\t\t\r\n\t\t}", "public function __construct()\n {\n parent::__construct(new ClosureReflectionFactory(\n new InvokableObjectReflectionFactory(\n new MethodArrayReflectionFactory(\n new MethodStringReflectionFactory(\n new FunctionNameReflectionFactory(\n new FaillingCallableReflectionFactory\n )\n )\n )\n )\n ));\n }", "public function getConstructor() {}", "final public function __construct() {\n\t\t\tthrow new CallerException('String should never be instantiated. All methods and variables are publically statically accessible.');\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Creates a table based on a section Requires only the section name
public function create_table($section) { if( !$this->is_section($section)) return false; $field_args = $this->fields_for_database($section); $qry = "CREATE TABLE IF NOT EXISTS $section(\n\t" . implode(",\n\t", $field_args) . "\n)\n"; $result = $this->db->query($qry); if($result) return true; else return false; }
[ "protected function createSectionTable($strValue) {\n\t\t$arrDefaultFields = array('add' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'lang_content'\t\t=> array('type' => 'integer', 'unsigned' => 0, 'notnull' => 1, 'default' => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t'usr_data_id'\t\t=> array('type' => 'integer', 'unsigned' => 0, 'notnull' => 0),\n\t\t\t\t\t\t\t\t\t\t\t\t'sys_language_id'\t=> array('type' => 'integer', 'unsigned' => 0, 'notnull' => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t'date_create' \t\t=> array('type' => 'timestamp', 'notnull' => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t'date_publish' \t\t=> array('type' => 'timestamp', 'notnull' => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t'date_expire' \t\t=> array('type' => 'timestamp', 'notnull' => 0),\n\t\t\t\t\t\t\t\t\t\t\t\t'create_html'\t\t=> array('type' => 'boolean', 'notnull' => 1, 'default' => 0),\n\t\t\t\t\t\t\t\t\t\t\t\t'active'\t\t\t=> array('type' => 'boolean', 'notnull' => 1, 'default' => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t'deleted'\t\t\t=> array('type' => 'boolean', 'notnull' => 1, 'default' => 0),\n\t\t\t\t\t\t\t\t\t\t\t\t'seo_description'\t=> array('type' => 'text', 'notnull' => 0),\n\t\t\t\t\t\t\t\t\t\t\t\t'seo_keywords'\t\t=> array('type' => 'text', 'length' => 255, 'notnull' => 0),\n\t\t\t\t\t\t\t\t\t\t\t\t'permalink'\t\t\t=> array('type' => 'text', 'length' => 255, 'notnull' => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t'name' \t\t\t\t=> array('type' => 'text', 'length' => 255, 'notnull' => 1)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\n\t\tif($this->objManage->createTable($strValue)) {\n\t\t\tif($this->objManage->alterTable($strValue,$arrDefaultFields)) {\n\t\t\t\tif($this->objManage->setForeignKey($strValue,'usr_data',array('usr_data_id' => array()))) {\n\t\t\t\t\tif($this->objManage->setForeignKey($strValue,'sys_language',array('sys_language_id' => array()))) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else return false;\n\t\t\t\t} else return false;\n\t\t\t} else return false;\n\t\t} else return false;\n\t}", "protected function create_section_data() {\n\t\t$this->in_out();\n\t\t$this->active_link();\n\t}", "public function createTables();", "protected function create_section_data() {\n\t\t$this->font_family();\n\t\t$this->customize_font_family();\n\t\t$this->list_style_type();\n\t\t$this->nested_list();\n\t\t$this->enable_collapse_expand();\n\t\t$this->show_sub_icon();\n\t\t$this->accordion();\n\t\t$this->colexp_init_state();\n\t\t$this->strong_1st();\n\t}", "function create_table()\n {\n }", "public function creating(Section $section)\n {\n $maxOrder = (int) $this->getMaxSectionOrder($section);\n $section->order = ($maxOrder >= 1) ? $maxOrder + 1 : 1;\n }", "public function created(Section $section)\n {\n //\n }", "abstract protected function buildTable();", "protected function create_section_data() {\n\t\t$this->developer_debug();\n\t}", "function createNewSection($section)\n{\n add_settings_section(\n \"vm_app_options_{$section}_section\", // id attribute\n ucwords($section), // section Title\n [$this, 'renderSection'], // render callback\n 'pluginPage' // page (do not modify)\n );\n}", "public function _add_table() {\n global $wpdb,$catpdf_data;\n // Construct query\n $table_name = $wpdb->prefix . \"catpdf_template\";\n $sql = \"\n\t\tCREATE TABLE `{$table_name}` (\n\t\t\t`template_id` mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\t`template_name` varchar(50) NOT NULL,\n\t\t\t`template_description` text,\n\t\t\t`template_loop` text,\n\t\t\t`template_body` text,\n\t\t\t`template_pageheader` text,\n\t\t\t`template_pagefooter` text,\n\t\t\t`create_by` mediumint(9) NOT NULL,\n\t\t\t`create_date` datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n\t UNIQUE KEY id (template_id)\n\t\t);\";\n // Import wordpress database library\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta($sql);\n // Save version\n add_option('catpdf_db_version', CATPDF_VERSION);\n // Add plugin option holder\n $options = $catpdf_data->get_options();\n add_option('catpdf_options', $options, '', 'yes');\n\t\t// Define and create required directories\n\t\t$required_dir = array(\n\t\t\t'htmlfragments' => SCRAPE_PATH . '/cache/html',\n\t\t\t'pdf' => SCRAPE_PATH . '/cache/pdf'\n\t\t);\n\t\tforeach ($required_dir as $dir)\n\t\t\tif( !is_dir($dir) ) @mkdir($dir, 0777);\n\t\t\n\t\t\n\t\t\n }", "function ouwiki_create_new_section($course, $cm, $ouwiki, $subwiki, $pagename, $newcontent,\n $sectionheader, $formdata) {\n $sourcepage = ouwiki_get_current_page($subwiki, $pagename);\n $sectiondetails = ouwiki_get_new_section_details($sourcepage->xhtml, $sectionheader);\n ouwiki_save_new_version_section($course, $cm, $ouwiki, $subwiki, $pagename,\n $sourcepage->xhtml, $newcontent, $sectiondetails, $formdata);\n}", "public function addSection($section);", "public function actionCreate()\n {\n $model = new Section();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n // data section\n $data_section = $_POST['Section'];\n // name catalog\n foreach ($data_section as $vlSection){\n $name_section = $vlSection;\n }\n\n // last id catalog\n $last_section = Section::find()\n ->orderBy('id_section DESC')\n ->one();\n $last = $last_section->id_section;\n\n // insert search_table\n $search_section = new SearchTable([\n 'name_search' => $name_section,\n 'type_search' => '2',\n 'link_search' => $last,\n ]);\n $search_section->save();\n\n return $this->redirect(['view', 'id' => $model->id_section]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create_sections() {\n\t\tif ( count( $this->sections ) > 0 ) {\n\t\t\tforeach ( $this->sections as $k => $v ) {\n\t\t\t\tadd_settings_section( $k, $v['name'], array( $this, 'section_description' ), $this->token );\n\t\t\t}\n\t\t}\n\t}", "public function create_section($section = CONFIG_PRIMARY_SECTION)\n\t{\n\t\tif ($this->section_exists($section))\n\t\t{\n\t\t\tthrow new Exception('Configuration section already exists');\n\t\t}\n\n\t\t$this->config[$section] = array();\n\t}", "public function create_sections () {\r\n foreach($this->sections as $name => $arr){\r\n add_settings_section( $name, $arr['name'], array( &$this, 'section_description' ), $this->page_slug );\r\n }\r\n\r\n }", "private function createDummyTable() {}", "private function addTableSection(Model $model, array $fields): void\n {\n $cardTable = CardTable::addTo($this, ['class' => $this->tableClass]);\n $cardTable->setModel($model, $fields);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Gets the private 'vich_uploader.property_mapping_factory' shared service.
protected function getVichUploader_PropertyMappingFactoryService() { return $this->services['vich_uploader.property_mapping_factory'] = new \Vich\UploaderBundle\Mapping\PropertyMappingFactory($this, ${($_ = isset($this->services['vich_uploader.metadata_reader']) ? $this->services['vich_uploader.metadata_reader'] : $this->getVichUploader_MetadataReaderService()) && false ?: '_'}, $this->getParameter('vich_uploader.mappings'), '_name'); }
[ "protected function getVichUploader_PropertyMappingFactoryService()\n {\n return $this->privates['vich_uploader.property_mapping_factory'] = new \\Vich\\UploaderBundle\\Mapping\\PropertyMappingFactory($this, ($this->privates['vich_uploader.metadata_reader'] ?? $this->getVichUploader_MetadataReaderService()), [], '_name');\n }", "protected function getVichUploader_PropertyMappingFactoryService()\n {\n return $this->services['vich_uploader.property_mapping_factory'] = new \\Vich\\UploaderBundle\\Mapping\\PropertyMappingFactory($this, ${($_ = isset($this->services['vich_uploader.metadata_reader']) ? $this->services['vich_uploader.metadata_reader'] : $this->getVichUploader_MetadataReaderService()) && false ?: '_'}, array('users_images' => array('namer' => array('service' => 'vich_uploader.namer_origname.users_images', 'options' => array()), 'uri_prefix' => '/users/image', 'upload_destination' => ($this->targetDirs[3].'\\\\app/../web/users/image'), 'inject_on_load' => false, 'delete_on_update' => true, 'delete_on_remove' => true, 'directory_namer' => array('service' => NULL, 'options' => NULL), 'db_driver' => 'orm'), 'users_pdf' => array('namer' => array('service' => 'vich_uploader.namer_origname.users_pdf', 'options' => array()), 'uri_prefix' => '/users/pdf', 'upload_destination' => ($this->targetDirs[3].'\\\\app/../web/users/pdf'), 'inject_on_load' => false, 'delete_on_update' => true, 'delete_on_remove' => true, 'directory_namer' => array('service' => NULL, 'options' => NULL), 'db_driver' => 'orm'), 'universites_pdf' => array('namer' => array('service' => 'vich_uploader.namer_origname.universites_pdf', 'options' => array()), 'uri_prefix' => '/universites/pdf', 'upload_destination' => ($this->targetDirs[3].'\\\\app/../web/universites/pdf'), 'inject_on_load' => false, 'delete_on_update' => true, 'delete_on_remove' => true, 'directory_namer' => array('service' => NULL, 'options' => NULL), 'db_driver' => 'orm'), 'demandes_pdf' => array('namer' => array('service' => 'vich_uploader.namer_origname.demandes_pdf', 'options' => array()), 'uri_prefix' => '/demandes/pdf', 'upload_destination' => ($this->targetDirs[3].'\\\\app/../web/demandes/pdf'), 'inject_on_load' => false, 'delete_on_update' => true, 'delete_on_remove' => true, 'directory_namer' => array('service' => NULL, 'options' => NULL), 'db_driver' => 'orm')), '_name');\n }", "protected function getValidator_Mapping_ClassMetadataFactoryService()\n {\n return $this->services['validator.mapping.class_metadata_factory'] = new \\Symfony\\Component\\Validator\\Mapping\\ClassMetadataFactory(new \\Symfony\\Component\\Validator\\Mapping\\Loader\\LoaderChain(array(0 => new \\Symfony\\Component\\Validator\\Mapping\\Loader\\StaticMethodLoader(), 1 => new \\Symfony\\Component\\Validator\\Mapping\\Loader\\XmlFilesLoader(array(0 => '/vagrant/project/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/config/validation.xml')), 2 => new \\Symfony\\Component\\Validator\\Mapping\\Loader\\YamlFilesLoader(array()))), NULL);\n }", "protected function getPropertyNamerService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\vich\\\\uploader-bundle\\\\src\\\\Naming\\\\NamerInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\vich\\\\uploader-bundle\\\\src\\\\Naming\\\\ConfigurableInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\vich\\\\uploader-bundle\\\\src\\\\Naming\\\\Polyfill\\\\FileExtensionTrait.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\vich\\\\uploader-bundle\\\\src\\\\Naming\\\\PropertyNamer.php';\n\n return $this->services['Vich\\\\UploaderBundle\\\\Naming\\\\PropertyNamer'] = new \\Vich\\UploaderBundle\\Naming\\PropertyNamer(($this->privates['Vich\\\\UploaderBundle\\\\Util\\\\Transliterator'] ?? $this->getTransliteratorService()));\n }", "abstract protected function _getMappingProperties();", "protected function getVichUploader_NamerPropertyService()\n {\n return $this->services['vich_uploader.namer_property'] = new \\Vich\\UploaderBundle\\Naming\\PropertyNamer();\n }", "protected function getSylius_Grid_DataExtractor_PropertyAccessService()\n {\n return $this->services['sylius.grid.data_extractor.property_access'] = new \\Sylius\\Component\\Grid\\DataExtractor\\PropertyAccessDataExtractor(${($_ = isset($this->services['property_accessor']) ? $this->services['property_accessor'] : $this->get('property_accessor')) && false ?: '_'});\n }", "public function getClassMapFactory() {\n return $this->ocmf;\n }", "protected function getValidator_PropertyInfoLoaderService()\n {\n $a = ($this->privates['property_info'] ?? $this->getPropertyInfoService());\n\n return $this->privates['validator.property_info_loader'] = new \\Symfony\\Component\\Validator\\Mapping\\Loader\\PropertyInfoLoader($a, $a, $a, NULL);\n }", "public function getPropertyMappingConfiguration() {\n\t\tif ($this->propertyMappingConfiguration === NULL) {\n\t\t\t$this->propertyMappingConfiguration = new \\TYPO3\\Flow\\Mvc\\Controller\\MvcPropertyMappingConfiguration();\n\t\t\t$this->propertyMappingConfiguration->allowAllProperties();\n\t\t}\n\t\treturn $this->propertyMappingConfiguration;\n\t}", "protected function getDataMapFactoryService()\n {\n return $this->services['TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\Mapper\\\\DataMapFactory'] = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstanceForDi(\\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Mapper\\DataMapFactory::class, ($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Reflection\\\\ReflectionService'] ?? $this->getReflectionServiceService()), ($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Configuration\\\\ConfigurationManager'] ?? $this->getConfigurationManagerService()), ($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager'] ?? $this->getObjectManagerService()), ($this->services['TYPO3\\\\CMS\\\\Core\\\\Cache\\\\CacheManager'] ?? $this->getCacheManagerService()), ($this->services['TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\ClassesConfigurationFactory'] ?? $this->getClassesConfigurationFactoryService()));\n }", "public function testConfiguredMappingAccess(): void\n {\n $object = new DummyEntity();\n $prop = new PropertyMapping('file', 'fileName');\n $prop->setMapping([\n 'upload_destination' => '/tmp',\n 'namer' => DummyNamer::class,\n ]);\n\n self::assertEquals('', $prop->getUploadDir($object));\n self::assertEquals('/tmp', $prop->getUploadDestination());\n self::assertEquals('file', $prop->getFilePropertyName());\n self::assertEquals('fileName', $prop->getFileNamePropertyName());\n }", "protected function getApiPlatform_Serializer_Mapping_ClassMetadataFactoryService()\n {\n return $this->privates['api_platform.serializer.mapping.class_metadata_factory'] = new \\ApiPlatform\\Core\\Serializer\\Mapping\\Factory\\ClassMetadataFactory(new \\Symfony\\Component\\Serializer\\Mapping\\Factory\\ClassMetadataFactory(new \\Symfony\\Component\\Serializer\\Mapping\\Loader\\LoaderChain([0 => new \\Symfony\\Component\\Serializer\\Mapping\\Loader\\AnnotationLoader(($this->privates['annotations.cached_reader'] ?? $this->getAnnotations_CachedReaderService()))])));\n }", "protected static function propertiesMap() {\n return [\n 'search_term' => ['search_term'],\n 'type' => ['type'],\n 'bundle' => ['bundle'],\n 'tags' => ['tags'],\n 'label' => ['label'],\n 'start_date' => ['start_date'],\n 'end_date' => ['end_date'],\n 'from' => ['from', 'start'],\n 'size' => ['size', 'limit'],\n 'sorting' => ['sort'],\n 'version' => ['version'],\n 'languages' => ['languages'],\n ];\n }", "public function getMapper(){ \n $mapper = new Wf_Model_WfProcesso_Mapper();\n return $mapper;\n }", "protected function getProductMapperService()\n {\n return $this->services['App\\\\Client\\\\Product\\\\Persistence\\\\Mapper\\\\ProductMapper'] = new \\App\\Client\\Product\\Persistence\\Mapper\\ProductMapper();\n }", "protected function propertyFactory()\n {\n if ($this->propertyFactory === null) {\n throw new RuntimeException(sprintf(\n '[%s] Model does not have a property factory',\n get_class($this)\n ));\n }\n\n return $this->propertyFactory;\n }", "public function get_exposer_mapping() {\n \treturn $this->get_mapped_property('exposer_mapping');\n }", "public function getMapper(){ \n $mapper = new Vendas_Model_Produto_Mapper();\n return $mapper;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Detect is current path a dir?
public function isDir() { return is_dir((string) $this); }
[ "public function is_dir(): bool;", "abstract function isdir($rempath = '.');", "public function isDir () {}", "function isdir($rempath = '.')\n {\n // TODO: Implement isdir() method.\n }", "function is_current($dirname) {\n $dir = get_parent_dir();\n if ($dir == $dirname) {\n echo 'class=\"current\"';\n } else {\n echo '';\n } \n }", "public function isCurrentDirectoryBase()\n {\n return $this->currentDir === $this->baseDir;\n }", "public function isDirectory(): bool;", "public function isDirectory() : bool {\n return true;\n }", "function is_dir ($filename) {}", "function _check_dir ( $path ) {\n\n if (substr($path, (strlen($path) - 1), 1) == \"/\") {\n return true;\n } else {\n return false;\n }\n }", "public static function isCurrentDirName($name) {\n return $name == DOT;\n }", "public function isDir() {\n return $this->isDir;\n }", "function is_dir( $dir )\r\n {\r\n\t\tglobal $GlobalSiteIni;\r\n \tif ( $dir != \"\" && $GlobalSiteIni)\r\n {\r\n $dir = $GlobalSiteIni->SiteDir . $dir;\r\n }\r\n return is_dir( $dir );\r\n }", "public function isDirectory()\n {\n return is_dir($this->path);\n }", "public function is_directory() {\n return true;\n }", "abstract function is_dir ($filename);", "public function getIsDir()\n {\n return $this->is_dir;\n }", "private function dirIsValid() {\n return is_dir($this->directory);\n }", "function is_dir($name, $path) {\r\n\t\treturn $name != '.' && $name != '..' && is_dir(suio::tslash($path).$name);\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Lists all Responsable entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $responsables = $em->getRepository('AppBundle:Responsable')->findAll(); return $this->render('responsable/index.html.twig', array( 'responsables' => $responsables, )); }
[ "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Responsable::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getResponsables()\n {\n return $this->hasMany(Responsable::className(), ['Num_Eleve' => 'Num_eleve']);\n }", "public function getAll()\n {\n return\n DB::table('responsibilities')\n ->select(\n 'responsibilities.id',\n 'responsibilities.responsibility_group_code as responsibilityGroupCode',\n 'responsibility_groups.name as responsibilityGroupName',\n 'responsibilities.code',\n 'responsibilities.name',\n 'responsibilities.description',\n 'responsibilities.eff_begin as effBegin',\n 'responsibilities.eff_end as effEnd'\n )\n ->leftJoin('responsibility_groups', 'responsibility_groups.code', '=', 'responsibilities.responsibility_group_code')\n ->where([\n ['responsibilities.tenant_id', $this->requester->getTenantId()],\n ['responsibilities.company_id', $this->requester->getCompanyId()]\n ])\n ->orderBy('responsibilities.eff_end', 'desc')\n ->orderBy('responsibilities.id', 'asc')\n ->get();\n }", "public function all() {\n return $this->app->entityManager->getRepository($this->model_name)->findAll();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('mqlUITCandidatureBundle:Responsable')->findAll();\n \n $filiere = $em->getRepository('mqlUITCandidatureBundle:Filiere')->findAll();\n \n \n /* $qb = $em->createQueryBuilder();\n \n$res = $qb->select('res.id')\n ->from('mqlUITCandidatureBundle:Responsable', 'res')\n ->getQuery()\n ->getResult(); \n\n$fil = $qb->select('fil.responsable')\n ->from('mqlUITCandidatureBundle:Filiere', 'fil')\n ->where($qb->expr()->In('fil.responsable', $res))\n ->getQuery()\n ->getResult();\n \n */ \n \n\n return $this->render('mqlUITCandidatureBundle:Responsable:index.html.twig', array(\n 'entities' => $entities,\n 'filiere' => $filiere,\n ));\n }", "public function getResponsabilidades()\n {\n return $this->hasMany(Responsabilidade::className(), ['idFase' => 'idFase']);\n }", "function get_all_responsables_titulacion_()\n {\n return $this->db->get('responsables_titulacion')->result_array();\n }", "public function getResponsable()\n {\n return $this->responsable;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DataLayerBundle:T360Reponses')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function getResponsable()\r\n\t{\r\n\t\treturn($this->responsable);\r\n\t}", "public function indexAction()\n {\n \t\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('JobHubBundle:Offre')->findBy(array('enabled'=>true));\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MissTheRaidCharacterBundle:Character')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function getResponsibilities()\n {\n return $this->getProperty(\"Responsibilities\");\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MissTheRaidAttendanceBundle:Entry')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DistritalCecadBundle:Hito')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function indexAction(){\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('FiterPollBundle:Answer')->findAll();\n return array(\n 'entities' => $entities,\n );\n }", "public function getResponders()\n {\n return $this->responders;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('Area4ContableBundle:Egreso')->findAll();\n\n return array('entities' => $entities);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SmartPsyBundle:Reponses')->findAll();\n\n return $this->render('SmartPsyBundle:Reponses:index.html.twig', array(\n 'entities' => $entities,\n ));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Load up AMP scripts needed for Customizer integrations.
public function add_customizer_scripts() { wp_enqueue_script( 'amp-customize-controls', amp_get_asset_url( 'js/amp-customize-controls.js' ), array( 'jquery', 'customize-controls' ), AMP__VERSION, true ); wp_add_inline_script( 'amp-customize-controls', sprintf( 'ampCustomizeControls.boot( %s );', wp_json_encode( array( 'queryVar' => amp_get_slug(), 'panelId' => self::PANEL_ID, 'ampUrl' => amp_admin_get_preview_permalink(), 'l10n' => array( 'unavailableMessage' => __( 'AMP is not available for the page currently being previewed.', 'amp' ), 'unavailableLinkText' => __( 'Navigate to an AMP compatible page', 'amp' ), ), ) ) ) ); wp_enqueue_style( 'amp-customizer', amp_get_asset_url( 'css/amp-customizer.css' ) ); /** * Fires when plugins should register settings for AMP. * * In practice the `customize_controls_enqueue_scripts` hook should be used instead. * * @since 0.4 * @param WP_Customize_Manager $manager Manager. */ do_action( 'amp_customizer_enqueue_scripts', $this->wp_customize ); }
[ "function wcus_amp_component_scripts( $data ) {\n\t$amp_cdn = 'https://cdn.ampproject.org/v0/';\n\t$data['amp_component_scripts']['amp-sidebar'] = $amp_cdn . 'amp-sidebar-0.1.js';\n\t$data['amp_component_scripts']['amp-accordion'] = $amp_cdn . 'amp-accordion-0.1.js';\n\treturn $data;\n}", "function wcus_amp_component_scripts( $data ) {\n\t$amp_cdn = 'https://cdn.ampproject.org/v0/';\n\t$data['amp_component_scripts']['amp-ad'] = $amp_cdn . 'amp-ad-0.1.js';\n\t$data['amp_component_scripts']['amp-sidebar'] = $amp_cdn . 'amp-sidebar-0.1.js';\n\t$data['amp_component_scripts']['amp-audio'] = $amp_cdn . 'amp-audio-0.1.js';\n\t$data['amp_component_scripts']['amp-social-share'] = $amp_cdn . 'amp-social-share-0.1.js';\n\treturn $data;\n}", "public function add_legacy_customizer_scripts() {\n\t\t$asset_file = AMP__DIR__ . '/assets/js/amp-customize-controls-legacy.asset.php';\n\t\t$asset = require $asset_file;\n\t\t$dependencies = $asset['dependencies'];\n\t\t$version = $asset['version'];\n\n\t\t/** This action is documented in includes/class-amp-theme-support.php */\n\t\tdo_action( 'amp_register_polyfills' );\n\n\t\twp_enqueue_script(\n\t\t\t'amp-customize-controls', // Note: This is not 'amp-customize-controls-legacy' to not break existing scripts that have this dependency.\n\t\t\tamp_get_asset_url( 'js/amp-customize-controls-legacy.js' ),\n\t\t\tarray_merge( $dependencies, [ 'jquery', 'customize-controls' ] ),\n\t\t\t$version,\n\t\t\ttrue\n\t\t);\n\n\t\twp_add_inline_script(\n\t\t\t'amp-customize-controls',\n\t\t\tsprintf(\n\t\t\t\t'ampCustomizeControls.boot( %s );',\n\t\t\t\twp_json_encode(\n\t\t\t\t\t[\n\t\t\t\t\t\t'queryVar' => amp_get_slug(),\n\t\t\t\t\t\t'panelId' => self::PANEL_ID,\n\t\t\t\t\t\t'ampUrl' => amp_admin_get_preview_permalink(),\n\t\t\t\t\t\t'l10n' => [\n\t\t\t\t\t\t\t'unavailableMessage' => __( 'AMP is not available for the page currently being previewed.', 'amp' ),\n\t\t\t\t\t\t\t'unavailableLinkText' => __( 'Navigate to an AMP compatible page', 'amp' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t]\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\twp_enqueue_style(\n\t\t\t'amp-customizer',\n\t\t\tamp_get_asset_url( 'css/amp-customizer-legacy.css' ),\n\t\t\t[],\n\t\t\tAMP__VERSION\n\t\t);\n\n\t\twp_styles()->add_data( 'amp-customizer', 'rtl', 'replace' );\n\n\t\t/**\n\t\t * Fires when plugins should register settings for AMP.\n\t\t *\n\t\t * In practice the `customize_controls_enqueue_scripts` hook should be used instead.\n\t\t *\n\t\t * @since 0.4\n\t\t * @param WP_Customize_Manager $manager Manager.\n\t\t */\n\t\tdo_action( 'amp_customizer_enqueue_scripts', $this->wp_customize );\n\t}", "public function mobilemenucpt_scripts() {\n\n\t\t\t// If the AMP plugin is active, return early.\n\t\t\tif ( amply_is_amp() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Enqueue sidr menu script.\n\t\t\twp_enqueue_script( 'amply-mobilemenucpt-sidr', get_theme_file_uri( 'views/mobilemenu/mobilemenucpt/js/mobilemenucpt-sidr.js' ), array( 'jquery', 'amply-sidr' ), '20180514', false );\n\t\t\twp_script_add_data( 'amply-mobilemenucpt-sidr', 'defer', true );\n\n\t\t}", "public function loadAOSscripts() {\n\n\t\tif ($this->script_loaded) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->script_loaded = true;\n\t\twp_enqueue_script( 'oxygen-aos', \tCT_FW_URI . '/vendor/aos/aos.js', null, true);\n\t\twp_enqueue_style ( 'oxygen-aos', \tCT_FW_URI . '/vendor/aos/aos.css');\n\t}", "public function enqueueScripts() {}", "function charity_is_hope_options_custom_load_scripts() {\n\t\twp_enqueue_script( 'charity-is-hope-options-custom-script',\tcharity_is_hope_get_file_url('core/core.options/js/core.options-custom.js'), array(), null, true );\n\t}", "static function include_scripts() {\n\t\tif (Config::inst()->get('GoogleMap', 'include_api_script')) {\n\t\t\tRequirements::javascript(self::api_script_src(), 'GoogleMapsAPI');\n\t\t}\n\t\tif (Config::inst()->get('GoogleMap', 'include_frontend_script')) {\n\t\t\tRequirements::javascript(self::frontend_script_src(), 'MapFieldFrontend');\n\t\t}\n\t}", "public function load_inline_scripts() {\n do_action( 'cv_theme_settings_inline_scripts' );\n }", "public function enqueue_scripts() {\n\t\tglobal $pagenow;\n\n\t\t/**\n\t\t * Yoast ACF plugin configuration.\n\t\t *\n\t\t * @var \\Yoast_ACF_Analysis_Configuration\n\t\t */\n\t\t$config = Yoast_ACF_Analysis_Facade::get_registry()->get( 'config' );\n\n\t\t// Post page enqueue.\n\t\tif ( wp_script_is( WPSEO_Admin_Asset_Manager::PREFIX . 'post-scraper' ) ) {\n\t\t\twp_enqueue_script(\n\t\t\t\t'yoast-acf-analysis-post',\n\t\t\t\tplugins_url( '/js/yoast-acf-analysis.js', AC_SEO_ACF_ANALYSIS_PLUGIN_FILE ),\n\t\t\t\tarray( 'jquery', WPSEO_Admin_Asset_Manager::PREFIX . 'post-scraper', 'underscore' ),\n\t\t\t\t$this->plugin_data['Version'],\n\t\t\t\ttrue\n\t\t\t);\n\n\t\t\twp_localize_script( 'yoast-acf-analysis-post', 'YoastACFAnalysisConfig', $config->to_array() );\n\t\t}\n\n\t\t// Term page enqueue.\n\t\tif ( wp_script_is( WPSEO_Admin_Asset_Manager::PREFIX . 'term-scraper' ) ) {\n\t\t\twp_enqueue_script(\n\t\t\t\t'yoast-acf-analysis-term',\n\t\t\t\tplugins_url( '/js/yoast-acf-analysis.js', AC_SEO_ACF_ANALYSIS_PLUGIN_FILE ),\n\t\t\t\tarray( 'jquery', WPSEO_Admin_Asset_Manager::PREFIX . 'term-scraper' ),\n\t\t\t\t$this->plugin_data['Version'],\n\t\t\t\ttrue\n\t\t\t);\n\n\t\t\twp_localize_script( 'yoast-acf-analysis-term', 'YoastACFAnalysisConfig', $config->to_array() );\n\t\t}\n\t}", "function ManageTheScripts() {\n if (!defined('SLPLUS_SCRIPTS_MANAGED') || !SLPLUS_SCRIPTS_MANAGED) {\n\n // If no shortcode rendered, remove scripts\n //\n if (!defined('SLPLUS_SHORTCODE_RENDERED') || !SLPLUS_SHORTCODE_RENDERED) {\n wp_dequeue_script('google_maps');\n wp_deregister_script('google_maps');\n wp_dequeue_script('csl_script');\n wp_deregister_script('csl_script');\n }\n define('SLPLUS_SCRIPTS_MANAGED',true);\n }\n }", "function load_on_podcasts_admin() {\n\tglobal $my_admin_page;\n\t$screen = get_current_screen();\n\tif ( 'podcasts' != $screen->id ) {\n\t\treturn;\n\t} # Else Proceed\n\twp_enqueue_script( 'my_custom_script', plugin_dir_url( __FILE__ ) . '/includes/js/autopopulate.js' );\n}", "function load_ace_scripts() {\n global $PAGE;\n $plugindirrel = '/question/type/coderunner';\n $PAGE->requires->js($plugindirrel . '/ace/ace.js');\n $PAGE->requires->js($plugindirrel . '/ace/ext-language_tools.js');\n $PAGE->requires->js($plugindirrel . '/ace/ext-modelist.js');\n}", "function ManageTheScripts() {\n if (!defined('SLPLUS_SCRIPTS_MANAGED') || !SLPLUS_SCRIPTS_MANAGED) {\n\n // If no shortcode rendered, remove scripts\n //\n if (!defined('SLPLUS_SHORTCODE_RENDERED') || !SLPLUS_SHORTCODE_RENDERED) {\n wp_dequeue_script('google_maps');\n wp_deregister_script('google_maps');\n wp_dequeue_script('csl_script');\n wp_deregister_script('csl_script');\n }\n define('SLPLUS_SCRIPTS_MANAGED',true);\n }\n }", "public function loadScripts()\n\t{\n\t\tif(!$this->scriptLoader)\n\t\t\t$this->scriptLoader = new ScriptLoader($this->isProVersion());\n\t\t\n\t\tif(!empty($this->settings->developer_mode))\n\t\t\t$this->scriptLoader->build();\n\t\t\n\t\tif(Plugin::$enqueueScriptsFired)\n\t\t{\n\t\t\t$this->scriptLoader->enqueueScripts();\n\t\t\t$this->scriptLoader->enqueueStyles();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach(Plugin::$enqueueScriptActions as $action)\n\t\t\t{\n\t\t\t\tadd_action($action, function() {\n\t\t\t\t\t$this->scriptLoader->enqueueScripts();\n\t\t\t\t\t$this->scriptLoader->enqueueStyles();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "public function enqueueScripts() {\n wp_enqueue_script('commands-utility', plugin_dir_url(__FILE__) . 'command.js');\n\n wp_enqueue_script('vue', 'https://unpkg.com/vue');\n\n wp_register_script('frontend', plugin_dir_url(__FILE__) . 'frontend/dist/wpcommandlib.umd.js');\n $localize = [\n 'ajaxUrl' => admin_url('admin-ajax.php')\n ];\n wp_localize_script('frontend', 'SERVER', $localize);\n wp_enqueue_script('frontend');\n }", "function load_input_scripts(){\n\t\t\n\t\tif($this -> input_scripts['shipped']){\n\t\t\tforeach($this -> input_scripts['shipped'] as $handler){\n\t\t\t\twp_enqueue_script($handler);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//front end scripts\n\t\tif($this -> input_scripts['custom']){\n\t\t\tforeach($this -> input_scripts['custom'] as $scripts => $script){\n\t\t\t\t\n\t\t\t\t//checking if it is style\n\t\t\t\tif( $script['type'] == 'js'){\n\t\t\t\t\twp_enqueue_script($this->plugin_meta['shortname'].'-'.$script['script_name'], $this->plugin_meta['url'].$script['script_source'], $script['depends'], '3.0', $script['in_footer']);\n\t\t\t\t}else{\n\t\t\t\t\twp_enqueue_style($this->plugin_meta['shortname'].'-'.$script['script_name'], $this->plugin_meta['url'].$script['script_source']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function enqueue_front_scripts() {\n\n\t\t// Scripts not allowed in AMP.\n\t\tif ( power_is_amp() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If a single post or page, threaded comments are enabled, and comments are open.\n\t\tif ( is_singular() && get_option( 'thread_comments' ) && comments_open() ) {\n\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t}\n\n\t\t// If superfish is enabled.\n\t\tif ( power_superfish_enabled() ) {\n\n\t\t\twp_enqueue_script( 'superfish' );\n\t\t\twp_enqueue_script( 'superfish-args' );\n\n\t\t}\n\n\t\t// If accessibility support enabled.\n\t\tif ( power_a11y( 'skip-links' ) ) {\n\t\t\twp_enqueue_script( 'skip-links' );\n\t\t}\n\n\t}", "public function print_dirty_amp_scripts() {\n\t\tif ( ! amp_is_request() && ! empty( $this->content_required_amp_scripts ) ) {\n\t\t\twp_scripts()->do_items( $this->content_required_amp_scripts );\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Applies a predefined named transformation of the given name.
public function namedTransformation($transformationName) { return $this->addAction(ClassUtils::verifyInstance($transformationName, NamedTransformation::class)); }
[ "public function namedTransformation($transformationName);", "static function registerTransform($class, $name=false) {\n static::$transforms[$name ?: $class::$name] = [get_called_class(), $class];\n }", "function getTransformer($name);", "public function transform($word);", "public static function get($name)\n {\n if (!isset(self::$_transformations[$name])) {\n self::$_transformations[$name] = new Transformation();\n }\n return self::$_transformations[$name];\n }", "protected function replaceTransformMethodName(&$stub, $name)\n {\n return $this->replaceTemplate('transform_method_name', $name, $stub);\n }", "protected function transformName($name)\n {\n if (!$this->complexTypeNameTransformer) {\n throw new TransformerNotSpecifiedException(\"Complex type name\", $name);\n }\n return $this->complexTypeNameTransformer ? $this->complexTypeNameTransformer->transform($name) : $name;\n }", "public function getTransformName();", "public static function create_transformer($name)\n {\n }", "public function replaceName($name);", "private function convertFunctionNameToFilterName($name)\n {\n preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $name, $matches);\n\n $ret = $matches[0];\n array_pop($ret);\n\n foreach ($ret as &$match) {\n $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match);\n }\n\n return str_replace('image', 'img', implode('_', $ret));\n }", "function transform_name( $name = '', $type = '' ) {\n\t$word = array( ' ' => $type, '&' => '' );\n\t$new = strtr( $name, $word );\n $new = strtolower( $new );\n return $new;\n}", "public function getOutputTransition($name = '');", "public static function xsltCallback($name) {\r\n $callback = self::getCallback($name);\r\n $arguments = func_get_args();\r\n array_shift($arguments);\r\n return call_user_func_array($callback, $arguments);\r\n }", "public function transRoute($routeName);", "public function normalize($name);", "public function transform($w)\n {\n\n foreach ($this->transforms as $t) {\n $w = $t->transform($w);\n }\n\n return $w;\n }", "public function buildFunction($name);", "abstract protected function applyTransformations();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get current phase name There are eight phases, evenly split. A "New Moon" occupies the 1/16th phases either side of phase = 0, and the rest follow from that.
public function getPhaseName(): string { $names = [ 'New Moon', 'Waxing Crescent', 'First Quarter', 'Waxing Gibbous', 'Full Moon', 'Waning Gibbous', 'Third Quarter', 'Waning Crescent', 'New Moon', ]; return $names[floor(($this->phase + 0.0625) * 8)]; }
[ "public function getPhase(): string;", "public function getPhase();", "public function getPhaseName(): ?string\n {\n if (isset($this->kill_chain_phases[0])) {\n return $this->kill_chain_phases[0]->phase_name ?? null;\n }\n\n return null;\n }", "public function getPhase()\n {\n return $this->phase;\n }", "public function getPhase() {\n return $this->phase;\n }", "public function getPhaseId()\n {\n return $this->phase_id;\n }", "static public function get_name_string() {\n return get_string(self::NAME_CODE_STRING, 'gradereport_progress');\n }", "public static function createTournamentName()\n {\n return self::$months[date('m')] . ' ' . date('Y');\n }", "function lingotek_current_phase($phases) {\n $phase_id = -1;\n\n $current_phase = 0;\n\n foreach ($phases as $phase) {\n if (!$phase->isMarkedComplete) {\n $phase_id = $phase->id;\n break;\n }\n $current_phase++;\n }\n\n // All phases are complete, use last phase as current.\n if (!empty($phases) && $phase_id == -1) {\n $last_phase = end($phases);\n $phase_id = $last_phase->id;\n }\n\n return $phase_id;\n}", "function moonphase ($WDmoonage) {\n\n preg_match_all('|(\\d+)|is',$WDmoonage,$matches);\n print \"<!-- WDmoonage='$WDmoonage' matches=\\n\" . print_r($matches,true) . \"-->\\n\";\n $mdays = $matches[1][0];\n $mhours = $matches[1][1];\n $mmins = $matches[1][2];\n $mpct = $matches[1][3];\n \n $mdaysd = $mdays + ($mhours / 24) + ($mmins / 1440);\n // Definitions from http://www.answers.com/topic/lunar-phase\n // * Dark Moon - Not visible\n // * New Moon - Not visible, or traditionally, the first visible crescent of the Moon\n // * Waxing Crescent Moon - Right 1-49% visible\n // * First Quarter Moon - Right 50% visible\n // * Waxing gibbous Moon - Right 51-99% visible\n // * Full Moon - Fully visible\n // * Waning gibbous Moon - Left 51-99% visible\n // * Third Quarter Moon - Left 50% visible\n // * Waning Crescent Moon - Left 1-49% visible\n // * New Moon - Not visible\n\n if ($mdaysd <= 29.53/2) { // increasing illumination\n $ph = \"Waxing\";\n\t$qtr = \"First\";\n } else { // decreasing illumination\n $ph = \"Waning\";\n\t$qtr = \"Last\";\n }\n \n if ($mpct < 1 ) { return(\"New Moon\"); }\n if ($mpct <= 49) { return(\"$ph Crescent\"); }\n if ($mpct < 51) { return(\"$qtr Quarter\"); }\n if ($mpct < 99) { return(\"$ph Gibbous\"); }\n\treturn(\"Full Moon\");\n }", "public function providerTestGetFriendlyPhase() {\n return [\n ['Completed', 'Completed'],\n ['In Progress', 'InProgress'],\n ['Failed Validation', 'FailedValidation'],\n ['Completed', 'Completed'],\n ['', ''],\n ];\n }", "public function getStepTitle()\n {\n $step_title = null;\n switch ( $this->_step ) {\n case self::STEP_CHECK:\n $step_title = _T(\"Checks\");\n break;\n case self::STEP_TYPE:\n $step_title = _T(\"Installation mode\");\n break;\n case self::STEP_DB:\n $step_title = _T(\"Database\");\n break;\n case self::STEP_DB_CHECKS:\n $step_title = _T(\"Database access and permissions\");\n break;\n case self::STEP_VERSION:\n $step_title = _T(\"Previous version selection\");\n break;\n case self::STEP_DB_UPGRADE:\n $step_title = _T(\"Datapase upgrade\");\n break;\n case self::STEP_DB_INSTALL:\n $step_title = _T(\"Tables Creation\");\n break;\n case self::STEP_ADMIN:\n $step_title = _T(\"Admin parameters\");\n break;\n case self::STEP_GALETTE_INIT:\n $step_title = _T(\"Galette initialization\");\n break;\n case self::STEP_END:\n $step_title = _T(\"End!\");\n break;\n }\n return $step_title;\n }", "private function getPhaseErrorMessage(int $phase): string\r\n {\r\n switch ($phase) {\r\n case 1:\r\n return 'User defined UTF-8 filter error.';\r\n case 2:\r\n return 'User defined ISO-8859-1 filter error.';\r\n case 3:\r\n return 'PHP string filter error.';\r\n case 4:\r\n return 'PHP field filter error.';\r\n default:\r\n return 'Fatal filter error.';\r\n }\r\n }", "public function getPhase($id);", "function moonphase ($WDmoonage) {\n\n preg_match_all('|(\\d+)|is',$WDmoonage,$matches);\n// print \"<!-- matches=\\n\" . print_r($matches,true) . \"-->\\n\";\n $mdays = $matches[1][0];\n $mhours = $matches[1][1];\n $mmins = $matches[1][2];\n $mpct = $matches[1][3];\n \n $mdaysd = $mdays + ($mhours / 24) + ($mmins / 1440);\n // Definitions from http://www.answers.com/topic/lunar-phase\n // * Dark Moon - Not visible\n // * New Moon - Not visible, or traditionally, the first visible crescent of the Moon\n // * Waxing Crescent Moon - Right 1-49% visible\n // * First Quarter Moon - Right 50% visible\n // * Waxing gibbous Moon - Right 51-99% visible\n // * Full Moon - Fully visible\n // * Waning gibbous Moon - Left 51-99% visible\n // * Third Quarter Moon - Left 50% visible\n // * Waning Crescent Moon - Left 1-49% visible\n // * New Moon - Not visible\n\n if ($mdaysd <= 29.53/2) { // increasing illumination\n $ph = \"Waxing\";\n\t$qtr = \"First\";\n } else { // decreasing illumination\n $ph = \"Waning\";\n\t$qtr = \"Last\";\n }\n \n if ($mpct < 1 ) { return(\"New Moon\"); }\n if ($mpct <= 49) { return(\"$ph Crescent\"); }\n if ($mpct < 51) { return(\"$qtr Quarter\"); }\n if ($mpct < 99) { return(\"$ph Gibbous\"); }\n\treturn(\"Full Moon\");\n }", "public function getCommunityPhase()\n {\n switch ($this->community->score) {\n case 1:\n return $this->getStepOnePhase();\n case 2:\n return $this->getStepTwoPhase();\n case 3:\n return $this->getStepThreePhase();\n case 4:\n return $this->getStepFourPhase();\n default:\n return null;\n }\n }", "public function __toString() {\n return 'step_' . $this->order(); //TODO: a better idea might be to use the step code rather than its order\n }", "private function getCurrentPeriodInProcesShortname()\n {\n return $this->getPeriodShortname($this->period);\n }", "public function get_progress_label() {\n\t\t$current_step = $this->get_current_step();\n\t\t$steps = $this->get_steps();\n\t\t$label = '';\n\t\tif ( isset($steps[$current_step]) ) {\n\t\t\t$step = $steps[$current_step];\n\t\t\tif ( isset($step['progress_label']) ) {\n\t\t\t\t$label = $step['progress_label'];\n\t\t\t} elseif ( isset($step['name']) ) {\n\t\t\t\t$label = $step['name'];\n\t\t\t}\n\t\t}\n\n\t\tif ( sizeof($steps) > 1 ) {\n\t\t\t$preLabel = sprintf( __('Step %d of %d', 'tainacan'), $current_step + 1, sizeof($steps) );\n\t\t\t$label = $preLabel . ': ' . $label;\n\t\t}\n\n\t\tif ( empty($label) ) {\n\t\t\t$label = __('Running Importer', 'tainacan');\n\t\t}\n\n\t\treturn $label;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
method: send_mail($target, $subject, $message, $buffer = 0) throws a steam_exception because this method cannot be used using steam_connector_lite
function send_mail_from($target, $subject, $message, $from, $buffer = FALSE, $mime_type = "text/html") { throw new steam_exception( $this->get_login_user_name(), "Error: send_mail_from is not available using steam_connector_lite", 980 ); }
[ "abstract protected function _sendmail();", "public function sendMail()\n {\n }", "public function send(MailMessage $message);", "public function sendMail()\n {\n }", "public function send(MailParameters $mailParameters): void;", "public function testSendEmail()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function send($mailer);", "private function spool_email() {\n $this->unwrap_specials();\n\n // Sendmail will use the address given to From: header as the return path \n // if it's not specified using $this->return_path()\n $return_path = ($this->return_path !== '') ? $this->return_path : $this->headers['From'];\n \n // Opens process file pointer\n // Check out http://www.postfix.org/sendmail.1.html for sendmail flags\n // -t extracts recipients from message headers.\n // -r sets the envelope sender address. This is the address where delivery problems are sent to.\n $fp = @popen($this->sendmail_path.' -oi -f '.$this->extract_email($this->headers['From']).' -t -r '.$this->extract_email($return_path), 'w');\n \n if ($fp === FALSE) {\n $this->set_error_message('email_send_failure_sendmail');\n \n // Server probably has popen disabled, so nothing we can do to get a verbose error.\n return FALSE;\n }\n \n fputs($fp, $this->header_str);\n fputs($fp, $this->finalbody);\n \n $status = pclose($fp);\n \n if ($status !== 0) {\n $this->set_error_message('email_exit_status', $status);\n $this->set_error_message('email_no_socket');\n \n $this->set_error_message('email_send_failure_sendmail');\n return FALSE;\n }\n \n $this->set_error_message('email_sent_success');\n return TRUE;\n }", "public function sendMail() {\r\n if (!is_null($this->sMsgTable) and $this->iMailid > 0) {\r\n $this->getPropertiesFromDb();\r\n }\r\n\r\n if ($this->sEmailsTo === NULL or $this->sEmailBody === NULL or $this->sContentType === NULL) {\r\n $this->bHasErrors = true;\r\n $this->setError(\"Email headers(email to, content type) and email body were not set\");\r\n } else {\r\n if (!$this->bHasErrors) {\r\n $sEol = PHP_EOL;\r\n $sMailheaders = \"From: {$this->sEmailFrom}$sEol\";\r\n $sMailheaders .= \"{$this->sMimeVersion}\";\r\n $sMailheaders .= \"Content-Type: {$this->sContentType}; charset=ISO-8859-1$sEol\";\r\n $sMailheaders .= \"Reply-To: {$this->sSiteName} <{$this->sWebmasterMail}>\";\r\n $sAdditionalheader = \"-f{$this->sWebmasterMail}\";\r\n if (!mail($this->sEmailsTo, $this->sSubject, $this->sEmailBody, $sMailheaders, $sAdditionalheader)) {\r\n $this->bHasErrors = true;\r\n $this->setError(\"sendmail failed because: \" . $this->genericError(true));\r\n }\r\n }\r\n }\r\n }", "protected function _send() {\n $params = array(\n 'Action' => 'SendEmail',\n 'Source' => static::format_addresses(array($this->config['from'])),\n 'Message.Subject.Data' => $this->subject,\n 'Message.Body.Text.Data' => $this->alt_body,\n 'Message.Body.Html.Data' => $this->body\n );\n\n $i = 0;\n foreach ($this->to as $value) {\n $params['Destination.ToAddresses.member.' . ($i + 1)] = static::format_addresses(array($value));\n ++$i;\n }\n\n $i = 0;\n foreach ($this->cc as $value) {\n $params['Destination.CcAddresses.member.' . ($i + 1)] = static::format_addresses(array($value));\n ++$i;\n }\n\n $i = 0;\n foreach ($this->bcc as $value) {\n $params['Destination.BccAddresses.member.' . ($i + 1)] = static::format_addresses(array($value));\n ++$i;\n }\n\n $i = 0;\n foreach ($this->reply_to as $value) {\n $params['ReplyToAddresses.member.' . ($i + 1)] = static::format_addresses(array($value));\n ++$i;\n }\n\n LogLib::info('Start send email', __METHOD__, $params);\n \n $date = date(DATE_RSS);\n $signature = $this->_sign_signature($date);\n \n LogLib::info('Signature: ', __METHOD__, $signature);\n \n try {\n $url = \"tls://email-smtp.{$this->region}.amazonaws.com/\";\n $curl = \\Request::forge($url, array(\n 'driver' => 'curl',\n 'method' => 'post'\n ))\n ->set_header('Content-Type', 'application/x-www-form-urlencoded')\n ->set_header(\n 'X-Amzn-Authorization', \n 'AWS3-HTTPS AWSAccessKeyId=' . \\Config::get('ses.access_key','AKIAJ5DQYYMFTZCYBR5A') . ', Algorithm=HmacSHA256, Signature=' . $signature\n )\n ->set_header('Date', $date);\n $response = $curl->execute($params); \n \n LogLib::info('End send email', __METHOD__, $response->response());\n if (intval($response->response()->status / 100) != 2) {\n LogLib::info('return 1', __METHOD__, $response->response()->status);\n return false;\n }\n return true;\n }\n catch(\\Exception $e)\n {\n LogLib::error(sprintf(\n \"Send mail Exception\\n\"\n . \" - Message : %s\\n\"\n . \" - Code : %s\\n\"\n . \" - File : %s\\n\"\n . \" - Line : %d\\n\"\n . \" - Stack trace : \\n\"\n . \"%s\", \n $e->getMessage(), \n $e->getCode(), \n $e->getFile(), \n $e->getLine(), \n $e->getTraceAsString()), \n __METHOD__, \n $_FILES);\n }\n LogLib::info('return 2', __METHOD__, 'aaa');\n return false;\n }", "function send () {\r\n $this->_buildMail();\r\n\r\n $to_str = ($this->apply_windows_bugfix) ? implode(',', $this->all_emails) : $this->xheaders['To'];\r\n\r\n\t\t\t// Поддержка safe mode\r\n\t\t\t// Автор: Холодий Андрей\r\n\t\t\t// Дата изменения: 02.09.2005 18:59\r\n if (ini_get('safe_mode')) {\r\n \treturn mail($to_str, $this->xheaders['Subject'], $this->fullBody, $this->headers);\r\n } else {\r\n\t return mail($to_str, $this->xheaders['Subject'], $this->fullBody, $this->headers, \"-odb\");\r\n }\r\n }", "abstract public function sendSuspendEmail();", "function hw_send_mail() {\r\n\r\n}", "private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => 'opublisher@gmail.com',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => 'opublisher@gmail.com',\r\n 'fromName' => 'opublisher@gmail.com',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }", "public function testSendEmailWithQueue()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function churchdb_send_mail($subject, $message, $to) {\n churchcore_systemmail($to, $subject, $message, true);\n}", "public function sendEmail()\n {\n }", "public function testSendMessage() {\n $mailSystem = $this->getMandrillMail();\n $message = $this->getMessageTestData();\n $message['to'] = 'Recipient One <recipient.one@example.com>,' . 'Recipient Two <recipient.two@example.com>,' . 'Recipient Three <recipient.three@example.com>';\n $response = $mailSystem->mail($message);\n $this->assertTrue($response, 'Tested sending message to multiple recipients.');\n }", "public function testSendMethodViaSendMail()\n {\n $app = array(\n 'orchestra.memory' => $memory = m::mock('Memory'),\n 'mailer' => $mailer = m::mock('Mailer'),\n );\n\n $memory->shouldReceive('makeOrFallback')->andReturn($memory)\n ->shouldReceive('get')->with('email')->andReturn(array(\n 'driver' => 'sendmail',\n 'sendmail' => '/bin/sendmail -t',\n ))\n ->shouldReceive('get')->with('email.from')->andReturn(array(\n 'address' => 'hello@orchestraplatform.com',\n 'name' => 'Orchestra Platform',\n ));\n\n $mailer->shouldReceive('setSwiftMailer')->once()->andReturn(null)\n ->shouldReceive('alwaysFrom')->once()->with('hello@orchestraplatform.com', 'Orchestra Platform')\n ->shouldReceive('send')->once()->with('foo.bar', array('foo' => 'foobar'), '')->andReturn(true);\n\n $stub = new Mail($app);\n $this->assertTrue($stub->send('foo.bar', array('foo' => 'foobar'), ''));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets all replies to the comment with it parent_id and gets the replies to those replies
function getReply($conn, $parent_id, $reply_number){ $stmt = $conn->prepare("SELECT ProductComments.comment_text, ProductComments.comment_id, Customers.customer_fname, Customers.customer_lname FROM shopdb.ProductComments, shopdb.Customers WHERE ProductComments.product_id = ? AND ProductComments.customer_id = Customers.customer_id AND ProductComments.comment_parent_id = ?;"); $stmt->bind_param("ii",$product_id, $parent_id); $stmt->execute(); $stmt->bind_result($comment_text, $comment_id, $comment_fname, $comment_lname); $stmt->store_result(); //Loops until there are no more comments with the same parent while ($stmt->fetch()){ //display the comment displayComment($comment_text, $comment_fname, $comment_lname, $reply_number, $comment_id); //retrieve any replies to this comment getReply($conn, $comment_id, $reply_number+1); } $stmt->free_result(); $stmt->close(); }
[ "public function replies()\n\t{\n\t\treturn $this->hasMany('App\\Comment','reply_id');\n\t}", "public function replies()\n {\n return $this->hasMany('App\\CommentReply');\n }", "public function replies()\n {\n return $this->hasMany('App\\NoteComment', 'reply_id');\n }", "public function replies(){\n return $this->hasMany(CommentReply::class);\n }", "public function getCommentReplytByCommentId($id)\n\t{\n\t\t$select = $this->db->select()\n\t ->from('comment',array('content','date','userId', 'id'))\n\t ->where('parent = ?', $id)\n\t ->join('user','user.id = comment.userId','username');\n\t $result = $this->db->fetchAll($select);\n\t $finished = [];\n\t // we append the like count to every reply\n\t\tforeach($result as $key => $inner) {\n\t\t\t$inner['likeCount'] = $this->countLikesDislikes((int)$inner['id']);\n\t\t\t$finished[$key] = $inner;\n\t\t}\n\t return $finished;\n\t}", "private function recursive_build_comment($ref_id, $parent_id = \"-\") {\n\n\t\t// First check if we have a parent\n\t\tif ($parent_id === \"-\") {\n\t\t\t// no, so LIMIT it\n\t\t\t$limit = $this->limit;\n\t\t} else {\n\t\t\t// we have, no limit, get all replies then\n\t\t\t$limit = \"\";\n\t\t}\n\n\t\t// Let's check if it's admin viewing to show all comments, or not and show only published comments\n\t\tif ($this->admin_viewing === true)\n\t\t\t$and_show_it = \"\";\n\t\telse\n\t\t\t$and_show_it = \"AND show_it = '1'\";\n\n\t\t// Get the comments\n\t\t$result \t= mysqli_query(\"SELECT * FROM commax_comments WHERE ref_id = '$ref_id' AND parent = '$parent_id' $and_show_it ORDER BY id \".$this->display_order.\" $limit\");\n\t\t// set the output var to nothing\n\t\t$out \t\t= \"\";\n\n\t\t// Loop trought all the results (comments)\n\t\twhile($row = mysqli_fetch_assoc($result)) {\n\t\t\t// Process the comment\n\t\t\t$this->process_comment($row);\n\t\t\t// Check again if we have a parent (meaning, are we a reply?)\n\t\t\tif ($parent_id === \"-\") {\n\t\t\t\t// no, get the comment HTML\n\t\t\t\t$out .= $this->pre_Markup();\n\t\t\t} else {\n\t\t\t\t// yes, get the reply HTML\n\t\t\t\t$out .= $this->pre_Markup(true);\n\t\t\t}\n\t\t\t// Right so is the recursive check. If this comment has childs, call this function again.\n\t\t\tif (($this->commentHasReplies($row[\"id\"]) === true) and ($parent_id === \"-\"))\n\t\t\t\t$out .= $this->recursive_build_comment($ref_id, $row[\"id\"]);\n\t\t}\n\t\t// Return output\n\t\treturn $out;\n\t}", "public function replies(){\n return $this->hasMany('Social\\Models\\Status', 'parent_id');\n }", "public function replies()\n {\n return $this->hasMany('Chatty\\Plus\\Statuses\\Status', 'parent_id');\n }", "public function getChildrenComments()\n {\n return $this->hasMany(UserCommentResource::class, ['parent_id' => 'id'])\n ->orderBy('created_at DESC');\n }", "public function replies()\n {\n return $this->hasMany(Reply::class, 'discussion_id', 'id');\n }", "public function replies()\n {\n return $this->hasMany('friends\\Models\\Status','parent_id');\n }", "public function replies()\n {\n return $this->hasMany(Reply::class, 'conversation_id');\n }", "public function parentReply()\n {\n if ($this->reply_id == 0) {\n return null;\n } else {\n $reply = Reply::findOrFail($this->reply_id);\n\n return $reply;\n }\n }", "public function childrenComments()\n {\n return $this->hasMany(Comment::class, 'parent_id')->with('comments');\n }", "public function replies()\n {\n return $this->hasMany(Reply::class, 'enquiry_id')->orderBy('created_at', 'desc');\n }", "protected function findAndAttachCommentReplies(Tx_PwComments_Domain_Model_Comment $comment) {\n\t\t$query = $this->createQuery();\n\t\t$query->matching(\n\t\t\t$query->equals('parentComment', $comment->getUid())\n\t\t);\n\t\t$query->setOrderings(array('crdate' => $this->getReplySortingDirection()));\n\t\t$comment->setReplies($query->execute());\n\t}", "public function replyCommentAction($id) {\n $parent = $this->models[CommentModel::NAME]->findById($id);\n if (!$parent) {\n $this->addError(self::TRANSLATION_ERROR_NOT_FOUND);\n \t\t$this->setError404();\n return;\n }\n\n $comment = $this->createComment();\n $comment->parent = $parent->id;\n\n \t$form = $this->createForm($comment);\n\n \t$this->setCommentsView($form, self::TRANSLATION_REPLY, $parent);\n }", "public function getParentCommentId()\n {\n return $this->getData('replyTo');\n }", "public function replies()\n {\n return $this->hasMany(Message::class, 'message_id');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns only hidden fields.
public function hiddenFields() { $hiddenFields = []; foreach ($this->fieldsCache as $name => $field) : if ($field->isHidden()): $hiddenFields[$name] = $field; endif; endforeach; return $hiddenFields; }
[ "abstract public function getHiddenFields();", "public function getHiddenFields()\n {\n return [\n 'createdAt',\n 'updatedAt',\n 'version',\n 'locale'\n ];\n }", "public function genericSearchHiddenFields();", "public function transaction_formGetHiddenFields ();", "public function getHiddenFields()\n {\n return [\n 'createdAt',\n 'updatedAt',\n 'version'\n ];\n }", "public function transaction_formGetHiddenFields () {\n }", "protected function hiddenFields() \n {\n /**\n * Intialize the hidden fields array.\n */\n $hidden_fields = array();\n \n /**\n * Get all the field names for the form.\n */\n $field_names = array_keys($this->fields);\n \n /**\n * Iterate over each field name.\n */\n foreach ($field_names as $name) {\n /**\n * Check a bound field instance of the field to see if it's hidden.\n */\n if ($this[$name]->is_hidden) {\n /**\n * Add the hidden field to the array.\n */\n $hidden_fields[] = $this[$name];\n }\n }\n \n /**\n * Return the hidden field array.\n */\n return $hidden_fields;\n }", "private function show_hidden() {\n\n if (!empty($this->_hiddenfields)) {\n\n foreach ($this->_hiddenfields as $name => $value) {\n ?>\n <input type=\"hidden\" name=\"<?php echo $name; ?>\" id=\"<?php echo $name; ?>\" value=\"<?php echo $value; ?>\">\n <?php\n }\n\n // Clear the array\n $this->_hiddenfields = array();\n\n }\n }", "public function get_visible_fields() {\n $fields = array();\n if (count($this->fields)) {\n foreach($this->fields as $field) {\n if (!$this->get_field($field)->is_hidden()) {\n $fields[] = $field;\n }\n }\n }\n return $fields;\n }", "public function getHiddenFields(): array\n {\n return $this->hiddenFields;\n }", "private function getHiddenFieldsWithoutAccess(): array\n\t{\n\t\treturn [\n\t\t\t'STORE_TO',\n\t\t\t'STORE_TO_INFO',\n\t\t\t'STORE_TO_TITLE',\n\t\t\t'STORE_TO_AMOUNT',\n\t\t\t'STORE_TO_RESERVED',\n\t\t\t'STORE_TO_AVAILABLE_AMOUNT',\n\t\t\t'STORE_FROM',\n\t\t\t'STORE_FROM_INFO',\n\t\t\t'STORE_FROM_TITLE',\n\t\t\t'STORE_FROM_AMOUNT',\n\t\t\t'STORE_FROM_RESERVED',\n\t\t\t'STORE_FROM_AVAILABLE_AMOUNT',\n\t\t\t'PURCHASING_PRICE',\n\t\t\t'BASE_PRICE',\n\t\t\t'TOTAL_PRICE',\n\t\t\t'AMOUNT',\n\t\t];\n\t}", "protected function render_hidden_fields()\n {\n }", "protected function visibleFields() \n {\n /**\n * Intialize the fields array.\n */\n $visible_fields = array();\n \n /**\n * Get all the field names for the form.\n */\n $field_names = array_keys($this->fields);\n\n /**\n * Iterate over each field name.\n */\n foreach ($field_names as $name) {\n /**\n * Check a bound field instance of the field to see if it's hidden.\n */\n if (!$this[$name]->is_hidden) {\n /**\n * Add the hidden field to the array.\n */\n $visible_fields[] = $this[$name];\n }\n }\n \n /**\n * Return the hidden field array.\n */\n return $visible_fields;\n }", "public function getVisibleFields()\n {\n return $this->getFieldsByVisibility(false, false);\n }", "public function getHidden()\n\t{\n\t\t# code...\n\t\treturn $this->__HIDDEN__ ?? [];\n\t}", "public function render_hidden_fields()\n\t{\n\t\tif (!empty($this->hidden_fields)) {\n\t\t\tforeach ($this->hidden_fields as $hidden) {\n\t\t\t\t$hidden->render();\n\t\t\t}\n\t\t}\n\t}", "public function getHiddenFields()\n {\n $fields = array();\n foreach ($this->points as $index => $point)\n {\n $fields['points[' . $index . '][location][0]'] = array();\n $fields['points[' . $index . '][location][1]'] = array();\n $fields['points[' . $index . '][order]'] = array('class' => 'order');\n }\n return $fields;\n }", "function getHidden() {\n\t\treturn $this->hidden;\n\t}", "public function getHidden()\n {\n return $this->hidden;\n //===\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Display a listing of rejects
public function index() { $rejects = Reject::all(); return View::make('rejects.index', compact('rejects')); }
[ "public function rejectAction()\n {\n // Denied user viewing if no front-end management permission assigned\n if (!$this->config('enable_front_edit') && 'front' == $this->section) {\n return $this->jumpTo404();\n }\n\n $result = [\n 'status' => self::RESULT_TRUE,\n 'message' => [],\n 'data' => [],\n ];\n\n $id = $this->params('id', 0);\n $rejectReason = $this->params('memo', '');\n\n if (!$id) {\n return ['message' => __('Not enough parameter.')];\n }\n\n $model = $this->getModel('draft');\n $row = $model->find($id);\n if (!$row->id or $row->status != DraftModel::FIELD_STATUS_PENDING) {\n return ['message' => __('Invalid draft.')];\n }\n\n // Getting permission and checking it\n $rules = Rule::getPermission();\n if (!(isset($rules[$row->category]['approve'])\n and $rules[$row->category]['approve'])\n ) {\n return $this->jumpToDenied();\n }\n\n $row->status = DraftModel::FIELD_STATUS_REJECTED;\n $row->reject_reason = $rejectReason;\n $row->save();\n\n $result['status'] = self::RESULT_TRUE;\n $result['data']['redirect'] = $this->url(\n '',\n ['action' => 'list', 'controller' => 'draft']\n );\n\n return $result;\n }", "public function rejectAction()\n {\n $result = array(\n 'status' => self::RESULT_TRUE,\n 'message' => array(),\n 'data' => array(),\n );\n\n $id = Service::getParam($this, 'id', 0);\n $rejectReason = Service::getParam($this, 'memo', '');\n\n if (!$id) {\n return array('message' => __('Not enough parameter.'));\n }\n \n $model = $this->getModel('draft');\n $row = $model->find($id);\n if (!$row->id or $row->status != Draft::FIELD_STATUS_PENDING) {\n return array('message' => __('Invalid draft.'));\n }\n \n $row->status = Draft::FIELD_STATUS_REJECTED;\n $row->reject_reason = $rejectReason;\n $row->save();\n\n $result['status'] = self::RESULT_TRUE;\n $result['data']['redirect'] = $this->url('', array('action'=>'list', 'controller' => 'draft'));\n\n return $result;\n }", "public function index_editor_rejected()\n {\n $papers = Paper::where('status', config('appConstants.status.rejected'))->get();\n $type = config('appConstants.titles.editor_rejected');\n return view(\n 'papers.index',\n compact('papers', 'type')\n );\n }", "public function rejectedUsers()\n {\n\n return view('Admin::users.rejectedusers');\n }", "public function listAction()\n {\n $reader = $this->get('app_main.submission.reader');\n\n $submissions = $reader->findAllNotValidated();\n\n return $this->render('AppMainBundle:Submission:list.html.twig', [\n 'submissions' => $submissions,\n ]);\n }", "public function show_applications_rejected(Request $req, $id = null)\n {\n $l_usr = $this->log_user;\n $prospects = Application::filter_rows($l_usr, 3, $id);\n $branches = Branch::where('status', 1)->get();\n $templates = Template::where('status',1)->get();\n\n if ( $req->ajax() ) {\n return view('applications.rejected.table', compact('prospects'));\n }\n return view('applications.rejected.index', compact('prospects', 'templates', 'branches'));\n }", "public function listFailed()\n {\n return view('admin.transactions.failed');\n }", "public function create()\n\t{\n\t\t$onlineForms = $this->onlineForms;\n\t\t$processes = $this->processes;\n\n\t\treturn View::make('admin.create.rejectreason', ['pageTitle' => 'Add Reject Reason'], compact('onlineForms', 'processes'));\n\t}", "public function report_reasons()\n {\n $reasons = str_replace(\"\\r\", '', PeepSo::get_option('site_reporting_types', __('Spam', 'peepso-core')));\n $reasons = explode(\"\\n\", $reasons);\n\n $reasons = apply_filters('peepso_activity_report_reasons', $reasons);\n\n echo '<select class=\"ps-select ps-full ps-js-report-type\">', PHP_EOL;\n echo '<option value=\"\">', __('- select reason -', 'peepso-core'), '</option>', PHP_EOL;\n foreach ($reasons as $reason) {\n $reason = esc_attr($reason);\n $reason = stripslashes($reason);\n echo '<option value=\"', $reason, '\">', $reason, '</option>';\n }\n echo '<option value=\"Other\" data-need-reason=\"1\">' . __('Other', 'peepso-core') . '</option>';\n echo '</select>', PHP_EOL;\n\n echo '<div class=\"ps-js-report-desc\" style=\"position:relative; margin-top:10px\">';\n echo '<textarea class=\"ps-textarea ps-full\" maxlength=\"250\" placeholder=\"' . esc_attr__( 'Report description...', 'peepso-core' ) . '\"></textarea>';\n echo '<div class=\"ps-charcount ps-charcount--input ps-js-counter\"></div>';\n echo '</div>';\n\n echo '<div class=\"ps-alert ps-alert-danger ps-js-report-error\" style=\"margin:10px 0 0; display:none\"></div>';\n }", "public function rejectAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') && $this->_getParam('user_reason') )\n\t\t{\t// TODO: validate and write entry to database\n\t\t\t// TODO: add success message to view\n\t\t\tif( $this->db->rejectRefund( $this->_getParam('user'), $this->_getParam('user_reason') ) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// TODO: If the refunds period has closed, parse request logs against refund list, update rejected users\n\t\t$this->view->user_options = $this->db->getRefunds('REQUESTED');\n\t}", "public function show($id)\n\t{\n\t\t$reject = Reject::findOrFail($id);\n\n\t\treturn View::make('rejects.show', compact('reject'));\n\t}", "public function confirmationListAction(): void\n {\n $issuesOpenApprovalStage1List = $this->issueRepository->findAllToApproveOnStage1();\n $issuesOpenApprovalStage2List = $this->issueRepository->findAllToApproveOnStage2();\n $issuesReadyToStart = $this->issueRepository->findAllToStartSending();\n\n $this->view->assignMultiple(\n [\n 'issuesOpenApprovalStage1List' => $issuesOpenApprovalStage1List,\n 'issuesOpenApprovalStage2List' => $issuesOpenApprovalStage2List,\n 'issuesReadyToStart' => $issuesReadyToStart\n ]\n );\n }", "public function return_reason_list()\n\t{\n\t\t$data['return'] = $this->Setting_model->return_reason_list();\n\t\t$this->load->view('settings/reason/return_reason_list',$data);\n\t}", "public function showManagePledge()\n {\n try {\n return view('admin.downloads.manage_pledge.list');\n } catch (Exception $e) {\n abort(500);\n }\n }", "public function showApproveList()\n {\n $template = 'admin/suggestedfoods.html.twig';\n\n $suggestedPublicFoods = $this->getDoctrine()->getRepository(SuggestedProduct::class)->findAll();\n\n $args = [\n 'controller_name' => 'Admin Panel - approve list',\n 'suggestedfoods' => $suggestedPublicFoods\n ];\n\n\n return $this->render($template, $args);\n }", "public function actionRejectServises()\n {\n // get user-client relationship\n $userClientRow = UsersClientList::model()->findByAttributes(array(\n 'User_ID'=>Yii::app()->user->userID,\n 'Client_ID'=>Yii::app()->user->clientID,\n ));\n\n // if user is client-admin\n if ($userClientRow->hasClientAdminPrivileges()) {\n $pendingClientServiceSettings = PendingClientServiceSettings::model()->findByAttributes(array(\n 'Client_ID'=>Yii::app()->user->clientID,\n ));\n\n if ($pendingClientServiceSettings) {\n $pendingClientServiceSettings->delete();\n Yii::app()->user->setFlash('success', \"New settings have been rejected!\");\n }\n }\n\n $this->redirect('/myaccount?tab=service');\n }", "public function rejected_vendors() {\n $this->load->model(\"rejected_model\");\n $this->load->view($this->vendors_url . \"header\");\n $this->load->view($this->vendors_url.\"rejected_vendors\", [\"vendors\"=> $this->rejected_model->get_vendor_details()]);\n $this->load->view($this->vendors_url . \"footer\");\n }", "public function actionFreeEssencesList()\n {\n $freeEssences = FreeEssences::find()->orderBy([\n 'free_essences_order' => SORT_ASC\n ])->all();\n\n return $this->render('@yicms-common/Views/developer/free_essences_list', [\n 'freeEssences' => $freeEssences,\n ]);\n }", "public function getRejectText() {\n return $this->t('Rechazar');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Saves sticky attributes into an internal file.
public function saveStickyAttributes(): void { $stickyAttributes = $this->stickyAttributes(); $stickyAttributes[] = 'template'; $values = []; foreach ($stickyAttributes as $name) { $method = 'get' . $name; if (method_exists($this, $method)) { $values[$name] = $this->$method(); } } $path = $this->getStickyDataFile(); if (!mkdir($concurrentDirectory = dirname($path), 0755, true) && !is_dir($concurrentDirectory)) { throw new RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); } file_put_contents($path, Json::encode($values)); }
[ "private function saveFile()\n\t{\n\t\tfile_put_contents($this->filename, serialize($this->persistenceArray));\n\t}", "private function save()\n\t{\n\t\t$this->writeAPTProxyConf();\n\t\t$this->writeSquidConf();\n\t\t$this->writeEtcProfiles();\n\t\t$this->writeACNGConf();\n\t}", "function save() {\n\t\tfile_put_contents( '../demo/config.dat', serialize($this) );\n\t}", "private function save() {\n $file = $this->saveLocation . $this->data['sessionID'];\n /* Serialize data array */\n $serdate = serialize($this->data);\n /* Open file and write serialized array to file */\n $fh = fopen($file, 'w') or die(\"can't open file\");\n fwrite($fh, $serdate);\n fclose($fh);\n }", "private function save()\n\t{\n\t\t$this->data['date'] = date('Y-m-d');\n\t\t$this->data['timestamp'] = $this->timestamp;\n\t\t// If the file exists, it must be writable. If it doesn't exist, the directory must be writable.\n\t\tif (is_writable($this->fileName) || (!file_exists($this->fileName) && is_writable(dirname($this->fileName)))) {\n\t\t\tfile_put_contents($this->fileName, json_encode($this->data));\n\t\t}\n\t}", "public function save()\n {\n $data = array();\n $data[] = \"; <?php die; ?>\";\n $data[] = \"; \";\n $data[] = \"; Liquid PHP Application Framework Configuration File\";\n $data[] = \"\";\n\n foreach($this->data as $a => $section)\n {\n $data[] = \"[\" . $a . \"]\";\n foreach($section as $b => $subsection)\n {\n foreach($subsection as $c => $value)\n {\n $data[] = $b . '.' . $c . '=\"' . $value . '\"';\n }\n }\n\n file_put_contents($this->filename, implode(\"\\r\\n\", $data));\n $this->requiresSave = false;\n }\n }", "public function save() {\n\t\tglobal $SESSION;\n\n\t\t$SESSION->rack_data = $this->serialize();\n\t}", "protected function saveMeta()\n {\n foreach ($this->getMetaAttributes() as $attribute) {\n if (is_null($attribute->getValue())) {\n $attribute->delete();\n } else {\n $this->metaAttributes()->save($attribute);\n }\n }\n }", "public function save()\n\t{\n\t\tif ($this->type != 'file') {\n\t\t\treturn;\n\t\t}\t\t\t\n\t\t\n\t\t// Randomly clean the cache out\n\t\tif (rand(0, 99) == 50) {\n\t\t\t$clear_before = time();\n\t\t\t\n\t\t\tforeach ($this->cache as $key => $value) {\n\t\t\t\tif ($value['expire'] && $value['expire'] < $clear_before) {\n\t\t\t\t\tunset($this->cache[$key]);\t\n\t\t\t\t\t$this->state = 'dirty';\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->state == 'clean') { return; }\n\t\t\n\t\tfile_put_contents($this->data_store, serialize($this->cache));\n\t\t$this->state = 'clean';\t\n\t}", "public function save()\n\t{\n\t\t$this->setP3PHeader();\n\t\t$this->setCookie( $this->name, $this->generateContentString(), $this->expire);\n\t}", "function savePosition()\t{\n\t\tif ($this->FE_USER->user) {\n\t\t\t$this->FE_USER->uc['tt_news'][$this->treeName] = serialize($this->stored);\n\t\t\t$this->FE_USER->writeUC();\n\t\t} else {\n\t\t\tsetcookie($this->treeName, serialize($this->stored));\n\t\t}\n\t}", "public function loadStickyAttributes(): void\n {\n $stickyAttributes = $this->stickyAttributes();\n $path = $this->getStickyDataFile();\n if (is_file($path)) {\n $result = Json::decode(file_get_contents($path), true);\n if (is_array($result)) {\n foreach ($stickyAttributes as $name) {\n $method = 'set' . $name;\n if (array_key_exists($name, $result) && method_exists($this, $method)) {\n $this->$method($result[$name]);\n }\n }\n }\n }\n }", "private function save( ) {\n $lock_file_path = $this->article_path( ) . \".lock\";\n // sleep in short bursts while waiting for a lock to be released\n do {\n usleep( 5 );\n } while( file_exists( $lock_file_path ) );\n\n // create a lock file to prevent other threads from attempting to write\n touch( $lock_file_path );\n $this->write_JSON( );\n // destroy the lock file\n unlink( $lock_file_path );\n }", "public function save() {\n file_put_contents($this->filepath, json_encode($this->data));\n }", "public function save() \n { \n // Create body using keys required by API\n $body = [];\n\n foreach (self::$attributes as $attributeName) {\n\n // Ignore advertiser\n if ($attributeName === 'advertiser') {\n continue;\n }\n\n if (property_exists($this, $attributeName)) {\n $body[$attributeName] = $this->{$attributeName};\n }\n }\n\n // Check for 'file' attribute\n if (property_exists($this, 'file')) {\n $body['file'] = $this->file;\n }\n\n // Execute\n $responseBody = self::_update(Creative::RESOURCE_PATH . '/' . $this->id, null, $body, true, true);\n\n // Update local properties to new ones returned by APIs\n $this->updateAttributes($responseBody);\n }", "public function save(){\n\t\t$fh = fopen($this->filepath, 'w+b');\n\t\tif (!$fh) {\n\t\t\techo \"Cannot write to {$this->filepath}. Check permissions.\";\n\t\t\treturn;\n\t\t}\n\n\t\t$json = json_encode($this->entries);\n\t\tfwrite($fh, $json);\n\t\tfclose($fh);\n\t}", "public function persist()\n {\n $filename = $this->getCacheFilename();\n $data = json_encode($this->attendees);\n\n file_put_contents($filename, $data);\n }", "public function save(){\r\n\t\t$this->exportContent($this->toc->saveXML(),'toc.xml',$this->getAbsStorageDir());\r\n\t}", "public function save() \n { \n\n // Create body using keys required by API\n $body = [];\n\n // Loop through all attributes and save\n foreach (self::$attributes as $attributeName) {\n\n // Ignore expanded attributes\n if (in_array($attributeName, ['campaign', 'priority', 'creatives', 'zones', 'zone_groups'])) {\n continue;\n }\n\n if (property_exists($this, $attributeName)) {\n $body[$attributeName] = $this->{$attributeName};\n }\n }\n \n // Execute\n $responseBody = self::_update(Placement::RESOURCE_PATH . '/' . $this->id, null, $body);\n\n // Update local properties to new ones returned by APIs\n $this->updateAttributes($responseBody);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Calculate the final result Iterate throught the functions in order to get output $Railing, $Posts, $Length return $Railing or $Posts or $Length
function Execution($Railing, $Posts, $Length) { if($Railing == True && $Railing >= 1 ) { return Railing($Railing); } elseif($Posts == True && $Posts >= 2 ) { return Posts($Posts); } elseif($Length == True && $Length >= 1.70){ return Length($Length); } else { return '<img src="please.jpg" alt="" width="326" height="400" />'; } }
[ "function lengthToPostsAndRailings(Float $length, Array $railingLength, Array $postLength) : array {\n$length *= 100;\n\n$binLength = intToBinary($length);\n\n$binLength = binarySubtract($binLength, $postLength);\n\n$panelLength = binaryAdd($postLength, $railingLength);\n$railNumber = binaryDivide($binLength, $panelLength, $remainder);\n\nif (binGreaterThan($remainder, [0 => 0])) {\n$railNumber = binaryAdd($railNumber, [0 => 1]);\n}\n\n$decRailNumber = binToDecimal($railNumber);\n\nreturn [\n'Railings' => $decRailNumber,\n'Posts' => $decRailNumber + 1,\n];\n}", "function howManyRailingsAndPosts($posts, $railings)\n{\n if ($posts > $railings) {\n return 1;\n } elseif ($posts < $railings) {\n return 2;\n } elseif ($posts == $railings) {\n return 3;\n }\n}", "function CalcLengthOfFence($numberOfRailings) {\n if(gettype($numberOfRailings) == 'integer') {\n $totalLength = $numberOfRailings * 1.5 + ($numberOfRailings + 1) * 0.1;\n return \"This number of railings will have a total length of \" . $totalLength;\n $numberOfRailings = 0;\n } else {\n return \"Sorry, Something Has Gone Wrong\";\n }\n}", "function output(int $postCount, int $railingCount) : string {\n return $postCount . ' posts' . '<br>' . $railingCount . ' railings';\n}", "public function numberOfPostings(): int;", "function hwoo_archive_result_count() {\r\n $data = utility_data(func_get_args());\r\n global $wp_query;\r\n\r\n if ( ! woocommerce_products_will_display() )\r\n return;\r\n\r\n $paged = max( 1, $wp_query->get( 'paged' ) );\r\n $per_page = $wp_query->get( 'posts_per_page' );\r\n $total = $wp_query->found_posts;\r\n $first = ( $per_page * $paged ) - $per_page + 1;\r\n $last = min( $total, $wp_query->get( 'posts_per_page' ) * $paged );\r\n\r\n $context = HW_Timber::load($data['current_working_template']);\r\n $context['total'] = $total;\r\n $context['first'] = $first;\r\n $context['last'] = $last;\r\n $context['show_all'] = $total <= $per_page || -1 == $per_page;\r\n\r\n HW_Timber::_render(array('woo/loop/result-count.twig'), $context);\r\n\r\n }", "public function testFcalculateLength() {\n $numPosts = 10;\n $numRailings = 3;\n $expected = (10*POST + 3*RAILING);\n $actual = calculateLength($numPosts, $numRailings);\n $this -> assertEquals($expected, $actual);\n }", "public function countR(): int;", "function get_result_count( $params = [] ) {\n $text_of = __( 'of', 'fwp-front' );\n\n $page = (int) $params['page'];\n $per_page = (int) $params['per_page'];\n $total_rows = (int) $params['total_rows'];\n\n if ( $per_page < $total_rows ) {\n $lower = ( 1 + ( ( $page - 1 ) * $per_page ) );\n $upper = ( $page * $per_page );\n $upper = ( $total_rows < $upper ) ? $total_rows : $upper;\n $output = \"$lower-$upper $text_of $total_rows\";\n }\n else {\n $lower = ( 0 < $total_rows ) ? 1 : 0;\n $upper = $total_rows;\n $output = $total_rows;\n }\n\n return apply_filters( 'facetwp_result_count', $output, [\n 'lower' => $lower,\n 'upper' => $upper,\n 'total' => $total_rows,\n ] );\n }", "function getFenceLength(int $numPosts, int $numRailings) {\n if ($numPosts == 2 && $numRailings == 1) {\n $fenceLength = RAILING_LENGTH + (POST_LENGTH * 2);\n } else {\n $fenceLength = ($numPosts * POST_LENGTH) + (($numPosts - 1) * RAILING_LENGTH);\n }\n return $fenceLength;\n}", "public function get_result_count();", "public function hasMoreResults();", "public function calculateLength($numberOfPosts, $numberOfRailings)\n {\n $length = 0;\n $postWidth = Post::$width;\n $railLength = Railing::$length;\n $postsValidationResult = $this->validatePostsNumber($numberOfPosts);\n $railingValidationResult = $this->validateRailingNumber($numberOfRailings);\n if ($postsValidationResult && $railingValidationResult) {\n\n if ($numberOfPosts > $numberOfRailings + 1) {\n $numberOfPosts = $numberOfRailings + 1;\n }\n if ($numberOfPosts < $numberOfRailings) {\n $numberOfRailings = $numberOfPosts - 1;\n }\n $this->setNumberOfPosts($numberOfPosts);\n $this->setNumberOfRailings($numberOfRailings);\n $length = $numberOfRailings * ($railLength + $postWidth) + $postWidth;\n }\n $this->setFenceLength($length);\n\n return $length;\n }", "function getRailsAndPosts($userLengthOfFence) {\n $railLength = 1.5;\n $postLength = 0.1;\n $result = round(($userLengthOfFence - $postLength)/($railLength + $postLength), 2);\n $totalPosts = ceil($result) + 1;\n $totalRails = ceil($result);\n while ($result < $userLengthOfFence) {\n $result += ($railLength + $postLength);\n }\n $overShot = round(($result - $userLengthOfFence), 2);\n if ($userLengthOfFence<=1) {\n echo \"<br>\";\n echo \"Please enter a value above 1.\";\n } else {\n echo \"<br>If you had a fence that is $userLengthOfFence meters long, you would need $totalPosts posts, and $totalRails railings.\";\n echo \"<br>\" . \"With $totalPosts posts and $totalRails rails, you could build a fence $result meters long. This is over requirements by: $overShot meters.\";\n }\n}", "public function getNbResults();", "function get_objectives_count()\n {\n \tif($this->debug>1){error_log('New LP - In learnpathItem::get_objectives_count()',0);}\n \t$res = 0;\n \tif(!empty($this->objectives_count)){\n \t\t$res = $this->objectives_count;\n \t}\n \treturn $res;\n }", "public function getTotalLength();", "function getResultLength(){\n if($this->hasResult())\n return mysql_num_rows($this->result);\n }", "public function calcResult()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get userfolder if logged
function getUserName(){ if (isset($_COOKIE['username_log'])) { $userfolder = $_COOKIE['username_log']; }else{ $userfolder = ''; }; return $userfolder; }
[ "private function getUserDir()\n {\n return Auth::user()->name . '_' . Auth::id();\n }", "public function getUserDir()\n {\n// return Auth::user()->name . '_' . Auth::id();\n }", "function get_user_dir($id,$absolute=false){\r\n\r\nreturn ($absolute?HOME.\"/\":\"\").\"user_data/\".$id;\r\n\r\n}", "function user_directory () {\n\t$user = exec(\"whoami\");\n\treturn \"/Users/$user\";\n}", "public function getUserHomePath();", "function _get_user_folders ($user_id = 0) {\n\t\treturn _class_safe('gallery_folders', 'modules/gallery/')->{__FUNCTION__}($user_id);\n\t}", "function bp_docs_get_folder_user( $folder_id ) {\n\t$user_id = false;\n\n\t$folder_user_terms = get_the_terms( $folder_id, 'bp_docs_folder_in_user' );\n\tif ( ! empty( $folder_user_terms ) ) {\n\t\t$user_id = intval( substr( $folder_user_terms[0]->slug, 23 ) );\n\t}\n\n\treturn $user_id;\n}", "public function getDirectory(){\r\n\t\treturn \"usr/\".$this->_name.\"/\";\r\n\t}", "function alfresco_userdir($username) {\n global $CFG;\n\n if (ALFRESCO_DEBUG_TRACE) mtrace('alfresco_userdir(' . $username . ')');\n\n if (($uuid = alfresco_get_home_directory($username)) === false) {\n return false;\n }\n\n return $uuid;\n }", "protected function getFolder(): string\n {\n return $this->getParameter('kernel.project_dir') . '/var/images' . $this->getUser()->getFolder();\n }", "private function setUserDir()\n\t{\n\t\t$now = Carbon::now();\n\n\t\t// the 'D' means directory, nothing pervy\n\t\t$d_segments = array(\n\t\t\tpublic_path(), \n\t\t\t'pictures', \n\t\t\t$this->profile->user->username, \n\t\t\t$now->year, \n\t\t\t$now->month, \n\t\t\t$now->day\n\t\t);\n\t\t$d_name = '';\n\n\t\t//if a directory for the user doesn't exist, create one\n\t\tforeach ($d_segments as $segment) {\n\t\t\t$d_name .= $segment. '/';\n\n\t\t\tif (! \\File::isDirectory($d_name)) {\n\t\t\t\t\\File::makeDirectory($d_name, 0777, true);\n\t\t\t}\n\t\t}\n\n\t\t$this->user_dir = $d_name;\n\t}", "public static function get_userdir($user)\n {\n $ret = self::get_peepso_dir() . $user . '/';\n return ($ret);\n }", "function checkAccess_userFolderByUsername($requestPath,$params = array()) {\n\t\t$userFolderName = 'user_'.$this->feUserObj->user['username'];\n\t\t$pathInfo = pathinfo($requestPath);\n\t\t$requestPathArr = split('/',$pathInfo['dirname']);\n\n\t\t$compareDirName = end($requestPathArr);\n\n\t\tif($userFolderName == $compareDirName) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function accessMediasFolder()\n {\n return $this->isNotUser();\n }", "public function getUserHomeDir()\n {\n return rtrim(getenv('HOME') ?: getenv('USERPROFILE'), '/\\\\');\n }", "public function getUserHomePath()\n {\n return $this->serverBag->get('HOME');\n }", "function myfiles_getFolderRightsInfo($folderid='0',$userid='') {\r\n\tglobal $usr,$myFiles;\r\n\t\r\n\tif ($usr['isadmin']) {\r\n\t\tif ($userid=='') {\r\n\t\t\t$userid=$usr['id'];\r\n\t\t}\r\n\t\treturn 'RWA,'.$userid;\r\n\t}\t\r\n\tif ($folderid=='' || $folderid=='-1' || $folderid=='0') {\r\n\t\t// ok, we need to check which user's root folder\r\n\t\tif ($userid==$usr['id'] || $userid==\"\") {\r\n\t\t\t// your asking permission to your own root folder\r\n\t\t\treturn 'RWA,'.$usr['id'];\r\n\t\t} else {\r\n\t\t\tif ($myFiles['cfg_public_root']=='1') {\r\n\t\t\t\treturn 'R,'.$userid;\r\n\t\t\t} else {\r\n\t\t\t\treturn '';\r\n\t\t\t}\r\n\t\t}\r\n\t}\t\r\n\t// rootfolders (0) are not real folders (they have NO records, so will return NULL also)\r\n\t$frow = myfiles_getFolder($folderid);\r\n\tif ($frow==NULL) {\r\n\t\t// folder NOT found \r\n\t\treturn '';\r\n\t}\r\n\tif ($frow['pff_ispublic']==1 || $frow['pff_userid']==$usr['id'] ) {\r\n\t\tif ($frow['pff_userid']==$usr['id']) {\r\n\t\t\treturn 'RWA,'.$frow['pff_userid'];\r\n\t\t} else {\r\n\t\t\treturn 'R,'.$frow['pff_userid'];\r\n\t\t}\r\n\t}\r\n\treturn '';\r\n}", "public function checkUser_directory($storeFolder){\n\n\t\tif(file_exists($storeFolder))\n\t\t\treturn $storeFolder;\n\n\t\telse\n\t\t\tself::createUser_directory($storeFolder);\n\t}", "public static function userDirectory(): string\n {\n return implode(\n DIRECTORY_SEPARATOR,\n [getenv('HOME'), '.harvest-toolkit']\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets directories by relative or absolute path, optionally creates missing directories.
public function dirs($paths = false, $createMissing = false);
[ "public function getDirs(string $path)\n {\n //\n }", "public function GetDirectories() {\n $d = opendir($this->self->Path());\n if($d) {\n while($file = readdir($d)) {\n if($this->self->IsValid($this->self->Path().'/'.$file)) {\n $dir = new DirectoryObject();\n $dir->Path($this->self->Path());\n $dir->Name($file);\n $this->AddDirectory($dir);\n }\n }\n closedir($d);\n }\n }", "public function createDirectoriesIfTheyDontExist()\n {\n $directories = array(\n $this->getNewSitemapPath(),\n $this->getExistingSitemapPath()\n );\n foreach ($directories as $directory){\n if(!file_exists($directory)){\n mkdir($directory);\n }\n }\n }", "public function getFallbackDirs();", "public function getRequiredDirectories();", "public function createDirectories($path);", "private function findDirs(){\n $src = ($this->settings['source_locations'])? \n explode(',',$this->settings['source_locations']) : null;\n if(!is_null($src) & is_array($src)){\n \n $dirs = array_merge($this->directories,$src);\n $directories = array_unique($dirs);\n }else{\n $directories = $this->directories;\n }\n return $directories;\n }", "protected static function getDirectoriesFoundButNotExpected()\n {\n static $cache = null;\n if(!is_null($cache)) {\n return $cache;\n }\n\n $pluginsInManifest = self::getPluginsFoundInManifest();\n $directoriesInManifest = self::getDirectoriesFoundInManifest();\n $directoriesFoundButNotExpected = array();\n\n foreach (self::getPathsToInvestigate() as $file) {\n $file = substr($file, 2); // remove starting characters ./ to match format in manifest.inc.php\n $directory = dirname($file);\n\n if(in_array($directory, $directoriesInManifest)) {\n continue;\n }\n\n if (self::isFileNotInManifestButExpectedAnyway($file)) {\n continue;\n }\n if (self::isFileFromPluginNotInManifest($file, $pluginsInManifest)) {\n continue;\n }\n\n if (!in_array($directory, $directoriesFoundButNotExpected)) {\n $directoriesFoundButNotExpected[] = $directory;\n }\n }\n\n $cache = self::getParentDirectoriesFromListOfDirectories($directoriesFoundButNotExpected);\n return $cache;\n }", "function get_directories ($path)\n{\n $dirs = scandir ($path);\n $dirs = array_diff ($dirs, explode ('|', UNALLOWED_FILES));\n $dirs = array_filter ($dirs,\n\t\t\tfunction ($dir) use ($path) {\n return is_dir ($path . '/' . $dir);\n });\n sort ($dirs, SORT_NATURAL|SORT_FLAG_CASE);\n return $dirs;\n}", "public function directories()\n {\n return $this->filter(function($item) {\n return $item->isDir();\n });\n }", "public function fetch_upload_dirs($params = array())\n\t{\n\t\tif ( ! empty($this->_upload_dirs))\n\t\t{\n\t\t\treturn $this->_upload_dirs;\n\t\t}\n\n\t\treturn $this->_directories($params);\n\t}", "protected function createDirectories()\n {\n foreach ($this->directories as $directory) {\n if (! is_dir(base_path($directory))) {\n mkdir(base_path($directory), 0755, true);\n }\n }\n }", "public function getDirectories() {\r\n\t\tif ($this->_directories === null) {\r\n\t\t\t$this->_directories = array();\r\n\t\t\t$basePath = $this->basePath;\r\n\t\t\tif (!is_array($basePath)) {\r\n\t\t\t\t$basePath = array($basePath);\r\n\t\t\t}\r\n\t\t\tforeach($basePath as $path) {\r\n\t\t\t\t$this->_directories[$path] = array();\r\n\t\t\t\tforeach(AFileHelper::findDirectories($path) as $dir) {\r\n\t\t\t\t\t$this->_directories[$path][md5($dir)] = $dir; \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this->_directories;\r\n\t}", "public function createDirectories() {\n $directories = array(\n $this->packageDir,\n $this->moduleDir,\n \"{$this->moduleDir}/Block\",\n \"{$this->moduleDir}/controllers\",\n \"{$this->moduleDir}/etc\",\n \"{$this->moduleDir}/Helper\",\n \"{$this->moduleDir}/Model\",\n \"{$this->moduleDir}/sql\",\n );\n //make the directories \n foreach ($directories as $d) {\n $this->makeDirIfNotExist($d);\n }\n }", "private static function _getDirectories($parent)\n {\n\n if (empty($parent) || !is_string($parent)) {\n return null;\n }\n\n $dirs = array();\n $parent = self::_escape($parent);\n if (is_readable($parent) && is_dir($parent)) {\n $dirs[] = $parent;\n\n $list = scandir($parent);\n foreach ($list as $item) {\n $child = $parent . DIRECTORY_SEPARATOR . $item;\n if (is_readable($child) && is_dir($child) && !in_array($item, array('.', '..'))) {\n $dirs[] = $child;\n $dirs = array_merge($dirs, self::_getDirectories($child));\n }\n }\n }\n\n return $dirs;\n }", "public function getResourceDirectories() \n {\n $this->directories = File::directories( $this->getResourcePath() );\n return $this->directories;\n }", "function getDirList($relative = false) {\n if ($relative) {\n return $this -> dirRelative;\n } else {\n return $this -> dir;\n }\n }", "private function getDirectories($path)\n\t{\n\t\tif ( ! $this->files->exists($path)) {\n\t\t\tApp::abort(404);\n\t\t}\n\n\t\t$directories = $this->files->directories($path);\n\t\t$folders = [];\n\n\t\tif (count($directories) > 0) {\n\n\t\t}\n\n\t\tforeach ($directories as $dir) {\n\t\t\t$dir = str_replace('\\\\', '/', $dir);\n\t\t\t$folder = explode('/', $dir);\n\t\t\t$folders[] = end($folder);\n\t\t}\n\n\t\treturn $folders;\n\t}", "function readDirectoryRecursive($basedir = \"\");" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Shamelessly stolen from danielnorton.com/2013site/nerd/code/php/isdef.html Be silent about E_NOTICE errors, but make a note if we see one
function _isdef_error_handler( $errno, $errstr, $errfile, $errline, $errcontext ) { $GLOBALS['_isdef_error_detected'] = TRUE; return TRUE; }
[ "abstract function isDefined(): bool;", "abstract public function isDefined();", "function __isset($name)\n {\n }", "function flu_undefined_index_error($key)\n{\n if (is_bool($key)) {\n $key = (int)$key;\n }\n flu_error(\"Notice: Undefined offset: $key\", E_USER_NOTICE, 2);\n}", "static function unittest_defineUndefinedVariable () {\n PhlintTest::assertNoIssues('\n if (empty($foo))\n $foo = 1;\n $bar = $foo;\n ');\n }", "function geshi_c_get_if_elif_PP_subdirectives()\n{\n return array('defined');\n}", "protected function isLibParseFuncDefined() : bool {}", "function errorHandlerCatchUndefinedIndex($errno, $errstr, $errfile, $errline)\n {\n if (substr($errstr, 0, 16) == 'Undefined index:' or 'Undefined offset') {\n throw new ErrorException($errstr, 0, $errno, $errfile, $errline);\n }\n return false;\n }", "function isUnknown( $var );", "function errorHandlerCatchUndefinedIndex($errno, $errstr, $errfile, $errline ) \n {\n // We are only interested in one kind of error\n // need to fix that\n if (true) \n {\n //We throw an exception that will be catched in the test\n throw new ErrorException($errstr, 0, $errno, $errfile, $errline);\n }\n return false;\n }", "static public function is_undefined($obj) {\n return is_object($obj) ? get_class($obj) == 'Amfphp_Core_Amf_Types_Undefined' : false;\n }", "public function checkForNfo();", "function php_error() {\r\n die(\"for future use!\"); // We ran into issues don't this because it doesn't respect scope like $php_errormsg does. Wait until PHP 7.2 and error_clear_last\r\n $errorText = ''; \r\n $lastError = error_get_last();\r\n $skipTypes = [E_NOTICE]; // see: http://php.net/errorfunc.constants\r\n \r\n if (!empty($lastError['message']) && // skip error with blank error messages\r\n !in_array($lastError['type'], $skipTypes)) { // skip undefined var warnings\r\n $errorText = $lastError['message'];\r\n }\r\n return $errorText;\r\n}", "function broken() { return TRUE; }", "function _q204()\n\t{\n\t\t$disabled = ini_get('disabled_functions');\n\t\treturn (!empty($disabled));\n\t}", "function is_pDefined()\r\n{\r\n\t$array = func_get_args();\r\n\tforeach($array as $key) {\r\n\t\tif( ! isset($_POST[$key]) )\r\n\t\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "private function definesAvailable(){\n\t\tforeach ( $this->constants as $index => $define ){\n\t\t\tif ( false === defined($define) ){\n\t\t\t\tinclude_once DIR_WS_MODULES . 'ultimate_seo_urls5' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'Usu_Init.php';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function get_undefined($varname) {\n if ($this->debug & 4) {\n echo \"<p><b>get_undefined:</b> varname = $varname</p>\\n\";\n }\n if (!$this->loadfile($varname)) {\n $this->halt(\"get_undefined: unable to load $varname.\");\n return false;\n }\n\n preg_match_all(\"/{([^ \\t\\r\\n}]+)}/\", $this->get_var($varname), $m);\n $m = $m[1];\n if (!is_array($m)) {\n return false;\n }\n\n reset($m);\n while(list($k, $v) = each($m)) {\n if (!isset($this->varkeys[$v])) {\n if ($this->debug & 4) {\n echo \"<p><b>get_undefined:</b> undefined: $v</p>\\n\";\n }\n $result[$v] = $v;\n }\n }\n\n if (count($result)) {\n return $result;\n } else {\n return false;\n }\n }", "public function testSilencedUndefinedVariable()\n {\n $a = @$notSetVariable + 1;\n $this->assertEquals(1, $a);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
virtualStockMove do a virtual stock move
public function virtualStockMove($company_id,$rep_id,$rep_stock,$pm_id) { $stock_updated = true; try { Log::instance()->add(Log::DEBUG,"--Virtual stock move"); Log::instance()->add(Log::DEBUG,"RepId:".$rep_id); Log::instance()->add(Log::DEBUG,"PMId:".$pm_id); Log::instance()->add(Log::DEBUG,"Stock:".serialize($rep_stock)); if($company_id && $rep_id && $rep_stock) { $user = ORM::factory('User',$rep_id); if($user->loaded()) { foreach($rep_stock as $rs) { $stock_data = $rs->string; Log::instance()->add(Log::DEBUG,"Stock Data:".serialize($stock_data)); //Wycofanie z magazynu - stock równy 0 if($stock_data[0] > 0 && $stock_data[1] < 0) { $stock_data[1] = 0; $product = ORM::factory('Product')->where('id','=',$stock_data[0])->find(); $virtual_stock = ORM::factory('VirtualStock')->where('user_id','=',$rep_id)->and_where('product_id','=',$stock_data[0])->find(); $stockChange = $virtual_stock->stock; Log::instance()->add(Log::DEBUG,"Move from Virtual to Central:".$product->current_stock); Log::instance()->add(Log::DEBUG,"--Product stock 1:".$product->current_stock); Log::instance()->add(Log::DEBUG,"--Stock change 1:".$stockChange); $currentStock = $product->current_stock+$stockChange; if($virtual_stock->loaded()) { if($virtual_stock->stock > $stock_data[1]) { $stock_change = ORM::factory('StockChange'); $stock_change->product_id = $stock_data[0]; $stock_change->company_id = $company_id; $stock_change->stock_change_date = date('Y-m-d H:i:s'); $stock_change->user_id = $pm_id; $stock_change->stock_change = $stockChange; $stock_change->current_stock = $currentStock; $stock_change->stock_change_description = "Przesunięcie z: " . $user->name." ".$user->surname." do magazynu centralnego"; DB::query('START TRANSACTION'); if($stock_change->save() ) { $virtual_stock_change = ORM::factory('VirtualStockChange'); $virtual_stock_change->product_id = $stock_data[0]; $virtual_stock_change->product_count = $virtual_stock->stock * -1; $virtual_stock_change->product_add_date = date('Y-m-d H:i:s'); $virtual_stock_change->user_id = $pm_id; DB::query('START TRANSACTION'); if($virtual_stock_change->save()) { $virtual_stock->stock = $stock_data[1]; $product->current_stock = $currentStock; Log::instance()->add(Log::DEBUG,"--Current Stock:".$currentStock); $product->last_stock_change = $stock_change->stock_change_date; $product->value = $product->current_stock*$product->price; DB::query('START TRANSACTION'); if($product->update()) { DB::query('COMMIT'); DB::query('START TRANSACTION'); if($virtual_stock->update()) { DB::query('COMMIT'); Log::instance()->add(Log::DEBUG,"--Virtual stock move end"); }else { DB::query('ROLLBACK'); return array("error"=>"Could not move the stock"); } }else { DB::query('ROLLBACK'); return array("error"=>"Could not move the stock"); } }else { DB::query('ROLLBACK'); return array("error"=>"Could not move the stock"); } }else{ DB::query('ROLLBACK'); return array("error"=>"Could not move the stock"); } }else { $stock_updated = false; } } } if($stock_data[0] > 0 && $stock_data[1] > 0) { $product = ORM::factory('Product')->where('id','=',$stock_data[0])->find(); $virtual_stock = ORM::factory('VirtualStock')->where('user_id','=',$rep_id)->and_where('product_id','=',$stock_data[0])->find(); $stockChange = $virtual_stock->stock+($stock_data[1]*-1); Log::instance()->add(Log::DEBUG,"Move from Central to user Virtual Warehouse:".$rep_id); Log::instance()->add(Log::DEBUG,"--Product stock 2:".$product->current_stock); Log::instance()->add(Log::DEBUG,"--Stock change 2:".$stockChange); $currentStock = $product->current_stock+$stockChange; if($virtual_stock->loaded()) { $stock_change = ORM::factory('StockChange'); $stock_change->product_id = $stock_data[0]; $stock_change->company_id = $company_id; $stock_change->stock_change_date = date('Y-m-d H:i:s'); $stock_change->user_id = $pm_id; $stock_change->stock_change = $stockChange; $stock_change->current_stock = $currentStock; $stock_change->stock_change_description = "Przesunięcie do: ". $user->name." ".$user->surname; DB::query('START TRANSACTION'); if($stock_change->save() ) { $virtual_stock_change = ORM::factory('VirtualStockChange'); $virtual_stock_change->product_id = $stock_data[0]; $virtual_stock_change->product_count = $stock_data[1]; $virtual_stock_change->product_add_date = date('Y-m-d H:i:s'); $virtual_stock_change->user_id = $pm_id; DB::query('START TRANSACTION'); if($virtual_stock_change->save()) { $virtual_stock->stock = $stock_data[1]; $product->current_stock = $currentStock; $product->last_stock_change = $stock_change->stock_change_date; $product->value = $product->current_stock*$product->price; DB::query('START TRANSACTION'); if($product->update()) { DB::query('COMMIT'); DB::query('START TRANSACTION'); if($virtual_stock->update()) { DB::query('COMMIT'); Log::instance()->add(Log::DEBUG,"--Current Stock:".$currentStock); Log::instance()->add(Log::DEBUG,"--Virtual stock move end"); }else { DB::query('ROLLBACK'); return array("error"=>"Could not move the stock"); } }else { DB::query('ROLLBACK'); return array("error"=>"Could not move the stock"); } }else { DB::query('ROLLBACK'); return array("error"=>"Could not move the stock"); } }else{ DB::query('ROLLBACK'); return array("error"=>"Could not move the stock"); } }else{ $stock_change = ORM::factory('StockChange'); $stock_change->product_id = $stock_data[0]; $stock_change->company_id = $company_id; $stock_change->stock_change_date = date('Y-m-d H:i:s'); $stock_change->user_id = $pm_id; $stock_change->stock_change = $stockChange; $stock_change->current_stock = $currentStock; $stock_change->stock_change_description = "Przesunięcie do: " . $user->name." ".$user->surname; DB::query('START TRANSACTION'); if($stock_change->save() ) { $virtual_stock_change = ORM::factory('VirtualStockChange'); $virtual_stock_change->product_id = $stock_data[0]; $virtual_stock_change->product_count = $stock_data[1]; $virtual_stock_change->product_add_date = date('Y-m-d H:i:s'); $virtual_stock_change->user_id = $pm_id; DB::query('START TRANSACTION'); if($virtual_stock_change->save()) { $stockChange = $stock_data[1] * -1; $virtual_stock->stock = $stock_data[1]; $virtual_stock->product_id = $product->id; $virtual_stock->user_id = $rep_id; Log::instance()->add(Log::DEBUG,"--Product stock 3:".$product->current_stock); Log::instance()->add(Log::DEBUG,"--Stock change 3:".$stockChange); $currentStock = $product->current_stock+$stockChange; $product->current_stock = $currentStock; $product->last_stock_change = $stock_change->stock_change_date; $product->value = $product->current_stock*$product->price; DB::query('START TRANSACTION'); if($product->update()) { DB::query('COMMIT'); DB::query('START TRANSACTION'); if($virtual_stock->save()) { DB::query('COMMIT'); Log::instance()->add(Log::DEBUG,"--Current Stock:".$currentStock); Log::instance()->add(Log::DEBUG,"--Virtual stock move end"); }else { DB::query('ROLLBACK'); return array("error"=>"Could not move the stock"); } }else { DB::query('ROLLBACK'); return array("error"=>"Could not move the stock"); } }else { DB::query('ROLLBACK'); return array("error"=>"Could not move the stock"); } }else{ DB::query('ROLLBACK'); return array("error"=>"Could not move the stock"); } } } } return array("result"=>"stock_moved"); }else{ DB::query('ROLLBACK'); return array("error"=>"Virtual Stock user not found."); } }else { DB::query('ROLLBACK'); return array("error"=>"Wrong parameters passed to the service"); } if(!$stock_update) { return array("error"=>"No changes to stock needed."); }else { DB::query('ROLLBACK'); return array("error"=>"Too far..."); } }catch(Exception $e) { DB::query('ROLLBACK'); Log::instance()->add(Log::DEBUG,$e->getMessage()); Log::instance()->add(Log::DEBUG,$e->getLine()); Log::instance()->add(Log::DEBUG,$e->getTraceAsString()); } }
[ "public function actionMove()\n {\n $stocks = Stocks::model()->findAll();\n $this->render('add_movement',array('stocks' => $stocks));\n }", "protected function specialMove() \n\t{\n\t}", "function MoveStock($ITD,$LID1,$LID2,$quantity){\n\t$REM=RemoveStock($ITD,$LID1,$quantity);\n\t$AID=getID();\n\t$name=getAgentName($AID);\n\taddToStockLog($LID1,$LID2,$quantity,\"$name Attempted to move items between Stockpiles\",$ITD);\n\tif($REM=\"DONE\"){\n\t\tAddtoStock($ITD,$LID2,$quantity);\n\t\t\n\t}\n\t\n}", "abstract public function chooseMove();", "public function move() {\n $this->qty_movement+=1 ;\n }", "public function Move()\n\t{\n\t\techo \"Move Truck\";\n\t}", "public function promote()\n {\n $object = $this->getInvoker();\n $position = $object->get($this->_options['name']);\n\n if ($position > 1)\n {\n $position = $this->getPrevPosition();\n\n if (0 != $position)\n {\n $object->moveToPosition($position);\n }\n }\n }", "function move_item($itemid, $to){\n\tglobal $inventory;\n\tif (!isset($inventory)){\n\t\tload_inventory();\n\t}\n\tset_item_pref(\"inventorylocation\",$to,$itemid);\n\tclear_weights();\n\tcalculate_weights();\n}", "private static function stockToMovements($lStock = [], $iYearId = 0, $sDate = '', $iPO = 0)\n {\n $lMovements = array();\n $iWhs = 0;\n $iItem = 0;\n $iUnit = 0;\n foreach ($lStock as $oStock) {\n if ($iWhs != $oStock->whs_id) {\n if ($iWhs != 0) {\n $oMovement->aAuxRows = $aRows;\n\n array_push($lMovements, $oMovement);\n }\n $iWhs = $oStock->whs_id;\n\n $oMovement = new SMovement();\n $oMovement->dt_date = $sDate;\n $oMovement->is_closed_shipment = false;\n $oMovement->is_deleted = false;\n $oMovement->is_system = true;\n $oMovement->mvt_whs_class_id = \\Config::get('scwms.MVT_CLS_OUT');\n $oMovement->mvt_whs_type_id = \\Config::get('scwms.MVT_OUT_CONSUMPTION');\n $oMovement->mvt_trn_type_id = 1;\n $oMovement->mvt_adj_type_id = 1;\n $oMovement->mvt_mfg_type_id = 1;\n $oMovement->mvt_exp_type_id = 1;\n $oMovement->branch_id = $oStock->branch_id;\n $oMovement->whs_id = $oStock->whs_id;\n $oMovement->year_id = $iYearId;\n $oMovement->auth_status_id = 1;\n $oMovement->src_mvt_id = 1;\n $oMovement->doc_order_id = 1;\n $oMovement->doc_invoice_id = 1;\n $oMovement->doc_debit_note_id = 1;\n $oMovement->doc_credit_note_id = 1;\n $oMovement->prod_ord_id = $iPO;\n $oMovement->mfg_dept_id = 1;\n $oMovement->mfg_line_id = 1;\n $oMovement->mfg_job_id = 1;\n $oMovement->auth_status_by_id = 1;\n $oMovement->closed_shipment_by_id = 1;\n $oMovement->created_by_id = \\Auth::user()->id;\n $oMovement->updated_by_id = \\Auth::user()->id;\n\n $oMovement->aAuxPOs[SMovement::SRC_PO] = $iPO;\n\n $aRows = array();\n }\n\n $oMovementRow = new SMovementRow();\n\n $oMovementRow->quantity = $oStock->to_consume;\n $oMovementRow->amount_unit = 0;\n $oMovementRow->amount = 0;\n $oMovementRow->length = 0;\n $oMovementRow->surface = 0;\n $oMovementRow->volume = 0;\n $oMovementRow->mass = 0;\n $oMovementRow->is_deleted = false;\n $oMovementRow->item_id = $oStock->item_id;\n $oMovementRow->unit_id = $oStock->unit_id;\n $oMovementRow->pallet_id = $oStock->pallet_id;\n $oMovementRow->location_id = $oStock->location_id;\n $oMovementRow->doc_order_row_id = 1;\n $oMovementRow->doc_invoice_row_id = 1;\n $oMovementRow->doc_debit_note_row_id = 1;\n $oMovementRow->doc_credit_note_row_id = 1;\n\n if ($oMovementRow->item->is_lot) {\n $rowLots = array();\n\n $oMovementRowLot = new SMovementRowLot();\n $oMovementRowLot->quantity = $oStock->to_consume;\n $oMovementRowLot->amount_unit = 0;\n $oMovementRowLot->amount = 0;\n $oMovementRowLot->length = 0;\n $oMovementRowLot->surface = 0;\n $oMovementRowLot->volume = 0;\n $oMovementRowLot->mass = 0;\n $oMovementRowLot->is_deleted = false;\n $oMovementRowLot->lot_id = $oStock->lot_id;\n\n $rowLots[0] = $oMovementRowLot;\n $oMovementRow->setAuxLots($rowLots);\n }\n\n array_push($aRows, $oMovementRow);\n\n if (end($lStock) == $oStock) {\n $oMovement->aAuxRows = $aRows;\n\n array_push($lMovements, $oMovement);\n }\n }\n\n return $lMovements;\n }", "public function move()\n {\n }", "public function submitMoveStock(array &$form, FormStateInterface $form_state) {\n $variation_id = $form_state->getValue('prod_vid');\n $from_location_id = $form_state->getValue('location');\n $to_location_id = $form_state->getValue('to_location');\n $from_zone = $form_state->getValue('zone');\n $to_zone = $form_state->getValue('to_zone');\n $quantity = $form_state->getValue('quantity');\n $message = $form_state->getValue('transaction_notes');\n $unit_cost = NULL;\n $product_variation = $this->variationStorage->load($variation_id);\n $this->stockServiceManager->moveStock($product_variation, $from_location_id, $to_location_id, $from_zone, $to_zone, $quantity, $unit_cost, $message);\n }", "public function moveAction(){\n\t\t$menuitem = $this->_initMenuitem();\n\t\tif (!$menuitem) {\n\t\t\t$this->getResponse()->setBody(Mage::helper('megamenu2')->__('Menu Item move error'));\n\t\t\treturn;\n\t\t}\n\t\t$parentNodeId = $this->getRequest()->getPost('pid', false);\n\t\t$prevNodeId = $this->getRequest()->getPost('aid', false);\n\t\ttry {\n\t\t\t$menuitem->move($parentNodeId, $prevNodeId);\n\t\t\t$this->getResponse()->setBody(\"SUCCESS\");\n\t\t}\n\t\tcatch (Mage_Core_Exception $e) {\n\t\t\t$this->getResponse()->setBody($e->getMessage());\n\t\t}\n\t\tcatch (Exception $e){\n\t\t\t$this->getResponse()->setBody(Mage::helper('megamenu2')->__('Menu Item move error'));\n\t\t\tMage::logException($e);\n\t\t}\n\t}", "public function stockmovements()\n {\n return $this->morphMany( StockMovement::class, 'stockmovementable' );\n }", "private function stockToMovements($lStock = [], $iYearId = 0, $sDate = '')\n {\n $lMovements = array();\n $iWhs = 0;\n $iItem = 0;\n $iUnit = 0;\n foreach ($lStock as $oStock) {\n if ($iWhs != $oStock->whs_id) {\n if ($iWhs != 0) {\n $oMovement->aAuxRows = $aRows;\n\n array_push($lMovements, $oMovement);\n }\n $iWhs = $oStock->whs_id;\n\n $oMovement = new SMovement();\n $oMovement->dt_date = $sDate;\n $oMovement->is_closed_shipment = false;\n $oMovement->is_deleted = false;\n $oMovement->is_system = true;\n $oMovement->mvt_whs_class_id = \\Config::get('scwms.MVT_CLS_IN');\n $oMovement->mvt_whs_type_id = \\Config::get('scwms.MVT_TP_IN_ADJ');\n $oMovement->mvt_trn_type_id = 1;\n $oMovement->mvt_adj_type_id = \\Config::get('scwms.MVT_ADJ_TP_IFI');\n $oMovement->mvt_mfg_type_id = 1;\n $oMovement->mvt_exp_type_id = 1;\n $oMovement->branch_id = $oStock->branch_id;\n $oMovement->whs_id = $oStock->whs_id;\n $oMovement->year_id = $iYearId;\n $oMovement->auth_status_id = 1;\n $oMovement->src_mvt_id = 1;\n $oMovement->doc_order_id = 1;\n $oMovement->doc_invoice_id = 1;\n $oMovement->doc_debit_note_id = 1;\n $oMovement->doc_credit_note_id = 1;\n $oMovement->mfg_dept_id = 1;\n $oMovement->mfg_line_id = 1;\n $oMovement->mfg_job_id = 1;\n $oMovement->auth_status_by_id = 1;\n $oMovement->closed_shipment_by_id = 1;\n $oMovement->created_by_id = \\Auth::user()->id;\n $oMovement->updated_by_id = \\Auth::user()->id;\n\n $aRows = array();\n }\n\n $oMovementRow = new SMovementRow();\n\n $oMovementRow->quantity = $oStock->stock;\n $oMovementRow->amount_unit = 0;\n $oMovementRow->amount = 0;\n $oMovementRow->length = 0;\n $oMovementRow->surface = 0;\n $oMovementRow->volume = 0;\n $oMovementRow->mass = 0;\n $oMovementRow->is_deleted = false;\n $oMovementRow->item_id = $oStock->item_id;\n $oMovementRow->unit_id = $oStock->unit_id;\n $oMovementRow->pallet_id = $oStock->pallet_id;\n $oMovementRow->location_id = $oStock->location_id;\n $oMovementRow->doc_order_row_id = 1;\n $oMovementRow->doc_invoice_row_id = 1;\n $oMovementRow->doc_debit_note_row_id = 1;\n $oMovementRow->doc_credit_note_row_id = 1;\n\n if ($oMovementRow->item->is_lot) {\n $rowLots = array();\n\n $oMovementRowLot = new SMovementRowLot();\n $oMovementRowLot->quantity = $oStock->stock;\n $oMovementRowLot->amount_unit = 0;\n $oMovementRowLot->amount = 0;\n $oMovementRowLot->length = 0;\n $oMovementRowLot->surface = 0;\n $oMovementRowLot->volume = 0;\n $oMovementRowLot->mass = 0;\n $oMovementRowLot->is_deleted = false;\n $oMovementRowLot->lot_id = $oStock->lot_id;\n\n $rowLots[0] = $oMovementRowLot;\n $oMovementRow->setAuxLots($rowLots);\n }\n\n array_push($aRows, $oMovementRow);\n\n if (end($lStock) == $oStock) {\n $oMovement->aAuxRows = $aRows;\n\n array_push($lMovements, $oMovement);\n }\n }\n\n return $lMovements;\n }", "public function getModel(): StockMovement;", "public function movegoods($amount,$from,$to) {\n // TO is the ID of the warehouse because it may be empty if it's a SHIP for example\n $user_id = $this->input->cookie(\"current_id\");\n //get date of $from and $to\n $goods_from = $this->simulator_model->get_wh_goods($from,'id');\n $goods_to = $this->simulator_model->get_wh_goods($to,'id_whouse');\n if($goods_from->id_whouse == $goods_to->id_whouse) {\n die(\"Same warehouse\");\n }\n if(($goods_from->id_player!=$user_id) || ($goods_from->id_player!=$user_id)) {\n die(\"Both warehouses must belong to the same player\");// this should not happen by normal means\n }\n if($goods_from->id_place != $goods_to->id_place) {\n die(\"Warehouses must be in the same location\");\n }\n if($goods_from->avail_quantity < $amount) {\n //we don't move locked quantities as well\n die(\"Trying to move too many items\");\n }\n if($goods_to->capacity - $goods_to->avail_quantity - $goods_to->locked < $amount) {\n die(\"Not enough space in the destination warehouse\");\n }\n //finally we do the movement\n if ($this->simulator_model->movegoods($amount, $goods_from, $goods_to)) {\n die(\"OK\");\n } else {\n die(\"An error occurred during actual transfer\"); //maybe the data changed in the meanwhile\n }\n }", "public function updateStockDependingMovementType(BcsMovement $p_mvtMovement){\n $l_itmItemModel = new BcsItemModel($this->g_omObjectManager, $this->g_tiTranslator);\n $l_arrMovementDetail = $this->g_omObjectManager->getRepository(BcsMovementDetail::class)\n ->findBy(array('mvdMovement' => $p_mvtMovement->getId()));\n if ( $p_mvtMovement->getMvtMovementType()->getTpmCode() == \"TMV0608-000001\" ){\n //stock entry\n $l_sRet = $l_itmItemModel->addStock($l_arrMovementDetail);\n }\n else if ( $p_mvtMovement->getMvtMovementType()->getTpmCode() == \"TMV0608-000002\" ){\n //stock exit\n $l_sRet = $l_itmItemModel->reduceStock($l_arrMovementDetail);\n }\n else {\n $l_sRet = \"\";\n }\n\n return $l_sRet;\n }", "public function stockmovements()\n {\n return $this->morphMany(StockMovement::class, 'stockmovementable');\n }", "public static function stockmovementfromproduct($id,$qty,$amount,$remark,$reference=''){\n\n \tif($qty != 0){\n\n\t \t$stock = ProductStockModel::findOrFail($id);\n\n\t \t$before = $stock->product_stock_quantity;\n\t \t$different = $qty;\n\t \t$after = $before+$different;\n\n\t \t$stock->product_stock_quantity = $after;\n\t \t$stock->updated_at = Carbon::now();\n\n\t \tif($stock->save()){\n\n\t \t\t$transdate = $stock->updated_at;\n\n\t\t \t$ledger = ProductStockLedgerModel::where('product_stock_id',$id)->where('product_stock_ledger_year',date('Y',strtotime($transdate)))->first();\n\n\t\t \tif(empty($ledger)){\n\n\t\t \t\t$ledger = new ProductStockLedgerModel;\n\t\t \t\t$ledger->product_stock_id = $stock->product_stock_id;\n\t\t \t\t$ledger->product_stock_ledger_year = date('Y',strtotime($transdate));\n\n\t\t \t\tif($ledger->save()){\n\t\t \t\t\tfor($i=1; $i<=12; $i++){\n\n\t\t \t\t\t\t$movement = new ProductStockMovementModel;\n\t\t \t\t\t\t$movement->product_stock_ledger_id = $ledger->product_stock_ledger_id;\n\t\t \t\t\t\t$movement->product_stock_movement_month = $i;\n\t\t \t\t\t\t$movement->created_at = Carbon::now();\n\t\t \t\t\t\t$movement->save();\n\n\t\t \t\t\t} \n\t\t \t\t}\n\n\t\t \t}\n\n\t\t \tif($qty<0){\n\t\t \t\t$ledger->product_stock_ledger_quantity_out += (-1*$qty);\n\t\t \t\t$ledger->product_stock_ledger_quantity_out_price += $amount;\n\t\t \t}else{\n\t\t \t\t$ledger->product_stock_ledger_quantity_in += $qty;\n\t\t \t\t$ledger->product_stock_ledger_quantity_in_price += $amount;\n\t\t \t}\n\n\t\t \tif($ledger->save()){\n\n\t\t \t\t$movement = ProductStockMovementModel::where('product_stock_ledger_id',$ledger->product_stock_ledger_id)->where('product_stock_movement_month',str_replace('0','',date('m',strtotime($transdate))))->first();\n\n\t\t \t\tif($qty<0){\n\t\t \t\t\t$movement->product_stock_movement_quantity_out += (-1*$qty);\n\t\t \t\t\t$movement->product_stock_movement_quantity_out_price += $amount;\n\t\t\t \t}else{\n\t\t\t \t\t$movement->product_stock_movement_quantity_in += $qty;\n\t\t \t\t\t$movement->product_stock_movement_quantity_in_price += $amount;\n\t\t\t \t}\n\n\t\t \t\tif($movement->save()){\n\n\t\t \t\t\t$transaction = new ProductStockTransactionModel;\n\t\t \t\t\t$transaction->product_stock_movement_id = $movement->product_stock_movement_id;\n\t\t \t\t\t$transaction->product_stock_transaction_reference = ($reference!='') ? $reference : 'MERCHANT'.$stock->product->merchant_id;\n\t\t \t\t\t$transaction->product_stock_transaction_remark = $remark;\n\t\t \t\t\tif($qty<0){\n\t\t \t\t\t\t$transaction->product_stock_transaction_quantity_out = (-1*$qty);\n\t\t \t\t\t\t$transaction->product_stock_transaction_quantity_out_price = $amount;\n\t\t\t\t \t}else{\n\t\t\t\t \t\t$transaction->product_stock_transaction_quantity_in = $qty;\n\t\t \t\t\t\t$transaction->product_stock_transaction_quantity_in_price = $amount;\n\t\t\t\t \t}\n\t\t \t\t\t\n\t\t \t\t\tif($transaction->save()){\n\n\t\t \t\t\t\t$stockquantity = new ProductStockQuantityMovementModel;\n\t\t \t\t\t\t$stockquantity->product_stock_id = $stock->product_stock_id;\n\t\t \t\t\t\t$stockquantity->product_stock_quantity_movement_reference = ($reference!='') ? $reference : 'MERCHANT'.$stock->product->merchant_id;\n\t\t \t\t\t\t$stockquantity->product_stock_quantity_movement_remark = $remark;\n\t\t \t\t\t\t$stockquantity->product_stock_quantity_movement_before = $before;\n\t\t \t\t\t\t$stockquantity->product_stock_quantity_movement_movement = $different;\n\t\t \t\t\t\t$stockquantity->product_stock_quantity_movement_after = $after;\n\t\t \t\t\t\t$stockquantity->save();\n\n\t\t \t\t\t}\n\n\t\t \t\t}\n\n\t\t \t}\n\n\t\t }\n\t\t}\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rendering is the process of pushing the document buffers into the template placeholders, retrieving data from the document and pushing it into the application response buffer.
public function render() { $file = $this->input->getCmd('tmpl', 'index'); $options = array( 'template' => 'template', 'file' => $file . '.php', 'directory' => JPATH_THEMES, 'params' => '{}', ); // Parse the document. $this->document->parse($options); // Render the document. $data = $this->document->render($this->get('cache_enabled'), $options); // Set the application output data. $this->setBody($data); }
[ "protected function render()\n {\n $this->view->setFormat($this->getFormat());\n if (! $this->response->getContent()) {\n $this->view->setInnerData((array) $this->getData());\n $this->view->setAccept($this->getContext()->getAccept());\n $this->response->setContent($this->view->render());\n }\n $this->response->setContentType($this->view->getContentType());\n }", "public function render(){\n\t\t$bikesFlash = $this->app->getFlash();\n\t\t$title = $this->pageTitle;\n\t\t$this->loadHelpers();\n\n\t\tif(!empty($this->loadedHelpers)){\n\t\t\tforeach(array_keys($this->loadedHelpers) as $helper){\n\t\t\t\t$helper_lower = strtolower($helper);\n\t\t\t\t$$helper_lower = $this->loadedHelpers[$helper];\n\t\t\t}\n\t\t}\n\n\t\t$this->startOutputBuffer();\n\n\t\tif(empty($this->useLayout)){\n\t\t\t$templateName = $this->app->getConfig('layout.default');\n\t\t} else {\n\t\t\t$templateName = $this->useLayout . '.btmp';\n\t\t}\n\n\t\t$template = $this->app->getConfig('app.path') . DS . 'templates' . DS . $templateName;\n\n\t\tif(!file_exists($template)){\n\t\t\t$this->app->log(\"Template is not readable or the file does not exist.\\n\\tPlease set a correct template name in the config.ini value `layout.default`\", 'cache');\n\t\t\tthrow new bikes_TemplateIsNotThereException('Template ' . $templateName . ' does not exist.');\n\t\t}\n\n\t\tinclude $template;\n\n\t\t$layoutBuffer = $this->getAndCleanOutputBuffer();\n\n\t\tif(!empty($this->viewData)){\n\t\t\textract($this->viewData);\n\t\t}\n\n\t\tforeach($this->views as $region => $view){\n\t\t\tinclude $view->render();\n\t\t\t$viewBuffer = $this->getAndCleanOutputBuffer();\n\t\t\t$layoutBuffer = str_replace('<--{'.$region.'}-->', $viewBuffer, $layoutBuffer);\n\t\t\tunset($content);\n\t\t}\n\t\t$this->endOutputBuffer();\n\t\treturn $layoutBuffer;\n\t}", "public function render ()\n\t{\n\t\tforeach ($this->on_before_render as $callback)\n\t\t{\n\t\t\t$callback($this);\n\t\t}\n\n\t\t$this->rendered = $this->twig->render($this->template, $this->data);\n\n\t\tif ($this->get_cache_id() !== null)\n\t\t{\n\t\t\t\\Cache::set($this->get_cache_id(), $this->rendered);\n\t\t}\n\t}", "public function renderDocument()\n {\n\n }", "public function render()\n {\n $page = $this->twig->load($this->template);\n $this->prepareFlashMessages();\n $html = $page->render($this->vars);\n Router::sendResponse($html);\n }", "public function render() {\n\t\t\t// Initialize doc\n\t\t$this->setDocDefaults();\n\n\t\t\t// Call submodule\n\t\t$this->renderMainModule();\n\n\t\t\t// Set markers for template file\n\t\t$markers = array(\n\t\t\t'CONTENT' => $this->contentMarker,\n\t\t);\n\n\t\t\t// Render full page content\n\t\t$content = $this->doc->startPage('enet content cache analytics tool');\n\t\t$content .= $this->doc->moduleBody(array(), array(), $markers);\n\t\t$content .= $this->doc->endPage();\n\n\t\techo $content;\n\t}", "public function render() {\n $this->response->body($this->view->render($this->template));\n $this->response->sendHeaders();\n return $this->response;\n }", "public function render()\n\t{\n\t\t// The extract function is a weird bird\n\t\t// when you call it on an associative array\n\t\t// it creates regular vars.\n\t\t// For instance:\n\t\t// \t\t$this->pageVars[\"yourVar\"]\n\t\t// becomes:\n\t\t// \t\t$yourVar\n\t\t// so basically we are converting all the\n\t\t// index keys (with their values), in pageVars to\n\t\t// their own respected variables\n\t\textract($this->pageVars);\n\n\t\t// Now that we have all the variables extracted, the vars we set\n\t\t// in the template will be replaced by the value of the pageVars variables.\n\t\t// Now we start up our output buffer, grab our template and return the\n\t\t// buffer with it's \"rendered\" template\n\n\t\tob_start();\n\t\tif($this->blank == false) {\n\t\t\trequire('templates/header.html');\n\t\t}\n\t\t\trequire($this->template);\n\t\tif($this->blank == false) {\n\t\t\trequire('templates/footer.html');\n\t\t}\n\t\treturn ob_get_clean();\n\t}", "public function render() {\n //Extract defined vars in scope\n extract($this->_vars);\n \n ob_start();\n include($this->_view);\n $content = ob_get_contents();\n ob_end_clean();\n echo $this->_renderInLayout($content);\n }", "public function render()\n\t{\n\t\t\n\t\t$this -> requestView($this -> viewName);\t\t\n\t\t\n\t}", "public function render()\n {\n $html = $this->view->render();\n if ($this->expire ?: static::$cacheExpire) $this->storage->set($this->UID, $html, $this->expire, static::$cacheGroup ?: 'pages');\n echo $html;\n }", "public function render()\n {\n $response = $this->container->get('response');\n $response->prepare($this->container->get('request'));\n \n $content = $response->getContent();\n\n if ($this->container->has('stopwatch')) {\n $this->profile = $this->container->get('stopwatch')->stop('application');\n $response = $this->generateProfileHeaders($this->profile, $response);\n }\n\n $response->setContent($content)->send();\n }", "public function render()\n {\n if (!$this->__info['template']) {\n $this->__info['template'] = 'index';\n }\n \n $this->__info['folder'] = strtolower(basename($this->__info['folder']));\n $this->__info['file'] = strtolower(basename($this->__info['file']));\n $this->__info['template'] = strtolower(basename($this->__info['template']));\n\n switch ($this->__info['formatter']) {\n case 'json':\n header('Content-type: application/json');\n echo $this->render_view('json');\n break;\n\n default:\n $view_output = $this->render_view();\n $template_file = sprintf('../templates/%s.php', $this->__info['template']);\n if ($this->__info['ajax'] || !file_exists($template_file)) {\n echo $view_output;\n } else {\n ob_start();\n include $template_file;\n echo ob_get_clean();\n }\n break;\n }\n }", "public function render() {\n\t\t$view = $this;\n\t\t$view->hydrate();\n\n\t\tinclude $this->get_file_path() . '/' . $this->template_file . '.php';\n\t}", "public function render()\n {\n $this->factory->event->trigger('view.render.started', [$this], $this->view);\n\n $contents = $this->engine->get($this->path, $this->gatherData());\n\n $this->factory->event->trigger('view.render.ended', [&$contents], $this->view);\n\n return $contents;\n }", "public function render(){\n\n \\Timber\\Timber::render( $this->templates, $this->context );\n\n }", "public function render()\n {\n extract($this->data);\n\n ob_start();\n include($this->template);\n $content = ob_get_contents();\n ob_end_clean();\n return $content;\n }", "public function render()\n {\n extract($this->content);\n include $this->htmlPath;\n\n\n }", "public static function getRenderBufferContent() { return ob_get_contents(); }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the Live Update URL for the given order;
public function getLiveUpdateURL () { // Go $this->objLive->setOrderPName ($this->objName->toArray ()); $this->objLive->setOrderPInfo ($this->objInfo->toArray ()); $this->objLive->setOrderPCode ($this->objCode->toArray ()); $this->objLive->setOrderPrice ($this->objPrice->toArray ()); $this->objLive->setOrderQTY ($this->objQuantity->toArray ()); $this->objLive->setOrderVAT ($this->objVAT->toArray ()); // Return return new S ($this->objLive->liveUpdateURL); }
[ "public function getUpdate_url()\n \t{\n \t\t$url=Yii::app()->createUrl(\"admin/order/view\",array('id'=>$this->id));\n\t\treturn $url;\n \t}", "public function updateUrl()\n {\n return $this->paddleInfo()['update_url'];\n }", "abstract function getDownloadUpdateUrl();", "public function generate_request_trackingURL(Order $order);", "public function get_pue_update_url() {\n\t\t\t$pue_update_url = 'https://pue.tri.be';\n\n\t\t\tif ( defined( 'PUE_UPDATE_URL' ) ) {\n\t\t\t\t$pue_update_url = PUE_UPDATE_URL;\n\t\t\t}\n\n\t\t\t$pue_update_url = apply_filters( 'pue_get_update_url', $pue_update_url, $this->get_slug() );\n\n\t\t\t$pue_update_url = untrailingslashit( $pue_update_url );\n\n\t\t\treturn $pue_update_url;\n\t\t}", "public function get_request_url($order) {\n $args = http_build_query($this->get_args($order), '', '&');\n return $this->get_option('payment_url') . '?' . $args;\n }", "public function generate_releaseurl(Order $order) {\n\t\t\t$url = $this->generate_ordersredirurl();\n\t\t\t$url->query->setData(array('action' => 'release-order','ordn' => $order->ordernumber));\n\t\t\treturn $url->getUrl();\n\t\t}", "public function generate_releaseurl(Order $order) {\n\t\t\t$url = $this->generate_ordersredirURL();\n\t\t\t$url->query->setData(array('action' => 'release-order','ordn' => $order->ordernumber));\n\t\t\treturn $url->getUrl();\n\t\t}", "public function updatePaymentMethodUrl(): string\n {\n $response = LemonSqueezy::api('GET', \"subscriptions/{$this->lemon_squeezy_id}\");\n\n return $response['data']['attributes']['urls']['update_payment_method'];\n }", "public function getUpdatePOUrl() {\n return Mage::getModel('adminhtml/url')->getUrl('*/*/update', array('id' => $this->getRequest()->getParam('id'), '_secure' => true));\n }", "public function getOrderHistoryUrl();", "public function get_edit_order_url()\n {\n }", "function getUpgradeURL ()\r\n\t{\r\n\t\treturn str_replace('http://', 'https://', CloudNCo::config()->get('accountURL') ) . 'checkout/upgrade' ;\r\n\t}", "static function getDownloadUpdateUrl() {\n return self::$adapter->getDownloadUpdateUrl();\n }", "public function get_url() {\n\t\treturn $this->version_url . time();\n\t}", "public function getUrl()\n {\n return is_null($this->url)\n ? 'https://mibew.org/api2/updates.json'\n : $this->url;\n }", "function hrb_get_order_admin_url( $order_id ) {\n\treturn add_query_arg( array( 'post' => $order_id, 'action' => 'edit' ), network_admin_url( 'post.php' ) );\n}", "public static function get_order_admin_new_url() : string\n {\n }", "abstract function getCheckForUpdatesUrl();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper method to create an event instance that implements the DomainEvent interface.
private function createDomainEvent( string $name ): DomainEvent { return new class ($name) implements DomainEvent { public function __construct( private string $name, ) { } public function getName(): string { return $this->name; } }; }
[ "public function createEventInstance();", "public function createEvent();", "public function createNewEvent()\n {\n $event = new Event();\n\n return $event;\n }", "public function createEvent()\n {\n $entityClass = 'MU\\\\YourCityModule\\\\Entity\\\\EventEntity';\n\n $entity = new $entityClass();\n\n $this->entityInitialiser->initEvent($entity);\n\n return $entity;\n }", "function create_event($event) {\n return add_event($event);\n }", "protected function getNewEvent() {\n\t\treturn new dpsEmailEvent();\n\t}", "public function domainEventCollection();", "public function getDomainEvent()\n {\n return $this->domainEvent; \n }", "public function handle(DomainEvent $domainEvent);", "private function createDomainMessageForEvent($event): DomainMessage\n {\n ++$this->playhead;\n\n return DomainMessage::recordNow(1, $this->playhead, new Metadata([]), $event);\n }", "public static function instance() : DomainEventPublisher\n {\n return self::$instance ? self::$instance : new self();\n }", "public function registerEvent(DomainEvent $event): void\n {\n $this->raiseEvent($event);\n $this->eventStore->append($event);\n }", "public function makeEventStream(EventInterface $event): DomainEventStream;", "public static function creatEvent(array $data)\n\t{\t\t\n\t\t// if an events doesn't have a society, set to current session society id\n\t\tif (! isset($data['society_id']))\n\t\t{\n\t\t\t$data['society_id'] = \\Auth::user()->society->id;\n\t\t}\n\t\t\n\t\t$errorEvent = self::validate($data);\n\t\t\n\t\t\n\t\tif ($errorEvent !== true)\n\t\t{\n\t\t\treturn $errorEvent;\n\t\t}\n\t\t\n\t\t$event = new self();\n\t\t$event->fill($data);\n\t\t$event->society_id = $data['society_id'];\n\t\t$event->setDateTime($data['date'], $data['time']);\n\t\t$event->save();\n\t\t\n\t\treturn $event;\n\t}", "public function toDomainEvents(): DomainEvents {\n return DomainEvents::make($this->map(function (StreamEvent $streamEvent) {\n return $streamEvent->event();\n })->toArray());\n }", "protected function createFakeEvent($name = 'fake-event')\n {\n return Event::create(['name' => $name]);\n }", "public function dispatch(DomainEvent $event): DomainEvent\n {\n // DispatchSpecificDomainEventSubscriber will additionally dispatch the event with the specific event-name.\n /** @var DomainEvent $dispatchedEvent */\n $dispatchedEvent = $this->eventDispatcher->dispatch($event, DomainEvent::class);\n\n return $dispatchedEvent;\n }", "public function handle(DomainEvent $domainEvent): void;", "public function createSignalEventDefinition();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Find rows by a column and its value
public function findBy($column, $value) { return $this->getTableInfoscript()->getTableGateway()->select( function (Select $select) use ($column, $value) { $infoTable = $this->getTableInfoscript()->getTableGateway()->getTable(); $select = $this->joinWithInseratTable($select); $select->where(sprintf('%s.%s=%s', $infoTable, $column, $value)); return $select; } ); }
[ "public function findWhere($column, $value);", "public function findBy($column, $value);", "public function find($query, $column)\n {\n $rows = [];\n while ($row = fgetcsv($this->handle)) {\n if ($row[$column] == $query) {\n $rows[] = $row;\n }\n }\n return $rows;\n }", "static public function findWhere($col, $relation, $value);", "public function fetchByCol($column, $value)\n {\n $sql = \"SELECT * FROM $this->table WHERE $column = :value\";\n $params = ['value' => $value];\n $query = $this->query($sql, $params);\n return $query->fetchAll();\n }", "public function find(&$array, $column_name, $column_value)\n {\n $result = null;\n foreach($array as $key=>$value)\n {\n if ($value[$column_name] == $column_value)\n {\n $result = $key;\n break;\n }\n }\n return $result;\n }", "function get_where($col, $value) {\n $db = $this->_database;\n $table = $this->get_table();\n $db->where($col, $value);\n $query=$db->get($table);\n return $query;\n }", "public function getRowsBy ($table, $column_name, $column_value) {\r\n $result_array = $this->queryArray(\"SELECT * FROM {$table} WHERE {$column_name} = {$column_value}\");\r\n if (count($result_array) == 0) {\r\n return null;\r\n }\r\n return $result_array;\r\n }", "public static function searchInRowSet($theColumnName, $theValue, $theRowSet)\n {\n if (is_array($theRowSet))\n {\n foreach ($theRowSet as $key => $row)\n {\n if ((string)$row[$theColumnName]==(string)$theValue)\n {\n return $key;\n }\n }\n }\n\n return null;\n }", "function search_in_column($keyword, $array, $column){\n foreach ($array as $key => $val) {\n if ($val[''.$column.''] === $keyword) {\n return $key;\n }\n }\n return -1;\n}", "public function getAllByColumn($value,$column= \"\",$id=\"\"){\n \n if(empty($column)){\n $sql = \"SELECT * from {$this->table} WHERE {$this->id} = '$value' and {$this->deleted} = 0\";\n }else{\n $sql = \"SELECT * from {$this->table} WHERE {$column} = '$value' and {$this->id} = '$id' and {$this->deleted} = 0 \";\n }\n\n return $this->fetchAll($sql);\n \n }", "public function findByField($field, $value, $columns = ['*']);", "public function getByColumn($value,$column,$id=\"\"){\n \n if(empty($id)){\n $sql = \"SELECT * from {$this->table} WHERE {$column} = '$value' and {$this->deleted} = 0\";\n }else{\n $sql = \"SELECT * from {$this->table} WHERE {$column} = '$value' and {$this->id} = '$id' and {$this->deleted} = 0 \";\n }\n // echo $sql;\n $ex = mysqli_query(self::$conn,$sql);\n if(mysqli_num_rows($ex) > 0)\n return mysqli_fetch_object($ex);\n else\n return 0;\n }", "function get_records($col = '', $value = '')\n {\n // Searches and returns records matching $col $value\n // Assumes several records will be found \n $s = fix_value($value);\n $rows = array();\n if ($col == \"\") {\n $query = \"SELECT * FROM \" . $this->table_name;\n } else {\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE \" . $col . \"='$s'\";\n }\n $result = $this->do_query($query);\n if (!$result) {\n return false;\n }\n while ($row = $this->get_next_record($result)) {\n $rows[count($rows)] = $row;\n }\n return $rows;\n }", "public function where($column, $value, $operator = '=');", "public function where($column, $value, $operator = '=', $or = false);", "function get_where_custom($col, $value) {\n\t\t$db = $this->database;\n\t\t$table = $this->get_table();\n\t\t$db->where($col, $value);\n\t\t$query=$db->get($table);\n\t\t//print_r($query->result_array());exit;\n\t\treturn $query;\n }", "public function findOneBy($column, $value);", "function get_where_custom($col, $value) {\n\t\t$db = $this->database;\n\t\t$table = $this->get_table();\n\t\t$db->where($col, $value);\n\t\t$query=$db->get($table);\n\t\treturn $query;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Appends value to 'ResolutionRequestDenials' list
public function appendResolutionRequestDenials(\Diadoc\Api\Proto\Events\ResolutionRequestDenialAttachment $value) { return $this->append(self::RESOLUTIONREQUESTDENIALS, $value); }
[ "public function getResolutionRequestDenialsCount()\n {\n return $this->count(self::RESOLUTIONREQUESTDENIALS);\n }", "public function hasResolutionRequestDenialsList()\n {\n return $this->ResolutionRequestDenials !== null;\n }", "function wpd_residential_request_filter( $request ){\n\t if( array_key_exists( 'residential_taxonomies' , $request )\n\t && ! get_term_by( 'slug', $request['residential_taxonomies'], 'residential_taxonomies' ) ){\n\t $request['residential'] = $request['residential_taxonomies'];\n\t $request['name'] = $request['residential_taxonomies'];\n\t $request['post_type'] = 'residential';\n\t unset( $request['residential_taxonomies'] );\n\t }\n\t return $request;\n\t}", "public function appendResolutionRequests(\\Diadoc\\Api\\Proto\\Events\\ResolutionRequestAttachment $value)\n {\n return $this->append(self::RESOLUTIONREQUESTS, $value);\n }", "public function hasResolutionRequestDenialInfo()\n {\n return $this->ResolutionRequestDenialInfo !== null;\n }", "private function setValuesToWhiteListedAndRejected($request, $log_request)\n {\n if ($this->ip_filter->filterWhiteList($request)) {\n if ($log_request) {\n $log_request->fill(['white_listed' => true]);\n $log_request->fill(['rejected' => false]);\n $log_request->save();\n }\n }\n }", "public function getResolutionRequestDenialCancellationsCount()\n {\n return $this->count(self::RESOLUTIONREQUESTDENIALCANCELLATIONS);\n }", "public function put_workApp_visaDenial(){\n\t\tfor($i = 0; $i < count($this->visaDenial['country']); $i++){\n\t\t\t$this->mysql->add_visaDenial_workApp($this->visaDenial['country'][$i], $this->visaDenial['type'][$i], $this->visaDenial['date'][$i], $this->visaDenial['application_id']);\n\t\t}\n\t}", "public function addGranularity($g) {\n $this->granularity[] = $g;\n $this->granularity = array_unique($this->granularity);\n }", "private function addRestrictionToMedInfo(){\n if (LoginHelper::isACurrentPatient() || !LoginHelper::isLoggedIn()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized........!!</p>');\n }\n }", "private function addMissingConsentRequests()\n {\n $addon = ee('Addon')->get('consent');\n $requests = $addon->get('consent.requests', []);\n\n foreach ($requests as $name => $values) {\n $name = 'ee:' . $name;\n $request = ee('Model')->get('ConsentRequest')\n ->filter('consent_name', $name)\n ->first();\n if (is_null($request)) {\n $addon->makeConsentRequest($name, $values);\n } elseif (! $request->consent_request_version_id) {\n $version = ee('Model')->make('ConsentRequestVersion');\n $version->request = $values['request'];\n $version->request_format = (isset($values['request_format'])) ? $values['request_format'] : 'none';\n $version->author_id = 0;\n $version->create_date = ee()->localize->now;\n $request->Versions->add($version);\n\n $version->save();\n\n $request->CurrentVersion = $version;\n $request->save();\n }\n }\n }", "public function hasResolutionRequestDenialCancellationsList()\n {\n return $this->ResolutionRequestDenialCancellations !== null;\n }", "function _wp_privacy_action_request_types()\n{\n}", "public function addPriceRestriction($data){\r\n\r\n $this->priceRestrictions[] = $data;\r\n\r\n }", "public function lenses(Request $request) {\n\t\treturn [];\n\t}", "function add_quota()\n\t{\n\t\t$this->output('/consent/ev_quota/v_add_quota');\n\t}", "public function lenses(Request $request)\n {\n return [];\n }", "public function lenses(Request $request)\n\t{\n\t\treturn [];\n\t}", "public function lenses(Request $request) {\n return [];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the fix status on jobs attached with this change. It will become the job's status when the change is submitted (thus we don't allow to set it on already submitted changes).
public function setFixStatus($fixStatus) { if (!is_string($fixStatus) && $fixStatus !== null) { throw new \InvalidArgumentException('Job fix status must be a string or null.'); } // setting job's fix status makes sense only on unsubmitted changes if ($this->isSubmitted()) { throw new Exception('Cannot set job fix status on submitted changes.'); } $this->fixStatus = $fixStatus; return $this; }
[ "public function updateStatus(array $jobs);", "function setWorkStatus( $value )\n {\n if( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->WorkStatus = $value;\n }", "function change_job_status ( $job_id, $status ) {\n\n\t\t\t$job_title\t=\tget_the_title( $job_id );\n\t\t\t$job \t\t=\tget_post($job_id);\n\t\t\t// verify if sending mail is allowed\n\t\t\tif (!et_get_auto_email('approve') && $status == 'publish')\n\t\t\t\treturn false;\n\t\t\telse if (!et_get_auto_email('archive') && $status == 'archive')\n\t\t\t\treturn false;\n\n\t\t\tswitch ($status) {\n\t\t\t\tcase 'publish':\n\t\t\t\t\t$subject\t=\tapply_filters('et_publish_job_mail_title',\n\t\t\t\t\t\t\t\t\t\tsprintf(__('Your job \" %s \" posted in %s has been approved!', ET_DOMAIN),\n\t\t\t\t\t\t\t\t\t\t$job_title, get_option('blogname') )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$message\t=\t$this->get_approve_mail ();\n\t\t\t\t\t$message\t=\tapply_filters( 'et_approve_mail_message' , $this->filter( $message, $job ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'archive' :\n\t\t\t\t\t$subject\t=\tapply_filters('et_archive_job_mail_title',\n\t\t\t\t\t\t\t\t\t\tsprintf(__('Your job %s posted in %s has been archived!', ET_DOMAIN),\n\t\t\t\t\t\t\t\t\t\t$job_title, get_option('blogname') )\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$message\t=\t$this->get_archive_mail ();\n\t\t\t\t\t$message\t=\tapply_filters( 'et_archive_mail_message' , $this->filter( $message, $job ) );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$company_email\t=\tget_the_author_meta('email', $job->post_author);\n\t\t\t$this->mail ( $company_email, $subject, $message , '' );\n\n\t\t}", "public function getStatus($projectJob, $forceStatus = NULL) {\n // If there is some status requested, it will be set.\n if(!is_null($forceStatus))\n return $forceStatus;\n\n // If has provided file or has not parent job, status will be active.\n if($projectJob->hasProvidedSubtitle() || !$projectJob->hasParentJob())\n return self::STATUS_ACTIVE;\n\n // Set new as a default status\n $status = self::STATUS_NEW;\n\n if($projectJob->hasParentJob(true)) {\n // Get parent job\n $parentJob = $projectJob->getParentJob(true);\n // Get parent user job\n $parentUserJob = $parentJob->getUserJob(true);\n\n if($parentUserJob){\n \n // Get parent job type\n $parentJobTypeId = $parentJob->getJobTypeId();\n\n if(in_array($parentUserJob->status, $this->getParentReadyStatuses($parentJobTypeId))) {\n $status = self::STATUS_ACTIVE;\n /**\n * @comment Rafo\n * This part is not needed in a new workflow because the parent\n * job in a new workflow not a main job but the QC or Acceptance\n * itself, so it's enough to check parent state.\n *\n * In case the parent job has finished, but it has not\n * an acceptance mode mandatory, then we need check the\n * QC job on it if it is delivered the file back to parent\n * job, so the current job may get the file from parent.\n * Note that current job cannot be QC job, we making the\n * check for Translate / Conform children jobs.\n */\n /*if(!$projectJob->isQCJob() && $parentJob->hasQCJob() && !$parentJob->hasAcceptanceJob()) {\n // Set default status\n $status = self::STATUS_NEW;\n // Get parent QC job\n $parentQCJob = $parentJob->getLastQCJob();\n // Check if parent job is exists\n $hasParentQCJob = ($parentQCJob instanceof PProjectJob);\n // Get parent's QC user job\n $parentQCUserJob = ($hasParentQCJob) ? $parentQCJob->userJob : NULL;\n // Get parent's QC job's type\n $parentQCJobTypeId = ($hasParentQCJob) ? $parentQCJob->getJobTypeId() : NULL;\n if($parentQCUserJob instanceof PUserJob && in_array($parentQCUserJob->status, $this->getParentReadyStatuses($parentQCJobTypeId)))\n $status = self::STATUS_ACTIVE;\n }*/\n }\n }\n }\n\n return $status;\n }", "public function actionUpdateStatus() {\n $model = UserJobEditorFlag::model()->findByPk(Yii::app()->request->getPost('instanceId'));\n if (!$model instanceof UserJobEditorFlag) return false;\n $saved = $model->updateStatus(Yii::app()->request->getPost('status'));\n $this->sendResponse(200, $this->getObjectEncoded(array('message' => $saved ? 'ok' : 'error')));\n }", "private function setJobStatus($jobs)\n {\n $jobIds = array_keys($jobs);\n\n $cube = $this->getMongo()->selectDB($this->settings['mongo']['database']);\n\n\n $jobsCursor = $cube->selectCollection('done_events')->find(array('d.job_id' => array('$in' => $jobIds)));\n foreach ($jobsCursor as $successJob) {\n $jobs[$successJob['d']['job_id']]['status'] = self::JOB_STATUS_COMPLETE;\n $jobs[$successJob['d']['job_id']]['took'] = $successJob['d']['time'];\n unset($jobIds[array_search($successJob['d']['job_id'], $jobIds)]);\n }\n\n if (!empty($jobIds)) {\n $redisPipeline = $this->getRedis()->multi(\\Redis::PIPELINE);\n\n $jobsCursor = $cube->selectCollection('fail_events')->find(array('d.job_id' => array('$in' => $jobIds)));\n foreach ($jobsCursor as $failedJob) {\n $jobs[$failedJob['d']['job_id']]['status'] = self::JOB_STATUS_FAILED;\n $jobs[$failedJob['d']['job_id']]['log'] = $failedJob['d']['log'];\n $jobs[$failedJob['d']['job_id']]['took'] = $failedJob['d']['time'];\n $redisPipeline->get($this->settings['resquePrefix'] . 'failed:' . $failedJob['d']['job_id']);\n unset($jobIds[array_search($failedJob['d']['job_id'], $jobIds)]);\n }\n\n $failedTrace = array_filter($redisPipeline->exec());\n\n foreach ($failedTrace as $trace) {\n $trace = unserialize($trace);\n $jobs[$trace['payload']['id']]['trace'] = var_export($trace, true);\n }\n\n }\n\n if (!empty($jobIds)) {\n $jobsCursor = $cube->selectCollection('process_events')->find(array('d.job_id' => array('$in' => $jobIds)));\n foreach ($jobsCursor as $processJob) {\n $jobs[$processJob['d']['job_id']]['status'] = self::JOB_STATUS_RUNNING;\n unset($jobIds[array_search($processJob['d']['job_id'], $jobIds)]);\n }\n }\n if (!empty($jobIds)) {\n foreach ($jobIds as $id) {\n $jobs[$id]['status'] = self::JOB_STATUS_WAITING;\n }\n }\n\n return array_values($jobs);\n }", "public function changeJobSeekerStatus(Request $request)\n { \n try\n {\n $find = UserJob::find($request->id);\n if($find)\n {\n $find->update([\n 'job_status' => strtoupper($request->status)\n ]); \n\n // notification \n $notification_title = \"Job Status\";\n $notification_content = \"Your Job Status is changed\";\n $user_value = $find;\n $nf = new Notification;\n $nf->create_notification($user_value,$notification_title,$notification_content);\n return $this->sendSuccess(trans(\"message.jobskeer_job_update_status\"),$find);\n }\n return $this->sendError(trans('message.jobs_not_found'),404);\n }\n catch( \\Exception $e)\n {\n $msg = $e->getMessage();\n return $this->sendError($msg);\n } \n }", "public function set_ticket_status() {\n \n // Changes the ticket's status\n (new MidrubBaseAdminCollectionSupportHelpers\\Tickets)->set_ticket_status();\n \n }", "public function setJobStatusClosedAction()\n {\n \tif( \\Extended\\job::ChangeJobStatus( $this->getRequest()->getParam('job_id'), 4 ) )\n \t{\n \t\techo Zend_Json::encode(1);\n \t}\n \telse\n \t{\n \t\techo Zend_Json::encode(0);\n \t}\n \tdie;\n }", "protected function updateDatasetSubmissionStatus()\n {\n if ($this->getDataset() instanceof Dataset) {\n $this->getDataset()->setDatasetSubmissionStatus($this->status);\n }\n }", "function toggle_job($job_id)\r\r\n\t{\r\r\n\t\t$this->db->set('job_open', '1 - job_open', false);\r\r\n\r\r\n\t\t$this->db->where('job_id', $job_id);\r\r\n\t\treturn $this->db->update('Job');\r\r\n\t}", "public function updateBugStatus($table_name, $status)\n\t\t {\n\t\t\t\tif(!$this->fields_arr['bug_ids'])\n\t\t\t\t\treturn ;\n\n\t\t\t\t$id = $this->fields_arr['bug_ids'];\n\t\t\t\t$date_closed = '';\n\t\t\t\tif ($status == 'Closed')\n\t\t\t\t\t$date_closed = ', date_closed = NOW()';\n\t\t\t\t$sql = 'UPDATE '.$table_name.' SET status='.$this->dbObj->Param($status).$date_closed.' WHERE bug_id IN ('.$id.') OR parent_id IN ('.$id.')'.\n\t\t\t\t\t' AND status =\\'Open\\'';\n\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t$rs = $this->dbObj->Execute($stmt, array($status));\n\t\t\t\tif (!$rs)\n\t\t\t\t trigger_db_error($this->dbObj);\n\n\t\t\t\t$post_value = 'bid='.$id.'&bsite='.urlencode($this->CFG['site']['url']).'&sitename='.urlencode($this->CFG['site']['name']).'&bstatus=Closed';\n\t\t\t\tpostForm($this->CFG['members']['receivebugs'], $post_value);\n\t\t }", "public function changeJob(array $attrs)\n {\n $cmdString = 'CHGJOB';\n $success = i5_command($cmdString, $attrs);\n return $success;\n }", "public function updateJobs()\n {\n $this->workerManager->assignNewJobs();\n }", "public function setJobStatus($jobStatus)\n {\n $this->jobStatus = (string) $jobStatus;\n }", "public function testSetJobPriorityJobDefinition()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "protected function setLastJobAsActive(){\n\t\t$this->setProjectJob(end($this->getProject()->jobs));\n\t}", "public function markInProgress()\n {\n $this->update(['status' => config('constants.hr.status.in-progress.label')]);\n }", "function setStatus( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Status = $value;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ | | Method: scan_language_dirs() | | | Scans and finds all installed languages |
protected function scan_language_dirs() { // Finally, Load app languages $path = SYSTEM_PATH . DS . 'language'; $this->found_languages = $this->filesystem->list_folders($path); }
[ "private function scanLangDir()\r\n\t{\r\n\t\t$dirs = array_diff(scandir($this->workingDir), ['.','..']); \r\n\t\tforeach ($dirs as $dir) {\r\n\t\t\t$currentDir = $this->workingDir.$dir;\r\n\t\t\tif (is_dir($currentDir)) {\t\r\n\t\t\t\tarray_push($this->dirs, $this->workingDir.$dir);\r\n\t\t\t\tarray_push($this->lang, $dir);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->sortLang();\r\n\t\treturn $this->dirs;\r\n\t}", "function getLanguages()\n\t{\n\t\t$d = dir($this->lang_path);\n\t\t$tmpPath = getcwd();\n\t\tchdir ($this->lang_path);\n\n\t\t// get available setup-files\n\t\twhile ($entry = $d->read())\n\t\t{\n\t\t\tif (is_file($entry) && (ereg (\"(^setup_.{2}\\.lang$)\", $entry)))\n\t\t\t{\n\t\t\t\t$lang_key = substr($entry,6,2);\n\t\t\t\t$languages[] = $lang_key;\n\t\t\t}\n\t\t}\n\n\t\tchdir($tmpPath);\n\n\t\treturn $languages;\n\t}", "public function getSystemLanguages() {}", "public function scanLanguages($path, $sys = false)\n\t{\n\t\t$strings = array();\n\n\t\tif (!is_dir($path))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\tif ($dh = opendir($path))\n\t\t{\n\t\t\twhile (($folder = readdir($dh)) !== false)\n\t\t\t{\n\t\t\t\tif ($folder === '.' || $folder === '..')\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$folderPath = $path . '/' . $folder;\n\n\t\t\t\tif (is_dir($folderPath))\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($folder, $this->languages))\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($this->languages, $folder);\n\t\t\t\t\t}\n\n\t\t\t\t\t$strings[$folder] = $this->scanLanguage($folderPath, $folder, $sys);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tclosedir($dh);\n\t\t}\n\n\t\treturn $strings;\n\t}", "function get_languages() { \n\n\t/* Open the locale directory */\n\t$handle\t= @opendir(Config::get('prefix') . '/locale');\n\n\tif (!is_resource($handle)) { \n\t\tdebug_event('language','Error unable to open locale directory','1'); \n\t}\n\n\t$results = array(); \n\n\t/* Prepend English */\n\t$results['en_US'] = 'English (US)';\n\n\twhile ($file = readdir($handle)) { \n\n\t\t$full_file = Config::get('prefix') . '/locale/' . $file;\n\n\t\t/* Check to see if it's a directory */\n\t\tif (is_dir($full_file) AND substr($file,0,1) != '.' AND $file != 'base') { \n\t\t\t\t\n\t\t\tswitch($file) {\n\t\t\t\tcase 'af_ZA'; $name = 'Afrikaans'; break; /* Afrikaans */\n\t\t\t\tcase 'ca_ES'; $name = 'Catal&#224;'; break; /* Catalan */\n\t\t\t\tcase 'cs_CZ'; $name = '&#x010c;esky'; break; /* Czech */\n\t\t\t\tcase 'da_DK'; $name = 'Dansk'; break; /* Danish */\n\t\t\t\tcase 'de_DE'; $name = 'Deutsch'; break; /* German */\n\t\t\t\tcase 'en_US'; $name = 'English (US)'; break; /* English */\n\t\t\t\tcase 'en_GB'; $name = 'English (UK)'; break; /* English */\n\t\t\t\tcase 'es_ES'; $name = 'Espa&#241;ol'; break; /* Spanish */\n\t\t\t\tcase 'es_MX'; $name = 'Espa&#241;ol (MX)'; break; /* Spanish */\n\t\t\t\tcase 'es_AR'; $name = 'Espa&#241;ol (AR)'; break; /* Spanish */\n\t\t\t\tcase 'et_EE'; $name = 'Eesti'; break; /* Estonian */\n\t\t\t\tcase 'eu_ES'; $name = 'Euskara'; break; /* Basque */\n\t\t\t\tcase 'fr_FR'; $name = 'Fran&#231;ais'; break; /* French */\n\t\t\t\tcase 'ga_IE'; $name = 'Gaeilge'; break; /* Irish */\n\t\t\t\tcase 'el_GR'; $name = 'Greek'; break; /* Greek */\n\t\t\t\tcase 'is_IS'; $name = 'Icelandic'; break; /* Icelandic */\n\t\t\t\tcase 'it_IT'; $name = 'Italiano'; break; /* Italian */\n\t\t\t\tcase 'lv_LV'; $name = 'Latvie&#353;u'; break; /* Latvian */\n\t\t\t\tcase 'lt_LT'; $name = 'Lietuvi&#371;'; break; /* Lithuanian */\n\t\t\t\tcase 'hu_HU'; $name = 'Magyar'; break; /* Hungarian */\n\t\t\t\tcase 'nl_NL'; $name = 'Nederlands'; break; /* Dutch */\n\t\t\t\tcase 'no_NO'; $name = 'Norsk bokm&#229;l'; break; /* Norwegian */\n\t\t\t\tcase 'pl_PL'; $name = 'Polski'; break; /* Polish */\n\t\t\t\tcase 'pt_BR'; $name = 'Portugu&#234;s Brasileiro'; break; /* Portuguese */\n\t\t\t\tcase 'pt_PT'; $name = 'Portugu&#234;s'; break; /* Portuguese */\n\t\t\t\tcase 'ro_RO'; $name = 'Rom&#226;n&#259;'; break; /* Romanian */\n\t\t\t\tcase 'sk_SK'; $name = 'Sloven&#269;ina'; break; /* Slovak */\n\t\t\t\tcase 'sl_SI'; $name = 'Sloven&#353;&#269;ina'; break; /* Slovenian */\n\t\t\t\tcase 'sr_CS'; $name = 'Srpski'; break; /* Serbian */\n\t\t\t\tcase 'fi_FI'; $name = 'Suomi'; break; /* Finnish */\n\t\t\t\tcase 'sv_SE'; $name = 'Svenska'; break; /* Swedish */\n\t\t\t\tcase 'uk_UA'; $name = 'Українська'; break; /* Ukrainian */\n\t\t\t\tcase 'vi_VN'; $name = 'Ti&#7871;ng Vi&#7879;t'; break; /* Vietnamese */\n\t\t\t\tcase 'tr_TR'; $name = 'T&#252;rk&#231;e'; break; /* Turkish */\n\t\t\t\tcase 'bg_BG'; $name = '&#x0411;&#x044a;&#x043b;&#x0433;&#x0430;&#x0440;&#x0441;&#x043a;&#x0438;'; break; /* Bulgarian */\n\t\t\t\tcase 'ru_RU'; $name = '&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;'; break; /* Russian */\n\t\t\t\tcase 'zh_CN'; $name = '&#31616;&#20307;&#20013;&#25991;'; break; /* Chinese */\n\t\t\t\tcase 'zn_TW'; $name = '&#32321;&#39636;&#20013;&#25991;'; break; /* Chinese */\n\t\t\t\tcase 'ko_KR'; $name = '&#xd55c;&#xad6d;&#xb9d0;'; break; /* Korean */\n\t\t\t\tcase 'ja_JP'; $name = '&#x65e5;&#x672c;&#x8a9e;'; break; /* Japanese */\n\t\t\t\tcase 'nb_NO'; $name = 'Norsk'; break; /* Norwegian */\n\t\t\t\t/* These languages are right to left. */\n\t\t\t\tcase 'ar_SA'; $name = '&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;'; break; /* Arabic */\n\t\t\t\tcase 'he_IL'; $name = '&#1506;&#1489;&#1512;&#1497;&#1514;'; break; /* Hebrew */\n\t\t\t\tcase 'fa_IR'; $name = '&#1601;&#1575;&#1585;&#1587;&#1610;'; break; /* Farsi */\n\t\t\t\tdefault: $name = _('Unknown'); break;\n\t\t\t} // end switch\n\n\t\t\n\t\t\t$results[$file] = $name;\n\t\t}\n\n\t} // end while\n\n\treturn $results;\n\n}", "function get_languages_list()\n{\n\tglobal $installed_languages;\n\t\n\t$pkgs = get_pkg_or_list('language', null, array(\n\t\t\t\t'Package' => 'package',\n\t\t\t\t'Version' => 'available',\n\t\t\t\t'Name' => 'name',\n\t\t\t\t'Language' => 'code',\n\t\t\t\t'Encoding' => 'encoding',\n\t\t\t\t'RTLDir' => 'rtl',\n\t\t\t\t'Description' => 'Descr',\n\t\t\t\t'InstallPath' => 'path'\n\t\t\t));\n \n\t// add/update languages already installed\n\t// \n\tforeach($installed_languages as $id => $l) {\n\t\t$list = array_search_keys($l['code'], $pkgs, 'code');\t// get all packages with this code\n\t\tforeach ($list as $name) {\n\t\t\tif ($l['encoding'] == $pkgs[$name]['encoding']) {\t// if the same encoding\n\t\t\t\t$pkgs[$name]['version'] = @$l['version'];\t\t// set installed version\n\t\t\t\t$pkgs[$name]['local_id'] = $id;\t\t// index in installed_languages\n\t\t\t\tcontinue 2;\n\t\t\t}\n\t\t}\n\t\t$l['local_id'] = $id;\n\t\tif (!isset($l['package']) || $l['package'] == '' || !isset($pkgs[$l['package']]))\n\t\t\t$pkgs[] = $l;\n\t\telse\n\t\t\t$pkgs[$l['package']] = array_merge($pkgs[$l['package']], $l);\n\t}\n\tksort($pkgs);\n\treturn $pkgs;\n}", "function language_installed($lang) {\n foreach (language_get_searchpaths() as $searchpath) {\n if (is_readable($searchpath . 'lang/' . $lang . '/langconfig.php')) {\n return true;\n }\n }\n return false;\n}", "public static function getAvailableLangs()\n {\n return self::getLangs();\n }", "public function getAvailableLanguages ();", "public function listLanguages();", "function get_language_list ($inc_dir)\r\n{\r\n global $user_lang;\r\n $dir_ref = opendir($inc_dir);\r\n rewinddir($dir_ref);\r\n\t$list = array();\r\n\r\n\tdo\r\n\t{\r\n\t\t$file = readdir($dir_ref); //get next file of inc directory\r\n\t\tclearstatcache();\r\n\t\t\r\n\t\tif((substr($file,0,1)!=\".\")&&(!is_dir($inc_dir.\"/\".$file))&&($file!=\"\")) //current file is really a file and no directory\r\n\t\t{\r\n\t\t\tif((stristr($file, '.php')) && (!stristr($file, 'qqq'))) //file is really a language file (qqq comes from translatewiki)\r\n\t\t\t{\r\n\t\t\t\t$list[] = str_replace('.php', '', $file); //add language of file to the list\r\n\t\t\t}\r\n\t\t}\r\n\t}while($file);\r\n\t\t\r\n\tsort($list);\r\n\tclosedir($dir_ref);\r\n\treturn $list;\r\n}", "public static function get_list_languages();", "function loadLanguages()\n\t\t{\n\t\t\tif($this->loaded)\n\t\t\t\treturn;\n\n\t\t\t$languages = explode(\";\", ENABLED_LANGUAGES);\n\t\t\t$dh = opendir(LANGUAGE_DIR);\n\t\t\twhile (($entry = readdir($dh)) !== false) {\n\t\t\t\t$pick = 0;\n\t\t\t\t/*\n\t\t\t\t * Case 1: languages contains a generalization.\n\t\t\t\t * entry = zh_CN, languages = [zh]\n\t\t\t\t */\n\t\t\t\tif (in_array($entry, $languages) ||\n\t\t\t\t in_array(lang_strip_mod($entry), $languages) ||\n\t\t\t\t in_array(lang_strip_enc($entry), $languages) ||\n\t\t\t\t in_array(lang_strip_enc(lang_strip_mod($entry)), $languages) ||\n\t\t\t\t in_array(lang_strip_cc($entry), $languages) ||\n\t\t\t\t in_array(lang_strip_cc(lang_strip_mod($entry)), $languages) ||\n\t\t\t\t in_array(lang_strip_cc(lang_strip_enc($entry)), $languages) ||\n\t\t\t\t in_array(lang_strip_cc(lang_strip_enc(lang_strip_mod($entry))), $languages))\n\t\t\t\t\t$pick = 1;\n\t\t\t\t/*\n\t\t\t\t * Case 2: language contains a country\n\t\t\t\t * specialization that matches the default\n\t\t\t\t * country for a general language.\n\t\t\t\t * entry = de, language = [de_DE]\n\t\t\t\t */\n\t\t\t\tif (in_array(lang_add_cc($entry), $languages))\n\t\t\t\t\t$pick = 1;\n\t\t\t\tif (!$pick)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!is_dir(LANGUAGE_DIR.$entry.\"/LC_MESSAGES\"))\n\t\t\t\t\tcontinue;\n\t\t\t\tif (!is_file(LANGUAGE_DIR.$entry.\"/language.txt\"))\n\t\t\t\t\tcontinue;\n\t\t\t\t$fh = fopen(LANGUAGE_DIR.$entry.\"/language.txt\", \"r\");\n\t\t\t\t$lang_title = fgets($fh);\n\t\t\t\t$lang_table = fgets($fh);\n\t\t\t\tfclose($fh);\n\t\t\t\t/*\n\t\t\t\t * Always give the Preferences dialog valid\n\t\t\t\t * _gettext_ IDs (not directory names, ffs),\n\t\t\t\t * i.e. entries of the type \"lc_CC\" or\n\t\t\t\t * \"lc_CC.UTF-8\".\n\t\t\t\t */\n\t\t\t\t$entry = lang_add_enc(lang_add_cc($entry));\n\t\t\t\t$this->languages[$entry] = $lang_title;\n\t\t\t\t$this->languagetable[$entry] = $lang_table;\n\t\t\t}\n\t\t\t$this->loaded = true;\t\t\n\t\t}", "private static function loadFolders() {\n foreach(static::$folders as $folder)\n if(!in_array(static::$lang, $folder['langs']))\n I18N::instance(static::$lang)->loadLanguageFiles($folder);\n }", "function get_language_list ($inc_dir)\n{\n global $user_lang;\n $dir_ref = opendir($inc_dir);\n rewinddir($dir_ref);\n\t$list = array();\n\n\tdo\n\t{\n\t\t$file = readdir($dir_ref); //get next file of inc directory\n\t\tclearstatcache();\n\t\t\n\t\tif((substr($file,0,1)!=\".\")&&(!is_dir($inc_dir.\"/\".$file))&&($file!=\"\")) //current file is really a file and no directory\n\t\t{\n\t\t\tif((stristr($file, '.php')) && (!stristr($file, 'qqq'))) //file is really a language file (qqq comes from translatewiki)\n\t\t\t{\n\t\t\t\t$list[] = str_replace('.php', '', $file); //add language of file to the list\n\t\t\t}\n\t\t}\n\t}while($file);\n\t\t\n\tsort($list);\n\tclosedir($dir_ref);\n\treturn $list;\n}", "function get_available_languages( $dir = null ) {\n\t$languages = array();\n\n\tforeach( (array)glob( ( is_null( $dir) ? WP_LANG_DIR : $dir ) . '/*.mo' ) as $lang_file ) {\n\t\t$lang_file = basename($lang_file, '.mo');\n\t\tif ( 0 !== strpos( $lang_file, 'continents-cities' ) && 0 !== strpos( $lang_file, 'ms-' ) &&\n\t\t\t0 !== strpos( $lang_file, 'admin-' ))\n\t\t\t$languages[] = $lang_file;\n\t}\n\n\treturn $languages;\n}", "public static function getLanguages();", "protected function retrive_local_translations()\n\t{\n\t\t$dir_iterator = new \\DirectoryIterator($this->language_location);\t\t\n\t\t$arr_locales = array();\n\t\t\n\t\tforeach ($dir_iterator as $file)\n\t\t{\t\n\t\t\t// skip the system files for navigation and language_backup directory\n\t\t\tif($file->getFilename() != '.' && $file->getFilename() != '..' && $file->getFilename() != 'language_backup')\n\t\t\t{\n\t\t\t\tif (! $file->isDir())\n\t\t\t\t{ \n $lang = include ($file->getRealPath());\n\n if (! isset($lang)) continue;\n \n // the name of the files in symfony is resource_group.locale_name_eng,\n // we need to explode the name and get the parts\n \n $arr_filename_parts = explode('.', $file->getFilename());\n\t\t\t\t\t$resource_group_name = $arr_filename_parts[0];\n $locale = $arr_filename_parts[1];\n \n\t\t\t\t\t$arr_locales[$locale][$resource_group_name] = $lang;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \n return $arr_locales;\n\t}", "function wp_lang_dir() {\n return $this->find_folder(WP_LANG_DIR);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a form to edit a Archives entity.
private function createEditForm(Archives $entity) { $form = $this->createForm(new ArchivesType(), $entity, array( 'action' => $this->generateUrl('archives_update', array('id' => $entity->getId())), 'method' => 'PUT', )); $form->add('submit', 'submit', array('label' => 'Update')); return $form; }
[ "public function newAction()\n {\n $entity = new Archives();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function newAction()\n {\n $entity = new Archive();\n $form = $this->createForm(new ArchiveCreateType(), $entity);\n\n return $this->render('CineminoSiteBundle:Archive:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "private function editForm()\n {\n $m = $this->getViewModel();\n\n $blog = $m->blog;\n\n $m->isApprover = true; // isApprover()\n\n $stylelist = BlogView::getStyleList();\n\n $id = $blog->id;\n \n \n if ($m->revid === 0) {\n $m->revid = intval($blog->revision);\n }\n\n $m->revision = BlogRevision::findFirst('blog_id='.$id.' and revision='.$m->revid);\n \n // submit choices\n $m->rev_list = [\n 'Save' => 'Save',\n 'Revision' => 'Save as new revision',\n ];\n\n $m->title = '#' . $id;\n $m->stylelist = $stylelist;\n $m->catset = BlogView::getCategorySet($id);\n $m->events = BlogView::getEvents($id);\n $m->metatags = BlogView::getMetaTags($id);\n $m->content = $m->url = $this->url;\n\n return $this->render('blog', 'edit');\n }", "private function createEditForm(Avisos $entity)\n {\n $form = $this->createForm(new AvisosType(), $entity, array(\n 'action' => $this->generateUrl('avisos_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Editar Aviso'));\n\n return $form;\n }", "private function createEditForm(AsignacionMarcaModelo $entity)\n {\n\t\t\n $form = $this->createForm(new AsignacionMarcaModeloType(), $entity, array(\n 'action' => $this->generateUrl('abertura_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\t\t$form->add('file','file',array('label'=>' ', 'required'=>false, 'attr'=>array('accept'=>'image/*', 'class'=>'filestyle', 'data-buttonBefore'=>'true',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'data-buttonText'=>'Cambiar imagen')));\n\t\t$form->add('submit', 'submit', array('label' => 'Modificar', 'attr'=>array('onclick'=>'return confirmar()')));\n\t\t\n return $form;\n }", "private function createEditForm(ArreteModel $entity)\n {\n $form = $this->createForm(new ArreteModelType(), $entity, array(\n 'action' => $this->generateUrl('arretemodel_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Mettre à jour'));\n\n return $form;\n }", "public function editAction()\n {\n $filtro = $this->getDoctrine()->getRepository('BackendBundle:FeastStage')->setFiltroByUser(\n $this->get('security.authorization_checker'), $this->get('security.token_storage')\n );\n $artistas = $this->getDoctrine()->getRepository('BackendBundle:Artist')->getArtistasIds(\n $this->get('security.authorization_checker'), $this->get('security.token_storage')\n );\n $em = $this->getDoctrine()->getManager();\n $id = $this->getRequest()->get(\"id\");\n $entity = $em->getRepository('BackendBundle:FeastStageArtist')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find feaststageartist entity.');\n }\n $editForm = $this->createForm(new FeastStageArtistType($filtro, 'editar', $artistas, $entity->getDate()), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n );\n }", "private function createEditForm(Armor $entity)\n {\n $form = $this->createForm(new ArmorType(), $entity, array(\n 'action' => $this->generateUrl('armor_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function editAction() { \t \n \t$book = $this->_booksTable->find($this->_getParam('edit'))->current(); \n \t$this->_form->populate($book->toArray());\t\n \t$this->view->form = $this->_form;\n \t$this->view->book = $book;\n }", "private function createEditForm(CDeudas $entity) {\n $form = $this->createForm(new CDeudasType(), $entity, array(\n 'action' => $this->generateUrl('cdeudas_update', array('id' => $entity->getId())),\n 'method' => 'POST',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(DatossEdadvacunas $entity)\n {\n $form = $this->createForm(new DatossEdadvacunasType(), $entity, array(\n 'action' => $this->generateUrl('datossedadvacunas_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Actualizar', 'attr' => array('class' => 'btn-success')));\n\n return $form;\n }", "public function menuEditAction()\n\t{\n\t\t$entity = new Menu();\n\n\t\t$request = $this->get('request');\n\t\t$content = $request->getContent();\n\t\tparse_str(urldecode($content), $arr);\n\t\t$arr = $arr['form'];\n\t\t$this->get('validator')->\n\n\t\texit;\n\t}", "private function createEditForm(Adherent $entity)\n {\n $form = $this->createForm(new AdherentType(), $entity, array(\n 'action' => $this->generateUrl('adherent_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Personas $entity)\n {\n $form = $this->createForm(new PersonasType(), $entity, array(\n 'action' => $this->generateUrl('personas_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Editar','attr' => array('class' => 'btn btn-default')));\n\n return $form;\n }", "private function createEditForm(AircraftModel $entity)\n {\n $form = $this->createForm(new AircraftModelType(), $entity, array(\n 'action' => $this->generateUrl('admin_aircraft_models_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form\n ->add('submit', 'submit', array('label' => 'Save Aircraft'));\n\n return $form;\n }", "private function createEditForm(Marca $entity)\n {\n $form = $this->createForm(new MarcaType(), $entity, array(\n 'action' => $this->generateUrl('marca_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Modificar', 'attr'=>array('onclick'=>'return confirmar()')));\n\t\t\n return $form;\n }", "private function createEditForm(Menu $entity) {\n $form = $this->createForm(new MenuType(), $entity, array(\n 'action' => $this->generateUrl('menu_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n\n return $form;\n }", "private function createEditForm(Academico $entity)\n {\n $securityContext = $this->container->get('security.context');\n\n $form = $this->createForm(new AcademicoType($securityContext), $entity, array(\n 'action' => $this->generateUrl('academico_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "private function createEditForm(Ad $entity)\n {\n $form = $this->createForm(new AdType(), $entity, array(\n 'action' => $this->generateUrl('anuncio_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
____________________________________ Formata CNPJ _________________________________________
function formataCnpj($cnpj) { $cnpjRet = ""; if ($cnpj) { $cnpjRet = substr($cnpj, -14, 2).".".substr($cnpj, -12, 3).".".substr($cnpj, -9, 3)."/".substr($cnpj, -6, 4)."-".substr($cnpj, -2, 2); } return $cnpjRet; }
[ "function formata_cpf_cnpj($cpf_cnpj)\n {\n\n //# Retirando tudo que não for número.\n $cpf_cnpj = preg_replace('/[^0-9]/', '', $cpf_cnpj);\n $tipo_dado = null;\n if (strlen($cpf_cnpj) == 11) {\n $tipo_dado = 'cpf';\n }\n if (strlen($cpf_cnpj) == 14) {\n $tipo_dado = 'cnpj';\n }\n switch ($tipo_dado) {\n default:\n $cpf_cnpj_formatado = 'Não foi possível definir tipo de dado';\n break;\n\n case 'cpf':\n $bloco_1 = substr($cpf_cnpj, 0, 3);\n $bloco_2 = substr($cpf_cnpj, 3, 3);\n $bloco_3 = substr($cpf_cnpj, 6, 3);\n $dig_verificador = substr($cpf_cnpj, -2);\n $cpf_cnpj_formatado = $bloco_1.'.'.$bloco_2.'.'.$bloco_3.'-'.$dig_verificador;\n break;\n\n case 'cnpj':\n $bloco_1 = substr($cpf_cnpj, 0, 2);\n $bloco_2 = substr($cpf_cnpj, 2, 3);\n $bloco_3 = substr($cpf_cnpj, 5, 3);\n $bloco_4 = substr($cpf_cnpj, 8, 4);\n $digito_verificador = substr($cpf_cnpj, -2);\n $cpf_cnpj_formatado = $bloco_1.'.'.$bloco_2.'.'.$bloco_3.'/'.$bloco_4.'-'.$digito_verificador;\n break;\n }\n\n return $cpf_cnpj_formatado;\n }", "function formatCnpjCpf($document) {\n $cnpj_cpf = preg_replace(\"/\\D/\", '', $document);\n\n if (strlen($cnpj_cpf) === 11) {\n return preg_replace(\"/(\\d{3})(\\d{3})(\\d{3})(\\d{2})/\", \"\\$1.\\$2.\\$3-\\$4\", $cnpj_cpf);\n } else {\n return preg_replace(\"/(\\d{2})(\\d{3})(\\d{3})(\\d{4})(\\d{2})/\", \"\\$1.\\$2.\\$3/\\$4-\\$5\", $cnpj_cpf);\n }\n }", "public function getCpf_cnpj()\n {\n return $this->cpf_cnpj;\n }", "public function getCpfCnpj()\n\t{\n\t\treturn $this->cpf_cnpj;\n\t}", "public function getCNPJ()\n {\n return $this->cNPJ;\n }", "public function is_cnpj(){\n $verify = true;\n\n $c = preg_replace('/\\D/', '', $this->_data['value']);\n $b = array(6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2);\n\n if (strlen($c) != 14)\n $verify = false;\n for ($i = 0, $n = 0; $i < 12; $n += $c[$i] * $b[++$i]);\n\n if ($c[12] != ((($n %= 11) < 2) ? 0 : 11 - $n))\n $verify = false;\n\n for ($i = 0, $n = 0; $i <= 12; $n += $c[$i] * $b[$i++]);\n\n if ($c[13] != ((($n %= 11) < 2) ? 0 : 11 - $n))\n $verify = false;\n\n if(!$verify){\n $this->set_error(sprintf($this->_messages['is_cnpj'], $this->_data['value']));\n }\n\n return $this;\n }", "public function getCnpj()\n\t{\n\t\treturn $this->cnpj;\n\t}", "public function getCpfCnpj()\n {\n return $this->cpfCnpj;\n }", "public function getCnpj() {\n return $this->cnpj;\n }", "public function getCnpj()\n {\n return $this->cnpj;\n }", "function validate_cnp($cnp_primit) {\r\n\r\n $cnp['cnp primit'] = $cnp_primit;\r\n\r\n if (strlen($cnp['cnp primit']) != 13) {\r\n $cifre = strlen($cnp['cnp primit']);\r\n return 'CNP-ul trebuie sa aiba 13 numere, cel introdus are doar ' . $cifre . ' !';\r\n }\r\n $today = new DateObject(time());\r\n $datetime = strtotime(str_replace('/', '-', insoft_user_get_birthdate($cnp['cnp primit'])));\r\n $date = new DateObject($datetime);\r\n\r\n if ($today->difference($date, 'years', true) < 16) {\r\n return t('Vârsta trebuie să fie mai mare de 16 ani!');\r\n }\r\n\r\n // prima cifra din cnp reprezinta sexul si nu poate fi decat 1,2,5,6 (pentru cetatenii romani) \r\n // 1, 2 pentru cei nascuti intre anii 1900 si 1999\r\n // 5, 6 pentru cei nsacuti dupa anul 2000\r\n $cnp['sex'] = isset($cnp['cnp primit']{0}) ? $cnp['cnp primit']{0} : '';\r\n if ($cnp['sex'] == '') {//die('bbbb');\r\n return t('CNP-ul n-are corespondenta pentru sex!');\r\n }\r\n\r\n // cifrele 2 si 3 reprezinta anul nasterii\r\n $cnp['an'] = isset($cnp['cnp primit']{1}) && isset($cnp['cnp primit']{2}) ? $cnp['cnp primit']{1} . $cnp['cnp primit']{2} : '';\r\n if ($cnp['an'] == '') {\r\n return t('CNP-ul n-are corespondenta pentru an!');\r\n }\r\n\r\n // cifrele 4 si 5 reprezinta luna (nu poate fi decat intre 1 si 12) \r\n $cnp['luna'] = isset($cnp['cnp primit']{3}) && isset($cnp['cnp primit']{4}) ? $cnp['cnp primit']{3} . $cnp['cnp primit']{4} : '';\r\n if ($cnp['luna'] == '') {\r\n return t('CNP-ul n-are corespondenta pentru luna!');\r\n }\r\n\r\n // cifrele 6 si 7 reprezinta ziua (nu poate fi decat intre 1 si 31)\r\n $cnp['zi'] = isset($cnp['cnp primit']{5}) && isset($cnp['cnp primit']{6}) ? $cnp['cnp primit']{5} . $cnp['cnp primit']{6} : '';\r\n if ($cnp['zi'] == '') {\r\n return t('CNP-ul n-are corespondenta pentru zi!');\r\n }\r\n\r\n // cifrele 8 si 9 reprezinta codul judetului (nu poate fi decat intre 1 si 52)\r\n $cnp['judet'] = isset($cnp['cnp primit']{7}) && isset($cnp['cnp primit']{8}) ? $cnp['cnp primit']{7} . $cnp['cnp primit']{8} : '';\r\n if ($cnp['judet'] == '') {\r\n return t('CNP-ul n-are corespondenta pentru judet!');\r\n }\r\n // cifrele 10,11,12 reprezinta un nr. poate fi intre 001 si 999. \r\n // Numerele din acest interval se impart pe judete, \r\n // birourilor de evidenta a populatiei, astfel inct un anumit numar din acel \r\n // interval sa fie alocat unei singure persoane intr-o anumita zi.\r\n // cifra 13 reprezinta cifra de control aflata in relatie cu \r\n // toate celelate 12 cifre ale CNP-ului.\r\n // fiecare cifra din CNP este inmultita cu cifra de pe aceeasi pozitie \r\n // din numarul 279146358279; rezultatele sunt insumate, \r\n // iar rezultatul final este impartit cu rest la 11. Daca restul este 10, \r\n // atunci cifra de control este 1, altfel cifra de control este egala cu restul.\r\n $cnp['suma de control'] = $cnp['cnp primit']{0} * 2 + $cnp['cnp primit']{1} * 7 +\r\n $cnp['cnp primit']{2} * 9 + $cnp['cnp primit']{3} * 1 + $cnp['cnp primit']{4} * 4 +\r\n $cnp['cnp primit']{5} * 6 + $cnp['cnp primit']{6} * 3 + $cnp['cnp primit']{7} * 5 +\r\n $cnp['cnp primit']{8} * 8 + $cnp['cnp primit']{9} * 2 + $cnp['cnp primit']{10} * 7 +\r\n $cnp['cnp primit']{11} * 9;\r\n $cnp['rest'] = fmod($cnp['suma de control'], 11);\r\n\r\n if (empty($cnp['cnp primit'])) {\r\n return t('Campul CNP este gol!');\r\n } else {\r\n if (!is_numeric($cnp['cnp primit'])) {\r\n return t('CNP-ul este format doar din cifre!<br>');\r\n }\r\n if (strlen($cnp['cnp primit']) != 13) {\r\n $cifre = strlen($cnp['cnp primit']);\r\n return t('CNP-ul trebuie sa aiba 13 numere, cel introdus are doar ') . $cifre;\r\n }\r\n if ($cnp['sex'] != 1 && $cnp['sex'] != 2 && $cnp['sex'] != 5 && $cnp['sex'] != 6) {\r\n return t('Prima cifra din CNP - eronata!');\r\n }\r\n if ($cnp['luna'] > 12 || $cnp['luna'] == 0) {\r\n return t('Luna este incorecta!');\r\n }\r\n if ($cnp['zi'] > 31 || $cnp['zi'] == 0) {\r\n return t('Ziua este incorecta!');\r\n }\r\n if (is_numeric($cnp['luna']) && is_numeric($cnp['zi']) && is_numeric($cnp['an'])) {\r\n if (!checkdate($cnp['luna'], $cnp['zi'], $cnp['an'])) {\r\n return t('Data de nastere specificata este incorecta');\r\n }\r\n }\r\n\r\n if ($cnp['judet'] > 52 || $cnp['judet'] == 0) {\r\n return t('Codul judetului este eronat!');\r\n }\r\n if (($cnp['rest'] < 10 && $cnp['rest'] != $cnp['cnp primit']{12}) || ($cnp['rest'] >= 10 && $cnp['cnp primit']{12} != 1)) {\r\n return t('Cifra de control este gresita! (CNP-ul nu este valid)');\r\n }\r\n }\r\n\r\n return '';\r\n}", "public static function validarCNPJ($cnpj){\n\t\t$cnpj = html_entity_decode($cnpj);\n\t\t$j = 0;\n\t\tfor($i = 0; $i < (strlen($cnpj)); $i++){\n\t\t\tif(is_numeric($cnpj[$i])){\n\t\t\t\t$num[$j] = $cnpj[$i];\n\t\t\t\t$j++;\n\t\t\t}\n\t\t}\n\t\tif(count($num) != 14){\n\t\t\t$isCnpjValid = false;\n\t\t}\n\t\tif($num[0] == 0 && $num[1] == 0 && $num[2] == 0 && $num[3] == 0 && $num[4] == 0 && $num[5] == 0 && $num[6] == 0 && $num[7] == 0 && $num[8] == 0 && $num[9] == 0 && $num[10] == 0 && $num[11] == 0){\n\t\t\t$isCnpjValid = false;\n\t\t}else{\n\t\t\t$j = 5;\n\t\t\tfor($i = 0; $i < 4; $i++){\n\t\t\t\t$multiplica[$i] = $num[$i]*$j;\n\t\t\t\t$j--;\n\t\t\t}\n\t\t\t$soma = array_sum($multiplica);\n\t\t\t$j = 9;\n\t\t\tfor($i = 4; $i < 12; $i++){\n\t\t\t\t$multiplica[$i] = $num[$i]*$j;\n\t\t\t\t$j--;\n\t\t\t}\n\t\t\t$soma = array_sum($multiplica);\t\n\t\t\t$resto = $soma%11;\t\t\t\n\t\t\tif($resto < 2){\n\t\t\t\t$dg = 0;\n\t\t\t}else{\n\t\t\t\t$dg = 11-$resto;\n\t\t\t}\n\t\t\tif($dg != $num[12]){\n\t\t\t\t$isCnpjValid = false;\n\t\t\t} \n\t\t}\n\t\tif(!isset($isCnpjValid)){\n\t\t\t$j = 6;\n\t\t\tfor($i = 0; $i < 5; $i++){\n\t\t\t\t$multiplica[$i] = $num[$i]*$j;\n\t\t\t\t$j--;\n\t\t\t}\n\t\t\t$soma = array_sum($multiplica);\n\t\t\t$j = 9;\n\t\t\tfor($i = 5; $i < 13; $i++){\n\t\t\t\t$multiplica[$i] = $num[$i]*$j;\n\t\t\t\t$j--;\n\t\t\t}\n\t\t\t$soma = array_sum($multiplica);\t\n\t\t\t$resto = $soma%11;\t\t\t\n\t\t\tif($resto < 2){\n\t\t\t\t$dg = 0;\n\t\t\t}else{\n\t\t\t\t$dg = 11-$resto;\n\t\t\t}\n\t\t\tif($dg != $num[13]){\n\t\t\t\t$isCnpjValid = false;\n\t\t\t}else{\n\t\t\t\t$isCnpjValid =true;\n\t\t\t}\n\t\t}\n\t\treturn $isCnpjValid;\n\t}", "public function getPessoaCpfCnpj()\n {\n return $this->pessoaCpfCnpj;\n }", "private function limpaCaracterCpf() {\n\t\t\treturn str_replace(\".\",\"\",str_replace(\"-\",\"\",$this->getRequest()->getParam('nu_cpf')));\n\t\t}", "function string_cnpj($string){\n\treturn substr($string, 0, 2) . '.' . substr($string, 2, 3) . '.' . substr($string, 5, 3) . '/' . substr($string, 8, 4) . '-' . substr($string, 12, 2);\n}", "public function getCodcaj(){\n\t\treturn $this->codcaj;\n\t}", "public static function genCnpjValid() {\n $n1 = rand(0, 9);\n $n2 = rand(0, 9);\n $n3 = rand(0, 9);\n $n4 = rand(0, 9);\n $n5 = rand(0, 9);\n $n6 = rand(0, 9);\n $n7 = rand(0, 9);\n $n8 = rand(0, 9);\n $n9 = 0;\n $n10 = 0;\n $n11 = 0;\n $n12 = 1;\n $d1 = $n12 * 2 + $n11 * 3 + $n10 * 4 + $n9 * 5 + $n8 * 6 + $n7 * 7 + $n6 * 8 + $n5 * 9 + $n4 * 2 + $n3 * 3 + $n2 * 4 + $n1 * 5;\n $d1 = 11 - (self::mod($d1, 11) );\n if ($d1 >= 10) {\n $d1 = 0;\n }\n $d2 = $d1 * 2 + $n12 * 3 + $n11 * 4 + $n10 * 5 + $n9 * 6 + $n8 * 7 + $n7 * 8 + $n6 * 9 + $n5 * 2 + $n4 * 3 + $n3 * 4 + $n2 * 5 + $n1 * 6;\n $d2 = 11 - (self::mod($d2, 11) );\n if ($d2 >= 10) {\n $d2 = 0;\n }\n $cnpj = '' . $n1 . $n2 . $n3 . $n4 . $n5 . $n6 . $n7 . $n8 . $n9 . $n10 . $n11 . $n12 . $d1 . $d2;\n return $cnpj;\n }", "function validar_cnpj($cnpj) {\n $cnpj = preg_replace('/[^0-9]/', '', (string) $cnpj);\n // Valida tamanho\n if (strlen($cnpj) != 14)\n return false;\n // Valida primeiro dígito verificador\n for ($i = 0, $j = 5, $soma = 0; $i < 12; $i++) {\n $soma += $cnpj{$i} * $j;\n $j = ($j == 2) ? 9 : $j - 1;\n }\n $resto = $soma % 11;\n if ($cnpj{12} != ($resto < 2 ? 0 : 11 - $resto))\n return false;\n // Valida segundo dígito verificador\n for ($i = 0, $j = 6, $soma = 0; $i < 13; $i++) {\n $soma += $cnpj{$i} * $j;\n $j = ($j == 2) ? 9 : $j - 1;\n }\n $resto = $soma % 11;\n return $cnpj{13} == ($resto < 2 ? 0 : 11 - $resto);\n }", "public function testInsercaoCnpj() \n {\n $cnpj = $this->test->setCnpj(\"02.449.992/0056-38\");\n $nomeTeste = $this->test->getCnpj();\n $this->assertEquals(\"02.449.992/0056-38\", $nomeTeste);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the maximum load permitted
public function getMaxLoad();
[ "public function getMaxLoads()\n {\n return $this->max_loads;\n }", "public function getMaxCpu()\n {\n return $this->getAttribute('resources.limits.cpu', null);\n }", "public function getMaxRequests() {\n return $this->max_requests;\n }", "function rlip_get_maxruntime() {\n $maxruntime = (int)ini_get('max_execution_time');\n $maxruntime -= 2; // TBD: MUST STOP BEFORE time limit is reached!\n //echo \"\\nrlip_get_maxruntime(b):{$maxruntime}\\n\";\n if ($maxruntime < RLIP_MAXRUNTIME_MIN) {\n $maxruntime = RLIP_MAXRUNTIME_MIN;\n }\n return $maxruntime;\n}", "public function getMaxRequests ()\r\n {\r\n return $this->_maxRequests;\r\n }", "public function getMaxRequests()\n {\n return isset($this->max_requests) ? $this->max_requests : 0;\n }", "public function getMaximumLimit()\n {\n // get the default limit value of results per request from the config file\n return (int) $this->limit;\n }", "public function getMaxUnavailable()\n {\n return $this->max_unavailable;\n }", "function maxInstances()\n {\n $description = $this->describeAutoScalingGroup();\n $maxSize = $description[\"MaxSize\"];\n\n return $maxSize;\n }", "public function getThrottleLimit()\n {\n return $this->throttle->getLimit();\n }", "public function getMaxLimit()\n {\n return $this->max_limit;\n }", "public function getMaxThreads(): int {\r\n return $this->maxThreads;\r\n }", "public function getProcessLimit()\n {\n return $this->process_limit;\n\n }", "public function getMaximumQuota() {\n $dum = new Statistics_DiskUsageManager();\n $maxQuota = intval($dum->getProperty('maximum_quota'));\n if (!$maxQuota) {\n $maxQuota = 50;\n }\n return $maxQuota;\n }", "public function getMaxNumWorkers()\n {\n return $this->max_num_workers;\n }", "public function getMaxConcurrentRequests(): int\n {\n return $this->maxConcurrentRequests;\n }", "function getServerLoad()\n{\n $loads=sys_getloadavg();\n $core_nums=trim(shell_exec(\"grep -P '^physical id' /proc/cpuinfo | wc -l\"));\n $load= ($loads[0]/$core_nums) * 100;\n if($load > 100) $load = 100;\n return $load;\n}", "public function getMaximumQuota() {\n $maxQuota = intval($this->diskUsageManager->getProperty('maximum_quota'));\n if (!$maxQuota) {\n $maxQuota = 50;\n }\n return $maxQuota;\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}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update data for participant and his sponsor.
protected function updateParticipants(ProjectFlow $flow, $participant, $sponsor, Carbon $registration_starts) { // Update participant timing and notifications $participant->must_be_registered_from = $registration_starts; $participant->accept_stage_starts_at = ProjectFlow::addRegisterTime($flow, $registration_starts, $participant->level); $participant->notification_sent = null; $participant->notify_about_accept_sent = null; $participant->save(); // Update sponsor $sponsor->must_accept_children_from = $participant->accept_stage_starts_at; $sponsor->save(); }
[ "function UpdateSponsor()\n\t\t{\n\t\t\tglobal $_CONF;\n\t\t\t$this->AffiliateAuthenticate();\n\t\t\t\n\t\t\t$loggedInAffiliate = $_SESSION['username'];\n\t\t\t$affID = $this->oModel->getAffiliateID($loggedInAffiliate);\n\t\t\t\n\t\t\t$this->oModel->Sponsor->id\t\t\t\t\t= $_POST['id'];\n\t\t\t$this->oModel->Sponsor->sponsor_url\t\t\t= $_POST['sponsor_url'];\n\t\t\t$this->oModel->Sponsor->sponsor_name\t\t\t= \thtmlentities(trim($_REQUEST['sponsor_name']), ENT_QUOTES);\n\t\t\t$this->oModel->Sponsor->sponsor_description \t=\thtmlentities(trim($_REQUEST['sponsor_description']), ENT_QUOTES);\n\t\t\t$this->oModel->Sponsor->sponsor_url\t\t\t=\ttrim($_REQUEST['sponsor_url']);\n\t\t\t\n\t\t\t$art_id = $this->oModel->updateSponsor($affID);\n\t\t\t\n\t\t\tif($art_id) {\t\t\t\n\t\t\t\t$msg = \"Sponsor updated successfully.\";\t\t\t\t\n\t\t\t\techo \"<script>location='index.php?stage=affiliates&mode=AffiliateDashboard&msg=\".$msg.\"'</script>\";\n\t\t\t\tdie();\n\t\t\t} else {\t\t\t\t\t\t\t\t\n\t\t\t\t$msg = \"server_error.\";\t\n\t\t\t\techo \"<script>location='index.php?stage=affiliates&mode=AddNewSponsors&msg=\".$msg.\"'</script>\";\n\t\t\t\tdie($msg);\n\t\t\t}\t\t\t\n\t\n\t\n\t\n\t\t}", "public function putSponsor(){\n $this->input = Input::all();\n\n try {\n $this->dbConn->table('SPONSOR')\n ->where('ID', $this->input['ID'])\n ->update(array(\n 'ID' => $this->input['ID'],\n 'NAME' => $this->input['NAME'],\n 'ABBR' => $this->input['ABBR'],\n 'TYPE' => $this->input['TYPE'],\n 'DNIS' => $this->input['DNIS'],\n 'LDST_ID' => $this->input['LDST_ID'],\n 'API_KEY' => $this->input['API_KEY'],\n 'ANB' => $this->input['ANB'],\n 'ACTIVE' => $this->input['ACTIVE']\n ));\n return Response::json(\"{'msg':'putSponSponsor-sponsors-utility true'}\");\n } catch (Exception $e) {\n return Response::json(\"{'msg':'putSponSponsor-sponsors-utility rg-api ID = \" . $this->input['ID'] . \"'}\");\n }\n }", "public function updatePartner($data){\n\t\t$this->db->where('id', $data['id']);\n $this->db->update('partner', $data);\n\t}", "public function setSponsor(){\n $this->input = Input::all();\n\n try {\n $this->maxSponId = $this->dbConn->table('SPONSOR')->max('ID');\n $this->oneMore = $this->maxSponId + 1;\n\n $this->dbConn->table('SPONSOR')\n ->insert(array(\n 'ID' => $this->oneMore,\n 'NAME' => $this->input['NAME'],\n 'ABBR' => $this->input['ABBR'],\n 'TYPE' => $this->input['TYPE'],\n 'DNIS' => $this->input['DNIS'],\n 'LDST_ID' => $this->input['LDST_ID'],\n 'API_KEY' => $this->input['API_KEY'],\n 'ANB' => $this->input['ANB'],\n 'ACTIVE' => $this->input['ACTIVE']\n ));\n return Response::json(\"{'msg':'setSponsor-sponsors-utility true'}\");\n } catch (Exception $e) {\n return Response::json(\"{'msg':'setSponsor-sponsors-utility rg-api max id = \" . $this->oneMore . \"'}\");\n }\n }", "public function frontUpdateSponsorshipFields($observer)\n {\n $iban = Mage::app()->getRequest()->getParam('iban');\n $bic = Mage::app()->getRequest()->getParam('bic');\n $siret = Mage::app()->getRequest()->getParam('siret');\n $customer = $observer->getCustomer();\n /*Edit action*/\n if ($customer->getId()) {\n if (isset($iban)) {\n $customerIban = str_replace(CHR(32),\"\",$iban);\n $customerIban = str_replace(\"-\",\"\",$customerIban);\n if (Zend_Validate::is( trim($iban) , 'NotEmpty')) {\n if (!Zend_Validate::is( trim($iban) , 'Iban')) {\n Mage::throwException(Mage::helper('auguria_sponsorship')->__('Invalid IBAN code \"%s\"', $iban));\n }\n }\n $customer->setData('iban', $customerIban);\n }\n\n if (isset($bic)) {\n $customerBic = str_replace(CHR(32),\"\", $bic);\n $customerBic = str_replace(\"-\",\"\", $customerBic);\n $validator = new Zend_Validate_Regex(array('pattern' => '/^([a-zA-Z]){4}([a-zA-Z]){2}([0-9a-zA-Z]){2}([0-9a-zA-Z]{3})?$/'));\n if(!$validator->isValid($customerBic) && !empty($customerBic)){\n Mage::throwException(Mage::helper('auguria_sponsorship')->__('Invalid BIC code \"%s\"', $bic));\n }\n $customer->setData('bic', $customerBic);\n }\n\n if (isset($siret)) {\n $customerSiret = str_replace(CHR(32),\"\",$siret);\n $customerSiret = str_replace(\"-\",\"\",$customerSiret);\n /*desactivated for internationalization\n if (!Mage::helper('auguria_sponsorship')->isSiret(trim($siret))) {\n Mage::throwException(Mage::helper('auguria_sponsorship')->__('Invalid SIRET code \"%s\"', $siret));\n }\n */\n $customer->setData('siret', $customerSiret);\n }\n }\n /*Create action*/\n else {\n if ($sponsorId = Mage::helper(\"auguria_sponsorship\")->searchSponsorId($customer->getEmail())) {\n $customer->setData('sponsor',$sponsorId);\n $cookie = Mage::getSingleton('core/cookie');\n if ($cookie->get('sponsorship_id')) {\n $cookie->delete('sponsorship_id');\n $cookie->delete('sponsorship_email');\n $cookie->delete('sponsorship_firstname');\n $cookie->delete('sponsorship_lastname');\n }\n }\n }\n return $observer;\n }", "public function updating(Participation $participation)\n {\n $participation->updated_id = auth()->user() ? auth()->user()->id : null;\n }", "function editSponsorUser()\n {\n $content='';\n\n switch($this->piVars['formaction'])\n {\n case 'EditSponsorUser':\n $data=unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]);\n /** SANITY CHECKS **/\n // Basic validation left to Javscript\n $flag=0; // Everyone starts sane... till education ruins them :-)\n $errorMsg='';\n // Check whether the username that has been given exists or not\n // If it exists then the only case when it is acceptable is when the username has\n // not been changed :-)\n $result=$GLOBALS['TYPO3_DB']->exec_SELECTquery('uid, username', 'fe_users', 'username=\"' . $this->piVars['username'] .'\" AND pid=\"'. $data['sponsorUsersPID']. '\" '. t3lib_BEfunc::deleteClause('fe_users'));\n\n $row=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);\n if($row && $row['uid']!=$this->piVars['sponsor_user_id'])\n {\n // You can't take someone else's username STUPID!\n $flag=1;\n $errorMsg.='A user with the name \"'. $this->piVars['username'] .'\" already exists. Please choose a different username.<br>';\n }\n\n if($flag)\n {\n $content.=$this->generateSponsorUserEditingForm($errorMsg);\n }\n else\n {\n $insertFields=array(\n 'name' => trim($this->piVars['name']),\n 'email' => trim($this->piVars['email']),\n 'username' => trim($this->piVars['username']),\n 'password' => trim($this->piVars['password']),\n 'telephone' => trim($this->piVars['phone']),\n 'tstamp' => time(),\n );\n\n $GLOBALS['TYPO3_DB']->exec_UPDATEquery('fe_users', 'uid=\"'.$this->piVars['sponsor_user_id'].'\"', $insertFields);\n $content.=$this->generateMenu();\n }\n break;\n\n default:\n $content.=$this->generateSponsorUserEditingForm();\n }\n return $content;\n }", "function editsponsordesc($sponsid){\n ##check admin session live or not\n $this->session_check_admin();\n $projectid = $this->Session->read(\"sessionprojectid\");\n $project_name=$this->Session->read(\"projectwebsite_name_admin\"); \n $this->set('current_project_name',$project_name);\n ##import Sponsor model for processing\n App::import(\"Model\", \"Sponsor\");\n $this->Sponsor = & new Sponsor(); \n\n ##import Project model for processing\n App::import(\"Model\", \"Project\");\n $this->Project = & new Project(); \n\n\n ##check empty data\n if(!empty($this->data)) {\n\n if($this->Sponsor->Save($this->data)){\n $this->Session->setFlash('Sponsor Description updated Successfully.','default', array('class' => 'successmsg'));\n $this->redirect('/admins/editsponsordesc');\n }else{\n $this->Session->setFlash('Error in processing.','default',array('class' => 'msgTXt'));\n }\n }\n\n if($sponsid){\n ##sponsor comming by id\n\n $this->Sponsor->id = $sponsid;\n $this->data = $this->Sponsor->read(); \n\n }else{\n ##sponsor comming by project id\n\n ##check exist sponsor for particular project\n $condition = \"id = '\".$projectid.\"'\";\n $ptdata = $this->Project->find('all',array(\"conditions\"=>$condition));\n\n if($ptdata){\n if($ptdata[0]['Project']['sponsor_id'] !='' && $ptdata[0]['Project']['sponsor_id'] !='0'){\n\n $spid = $ptdata[0]['Project']['sponsor_id'];\n\n $this->Sponsor->id = $spid;\n $this->data = $this->Sponsor->read();\n\n }else{\n $this->Session->setFlash('First you need to add sponsor before adding description.','default',array('class' => 'msgTXt'));\n $this->redirect('/admins/editsponsordtl');\n }\n }\n\n\n }\n }", "public function createSponsorship() {\n // Get the transmitted data\n $data = \\Core\\App::getInstance()->request->getBody();\n $new_data = json_decode($data, true);\n\n // Replace empty values with null\n foreach($new_data as $key => $value) {\n if($value === '') {\n $new_data[$key] = NULL;\n }\n }\n\n // Insert the data\n $invalid_fields = [];\n $new_id = \\Helpers\\Database::createObject('sponsors', 'sponsorships', $new_data, $invalid_fields);\n\n // Update the sponsor's has_sponsored field\n $sponsor_id = $new_data['sponsor'];\n $this->updateHasSponsored($sponsor_id);\n \n // Return the appropriate result\n if($new_id === false) {\n \\Helpers\\Response::error(\\Helpers\\Response::$E_SAVE_FAILED, [\n 'invalid_fields' => $invalid_fields\n ]);\n } else {\n \\Helpers\\Response::success(\n [\n 'record_id' => $new_id\n ],\n [\n [\n 'module_name' => 'sponsors',\n 'model_name' => 'sponsorships'\n ]\n ]\n );\n }\n }", "function updateParticipate($editParticipate, $id)\n{\n updateOne(\"participate\", $id, $editParticipate);\n}", "public function update() {\n\t\tOrderPerson::$rawOrderPersons[$this->idOrderPerson]['address'] = $this->address;\n\t\tOrderPerson::$rawOrderPersons[$this->idOrderPerson]['email'] = $this->email;\n\t\tOrderPerson::$rawOrderPersons[$this->idOrderPerson]['firstName'] = $this->firstName;\n\t\tOrderPerson::$rawOrderPersons[$this->idOrderPerson]['lastName'] = $this->lastName;\n\t}", "public function update() {\n $query = DB::connection()->prepare('UPDATE Credit SET givenby = :givenby, topic = :topic, interrupted = :interrupted, startdate = :startdate, enddate = :enddate, grade = :grade WHERE id = :id');\n $query->execute(array('id' => $this->id, 'givenby' => $this->givenby, 'topic' => $this->topic, 'interrupted' => $this->interrupted, 'startdate' => $this->startdate, 'enddate' => $this->enddate, 'grade' => $this->grade));\n }", "public function updateDonorDetails() {\n if ($this->parameters['request'] == \"personal\") {\n $query = 'UPDATE `pic3pic_continents` SET `continent_name`=\"' . mysql_real_escape_string($this->parameters['ename']) . '\",\n `description`=\"' . mysql_real_escape_string($this->parameters['addrs']) . '\",\n `updated_at`=now()\n WHERE `id`=\"' . mysql_real_escape_string($this->parameters['donorid']) . '\";';\n return executeQuery($query);\n } else if ($this->parameters['request'] == \"commu\") {\n $query = 'UPDATE `user_profile` SET `addressline`=\"' . mysql_real_escape_string($this->parameters['addrs']) . '\",'\n . '`city`=\"' . mysql_real_escape_string($this->parameters['city_town']) . '\",\n `town`=\"' . mysql_real_escape_string($this->parameters['st_loc']) . '\",\n `district`=\"' . mysql_real_escape_string($this->parameters['district']) . '\",\n `province`=\"' . mysql_real_escape_string($this->parameters['province']) . '\",\n `country`=\"' . mysql_real_escape_string($this->parameters['country']) . '\",\n `zipcode`=\"' . mysql_real_escape_string($this->parameters['zipcode']) . '\",\n `website`=\"' . mysql_real_escape_string($this->parameters['website']) . '\" WHERE `id`=\"' . mysql_real_escape_string($this->parameters['donorid']) . '\";';\n return executeQuery($query);\n } else {\n\n }\n }", "public function savesponsor($data)\n\t{\n\n\t\t$error = false;\n\n\t\tforeach($data AS $var => $value)\n\t\t{\n\t\t\t$data[$var] = trim($value);\n\t\t}\n\t\t\n\t\tif (empty($data['from']) OR empty($data['to']) OR empty($data['amount']) OR $data['amount'] == 0 OR empty($data['link']) OR empty($data['description']))\n\t\t{\n\t\t\t\t\t\t\t$msg = '<div class=\"output\" style=\"color:red;\">Invalid Sponsor</div>';\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\t\techo \"here<pre>\"; print_r($data);\n\t\t} else {\n\t\t\t\t\t\t\t$data['from'] = strtotime($data['from']);\n\t\t\t\t\t\t\t$data['to'] = strtotime($data['to']);\n\n\t\t\t\t\t\t\t$Model = new Model($this->config);\n\t\t\t\t\t\t\t$result = $Model->saveSponsor($data);\n\t\t\t\t\t\t\tif (!$result) return false;\n\t\t}\n\t}", "public function updated(Testimonials $testimonials)\n {\n $user_id = auth()->user()->id;\n // $testimonials->created_by = $user_id;\n $testimonials->updated_by = $user_id;\n //\n }", "function sponsorship_set( $p_sponsorship ) {\n\t$t_min_sponsorship = config_get( 'minimum_sponsorship_amount' );\n\tif( $p_sponsorship->amount < $t_min_sponsorship ) {\n\t\terror_parameters( $p_sponsorship->amount, $t_min_sponsorship );\n\t\ttrigger_error( ERROR_SPONSORSHIP_AMOUNT_TOO_LOW, ERROR );\n\t}\n\n\t# if id == 0, check if the specified user is already sponsoring the bug, if so, overwrite\n\tif( $p_sponsorship->id == 0 ) {\n\t\t$t_sponsorship_id = sponsorship_get_id( $p_sponsorship->bug_id, $p_sponsorship->user_id );\n\t\tif( $t_sponsorship_id !== false ) {\n\t\t\t$p_sponsorship->id = $t_sponsorship_id;\n\t\t}\n\t}\n\n\t$t_sponsorship_table = db_get_table( 'mantis_sponsorship_table' );\n\n\t$c_id = db_prepare_int( $p_sponsorship->id );\n\t$c_bug_id = db_prepare_int( $p_sponsorship->bug_id );\n\t$c_user_id = db_prepare_int( $p_sponsorship->user_id );\n\t$c_amount = db_prepare_int( $p_sponsorship->amount );\n\t$c_logo = $p_sponsorship->logo;\n\t$c_url = $p_sponsorship->url;\n\t$c_now = db_now();\n\n\t# if new sponsorship\n\tif( $c_id == 0 ) {\n\t\t# Insert\n\t\t$query = \"INSERT INTO $t_sponsorship_table\n\t\t\t\t ( bug_id, user_id, amount, logo, url, date_submitted, last_updated )\n\t\t\t\t VALUES\n\t\t\t\t (\" . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ')';\n\n\t\tdb_query_bound( $query, Array( $c_bug_id, $c_user_id, $c_amount, $c_logo, $c_url, $c_now, $c_now ) );\n\t\t$t_sponsorship_id = db_insert_id( $t_sponsorship_table );\n\n\t\thistory_log_event_special( $c_bug_id, BUG_ADD_SPONSORSHIP, $c_user_id, $c_amount );\n\t} else {\n\t\t$t_old_amount = sponsorship_get_amount( $c_id );\n\t\t$t_sponsorship_id = $c_id;\n\n\t\tif( $t_old_amount == $c_amount ) {\n\t\t\treturn $t_sponsorship_id;\n\t\t}\n\n\t\t# Update\n\t\t$query = \"UPDATE $t_sponsorship_table\n\t\t\t\t\tSET\tbug_id = \" . db_param() . \",\n\t\t\t\t\t\tuser_id = \" . db_param() . \",\n\t\t\t\t\t\tamount = \" . db_param() . \",\n\t\t\t\t\t\tlogo = \" . db_param() . \",\n\t\t\t\t\t\turl = \" . db_param() . \",\n\t\t\t\t\t\tlast_updated = \" . db_param() . \"\n\t\t\t\t\tWHERE\tid = \" . db_param();\n\n\t\tsponsorship_clear_cache( $c_id );\n\n\t\tdb_query_bound( $query, Array( $c_bug_id, $c_user_id, $c_amount, $c_logo, $c_url, $c_now, $c_id ) );\n\n\t\thistory_log_event_special( $c_bug_id, BUG_UPDATE_SPONSORSHIP, $c_user_id, $c_amount );\n\t}\n\n\tsponsorship_update_bug( $c_bug_id );\n\tbug_monitor( $c_bug_id, $c_user_id );\n\n\tif( $c_id == 0 ) {\n\t\temail_sponsorship_added( $c_bug_id );\n\t} else {\n\t\temail_sponsorship_updated( $c_bug_id );\n\t}\n\n\treturn $t_sponsorship_id;\n}", "public function testUpdatePersonalInfoWithValidData(): void\n {\n $response = $this->actingAs($this->applicant->user)\n ->get(route('settings.edit'));\n $response->assertOk();\n $data = [\n 'first_name' => 'Joe',\n 'last_name' => 'Blow',\n 'email' => 'joeblow@test.com'\n ];\n $response = $this->followingRedirects()\n ->actingAs($this->applicant->user)\n ->post(route('settings.personal.update', $this->applicant->user), $data);\n $response->assertOk();\n // Success notification visible.\n $response->assertSee(Lang::get('success.update_personal'));\n // Data was updated.\n $this->assertDatabaseHas('users', $data);\n }", "public function testUpdateMeeting()\n {\n }", "public function updated(Courier $courier)\n {\n //$courier->updated_by = auth()->user()->id;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: storeHome Description: Store student's course preferences and refresh the page
public function storeHome(Request $request){ // Get session info for logged in student $user = Auth::guard('student')->user(); // Find out which submit button was pressed and act accordingly if($request->input('Submit') != null){ // Submitting courses request()->validate([ 'Term' => ['required'], 'Year' => ['required'], 'Course1' => ['required'] ]); // Assign numerical values to TERM for sorting $term = request('Term'); switch($term){ case 'FALL': $term_id = 4; break; case 'WINTER': $term_id = 1; break; case 'SPRING': $term_id = 2; break; case 'SUMMER': $term_id = 3; break; default: } // Add Course1 $courseName = Course::where('COURSE_ABBR', request('Course1'))->first(); $student_courses = SelectedCourse::updateOrCreate( ['STUDENT_ID' => $user->student_id, 'COURSE_ABBR' => $courseName->COURSE_ABBR, 'COURSE_NAME' => $courseName->COURSE_NAME] ); $student_courses->TERM = request('Term'); $student_courses->TERM_ID = $term_id; $student_courses->YEAR = request('Year'); $student_courses->ADDED_AT = Carbon::now(); $student_courses->save(); // Make sure the courses being added are unique if(request('Course2') != NULL){ if(request('Course2') != request('Course1')){ $courseName = Course::where('COURSE_ABBR', request('Course2'))->first(); $student_courses = SelectedCourse::updateOrCreate( ['STUDENT_ID' => $user->student_id, 'COURSE_ABBR' => $courseName->COURSE_ABBR, 'COURSE_NAME' => $courseName->COURSE_NAME] ); $student_courses->TERM = request('Term'); $student_courses->TERM_ID = $term_id; $student_courses->YEAR = request('Year'); $student_courses->ADDED_AT = Carbon::now(); $student_courses->save(); } } if(request('Course3') != NULL){ if((request('Course3') != request('Course2')) && (request('Course3') != request('Course1'))){ $courseName = Course::where('COURSE_ABBR', request('Course3'))->first(); $student_courses = SelectedCourse::updateOrCreate( ['STUDENT_ID' => $user->student_id, 'COURSE_ABBR' => $courseName->COURSE_ABBR, 'COURSE_NAME' => $courseName->COURSE_NAME], ); $student_courses->TERM = request('Term'); $student_courses->TERM_ID = $term_id; $student_courses->YEAR = request('Year'); $student_courses->ADDED_AT = Carbon::now(); $student_courses->save(); } } if(request('Course4') != NULL){ if((request('Course4') != request('Course3')) && (request('Course4') != request('Course2')) && (request('Course4') != request('Course1'))){ $courseName = Course::where('COURSE_ABBR', request('Course4'))->first(); $student_courses = SelectedCourse::updateOrCreate( ['STUDENT_ID' => $user->student_id, 'COURSE_ABBR' => $courseName->COURSE_ABBR, 'COURSE_NAME' => $courseName->COURSE_NAME], ); $student_courses->TERM = request('Term'); $student_courses->TERM_ID = $term_id; $student_courses->YEAR = request('Year'); $student_courses->ADDED_AT = Carbon::now(); $student_courses->save(); } } if(request('Course5') != NULL){ if((request('Course5') != request('Course4')) && (request('Course5') != request('Course3')) && (request('Course5') != request('Course2')) && (request('Course5') != request('Course1'))){ $courseName = Course::where('COURSE_ABBR', request('Course5'))->first(); $student_courses = SelectedCourse::updateOrCreate( ['STUDENT_ID' => $user->student_id, 'COURSE_ABBR' => $courseName->COURSE_ABBR, 'COURSE_NAME' => $courseName->COURSE_NAME], ); $student_courses->TERM = request('Term'); $student_courses->TERM_ID = $term_id; $student_courses->YEAR = request('Year'); $student_courses->ADDED_AT = Carbon::now(); $student_courses->save(); } } } // Remove selected courses else { $toRemove = $request->input('removeSelected'); // Delete courses if courses were selected if($toRemove != null){ // Remove selected courses from selected_course table for($x = 0; $x < count($toRemove); $x++){ SelectedCourse::where('STUDENT_ID', $user->student_id)->where('COURSE_ABBR', $toRemove[$x])->delete(); } } } return redirect('/student/home'); }
[ "public function preferencesAction()\r\n {\r\n $this->loadLayout();\r\n $this->_initLayoutMessages('customer/session');\r\n $this->_initLayoutMessages('catalog/session');\r\n\r\n $block = $this->getLayout()->getBlock('customer_preferences');\r\n if ($block) {\r\n $block->setRefererUrl($this->_getRefererUrl());\r\n }\r\n $data = $this->_getSession()->getCustomerFormData(true);\r\n $customer = $this->_getSession()->getCustomer();\r\n if (!empty($data)) {\r\n $customer->addData($data);\r\n }\r\n if ($this->getRequest()->getParam('changepass') == 1) {\r\n $customer->setChangePassword(1);\r\n }\r\n\r\n $this->getLayout()->getBlock('head')->setTitle($this->__('Account Email Preferences'));\r\n $this->getLayout()->getBlock('messages')->setEscapeMessageFlag(true);\r\n $this->renderLayout();\r\n }", "public function grade_system()\n {\n $data = $this->paginate_grades();\n if($this->authadmin->checkSessionOrCookie()==TRUE){\n $data_send = Page_Settings::set_page('adminaddgrade_view', $data, '' , 'Welcome Once Again', 'Admin_student_results');\n $this->templates->backend($data_send); \n }else if($this->authadmin->checkSessionOrCookie()==FALSE){\n redirect(base_url().\"administrator/login\"); \n }\n }", "public function store()\n {\n // make sure request is post\n if( ! SCMUtility::requestIsPost())\n {\n View::make('templates/system/error.php',array());\n return;\n }\n\n // get inputs and clean\n $inputs = array();\n foreach($_POST as $k => $v)\n {\n $inputs[$k] = SCMUtility::stripTags($v);\n }\n\n // validate Course info\n $validator = Validator::make($inputs,Course::$rules,Course::$rulesMessages);\n\n if($validator->fails())\n {\n SCMUtility::setFlashMessage($validator->messages()->first());\n View::make('templates/admin/course-create.php',compact('data'));\n return;\n }\n\n // store Course\n $Course = new Course();\n $Course->name = $inputs['name'];\n $Course->description = $inputs['description'];\n $Course->location = $inputs['location'];\n $Course->dates = $inputs['dates'];\n $Course->times = $inputs['times'];\n $Course->fee = $inputs['fee'];\n $Course->premium = (isset($inputs['premium'])) ? 1 : 0;\n $Course->registration_end_date = Carbon::createFromTimestamp(strtotime($inputs['registration_end_date']))->toDateString();\n\n if( ! $Course->save())\n {\n SCMUtility::setFlashMessage('Failed to store course');\n }\n\n // back to course lists\n SCMUtility::redirect('?page=scmCourseModule&state=Course&action=index');\n }", "public function index() {\n if($_GET['teacher_tag']==1){\n cookie('is_teacher', 1, 3600 * 24 * 365);\n }else{\n cookie('is_teacher', 0, 3600 * 24 * 365);\n }\n //haven login\n\t\t$id=session('sc_wap_user_id');\n\n\t\t//student demand\n\t\t$demand_data=D('DemandOrder')->where(array('student_id'=>$id))->select();\n\n\t\tforeach ($demand_data as $key => $value) {\n\t\t\t$arr=explode(',',$value['course_name']);\n\t\t\n\t\t\tforeach ($arr as $ke => $va) {\n\t\t\t\tif($ke==0){\n\t\t\t\t\tunset($arr[$ke]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$demand_data[$key]['course_name']=implode(',',$arr);\n\t\t}\n\t\t$this->demand_data=$demand_data;\n\n\t\t$levelOnetype=D('CourseType')->where(array('cate_ParentId'=>0))->limit(4)->select();\n\t\t$member_id=session('sc_wap_user_id');\n\t\t$member_data=D('MemberInfo')->where(array('member_id' => $member_id ))->find();\n\n\t\t$this->levelOnetype=$levelOnetype;\n\n\t\t$this->member_data=$member_data;\n\t\t$teacher_type=D('MemberInfo')->where(array('member_id'=>session('sc_wap_user_id')))->find();\n\t\tif($teacher_type['member_type']==1){\n\t\t\t$this->isteacher=true;\n\t\t}\n\n\t\t$this->display('student_1');\n\t}", "function view()\n{\n\tstartOfPage();\n\tusers_renderLoginForm();\n\th1(\"Course Enrolled Successfully!\");\n}", "public function storeHome(){\n request()->validate([\n 'StudentID' => ['required', 'digits:9']\n ]);\n\n $user = Auth::guard('adviser')->user();\n\n $student = VerifiedStudent::where('SID', request('StudentID'))->first();\n\n\n // Check if student with given Student ID exists in VerifiedStudent table\n if(isset($student) && ! empty($student)){\n // Store Student ID in SID_REQUEST\n $user->SID_REQUEST = request('StudentID');\n $user->save();\n\n return redirect('/adviser/viewStudent');\n }\n else{\n return redirect('/adviser/home')->with('message', 'Either a student with that Student ID does not exist, or that student has not yet created a verified account.');\n }\n }", "function displayProfileEditCourses($clid)\n{\n\techo '<h1 style=\"text-align:center\">Student Profile</h1><h3 style=\"text-align:center\">Edit Courses</h3><hr>';\n\n\techo '<center><form action=\"profile.php\"><input type=\"submit\" value=\"Back to profile\" /></form></center>';\n\t\n\tdisplayAddCoursesForm();\n\techo '<br>';\n\t$upcomingCourses = getUpcomingCourses($clid);\n\tdisplayEditUpcomingCoursesForm($upcomingCourses);\n\techo '<br>';\n\t$currentCourses = getCurrentCourses($clid);\n\tif ($_SESSION['advisor']==true) // user is an advisor\n\t\tdisplayEditCurrentCoursesForm($currentCourses);\n\telse\n\t\tdisplayCurrentCourses($currentCourses);\n\techo '<br>';\n\t$pastCourses = getPastCourses($clid);\n\tif ($_SESSION['advisor']==true) // user is an advisor\n\t\tdisplayEditPastCoursesForm($pastCourses);\n\telse\n\t\tdisplayPastCourses($pastCourses);\n\t\n}", "public function createUserCourseList($courseList = array()){\n $_SESSION[\"course_list\"] = $courseList;\n }", "public function index()\n\t\t{\n\t\t\t$data['breadcrumb1'] = 'Website managements';\n\t\t\t$data['pageHeader'] = $data['breadcrumb2'] = 'Manage course';\n\t\t\t$data['title'] = 'plus-ed.com | Manage course';\n\t\t\t$this->ltelayout->view('frontweb/course_list' , $data);\n\t\t}", "public function preferences()\n\t{\n\t\t$this->load->library('user_check');\n\t\tif (!file_exists(APPPATH.'/views/user/preferences.php')){\n\t\t\tshow_404();\n\t\t}\n\t\t\n\t\t$data = $this->data;\n\t\t$data['title'] = \"Preferences\";\n\t\t$data['breadcrumb'] = array('PREFERENCES');\n\t\t$data['categories'] = $this->deep_search_model->get_available_categories();\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->load->view('templates/menu', $data);\n\t\t$this->load->view('templates/menu_mall', $data);\n\t\t$this->load->view('user/preferences', $data);\n\t\t$this->load->view('templates/footer', $data);\n\t}", "public function studentHome(){\n return view('student.my_marks')->with('courses', $this->getCourses(null, null, null, null));\n }", "function save() {\n\n $record = new stdClass;\n $record->department = $this->department;\n $record->course_number = $this->course_number;\n $record->fullname = $this->fullname;\n $record->course_type = $this->course_type;\n $record->grade_type = $this->grade_type;\n $record->first_year = $this->first_year;\n $record->exception = $this->exception;\n $record->legal_writing = $this->legal_writing;\n\n if (!$this->id) {\n\n $this->id = insert_record('block_courseprefs_courses', $record, true);\n\n if (!$this->id) {\n throw new Exception('Unable to create new courseprefs course within database');\n }\n\n } else {\n\n $record->id = $this->id;\n\n // #202: Escape apostrophe's in fullname\n $record->fullname = addslashes($this->fullname);\n\n if (!update_record('block_courseprefs_courses', $record)) {\n throw new Exception('Unable to update new courseprefs course within database');\n }\n }\n }", "public function save_preferences()\n {\n $save_arr = $this->preferences;\n\t\t$this->EE->db->where('site_id', $this->EE->config->item('site_id'));\n $this->EE->db->update($this->table_name, $save_arr);\n }", "public function showHome() {\n $this->dData = $this->loadCourses();\n return $this->display(\"home\");\n }", "public function store()\n {\n // Sets end year to NULL if not set\n if((int)$_POST['end_year'] === 0) {\n\t $_POST['end_year'] = NULL;\n }\n \n // Saves post data in education var\n $education = $_POST;\n \n // Links with a user ID, set created by ID and set created date\n if (!isset($education['user_id'])) {\n $education['user_id'] = Helper::getUserIdFromSession();\n }\n $education['created_by'] = Helper::getUserIdFromSession();\n $education['created'] = date('Y-m-d H:i:s');\n \n // Save the record to the database\n EducationModel::load()->store($education);\n View::redirect('education');\n }", "public function savingSelectedCourse (Request $request){\n $selectedCourse = $request->input('course');\n $courseSession = $request->session()->put('selectedCourse' , $selectedCourse);\n return redirect('/getting_students_quiz_request');\n }", "public function sugested_schools(){\n \t//load session library\n\t\t$this->load->library('session');\n if($this->session->userdata('#_AID_SUA')){\n $page_data['adminstrator'] = $this->session->userdata('#_AID_SUA');\n\n $page_data['sugested'] = $this->Other_info_model->get_suggested_schools();\n $pagePath = 'adminstrator/school';\n $secondpagePath = 'adminstrator/sugested_schools';\n\n $page_data['maintitle'] = \"Institution\";\n $page_data['title'] = \"Home\";\n $page_data['subtitle'] = \"Sugested institution\";\n\t\t\t\n\t\t\t\n\t\t\t$this->top_Content($page_data);\n $this->navigation($page_data);\n $this->sideNav($pagePath,$secondpagePath);\n $this->load->view('adminstrator/sugested_schools', $page_data);\n\t \t\t$this->bottom_content($page_data);\n\t\t}else{\n\t\t\tredirect('Home');\n\t\t}\n }", "function applyForCourse()\r\n{\r\n $data = checkAuthenticatedStudent();\r\n $output[KEY_FULL_NAME] = $data[KEY_FULL_NAME];\r\n $dao = new Dao();\r\n if (isset($_REQUEST['coursecode'])) {\r\n $values = array('regcode' => $data[KEY_UID], 'coursecode' => $_REQUEST['coursecode']);\r\n $dao->applyForCourse($values);\r\n }\r\n $output[KEY_COURSES] = $dao->getCourses();\r\n $dao->close();\r\n return $output;\r\n}", "public function update_students($param)\n {\n $data[\"student\"] = $this->fetch_student_by_id($param);\n $data[\"classes\"] = $this->admin_classes->fetch_classes_for_sub_classes();\n if($this->authadmin->checkSessionOrCookie()==TRUE){\n $data_send = Page_Settings::set_page('adminstudentupdate_view', $data, '' , 'Welcome Once Again', 'Admin_student_details');\n $this->templates->backend($data_send); \n }else if($this->authadmin->checkSessionOrCookie()==FALSE){\n redirect(base_url().\"administrator/login\"); \n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation prepareAnAccountBasedTransactionFromHDWalletXPubYPubZPubWithHttpInfo Prepare An AccountBased Transaction From HD Wallet (xPub, yPub, zPub)
public function prepareAnAccountBasedTransactionFromHDWalletXPubYPubZPubWithHttpInfo($blockchain, $network, $context = null, $prepare_an_account_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_rb = null) { $request = $this->prepareAnAccountBasedTransactionFromHDWalletXPubYPubZPubRequest($blockchain, $network, $context, $prepare_an_account_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_rb); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, (string) $request->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } switch($statusCode) { case 200: if ('\CryptoAPIs\Model\PrepareAnAccountBasedTransactionFromHDWalletXPubYPubZPubR' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ ObjectSerializer::deserialize($content, '\CryptoAPIs\Model\PrepareAnAccountBasedTransactionFromHDWalletXPubYPubZPubR', []), $response->getStatusCode(), $response->getHeaders() ]; case 400: if ('\CryptoAPIs\Model\InlineResponse40068' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ ObjectSerializer::deserialize($content, '\CryptoAPIs\Model\InlineResponse40068', []), $response->getStatusCode(), $response->getHeaders() ]; case 401: if ('\CryptoAPIs\Model\InlineResponse40168' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ ObjectSerializer::deserialize($content, '\CryptoAPIs\Model\InlineResponse40168', []), $response->getStatusCode(), $response->getHeaders() ]; case 402: if ('\CryptoAPIs\Model\InlineResponse402' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ ObjectSerializer::deserialize($content, '\CryptoAPIs\Model\InlineResponse402', []), $response->getStatusCode(), $response->getHeaders() ]; case 403: if ('\CryptoAPIs\Model\InlineResponse40368' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ ObjectSerializer::deserialize($content, '\CryptoAPIs\Model\InlineResponse40368', []), $response->getStatusCode(), $response->getHeaders() ]; case 409: if ('\CryptoAPIs\Model\InlineResponse409' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ ObjectSerializer::deserialize($content, '\CryptoAPIs\Model\InlineResponse409', []), $response->getStatusCode(), $response->getHeaders() ]; case 415: if ('\CryptoAPIs\Model\InlineResponse415' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ ObjectSerializer::deserialize($content, '\CryptoAPIs\Model\InlineResponse415', []), $response->getStatusCode(), $response->getHeaders() ]; case 422: if ('\CryptoAPIs\Model\InlineResponse422' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ ObjectSerializer::deserialize($content, '\CryptoAPIs\Model\InlineResponse422', []), $response->getStatusCode(), $response->getHeaders() ]; case 429: if ('\CryptoAPIs\Model\InlineResponse429' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ ObjectSerializer::deserialize($content, '\CryptoAPIs\Model\InlineResponse429', []), $response->getStatusCode(), $response->getHeaders() ]; case 500: if ('\CryptoAPIs\Model\InlineResponse500' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ ObjectSerializer::deserialize($content, '\CryptoAPIs\Model\InlineResponse500', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\CryptoAPIs\Model\PrepareAnAccountBasedTransactionFromHDWalletXPubYPubZPubR'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\CryptoAPIs\Model\PrepareAnAccountBasedTransactionFromHDWalletXPubYPubZPubR', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\CryptoAPIs\Model\InlineResponse40068', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\CryptoAPIs\Model\InlineResponse40168', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 402: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\CryptoAPIs\Model\InlineResponse402', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\CryptoAPIs\Model\InlineResponse40368', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 409: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\CryptoAPIs\Model\InlineResponse409', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 415: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\CryptoAPIs\Model\InlineResponse415', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 422: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\CryptoAPIs\Model\InlineResponse422', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\CryptoAPIs\Model\InlineResponse429', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 500: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\CryptoAPIs\Model\InlineResponse500', $e->getResponseHeaders() ); $e->setResponseObject($data); break; } throw $e; } }
[ "public function prepareAUTXOBasedTransactionFromHDWalletXPubYPubZPubWithHttpInfo($blockchain, $network, $context = null, $prepare_autxo_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_rb = null)\n {\n $request = $this->prepareAUTXOBasedTransactionFromHDWalletXPubYPubZPubRequest($blockchain, $network, $context, $prepare_autxo_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_rb);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\CryptoAPIs\\Model\\PrepareAUTXOBasedTransactionFromHDWalletXPubYPubZPubR' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\PrepareAUTXOBasedTransactionFromHDWalletXPubYPubZPubR', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 400:\n if ('\\CryptoAPIs\\Model\\InlineResponse40066' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse40066', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 401:\n if ('\\CryptoAPIs\\Model\\InlineResponse40166' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse40166', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 402:\n if ('\\CryptoAPIs\\Model\\InlineResponse402' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse402', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 403:\n if ('\\CryptoAPIs\\Model\\InlineResponse40366' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse40366', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 409:\n if ('\\CryptoAPIs\\Model\\InlineResponse409' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse409', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 415:\n if ('\\CryptoAPIs\\Model\\InlineResponse415' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse415', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 422:\n if ('\\CryptoAPIs\\Model\\InlineResponse422' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse422', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 429:\n if ('\\CryptoAPIs\\Model\\InlineResponse429' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse429', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 500:\n if ('\\CryptoAPIs\\Model\\InlineResponse500' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse500', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\CryptoAPIs\\Model\\PrepareAUTXOBasedTransactionFromHDWalletXPubYPubZPubR';\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 } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\PrepareAUTXOBasedTransactionFromHDWalletXPubYPubZPubR',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse40066',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse40166',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 402:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse402',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse40366',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse409',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse415',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 422:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse422',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse429',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse500',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function prepareAnAccountBasedTransactionFromHDWalletXPubYPubZPubRequest($blockchain, $network, $context = null, $prepare_an_account_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_rb = null)\n {\n // verify the required parameter 'blockchain' is set\n if ($blockchain === null || (is_array($blockchain) && count($blockchain) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $blockchain when calling prepareAnAccountBasedTransactionFromHDWalletXPubYPubZPub'\n );\n }\n // verify the required parameter 'network' is set\n if ($network === null || (is_array($network) && count($network) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network when calling prepareAnAccountBasedTransactionFromHDWalletXPubYPubZPub'\n );\n }\n\n $resourcePath = '/blockchain-data/{blockchain}/{network}/transactions/prepare-account-based-transaction';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($context !== null) {\n if('form' === 'form' && is_array($context)) {\n foreach($context as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['context'] = $context;\n }\n }\n\n\n // path params\n if ($blockchain !== null) {\n $resourcePath = str_replace(\n '{' . 'blockchain' . '}',\n ObjectSerializer::toPathValue($blockchain),\n $resourcePath\n );\n }\n // path params\n if ($network !== null) {\n $resourcePath = str_replace(\n '{' . 'network' . '}',\n ObjectSerializer::toPathValue($network),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($prepare_an_account_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_rb)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($prepare_an_account_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_rb));\n } else {\n $httpBody = $prepare_an_account_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_rb;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-key');\n if ($apiKey !== null) {\n $headers['x-api-key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function prepareAUTXOBasedTransactionFromHDWalletXPubYPubZPubRequest($blockchain, $network, $context = null, $prepare_autxo_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_rb = null)\n {\n // verify the required parameter 'blockchain' is set\n if ($blockchain === null || (is_array($blockchain) && count($blockchain) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $blockchain when calling prepareAUTXOBasedTransactionFromHDWalletXPubYPubZPub'\n );\n }\n // verify the required parameter 'network' is set\n if ($network === null || (is_array($network) && count($network) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network when calling prepareAUTXOBasedTransactionFromHDWalletXPubYPubZPub'\n );\n }\n\n $resourcePath = '/blockchain-data/{blockchain}/{network}/transactions/prepare-utxo-transaction';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($context !== null) {\n if('form' === 'form' && is_array($context)) {\n foreach($context as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['context'] = $context;\n }\n }\n\n\n // path params\n if ($blockchain !== null) {\n $resourcePath = str_replace(\n '{' . 'blockchain' . '}',\n ObjectSerializer::toPathValue($blockchain),\n $resourcePath\n );\n }\n // path params\n if ($network !== null) {\n $resourcePath = str_replace(\n '{' . 'network' . '}',\n ObjectSerializer::toPathValue($network),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($prepare_autxo_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_rb)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($prepare_autxo_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_rb));\n } else {\n $httpBody = $prepare_autxo_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_rb;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-key');\n if ($apiKey !== null) {\n $headers['x-api-key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testPrepareAnAccountBasedTransactionFromHDWalletXPubYPubZPub()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function prepareAUTXOBasedTransactionFromHDWalletXPubYPubZPubAsyncWithHttpInfo($blockchain, $network, $context = null, $prepare_autxo_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_rb = null)\n {\n $returnType = '\\CryptoAPIs\\Model\\PrepareAUTXOBasedTransactionFromHDWalletXPubYPubZPubR';\n $request = $this->prepareAUTXOBasedTransactionFromHDWalletXPubYPubZPubRequest($blockchain, $network, $context, $prepare_autxo_based_transaction_from_hd_wallet_x_pub_y_pub_z_pub_rb);\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 syncHDWalletXPubYPubZPubWithHttpInfo($blockchain, $network, $context = null, $sync_hd_wallet_x_pub_y_pub_z_pub_rb = null)\n {\n $request = $this->syncHDWalletXPubYPubZPubRequest($blockchain, $network, $context, $sync_hd_wallet_x_pub_y_pub_z_pub_rb);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 201:\n if ('\\CryptoAPIs\\Model\\SyncHDWalletXPubYPubZPubR' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\SyncHDWalletXPubYPubZPubR', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 400:\n if ('\\CryptoAPIs\\Model\\InlineResponse40041' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse40041', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 401:\n if ('\\CryptoAPIs\\Model\\InlineResponse40141' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse40141', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 402:\n if ('\\CryptoAPIs\\Model\\InlineResponse402' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse402', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 403:\n if ('\\CryptoAPIs\\Model\\InlineResponse40341' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse40341', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 409:\n if ('\\CryptoAPIs\\Model\\InlineResponse4096' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse4096', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 415:\n if ('\\CryptoAPIs\\Model\\InlineResponse415' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse415', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 422:\n if ('\\CryptoAPIs\\Model\\InlineResponse4221' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse4221', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 429:\n if ('\\CryptoAPIs\\Model\\InlineResponse429' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse429', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 500:\n if ('\\CryptoAPIs\\Model\\InlineResponse500' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse500', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\CryptoAPIs\\Model\\SyncHDWalletXPubYPubZPubR';\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 } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\SyncHDWalletXPubYPubZPubR',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse40041',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse40141',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 402:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse402',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse40341',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse4096',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse415',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 422:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse4221',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse429',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse500',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function syncNewHDWalletXPubYPubZPubWithHttpInfo($blockchain, $network, $context = null, $sync_new_hd_wallet_x_pub_y_pub_z_pub_rb = null)\n {\n $request = $this->syncNewHDWalletXPubYPubZPubRequest($blockchain, $network, $context, $sync_new_hd_wallet_x_pub_y_pub_z_pub_rb);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 201:\n if ('\\CryptoAPIs\\Model\\SyncNewHDWalletXPubYPubZPubR' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\SyncNewHDWalletXPubYPubZPubR', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 400:\n if ('\\CryptoAPIs\\Model\\InlineResponse40046' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse40046', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 401:\n if ('\\CryptoAPIs\\Model\\InlineResponse40146' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse40146', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 402:\n if ('\\CryptoAPIs\\Model\\InlineResponse402' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse402', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 403:\n if ('\\CryptoAPIs\\Model\\InlineResponse40346' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse40346', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 409:\n if ('\\CryptoAPIs\\Model\\InlineResponse4098' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse4098', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 415:\n if ('\\CryptoAPIs\\Model\\InlineResponse415' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse415', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 422:\n if ('\\CryptoAPIs\\Model\\InlineResponse4222' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse4222', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 429:\n if ('\\CryptoAPIs\\Model\\InlineResponse429' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse429', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 500:\n if ('\\CryptoAPIs\\Model\\InlineResponse500' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse500', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\CryptoAPIs\\Model\\SyncNewHDWalletXPubYPubZPubR';\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 } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 201:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\SyncNewHDWalletXPubYPubZPubR',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse40046',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse40146',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 402:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse402',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse40346',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse4098',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse415',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 422:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse4222',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse429',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse500',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function syncHDWalletXPubYPubZPubRequest($blockchain, $network, $context = null, $sync_hd_wallet_x_pub_y_pub_z_pub_rb = null)\n {\n // verify the required parameter 'blockchain' is set\n if ($blockchain === null || (is_array($blockchain) && count($blockchain) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $blockchain when calling syncHDWalletXPubYPubZPub'\n );\n }\n // verify the required parameter 'network' is set\n if ($network === null || (is_array($network) && count($network) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network when calling syncHDWalletXPubYPubZPub'\n );\n }\n\n $resourcePath = '/blockchain-data/{blockchain}/{network}/hd/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($context !== null) {\n if('form' === 'form' && is_array($context)) {\n foreach($context as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['context'] = $context;\n }\n }\n\n\n // path params\n if ($blockchain !== null) {\n $resourcePath = str_replace(\n '{' . 'blockchain' . '}',\n ObjectSerializer::toPathValue($blockchain),\n $resourcePath\n );\n }\n // path params\n if ($network !== null) {\n $resourcePath = str_replace(\n '{' . 'network' . '}',\n ObjectSerializer::toPathValue($network),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($sync_hd_wallet_x_pub_y_pub_z_pub_rb)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($sync_hd_wallet_x_pub_y_pub_z_pub_rb));\n } else {\n $httpBody = $sync_hd_wallet_x_pub_y_pub_z_pub_rb;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-key');\n if ($apiKey !== null) {\n $headers['x-api-key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createTransactionWithHttpInfo($body = null)\n {\n // parse inputs\n $resourcePath = \"/transaction\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json', 'application/xml']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json', 'application/xml']);\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 // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('ApiKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['ApiKey'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\BumbalClient\\Model\\TransactionCreateResponse',\n '/transaction'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\BumbalClient\\Model\\TransactionCreateResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\BumbalClient\\Model\\TransactionCreateResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 401:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\BumbalClient\\Model\\ApiResponse401', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 403:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\BumbalClient\\Model\\ApiResponse403', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 405:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\BumbalClient\\Model\\ApiResponse405', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function create3WithHttpInfo($body)\n {\n $returnType = '\\Frengky\\Fineract\\Model\\PostAccountTransfersResponse';\n $request = $this->create3Request($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 '\\Frengky\\Fineract\\Model\\PostAccountTransfersResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function topupTopupServiceInitWithHttpInfo($customer_account_id, $subscription_id, $parameters, $correlation_id = null, $transaction_id = null, $user = null)\n {\n // verify the required parameter 'customer_account_id' is set\n if ($customer_account_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $customer_account_id when calling topupTopupServiceInit');\n }\n // verify the required parameter 'subscription_id' is set\n if ($subscription_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $subscription_id when calling topupTopupServiceInit');\n }\n // verify the required parameter 'parameters' is set\n if ($parameters === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $parameters when calling topupTopupServiceInit');\n }\n // parse inputs\n $resourcePath = \"/customers/{customerAccountId}/subscriptions/{subscriptionId}/topup/init\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // header params\n if ($correlation_id !== null) {\n $headerParams['correlationId'] = $this->apiClient->getSerializer()->toHeaderValue($correlation_id);\n }\n // header params\n if ($transaction_id !== null) {\n $headerParams['transactionId'] = $this->apiClient->getSerializer()->toHeaderValue($transaction_id);\n }\n // header params\n if ($user !== null) {\n $headerParams['user'] = $this->apiClient->getSerializer()->toHeaderValue($user);\n }\n // path params\n if ($customer_account_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"customerAccountId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($customer_account_id),\n $resourcePath\n );\n }\n // path params\n if ($subscription_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"subscriptionId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($subscription_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n // body params\n $_tempBody = null;\n if (isset($parameters)) {\n $_tempBody = $parameters;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('accessKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['accessKey'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\iNew\\Rest6_1\\Model\\InitTopupResponse',\n '/customers/{customerAccountId}/subscriptions/{subscriptionId}/topup/init'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\iNew\\Rest6_1\\Model\\InitTopupResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\InitTopupResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function createTransactionRequestWithHttpInfo($body)\n {\n $returnType = '\\Frengky\\Fineract\\Model\\InteropTransactionRequestResponseData';\n $request = $this->createTransactionRequestRequest($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 '\\Frengky\\Fineract\\Model\\InteropTransactionRequestResponseData',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "function CreateTranRequestDatas_ForHZ($cardholdername,\n $kontur,\n $currency,\n $xid,\n $ccno = \"\",\n $expdate = \"\",\n $cvc = \"\") {\n\n $posnetOOSRequest = new PosnetOOSRequest();\n\n if ($ccno == NULL)\n $posnetOOSRequest->ccno = \"\";\n else\n $posnetOOSRequest->ccno = $ccno;\n\n if ($expdate == NULL)\n $posnetOOSRequest->expdate = \"\";\n else\n $posnetOOSRequest->expdate = $expdate;\n\n if ($cvc == NULL)\n $posnetOOSRequest->cvc = \"\";\n else\n $posnetOOSRequest->cvc = $cvc;\n\n $posnetOOSRequest->cardholdername = $cardholdername;\n $posnetOOSRequest->amount = $kontur;\n $posnetOOSRequest->currency = $currency;\n $posnetOOSRequest->instnumber = \"00\";\n $posnetOOSRequest->xid = $xid;\n $posnetOOSRequest->tranType = \"HZKart\";\n\n return $this->DoTran($posnetOOSRequest, \"0\");\n }", "abstract public function createTransaction(array $params);", "function createCustomerProfileTransaction($params, $isRefund)\n {\n //Get customer Buypass payment profile\n $customerProfile = $this->getCustomerProfile($params);\n if($customerProfile['error']){\n return $customerProfile;\n }else{\n $profile_id = $customerProfile['profile_id'];\n }\n\n //Invoice Information from CE\n $amount = sprintf(\"%01.2f\", round($params[\"invoiceTotal\"], 2));\n\n //Buypass Credentials from CE plugin\n $UserID = $this->settings->get('plugin_buypass_Buypass User ID');\n $GatewayID = $this->settings->get('plugin_buypass_Buypass Gateway ID');\n $LiveURL = $this->settings->get('plugin_buypass_Buypass Live URL');\n $TestURL = $this->settings->get('plugin_buypass_Buypass Test URL');\n $sandbox = $this->settings->get('plugin_buypass_Buypass Test Mode');\n $USE_DEVELOPMENT_SERVER = ($sandbox)? Buypass::USE_DEVELOPMENT_SERVER : Buypass::USE_PRODUCTION_SERVER;\n $TerminalID = $this->settings->get('plugin_buypass_Buypass Terminal ID');\n $Platform = $this->settings->get('plugin_buypass_Buypass Platform');\n $ApplicationID = $this->settings->get('plugin_buypass_Buypass Application ID');\n\n try{\n // Process the transaction\n $buypass = new Buypass($UserID, $GatewayID, $LiveURL, $TestURL, $USE_DEVELOPMENT_SERVER);\n\n //Max Size: 11\n //Terminal identifier.\n $buypass->setParameter('Tid', $TerminalID, 11);\n\n //Max Size: 11\n //Identifies the platform to perform transaction processing.\n $buypass->setParameter('Platform', $Platform, 11);\n\n //Max Size: 12\n //Full amount of transaction including cents.\n // Only numeric characters and a decimal point are allowed; for example, 1000.00\n $buypass->setParameter('Amount', $amount, 12);\n\n //Max Size: 16\n //Token identifying the card number to process\n $buypass->setParameter('Token', $profile_id, 16);\n\n //Max Size: 50\n //Custom field used to record transaction details.\n //This field is optional and used for transaction reporting.\n $buypass->setParameter('Cf1', 'customerid: '.$params['CustomerID'], 50);\n $buypass->setParameter('Cf2', 'invoiceid: '.$params['invoiceNumber'], 50);\n\n //Max Size: 20\n //Application identifier for the application used in sending/receiving transaction request.\n //The value of this field is assigned/authorized by the gateway and must be used in all transactions used by the certified application.\n $buypass->setParameter('ApplicationId', $ApplicationID, 20);\n\n //Max Size: 1\n //Recurring payment indicator. 1 – ON; 0 – OFF;\n //Buypass currently only supports the recurring payment indicator for Visa and MasterCard transactions.\n $buypass->setParameter('Recurring', '0', 1);\n\n if($isRefund){\n $buypass->processRefund();\n }else{\n $buypass->processPayment();\n }\n\n // Get the payment or refund profile ID returned from the request\n if($buypass->isSuccessful()){\n return array(\n 'error' => false,\n\n //Identifies the response identification assigned by the authorizing institution. Present only for approvals.\n 'AuthIdentificationResponse' => $buypass->getAuthIdentificationResponse(),\n\n //Unique value identifying the transaction. Used to identify the transaction for void/reversals\n 'ReferenceNumber' => $buypass->getReferenceNumber(),\n\n //Identifies the disposition of a message. Refer to Appendix F in https://drive.google.com/file/d/0B-NTHmk-nv8FRVZSelBERnh2Y0U/view\n // 00 - Approved or completed successfully\n // 11 - Approved (VIP)\n // 10 - Approved, partial amount approved\n 'ResponseCode' => $buypass->getResponseCode(),\n\n //Identifies the transaction's total amount in US dollars. Format assumes 2 decimal points.\n 'TransactionAmount' => $buypass->getTransactionAmount(),\n\n 'amount' => $amount\n );\n }else{\n //Result Code. Can have details of the error.\n $ResultCode = $buypass->getResultCode();\n\n //Identifies the disposition of a message. Refer to Appendix F in https://drive.google.com/file/d/0B-NTHmk-nv8FRVZSelBERnh2Y0U/view\n $ResponseCode = $buypass->getResponseCode();\n\n //Identifies a decline message, failed bit number, or auth telephone number. Present only for declines.\n $AdditionalResponseData = $buypass->getAdditionalResponseData();\n return array(\n 'error' => true,\n 'detail' => '*Result Code: '.$ResultCode.' *Response Code: '.$ResponseCode.' *Additional Response Data: '.$AdditionalResponseData\n );\n }\n }catch(BuypassException $e){\n return array(\n 'error' => true,\n 'detail' => $e\n );\n }\n }", "public function getHDWalletXPubYPubZPubDetailsWithHttpInfo($blockchain, $extended_public_key, $network, $context = null, $derivation = null)\n {\n $request = $this->getHDWalletXPubYPubZPubDetailsRequest($blockchain, $extended_public_key, $network, $context, $derivation);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n\n switch($statusCode) {\n case 200:\n if ('\\CryptoAPIs\\Model\\GetHDWalletXPubYPubZPubDetailsR' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\GetHDWalletXPubYPubZPubDetailsR', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 400:\n if ('\\CryptoAPIs\\Model\\InlineResponse40070' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse40070', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 401:\n if ('\\CryptoAPIs\\Model\\InlineResponse40170' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse40170', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 402:\n if ('\\CryptoAPIs\\Model\\InlineResponse402' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse402', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 403:\n if ('\\CryptoAPIs\\Model\\InlineResponse40370' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse40370', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 409:\n if ('\\CryptoAPIs\\Model\\InlineResponse409' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse409', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 415:\n if ('\\CryptoAPIs\\Model\\InlineResponse415' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse415', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 422:\n if ('\\CryptoAPIs\\Model\\InlineResponse4226' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse4226', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 429:\n if ('\\CryptoAPIs\\Model\\InlineResponse429' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse429', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 500:\n if ('\\CryptoAPIs\\Model\\InlineResponse500' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\CryptoAPIs\\Model\\InlineResponse500', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\CryptoAPIs\\Model\\GetHDWalletXPubYPubZPubDetailsR';\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 } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\GetHDWalletXPubYPubZPubDetailsR',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse40070',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse40170',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 402:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse402',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse40370',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse409',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse415',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 422:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse4226',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse429',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\CryptoAPIs\\Model\\InlineResponse500',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function prepareTransaction();", "public function topupTopupServiceCommitWithHttpInfo($transaction_id, $customer_account_id, $subscription_id, $correlation_id = null, $user = null)\n {\n // verify the required parameter 'transaction_id' is set\n if ($transaction_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $transaction_id when calling topupTopupServiceCommit');\n }\n // verify the required parameter 'customer_account_id' is set\n if ($customer_account_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $customer_account_id when calling topupTopupServiceCommit');\n }\n // verify the required parameter 'subscription_id' is set\n if ($subscription_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $subscription_id when calling topupTopupServiceCommit');\n }\n // parse inputs\n $resourcePath = \"/customers/{customerAccountId}/subscriptions/{subscriptionId}/topup/commit\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // header params\n if ($correlation_id !== null) {\n $headerParams['correlationId'] = $this->apiClient->getSerializer()->toHeaderValue($correlation_id);\n }\n // header params\n if ($transaction_id !== null) {\n $headerParams['transactionId'] = $this->apiClient->getSerializer()->toHeaderValue($transaction_id);\n }\n // header params\n if ($user !== null) {\n $headerParams['user'] = $this->apiClient->getSerializer()->toHeaderValue($user);\n }\n // path params\n if ($customer_account_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"customerAccountId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($customer_account_id),\n $resourcePath\n );\n }\n // path params\n if ($subscription_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"subscriptionId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($subscription_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('accessKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['accessKey'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'PUT',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\iNew\\Rest6_1\\Model\\CommitTopupResponse',\n '/customers/{customerAccountId}/subscriptions/{subscriptionId}/topup/commit'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\iNew\\Rest6_1\\Model\\CommitTopupResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\CommitTopupResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function preparePayment(Payment $payment, array $params);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize a new PDF document by specifying page size and orientation.
public function initializePageSetup(string $pageSize = null, string $orientation = null): PdfInterface { in_array($pageSize, $this->pageTypes) ? $this->setProperty( 'mpdf', new \mPDF( 'utf-8', $pageSize . '-' . $orientation[0], $this->fontSize, $this->fontType, $this->marginLeft, $this->marginRight, $this->marginTop, $this->marginBottom, $this->marginHeader, $this->marginFooter, $orientation[0] ) ) : $this->setProperty('mpdf', new \mPDF('UTF-8', 'Letter-P')); return $this; }
[ "function PDF_new(){}", "public function AddPage($orientation='') {\r\n //Start a new page\r\n if($this->state==0) {\r\n $this->Open();\r\n }\r\n $family=$this->FontFamily;\r\n $style=$this->FontStyle.($this->underline ? 'U' : '');\r\n $size=$this->FontSizePt;\r\n $lw=$this->LineWidth;\r\n $dc=$this->DrawColor;\r\n $fc=$this->FillColor;\r\n $tc=$this->TextColor;\r\n $cf=$this->ColorFlag;\r\n if($this->page>0) {\r\n //Page footer\r\n $this->InFooter=true;\r\n $this->Footer();\r\n $this->InFooter=false;\r\n //Close page\r\n $this->_endpage();\r\n }\r\n //Start new page\r\n $this->_beginpage($orientation);\r\n //Set line cap style to square\r\n $this->_out('2 J');\r\n //Set line width\r\n $this->LineWidth=$lw;\r\n $this->_out(sprintf('%.2f w',$lw*$this->k));\r\n //Set font\r\n if(strlen($family) > 0) {\r\n $this->SetFont($family,$style,$size);\r\n }\r\n //Set colors\r\n $this->DrawColor=$dc;\r\n if($dc!='0 G') {\r\n $this->_out($dc);\r\n }\r\n $this->FillColor=$fc;\r\n if($fc!='0 g') {\r\n $this->_out($fc);\r\n }\r\n $this->TextColor=$tc;\r\n $this->ColorFlag=$cf;\r\n //Page header\r\n $this->Header();\r\n //Restore line width\r\n if($this->LineWidth!=$lw) {\r\n $this->LineWidth=$lw;\r\n $this->_out(sprintf('%.2f w',$lw*$this->k));\r\n }\r\n //Restore font\r\n if(strlen($family)> 0) {\r\n $this->SetFont($family,$style,$size);\r\n }\r\n //Restore colors\r\n if($this->DrawColor!=$dc) {\r\n $this->DrawColor=$dc;\r\n $this->_out($dc);\r\n }\r\n if($this->FillColor!=$fc) {\r\n $this->FillColor=$fc;\r\n $this->_out($fc);\r\n }\r\n $this->TextColor=$tc;\r\n $this->ColorFlag=$cf;\r\n }", "function PDF_new()\n{\n\treturn new PDF();\n}", "public function __construct($orientation='P', $unit='mm', $format='A4', $unicode=true, $encoding='UTF-8', $diskcache=false, $pdfa=false) {\n /* Set internal character encoding to ASCII */\n if (function_exists('mb_internal_encoding') AND mb_internal_encoding()) {\n $this->internal_encoding = mb_internal_encoding();\n mb_internal_encoding('ASCII');\n }\n // set file ID for trailer\n $serformat = (is_array($format) ? json_encode($format) : $format);\n $this->file_id = md5(TCPDF_STATIC::getRandomSeed('TCPDF'.$orientation.$unit.$serformat.$encoding));\n $this->font_obj_ids = array();\n $this->page_obj_id = array();\n $this->form_obj_id = array();\n // set pdf/a mode\n $this->pdfa_mode = $pdfa;\n $this->force_srgb = false;\n // set language direction\n $this->rtl = false;\n $this->tmprtl = false;\n // some checks\n $this->_dochecks();\n // initialization of properties\n $this->isunicode = $unicode;\n $this->page = 0;\n $this->transfmrk[0] = array();\n $this->pagedim = array();\n $this->n = 2;\n $this->buffer = '';\n $this->pages = array();\n $this->state = 0;\n $this->fonts = array();\n $this->FontFiles = array();\n $this->diffs = array();\n $this->images = array();\n $this->links = array();\n $this->gradients = array();\n $this->InFooter = false;\n $this->lasth = 0;\n $this->FontFamily = defined('PDF_FONT_NAME_MAIN')?PDF_FONT_NAME_MAIN:'helvetica';\n $this->FontStyle = '';\n $this->FontSizePt = 12;\n $this->underline = false;\n $this->overline = false;\n $this->linethrough = false;\n $this->DrawColor = '0 G';\n $this->FillColor = '0 g';\n $this->TextColor = '0 g';\n $this->ColorFlag = false;\n $this->pdflayers = array();\n // encryption values\n $this->encrypted = false;\n $this->last_enc_key = '';\n // standard Unicode fonts\n $this->CoreFonts = array(\n 'courier'=>'Courier',\n 'courierB'=>'Courier-Bold',\n 'courierI'=>'Courier-Oblique',\n 'courierBI'=>'Courier-BoldOblique',\n 'helvetica'=>'Helvetica',\n 'helveticaB'=>'Helvetica-Bold',\n 'helveticaI'=>'Helvetica-Oblique',\n 'helveticaBI'=>'Helvetica-BoldOblique',\n 'times'=>'Times-Roman',\n 'timesB'=>'Times-Bold',\n 'timesI'=>'Times-Italic',\n 'timesBI'=>'Times-BoldItalic',\n 'symbol'=>'Symbol',\n 'zapfdingbats'=>'ZapfDingbats'\n );\n // set scale factor\n $this->setPageUnit($unit);\n // set page format and orientation\n $this->setPageFormat($format, $orientation);\n // page margins (1 cm)\n $margin = 28.35 / $this->k;\n $this->SetMargins($margin, $margin);\n $this->clMargin = $this->lMargin;\n $this->crMargin = $this->rMargin;\n // internal cell padding\n $cpadding = $margin / 10;\n $this->setCellPaddings($cpadding, 0, $cpadding, 0);\n // cell margins\n $this->setCellMargins(0, 0, 0, 0);\n // line width (0.2 mm)\n $this->LineWidth = 0.57 / $this->k;\n $this->linestyleWidth = sprintf('%F w', ($this->LineWidth * $this->k));\n $this->linestyleCap = '0 J';\n $this->linestyleJoin = '0 j';\n $this->linestyleDash = '[] 0 d';\n // automatic page break\n $this->SetAutoPageBreak(true, (2 * $margin));\n // full width display mode\n $this->SetDisplayMode('fullwidth');\n // compression\n $this->SetCompression();\n // set default PDF version number\n $this->setPDFVersion();\n $this->tcpdflink = true;\n $this->encoding = $encoding;\n $this->HREF = array();\n $this->getFontsList();\n $this->fgcolor = array('R' => 0, 'G' => 0, 'B' => 0);\n $this->strokecolor = array('R' => 0, 'G' => 0, 'B' => 0);\n $this->bgcolor = array('R' => 255, 'G' => 255, 'B' => 255);\n $this->extgstates = array();\n $this->setTextShadow();\n // signature\n $this->sign = false;\n $this->tsa_timestamp = false;\n $this->tsa_data = array();\n $this->signature_appearance = array('page' => 1, 'rect' => '0 0 0 0', 'name' => 'Signature');\n $this->empty_signature_appearance = array();\n // user's rights\n $this->ur['enabled'] = false;\n $this->ur['document'] = '/FullSave';\n $this->ur['annots'] = '/Create/Delete/Modify/Copy/Import/Export';\n $this->ur['form'] = '/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate';\n $this->ur['signature'] = '/Modify';\n $this->ur['ef'] = '/Create/Delete/Modify/Import';\n $this->ur['formex'] = '';\n // set default JPEG quality\n $this->jpeg_quality = 75;\n // initialize some settings\n TCPDF_FONTS::utf8Bidi(array(''), '', false, $this->isunicode, $this->CurrentFont);\n // set default font\n $this->SetFont($this->FontFamily, $this->FontStyle, $this->FontSizePt);\n $this->setHeaderFont(array($this->FontFamily, $this->FontStyle, $this->FontSizePt));\n $this->setFooterFont(array($this->FontFamily, $this->FontStyle, $this->FontSizePt));\n // check if PCRE Unicode support is enabled\n if ($this->isunicode AND (@preg_match('/\\pL/u', 'a') == 1)) {\n // PCRE unicode support is turned ON\n // \\s : any whitespace character\n // \\p{Z} : any separator\n // \\p{Lo} : Unicode letter or ideograph that does not have lowercase and uppercase variants. Is used to chunk chinese words.\n // \\xa0 : Unicode Character 'NO-BREAK SPACE' (U+00A0)\n //$this->setSpacesRE('/(?!\\xa0)[\\s\\p{Z}\\p{Lo}]/u');\n $this->setSpacesRE('/(?!\\xa0)[\\s\\p{Z}]/u');\n } else {\n // PCRE unicode support is turned OFF\n $this->setSpacesRE('/[^\\S\\xa0]/');\n }\n $this->default_form_prop = array('lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>array(255, 255, 255), 'strokeColor'=>array(128, 128, 128));\n // set document creation and modification timestamp\n $this->doc_creation_timestamp = time();\n $this->doc_modification_timestamp = $this->doc_creation_timestamp;\n // get default graphic vars\n $this->default_graphic_vars = $this->getGraphicVars();\n $this->header_xobj_autoreset = false;\n $this->custom_xmp = '';\n // Call cleanup method after script execution finishes or exit() is called.\n // NOTE: This will not be executed if the process is killed with a SIGTERM or SIGKILL signal.\n register_shutdown_function(array($this, '_destroy'), true);\n }", "public function createPage( $width, $height )\n {\n if ( $this->document === null )\n {\n $this->initialize();\n }\n\n $this->pages[] = $this->currentPage = $this->document->addPage();\n\n $this->currentPage->setWidth( ezcDocumentPcssMeasure::create( $width )->get( 'pt' ) );\n $this->currentPage->setHeight( ezcDocumentPcssMeasure::create( $height )->get( 'pt' ) );\n $this->currentPage->setTextRenderingMode( HaruPage::FILL );\n\n // The current font might need to be recreated for the new page.\n $this->currentFont['font'] = null;\n }", "protected function initPDF() {\n $this->SetAutoPageBreak(true);\n $this->AliasNbPages();\n }", "abstract public function createPage( $width, $height );", "protected function startStandardPdf() {\n\t\t$this->pdf = new Tx_WineTreatment_Page_StandardPdf();\n\t\t$this->initializePdf();\n\t}", "function setOrientation($orientation) {\n\t\tswitch ($orientation) {\n\t\t\tcase StyleConstants::LANDSCAPE:\n\t\t\t\t$orientation = 'landscape';\n\t\t\t\tif ($this->pageWidth < $this->pageHeight) {\n\t\t\t\t\t$this->setPageSize($this->pageHeight, $this->pageWidth);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase StyleConstants::PORTRAIT:\n\t\t\t\t$orientation = 'portrait';\n\t\t\t\tif ($this->pageWidth > $this->pageHeight) {\n\t\t\t\t\t$this->setPageSize($this->pageHeight, $this->pageWidth);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new StyleException('Invalid orientation value.');\n\t\t}\n\t\t$this->pageLayoutProperties->setAttribute('style:print-orientation', $orientation);\n\t}", "function pdf_create($html, $filename, $orientation = 'P', $page_format = 'A4', $unit = 'mm', $unicode = true, $encoding = 'UTF-8', $stream = 'I')\n\t{\n\t\tob_start();\n\t\t$_ci = get_instance();\n\t\t$_ci->load->library('Tcpdflib');\n\n\t\t// setlocale(LC_MONETARY, 'en_US');\n\n\t\t$pdf = new TCPDF($orientation, $unit, $page_format, true, $encoding, false);\n\t\t$pdf->SetCreator('JTS-PDF');\n\t\t$pdf->SetLeftMargin(9);\n\t\t$pdf->SetRightMargin(9);\n\t\t$pdf->SetPrintHeader(false);\n\t\t$pdf->SetPrintFooter(false);\n\t\t$pdf->AddPage();\n\n\t\t$pdf->writeHTML($html, true, true, false, false, '');\n\t\t$pdf->lastPage();\n\n\t\t$pdf->Output($filename . '.pdf', $stream);\n\t}", "public function newPage() {\n $lastElementType = -1;\n //add by Jin-Hsia Yang\n $isNewpage = TRUE;\n //end add by Jin-Hsia Yang\n if ($writer->getDirectContent()->size() == 0 && $writer->getDirectContentUnder()->size() == 0 && ($pageEmpty == TRUE || ($writer != NULL && $writer->isPaused() == TRUE))) {\n return FALSE;\n }\n $pageEvent = $writer->getPageEvent();\n if ($pageEvent != NULL)\n $pageEvent->onEndPage($writer, $this);\n\n //Added to inform any listeners that we are moving to a new page (added by David Freels)\n parent::newPage();\n\n // the following 2 lines were added by Pelikan Stephan\n $imageIndentLeft = 0;\n $imageIndentRight = 0;\n\n // we flush the arraylist with recently written lines\n flushLines();\n // we assemble the resources of this pages\n $pageResources->addDefaultColorDiff($writer->getDefaultColorspace());\n $resources = $pageResources->getResources();\n // we make a new page and add it to the document\n if ($writer->getPDFXConformance() != PdfWriter::PDFXNONE) {\n if (array_key_exists(\"art\", $thisBoxSize) == TRUE && array_key_exist(\"trim\", $thisBoxSize) == TRUE)\n throw new PdfXConformanceException(\"Only one of ArtBox or TrimBox can exist in the page.\");\n if (array_key_exists(\"art\", $thisBoxSize) == FALSE && array_key_exists(\"trim\", $thisBoxSize) == FALSE) {\n if (array_key_exists(\"crop\", $thisBoxSize) == TRUE)\n $thisBoxSize[\"trim\"] = $thisBoxSize[\"crop\"];\n else\n $thisBoxSize[\"trim\"] = new PdfRectangle($pageSize, $pageSize->getRotation());\n }\n }\n $page = NULL;//PdfPage\n $rotation = $pageSize->getRotation();\n $page = new PdfPage(new PdfRectangle($pageSize, $rotation), $thisBoxSize, $resources, $rotation);\n // we add the transitions\n if ($this->transition != NULL) {\n $page->put(PdfName::$TRANS, $this->transition->getTransitionDictionary());\n $transition = NULL;\n }\n if ($this->duration > 0) {\n $page->put(PdfName::$DUR,new PdfNumber($this->duration));\n $duration = 0;\n }\n // we add the page object additional actions\n if ($pageAA != null) {\n try {\n $page->put(PdfName::$AA, $writer->addToBody($pageAA)->getIndirectReference());\n }\n catch (IOException $ioe) {\n throw new Exception($ioe);\n }\n $pageAA = NULL;\n }\n // we add the annotations\n if (count($annotations) > 0) {\n $array = rotateAnnotations();\n if ($array->size() != 0)\n $page->put(PdfName::$ANNOTS, $array);\n }\n if ($open == FALSE || $close ==TRUE) {\n throw new PdfException(\"The document isn't open.\");\n }\n if ($text->size() > $textEmptySize)\n $text->endText();\n else\n $text = NULL;\n $pageReference = $writer->add($page, new PdfContents($writer->getDirectContentUnder(), $graphics, $text, $writer->getDirectContent(), $pageSize));\n // we initialize the new page\n initPage();\n\n //add by Jin-Hsia Yang\n $isNewpage = FALSE;\n //end add by Jin-Hsia Yang\n\n return TRUE;\n }", "public function RenderPDFDocument()\n {\n\n // Load xml object\n $page_number = 1;\n $suspended_pages = 0;\n $suspensions_per_page = array();\n\n foreach($this->_xml->pages as $page_key => $page_value)\n {\n $suspensions_per_page[$page_number] = 0;\n\n // Set page settings (page_id, margin, default fonts, etc)\n $this->_SetCurrentPageId((string)$page_value->item_id);\n\n // Get General document settings\n //\n // Array Format :\n //\n // Array\n // (\n // [paper_size] => letter\n // [font_family] => verdana\n // [font_size] => 12\n // [margin_top] => 1in\n // [margin_right] => 1in\n // [margin_bottom] => 1in\n // [margin_left] => 1in\n // [first_page_top] => 1in\n // )\n $general_settings = $this->_GetGeneralSettings();\n\n // Page margins\n $page_margin_left = 0;\n $page_margin_right = 0;\n $page_margin_top = 0;\n $page_margin_bottom = 0;\n $first_page_margin = 0;\n\n if(isset($page_value->styles->override_county_styles))\n {\n if(isset($page_value->styles->font_family))\n {\n $general_settings['font_family'] = (string)$page_value->styles->font_family;\n }\n if(isset($page_value->styles->font_size))\n {\n $general_settings['font_size'] = (int)$page_value->styles->font_size;\n }\n if(isset($page_value->styles->margin_left))\n {\n $general_settings['margin_left'] = $page_value->styles->margin_left;\n }\n if(isset($page_value->styles->margin_right))\n {\n $general_settings['margin_right'] = $page_value->styles->margin_right;\n }\n if(isset($page_value->styles->margin_top))\n {\n $general_settings['margin_top'] = $page_value->styles->margin_top;\n }\n if(isset($page_value->styles->margin_bottom))\n {\n $general_settings['margin_bottom'] = $page_value->styles->margin_bottom;\n }\n\n // Page margins\n $page_margin_left = $this->_GetDimensionsInPixels($general_settings['margin_left']);\n $page_margin_right = $this->_GetDimensionsInPixels($general_settings['margin_right']);\n $page_margin_top = $this->_GetDimensionsInPixels($general_settings['margin_top']);\n $page_margin_bottom = $this->_GetDimensionsInPixels($general_settings['margin_bottom']);\n\n if($page_number == 1 && isset($page_value->styles->first_page_top))\n {\n $first_page_margin = intval($page_value->styles->first_page_top);\n }\n }\n else\n {\n // Page margins\n $page_margin_left = $this->_GetDimensionsInPixels($general_settings['margin_left']) + 5;\n $page_margin_right = $this->_GetDimensionsInPixels($general_settings['margin_right']) + 5;\n $page_margin_top = $this->_GetDimensionsInPixels($general_settings['margin_top']) + 5;\n $page_margin_bottom = $this->_GetDimensionsInPixels($general_settings['margin_bottom']) + 5;\n if($page_number == 1)\n {\n $first_page_margin = intval($this->_GetDimensionsInPixels($general_settings['first_page_top']));\n }\n }\n\n $this->_SetFontFamily($general_settings['font_family']);\n $this->_SetFontSize($general_settings['font_size']);\n\n $font = $this->_GetObj()->load_font($this->_GetFontFamily() , \"unicode\", \"embedding\");\n\n // @TODO This needs serious improvement!\n $page_size = $general_settings['paper_size'];\n\n $paper_sizes_array = array(\n 'letter' => array('8.75in', '11in'),\n 'legal' => array('8.75in', '14in'),\n );\n\n switch(strtolower($page_size))\n {\n // If the paper siz is either legal or letter\n // letter dimensions are 8.5\" x 11\"\n // legal dimensions are 8.5\" x 14\"\n case 'letter':\n case 'legal':\n $current_page_width = $this->_GetDimensionsInPixels($paper_sizes_array[strtolower($page_size)][0]);\n $current_page_height = $this->_GetDimensionsInPixels($paper_sizes_array[strtolower($page_size)][1]);\n\n $current_canvas_width = $current_page_width - ($page_margin_left + $page_margin_right);\n $current_canvas_height = $current_page_height - ($page_margin_top + $page_margin_bottom);\n break;\n\n // If paper size is not set up correctly assume one\n default:\n $current_page_width = '600' - ($page_margin_left + $page_margin_right);\n $current_page_height = '800' - ($page_margin_top + $page_margin_bottom);\n break;\n }\n\n // Set Page Dimensions\n $this->_SetCanvasWidth($current_canvas_width);\n $this->_SetCanvasHeight($current_canvas_height);\n\n // Set Canvas Dimensions\n $this->_SetPageWidth($current_page_width);\n $this->_SetPageHeight($current_page_height);\n\n\n // Set Canvas outermarks\n $this->_SetLowerLeftX(0 + $page_margin_left);\n $this->_SetLowerLeftY(0 + $page_margin_bottom);\n // $this->_SetUpperRightX($current_page_width - ($page_margin_right));\n // $this->_SetUpperRightY($current_page_height - ($page_margin_top + $first_page_margin));\n $this->_SetUpperRightX($this->_GetLowerLeftX() + $this->_GetCanvasWidth());\n $this->_SetUpperRightY($this->_GetLowerLeftY() + $this->_GetCanvasHeight());\n\n\n // $this->_SetTempLastY(intval($current_page_height));\n $this->_SetLastX($page_margin_left);\n\n\n // Set Pdf dimensions.\n // Start a page\n // Establish coordinates with the origin in the upper left corner.\n\n $this->_GetObj()->begin_page_ext(0, 0, \"width=\" . $page_size . \".width height=\" . $page_size . \".height\");\n\n // Load default font and set default font size\n $this->_GetObj()->setfont($font, $this->_GetFontSize());\n\n // Reset block_row\n $this->_SetLastY($this->_GetUpperRightY());\n $this->_SetLastX($this->_GetLowerLeftX());\n $this->_SetLastY($current_page_height - ($page_margin_top + $first_page_margin), true);\n\n $row_width_filled = 0;\n\n // Check if the page has child blocks\n if(isset($page_value->block))\n {\n // Move blocks to an array format for better loop handling.\n $blocks_array = array();\n foreach ($page_value->block as $child_key => $child_value)\n {\n $blocks_array[] = $child_value;\n }\n\n // Loop over blocks\n for ($page_block_counter = 0; $page_block_counter < count($blocks_array); $page_block_counter++)\n {\n if(strcmp(strtolower(trim($blocks_array[$page_block_counter]->parent_id)), strtolower(trim($this->_GetCurrentPageId()))) != 0 )\n {\n // if not the same\n // End the page\n // Start a new page\n // Set the current page_id as the new page_id\n $this->_SetLowerLeftX($page_margin_left);\n $this->_SetLowerLeftY(0);\n\n $this->_GetObj()->end_page_ext(\"\");\n\n $page_number++;\n\n continue;\n }\n\n\n // Trim all extra spaces\n $addText = trim($blocks_array[$page_block_counter]->html_content);\n\n // Add a new line at the end of every block\n $addText = $addText . \"\\n\";\n\n // Replace tags with inline formatting handlers from PDFLib\n $addText = $this->_FormatInlineText($addText, $blocks_array[$page_block_counter]->styles->font_family);\n\n // Prepare options list for text blocks\n if(intval($blocks_array[$page_block_counter]->styles->line_spacing) == 0 )\n {\n $line_spacing = 115;\n }\n else\n {\n $line_spacing = floatval($blocks_array[$page_block_counter]->styles->line_spacing) * 100;\n }\n\n $fontname = $blocks_array[$page_block_counter]->styles->font_family;\n\n if((string)$blocks_array[$page_block_counter]->styles->font_weight == \"bold\")\n {\n $fontname = $fontname . \"_Bold\";\n }\n $this->_SetFontSize(intval($blocks_array[$page_block_counter]->styles->font_size));\n $optlist = \" fontname=\" . $fontname\n . \" leading=\" . $line_spacing . \"%\"\n . \" embedding fontsize=\" . intval($blocks_array[$page_block_counter]->styles->font_size)\n . \" encoding=unicode \"\n . \" alignment=\" . $blocks_array[$page_block_counter]->styles->text_align\n . \" parindent=0%\"\n . \" leftindent=0%\"\n . \" macro {\"\n . \" signature_holder {matchbox={name=new boxheight=\"\n . \" {ascender descender}} } \"\n . \" end {matchbox={end}} } \"\n ;\n\n\n // Set block margins\n $block_margin_top = floatval($blocks_array[$page_block_counter]->styles->margin_top);\n $block_margin_left = floatval($blocks_array[$page_block_counter]->styles->margin_left);\n $block_margin_bottom = floatval($blocks_array[$page_block_counter]->styles->margin_bottom);\n $block_margin_right = floatval($blocks_array[$page_block_counter]->styles->margin_right);\n\n\n // Block dimenstions\n $block_width = floatval($blocks_array[$page_block_counter]->styles->width);\n $block_height = floatval($blocks_array[$page_block_counter]->styles->height);\n\n // Calculating where the block ends on the x axis\n $item_type = $blocks_array[$page_block_counter]->item_type;\n $exploded_array = explode('-', $item_type);\n if(intval($exploded_array[1]) == 0)\n {\n $exploded_array[1] = 100;\n }\n $block_type_width = floatval($exploded_array[1]);\n $block_right_end = $this->_GetLastX() + ($block_type_width * $current_canvas_width * 0.01);\n\n\n // A temporary dirty hack to stop overflowing from the right side\n if ($block_right_end > $current_page_width)\n {\n $block_right_end = $current_page_width - $page_margin_right;\n }\n // End of dirty hack\n\n // Set The current $llx for block start\n if(intval($this->_GetLastX()) == $page_margin_left)\n {\n $llx = $this->_GetLowerLeftX();\n }\n else\n {\n $llx = $this->_GetLastX();\n }\n // Add block margin to the number\n $llx = $llx + $block_margin_left;\n\n // Set the current $lly for block start\n $lly = $this->_GetLowerLeftY() + $block_margin_bottom;\n\n // Set the current $urx for block end\n $urx = $block_right_end;\n\n if(intval($this->_GetLastY()) == 0)\n {\n $ury = abs(floatval($current_page_height) - $block_margin_top);\n }\n else\n {\n // $ury = abs($this->_GetPageHeight() - floatval($this->_GetLastY()) - $margin_top);\n $ury = abs(floatval($this->_GetLastY()) - $block_margin_top);\n }\n\n // Start Rendering blocks\n // First check for all special cases\n\n // Check if the block has an <hr>\n if($this->_CheckInlineHr($addText))\n {\n $this->_GetObj()->setlinewidth(1.0);\n\n // Set the current point for graphics output\n\n $this->_GetObj()->moveto($llx, $this->_GetTempLastY() - $block_margin_top);\n\n // Draw a line from the current point to the supplied point\n $this->_GetObj()->lineto($this->_GetUpperRightX() - $block_margin_left, $this->_GetTempLastY() - $block_margin_top);\n\n // Stroke the path using the current line width and stroke color\n $this->_GetObj()->stroke();\n\n $this->_SetTempLastY($this->_GetTempLastY() - $block_margin_top - $block_margin_bottom);\n }\n\n // If there is a table process it!\n elseif($this->_CheckInlineTables($addText))\n {\n $splitted = explode(\"<table\", $addText);\n $fontname = $blocks_array[$page_block_counter]->styles->font_family;\n\n // $ury = $this->_GetTempLastY();\n\n // $this->_SetTempLastY($, true);\n\n foreach ($splitted as $sub_block) {\n $tf = 0;\n if($this->_CheckInlineTables($sub_block))\n {\n if(intval($table_ury) == 0)\n {\n $table_ury = $this->_GetTempLastY();\n }\n\n $tbl = 0;\n $col = 1;\n $row = 1;\n\n $table_html = $this->_ExtractTable($addText);\n $sub_block = strip_tags($table_html, '<table><tr><td>');\n\n $dom = new DOMDocument();\n\n // Load the table html code\n $html = $dom->loadHTML($sub_block);\n\n // The table by its tag name\n $tables = $dom->getElementsByTagName('table');\n\n\n //get all rows from the table\n $rows = $tables->item(0)->getElementsByTagName('tr');\n // get each column by tag name\n $cols = $rows->item(0)->getElementsByTagName('th');\n $row_headers = NULL;\n foreach ($cols as $node) {\n $row_headers[] = $node->nodeValue;\n }\n\n $table = array();\n //get all rows from the table\n $rows = $tables->item(0)->getElementsByTagName('tr');\n foreach ($rows as $row)\n {\n // get each column by tag name\n $cols = $row->getElementsByTagName('td');\n $row = array();\n $i = 0;\n foreach ($cols as $node) {\n if($row_headers==NULL)\n $row[] = $node->nodeValue;\n else\n $row[$row_headers[$i]] = $node->nodeValue;\n $i++;\n }\n $table[] = $row;\n }\n\n\n $row_id = 1;\n $first_col_width = 0;\n $second_col_wdth = 0;\n foreach($table as $row)\n {\n\n $cell_optlist = \" fittextflow={verticalalign=top}\"\n . \" rowheight=1 \"\n ;\n // Column 1\n $tf = 0;\n if(isset($row[0]) && !empty($row[0]))\n {\n $text = $this->_FormatInlineText($row[0], $fontname);\n }\n $tf = $this->_GetObj()->create_textflow(trim($text), $optlist);\n $tbl = $this->_GetObj()->add_table_cell($tbl, 1, $row_id, \"\", $cell_optlist . \" textflow=\" . $tf);\n\n // Column 2\n $tf = 0;\n if(isset($row[1]) && !empty($row[1]))\n {\n $text = $this->_FormatInlineText($row[1], $fontname);\n }\n $tf = $this->_GetObj()->create_textflow(trim($text), $optlist);\n $tbl = $this->_GetObj()->add_table_cell($tbl, 2, $row_id, \"\", $cell_optlist . \" textflow=\" . $tf);\n\n $row_id++;\n }\n\n\n // Actual rendering of the table\n $font = $this->_GetObj()->load_font($fontname, \"unicode\", \"embedding\");\n\n $tab_optlist = \"fittextline={font=\" . $font\n . \" fontsize=\" . intval($blocks_array[$page_block_counter]->styles->font_size)\n . \" }\";\n $result = $this->_GetObj()->fit_table($tbl, $llx + 5, $lly + 5, $urx - 5, $table_ury - 5, \"\");\n\n\n $this->_SetTempLastY($table_ury - intval(10 + $this->_GetObj()->info_table($tbl, \"height\")));\n }\n else\n {\n $sub_block = strip_tags($sub_block, '<fontname><resetfont>');\n $text = $this->_FormatInlineText($sub_block, $fontname);\n $tf = $this->_GetObj()->create_textflow($text, $optlist);\n\n ########################################################\n # Start of copy code\n ########################################################\n if(!isset($suspensions_per_page[$page_number]))\n {\n $suspensions_per_page[$page_number] = 0;\n }\n\n\n $suspensions = 1;\n $j = 0;\n $existing_suspensions = intval($suspensions_per_page[$page_number]);\n do\n {\n $result = $this->_GetObj()->fit_textflow($tf, $llx, $lly, $urx, $ury, \"\");\n if($result != \"_stop\")\n {\n\n $this->_GetObj()->suspend_page(\"\");\n\n $do_we_have_an_overflow = \"_boxfull\";\n\n if($existing_suspensions != 0 && $suspensions < $existing_suspensions)\n {\n $j++;\n // print \"<p>We are at page \" . ($page_number + $j) . \"</p>\";\n $this->_GetObj()->resume_page(\"pagenumber=\" . ($page_number + $j));\n }\n else\n {\n $this->_GetObj()->begin_page_ext(0, 0, \"width=\" . $page_size . \".width height=\" . $page_size . \".height\");\n // print \"<p>We are at page \" . ($page_number + $suspensions) . \" [new]</p>\";\n }\n\n $ury = $this->_GetUpperRightY();\n\n $suspensions++;\n\n }\n $this->_SetTempLastY(floatval($this->_GetObj()->info_textflow($tf, \"textendy\")));\n\n\n\n } while ($result != \"_stop\");\n\n if (isset($do_we_have_an_overflow) && strcmp($do_we_have_an_overflow, \"_stop\"))\n {\n $this->_GetObj()->suspend_page(\"\");\n $this->_GetObj()->resume_page(\"pagenumber=\" . $page_number);\n }\n\n\n if($suspensions > $suspensions_per_page[$page_number])\n {\n $suspensions_per_page[$page_number] = $suspensions;\n }\n ########################################################\n # End of copy code\n ########################################################\n\n $table_ury = floatval($this->_GetObj()->info_textflow($tf, \"textendy\"));\n }\n }\n }\n\n // If there is a signature handle it\n elseif($this->_CheckInlineSignature($addText))\n {\n\n $sub_tfs = explode(\"<nextparagraph>\", $addText);\n $x = intval($this->_GetLastX());\n\n $i = 0;\n $len = count($sub_tfs);\n\n $this->_SetTempLastY($ury, true);\n\n $suspended = false;\n $suspensions = 1;\n\n $j = 0;\n $existing_suspensions = intval($suspensions_per_page[$page_number]);\n\n foreach ($sub_tfs as $sub_tf)\n {\n $tf = 0;\n $force_set_y = true;\n\n if($this->_CheckInlineSignature($sub_tf))\n {\n $image_size = getimagesize($this->_GetSignaturePath());\n\n $signature = $this->_GetObj()->load_image(\"auto\", $this->_GetSignaturePath(), \"\");\n\n $align = \"\" . $blocks_array[$page_block_counter]->styles->text_align;\n\n if ($align == \"right\")\n {\n $img_llx = $this->_GetUpperRightX() - $image_size[0];\n }\n else\n {\n $img_llx = $llx;\n }\n\n $y = intval($this->_GetTempLastY());\n $img_lly = $y - $image_size[1] - 5;\n\n\n if( (intval($y - $image_size[1])) < $lly )\n {\n $img_lly = $this->_GetUpperRighty() - $image_size[1] - 5;\n $this->_GetObj()->suspend_page(\"\");\n\n if($existing_suspensions != 0 && $suspensions < $existing_suspensions)\n {\n $j++;\n // print \"<p>We are at page \" . ($page_number + $j) . \"</p>\";\n $this->_GetObj()->resume_page(\"pagenumber=\" . ($page_number + $j));\n }\n else\n {\n $this->_GetObj()->begin_page_ext(0, 0, \"width=\" . $page_size . \".width height=\" . $page_size . \".height\");\n // print \"<p>We are at page \" . ($page_number + $suspensions) . \" [new]</p>\";\n }\n\n $suspensions++;\n\n }\n $this->_GetObj()->fit_image($signature, $img_llx, $img_lly, \"fitmethod=meet boxsize={0 \" . $image_size[1] . \"} position={left bottom} matchbox={name=signature}\");\n // $this->_SetTempLastY(intval($y) - intval($image_size[1]));\n\n $this->_GetObj()->close_image($signature);\n\n if ($this->_GetObj()->info_matchbox(\"signature\", 1, \"exists\") == 1)\n {\n $y_after_image = intval($this->_GetObj()->info_matchbox(\"signature\", 1, \"y1\"));\n\n $this->_SetTempLastY($y_after_image, $force_set_y);\n }\n }\n elseif(!empty($sub_tf))\n {\n\n $tf = $this->_GetObj()->create_textflow(trim($sub_tf), $optlist);\n\n ########################################################\n # Start of copy code\n ########################################################\n if(!isset($suspensions_per_page[$page_number]))\n {\n $suspensions_per_page[$page_number] = 1;\n }\n\n\n $subtf_ury = $this->_GetTempLastY();\n do\n {\n\n $result = $this->_GetObj()->fit_textflow($tf, $llx, $lly, $urx, $subtf_ury, \"\");\n if($result != \"_stop\")\n {\n $subtf_ury = $this->_GetUpperRighty();\n $suspennded = true;\n\n $this->_GetObj()->suspend_page(\"\");\n\n $do_we_have_an_overflow = \"_boxfull\";\n\n if($existing_suspensions != 0 && $suspensions < $existing_suspensions)\n {\n $j++;\n // print \"<p>We are at page \" . ($page_number + $j) . \"</p>\";\n $this->_GetObj()->resume_page(\"pagenumber=\" . ($page_number + $j));\n }\n else\n {\n $this->_GetObj()->begin_page_ext(0, 0, \"width=\" . $page_size . \".width height=\" . $page_size . \".height\");\n // print \"<p>We are at page \" . ($page_number + $suspensions) . \" [new]</p>\";\n }\n\n $ury = $this->_GetUpperRightY();\n\n $suspensions++;\n\n }\n $this->_SetTempLastY(floatval($this->_GetObj()->info_textflow($tf, \"textendy\")));\n\n\n\n } while ($result != \"_stop\");\n\n\n\n\n\n ########################################################\n # End of copy code\n ########################################################\n\n $tf = 0;\n }\n }\n\n if (isset($do_we_have_an_overflow) && strcmp($do_we_have_an_overflow, \"_stop\"))\n {\n $this->_GetObj()->suspend_page(\"\");\n $this->_GetObj()->resume_page(\"pagenumber=\" . $page_number);\n }\n\n if($suspensions > $suspensions_per_page[$page_number])\n {\n $suspensions_per_page[$page_number] = $suspensions;\n }\n\n }\n\n // Find single html <img src=\"...\" /> tag in block (no surrounding text)\n else if($this->_CheckInlineImage($addText))\n {\n $x = intval($this->_GetLastX());\n $this->_SetTempLastY($ury, true);\n\n $suspended = false;\n $suspensions = 1;\n\n $j = 0;\n $existing_suspensions = intval($suspensions_per_page[$page_number]);\n\n // Get image tag\n $img_tag = substr($addText, strpos($addText, '<img'));\n $img_tag = substr($img_tag, 0, strpos($img_tag, '/>'));\n\n // Get image source (a url)\n $img_url = substr($img_tag, strpos($img_tag, 'src=\"'));\n $img_url = str_replace('src=\"', '', $img_url);\n $img_url = substr($img_url, 0, strpos($img_url, '\"'));\n\n // Get image style (a CSS)\n $css_width = false;\n if(strpos($img_tag, 'style=\"') !== false)\n {\n $img_css = substr($img_tag, strpos($img_tag, 'style=\"'));\n $img_css = str_replace('style=\"', '', $img_css);\n $img_css = substr($img_css, 0, strpos($img_css, '\"'));\n\n $full_css_styles = explode(';', $img_css);\n $styles = array();\n foreach($full_css_styles as $style)\n {\n if(empty($style))\n {\n continue;\n }\n list($name, $value) = explode(':', $style);\n $styles[$name] = $value;\n }\n if(isset($styles['width']) && isset($styles['height']))\n {\n $css_width = true;\n $image_size = array();\n $image_size[0] = $this->_GetDimensionsInPixels($styles['width']);\n $image_size[1] = $this->_GetDimensionsInPixels($styles['height']);\n }\n }\n\n if(filter_var($img_url, FILTER_VALIDATE_URL) === false)\n {\n continue;\n }\n\n $file_headers = @get_headers($img_url);\n if(strpos($file_headers[0], 'Not Found') !== false ||\n strpos($file_headers[0], 'Forbidden') !== false ||\n strpos($file_headers[0], 'Error') !== false)\n {\n continue;\n }\n $tmpfname = tempnam(sys_get_temp_dir(), 'zlien_pdf');\n file_put_contents($tmpfname, fopen($img_url, 'r'));\n\n if(!$css_width)\n {\n $image_size = getimagesize($tmpfname);\n }\n\n $zlien_image = $this->_GetObj()->load_image(\"auto\", $tmpfname, \"\");\n\n $align = \"\" . $blocks_array[$page_block_counter]->styles->text_align;\n\n if ($align == \"right\")\n {\n $img_llx = $this->_GetUpperRightX() - $image_size[0];\n }\n else if ($align == \"center\")\n {\n $block_center = $llx + (($this->_GetUpperRightX() - $llx) / 2);\n $img_llx = intval($block_center - ($image_size[0] / 2));\n }\n else\n {\n $img_llx = $llx;\n }\n\n $y = intval($this->_GetTempLastY());\n $img_lly = $y - $image_size[1] - 5;\n\n if( (intval($y - $image_size[1])) < $lly )\n {\n $img_lly = $this->_GetUpperRighty() - $image_size[1] - 5;\n }\n $this->_GetObj()->fit_image($zlien_image, $img_llx, $img_lly, \"fitmethod=meet boxsize={\" . $image_size[0] . \" \" . $image_size[1] . \"} position={left bottom} matchbox={name=zlien_image}\");\n // $this->_SetTempLastY(intval($y) - intval($image_size[1]));\n\n $this->_GetObj()->close_image($zlien_image);\n\n if(!isset($blocks_array[$page_block_counter]->styles->float) && $this->_GetObj()->info_matchbox(\"zlien_image\", 1, \"exists\") == 1)\n {\n $y_after_image = intval($this->_GetObj()->info_matchbox(\"zlien_image\", 1, \"y1\"));\n\n $this->_SetTempLastY($y_after_image, true);\n }\n }\n\n // Else render normally\n else\n {\n $tf = 0;\n $tf = $this->_GetObj()->create_textflow($addText, $optlist);\n\n // $do_we_have_an_overflow = $result = $tihs->_GetObj()->fit_textflow($tf, $llx, $lly, $urx, $ury, \" blind\");\n\n\n ########################################################\n # Start of copy code\n ########################################################\n if(!isset($suspensions_per_page[$page_number]))\n {\n $suspensions_per_page[$page_number] = 0;\n }\n\n\n $suspensions = 1;\n $j = 0;\n $existing_suspensions = intval($suspensions_per_page[$page_number]);\n do\n {\n $result = $this->_GetObj()->fit_textflow($tf, $llx, $lly, $urx, $ury, \"\");\n if($result != \"_stop\")\n {\n\n $this->_GetObj()->suspend_page(\"\");\n\n $do_we_have_an_overflow = \"_boxfull\";\n\n if($existing_suspensions != 0 && $suspensions < $existing_suspensions)\n {\n $j++;\n // print \"<p>We are at page \" . ($page_number + $j) . \"</p>\";\n $this->_GetObj()->resume_page(\"pagenumber=\" . ($page_number + $j));\n }\n else\n {\n $this->_GetObj()->begin_page_ext(0, 0, \"width=\" . $page_size . \".width height=\" . $page_size . \".height\");\n // print \"<p>We are at page \" . ($page_number + $suspensions) . \" [new]</p>\";\n }\n\n $ury = $this->_GetUpperRightY();\n\n $suspensions++;\n\n }\n $this->_SetTempLastY(floatval($this->_GetObj()->info_textflow($tf, \"textendy\")));\n\n\n\n } while ($result != \"_stop\");\n\n if (isset($do_we_have_an_overflow) && strcmp($do_we_have_an_overflow, \"_stop\"))\n {\n $this->_GetObj()->suspend_page(\"\");\n $this->_GetObj()->resume_page(\"pagenumber=\" . $page_number);\n }\n\n\n if($suspensions > $suspensions_per_page[$page_number])\n {\n $suspensions_per_page[$page_number] = $suspensions;\n }\n ########################################################\n # End of copy code\n ########################################################\n\n }\n\n // if ($row_width_filled\n $item_id = $blocks_array[$page_block_counter]->item_id;\n\n $row_width_filled = $row_width_filled + $block_type_width;\n $this->_SetLastX($row_width_filled * $current_page_width * 0.01);\n\n if ($row_width_filled >= 99) {\n $row_width_filled = 0;\n $this->_SetLastY($this->_GetTempLastY());\n $this->_SetLastX($page_margin_left);\n }\n\n }\n }\n\n // Rest $_last_x & $_last_y\n $this->_SetLowerLeftX($page_margin_left);\n $this->_SetLowerLeftY(0);\n\n // End page\n $this->_GetObj()->suspend_page(\"\");\n\n $page_number = $page_number + $suspensions_per_page[$page_number];\n }\n\n\n // Close document\n $this->_CloseDocument($suspensions_per_page);\n\n // Finished Rendering\n return true;\n }", "public function initialize()\n {\n // set document information\n $this->setCreator(Configure::read('Tcpdf.creator', 'CakeTcpdf'));\n $this->setAuthor(Configure::read('Tcpdf.author', 'CakeTcpdf'));\n $this->SetTitle('Untitled Document');\n $this->SetSubject('Untitled Document');\n $this->SetKeywords('');\n\n // set header and footer fonts\n $this->setHeaderFont([PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN]);\n $this->setFooterFont([PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA]);\n\n // set default monospaced font\n $this->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);\n\n //set margins\n $this->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);\n $this->SetHeaderMargin(PDF_MARGIN_HEADER);\n $this->SetFooterMargin(PDF_MARGIN_FOOTER);\n\n //set auto page breaks\n $this->SetAutoPageBreak(true, PDF_MARGIN_BOTTOM);\n\n //set image scale factor\n $this->setImageScale(PDF_IMAGE_SCALE_RATIO);\n\n $this->SetTextColor(0, 0, 0);\n $this->SetFont('helvetica', '', 11);\n }", "private function initPdf()\n {\n if ( is_object( $this->pdf ) )\n {\n return;\n }\n\n $path2lib = t3lib_extMgm::extPath( 'caddy' ) . 'Resources/Private/Lib/';\n\n require_once( $path2lib . 'pdf/class.tx_caddy_pdf.php' );\n $this->pdf = t3lib_div::makeInstance( 'tx_caddy_pdf' );\n\n // DRS\n if ( $this->drs->drsSession || $this->drsUserfunc )\n {\n $this->pdf->drsUserfunc = true;\n $prompt = __METHOD__ . ': PDF object is initiated.';\n t3lib_div::devlog( '[INFO/USERFUNC] ' . $prompt, $this->extKey, 0 );\n }\n // DRS\n }", "private function startCreatePdf(): void\n {\n // Get PDF data\n\n $pdfDataRef = null;\n\n if ($this->pdfDataIsFile($this->pdfData)) {\n $pdfDataRef = $this->pdfData;\n } elseif (is_string($this->pdfData)) {\n $pdfDataRef = PdfStreamReader::createByString($this->pdfData);\n }\n\n // Get XML data from Builder\n\n $documentBuilderXmlDataRef = PdfStreamReader::createByString($this->getXmlContent());\n\n // Start\n\n $this->pdfWriter->attach(\n $documentBuilderXmlDataRef,\n $this->getXmlAttachmentFilename(),\n 'Factur-X Invoice',\n 'Data',\n 'text#2Fxml'\n );\n\n $this->pdfWriter->openAttachmentPane();\n\n // Copy pages from the original PDF\n\n $pageCount = $this->pdfWriter->setSourceFile($pdfDataRef);\n\n for ($pageNumber = 1; $pageNumber <= $pageCount; ++$pageNumber) {\n $pageContent = $this->pdfWriter->importPage($pageNumber, '/MediaBox');\n $this->pdfWriter->AddPage();\n $this->pdfWriter->useTemplate($pageContent, 0, 0, null, null, true);\n }\n\n // Set PDF version 1.7 according to PDF/A-3 ISO 32000-1\n\n $this->pdfWriter->setPdfVersion('1.7', true);\n\n // Update meta data (e.g. such as author, producer, title)\n\n $this->updatePdfMetadata();\n }", "public function asPdf();", "public function onInitialise()\n\t{\n\n\t\tif (ACTION == \"webpage\" && isset($_GET['action']) && $_GET['action'] == \"pdf\" && isset($_GET['id']))\n\t\t{\n\t\t\tcleanmygets();\n\n\t\t\trequire('tfpdf.php');\n\t\t\trequire('pdf.php');\n\n\t\t\t$this->pdf = new PDF();\n\n\t\t\t$unifontDir = 'podhawk/custom/plugins/pdf_maker/font/unifont'; // relative to PodHawk root\n\n\t\t\t$permissions = new Permissions(array($unifontDir));\n\n\t\t\t// open the unifont directory for caching font metrics\n\t\t\t$permissions->make_writable($unifontDir);\n\n\t\t\t// find the font to use, add it if necessary to the PDF object, set it as the font for the Chapter section, and find the charset\n\t\t\t$this->getFontToUse();\n\n\t\t\t// get the posting data and manipulate it as necessary\n\t\t\t$data = $this->getPDFData();\n\n\t\t\t// what our PDF file will be called\n\t\t\t$fileName = $this->makeFileName($_GET['id']);\t\t\n\t\n\t\t\t// send posting data to the PDF object\n\t\t\t$this->pdf->getData($data);\n\n\t\t\t// create a PDF page\t\t\n\t\t\t$this->pdf->AddPage();\t\t\n\n\t\t\t// write the PDF page\n\t\t\t$this->pdf->ChapterBody();\t\t\t\n\n\t\t\t// output the PDF to the browser\n\t\t\t$this->pdf->Output(urlencode($fileName), 'I');\n\n\t\t\t// close the unifont directory\n\t\t\t$permissions->make_not_writable($unifontDir);\n\n\t\t\t// save a copy of the PDF in the pdf directory if it exists\n\t\t\t$this->savePDF($fileName);\n\t\t\n\t\t\t// NB we need to exit the programme after the PDF has been sent.\n\t\t\texit;\n\t\t}\n\n\t}", "protected function _addNewPage()\n {\n $page = $this->_getPdf()->newPage(\\Zend_Pdf_Page::SIZE_A4);\n $this->_getPdf()->pages[] = $page;\n $this->y = 800;\n\n $this->_addItemTableHead($page);\n return $page;\n }", "protected function initDocInfo()\n {\n $pdf = $this->getPdf();\n \n $pdf->SetTitle('IRC Certificate');\n $pdf->SetSubject('IRC Education Certificate');\n $pdf->SetAuthor('IRC Education Management System');\n $pdf->SetKeywords('x, y, z');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Purposecopies data from $_POST variable to HTML page Inputs $smarty smarty object Remarks Returnsnothing
function _copyDataFromPostToPage( &$smarty ) { $smarty->hassign("first_name", $_POST["first_name"] ); $smarty->hassign("last_name", $_POST["last_name"] ); $smarty->hassign("countryID", $_POST["countryID"] ); $smarty->hassign("zoneID", $_POST["zoneID"] ); $smarty->hassign("state", $_POST["state"] ); $smarty->hassign("zip", $_POST["zip"] ); $smarty->hassign("city", $_POST["city"] ); $smarty->hassign("address", $_POST["address"] ); $zones = znGetZonesById( $_POST["countryID"] ); $smarty->hassign( "zones", $zones ); }
[ "function _copyDataFromPostToPage( &$smarty )\r\n{\r\n\t$smarty->hassign('first_name', $_POST['first_name'] );\r\n\t$smarty->hassign('last_name', $_POST['last_name'] );\r\n\t$smarty->hassign('email', $_POST['email'] );\r\n\t$smarty->assign('subscribed4news', (isset($_POST['subscribed4news'])?1:0) );\r\n/*\r\n@features \"Affiliate program\"\r\n@state begin\r\n*/\r\n\t$smarty->hassign('affiliationLogin', $_POST['affiliationLogin'] );\r\n/*\r\n@features \"Affiliate program\"\r\n@state end\r\n*/\r\n\t$zones = znGetZonesById( $_POST['countryID'] );\r\n\t$smarty->hassign('zones',$zones);\r\n\r\n\t$smarty->assign('countryID', $_POST['countryID'] );\r\n\tif ( isset($_POST['state']) )\r\n\t\t$smarty->hassign('state', $_POST['state'] );\r\n\tif ( isset($_POST['zoneID']) )\r\n\t\t$smarty->assign('zoneID', $_POST['zoneID'] );\r\n\t$smarty->hassign('zip', $_POST['zip'] );\r\n\t$smarty->hassign('city', $_POST['city'] );\r\n\t$smarty->hassign('address', $_POST['address'] );\r\n\r\n\t$smarty->hassign( 'receiver_first_name', $_POST['receiver_first_name'] );\r\n\t$smarty->hassign( 'receiver_last_name', $_POST['receiver_last_name'] );\r\n\r\n\t//aux registration fields\r\n\t$additional_field_values = array();\r\n\t$data = ScanPostVariableWithId( array( 'additional_field' ) );\r\n\tforeach( $data as $key => $val )\r\n\t{\r\n\t\t$item = array( 'reg_field_ID' => $key, 'reg_field_name' => '', \r\n\t\t\t'reg_field_value' => $val['additional_field'] );\r\n\t\t$additional_field_values[] = $item;\r\n\t}\r\n\t$smarty->hassign('additional_field_values', $additional_field_values );\r\n\r\n\tif ( CONF_ORDERING_REQUEST_BILLING_ADDRESS == '1' )\r\n\t{\r\n\t\tif ( isset($_POST['billing_address_check']) )\r\n\t\t\t$smarty->assign( 'billing_address_check', '1' );\r\n\r\n\t\tif ( !isset($_POST['billing_address_check']) )\r\n\t\t{\r\n\t\t\t$smarty->hassign( 'payer_first_name', $_POST['payer_first_name'] );\r\n\t\t\t$smarty->hassign( 'payer_last_name', $_POST['payer_last_name'] );\r\n\t\t\t$smarty->hassign( 'billingCountryID', $_POST['billingCountryID'] );\r\n\t\t\tif ( isset($_POST['billingState']) )\r\n\t\t\t\t$smarty->hassign( 'billingState', $_POST['billingState'] );\r\n\t\t\tif ( isset($_POST['billingZoneID']) )\r\n\t\t\t{\r\n\t\t\t\t$smarty->hassign( 'billingZoneID', $_POST['billingZoneID'] );\r\n\t\t\t}\r\n\t\t\t$smarty->hassign( 'billingZip', $_POST['billingZip'] );\r\n\t\t\t$smarty->hassign( 'billingCity', $_POST['billingCity'] );\r\n\t\t\t$smarty->hassign( 'billingAddress', $_POST['billingAddress'] );\r\n\r\n\t\t\t$billingZones = znGetZonesById( $_POST['billingCountryID'] );\r\n\t\t\t$smarty->hassign( 'billingZones', $billingZones );\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$smarty->hassign( 'payer_first_name', $_POST['receiver_first_name'] );\r\n\t\t\t$smarty->hassign( 'payer_last_name', $_POST['receiver_last_name'] );\r\n\t\t\t$smarty->hassign( 'billingCountryID', $_POST['countryID'] );\r\n\t\t\tif ( isset($_POST['state']) )\r\n\t\t\t\t$smarty->hassign( 'billingState', $_POST['state'] );\r\n\t\t\tif ( isset($_POST['zoneId']) )\r\n\t\t\t\t$smarty->assign( 'billingZoneID', $_POST['zoneId'] );\r\n\t\t\t$smarty->hassign( 'billingZip', $_POST['zip'] );\r\n\t\t\t$smarty->hassign( 'billingCity', $_POST['city'] );\r\n\t\t\t$smarty->hassign( 'billingAddress', $_POST['address'] );\r\n\t\t\t$smarty->hassign( 'billingZones', $zones);\r\n\t\t}\r\n\t}\r\n}", "function postAssign(&$smartyobj, $postArray='')\n { \n \t\tif (!is_array($postArray)) $postArray\t=\t$_POST;\n \t\tforeach ($postArray as $key=>$value) {\n\t\t\t$smartyobj->assign($key,db_prepare_input($value));\n\t\t}\n \t\n }", "public function tpldataAction()\n\t{\n\t\t$tpl_file_name = $_POST['tpl'];\n\t\tif($this->_user_api_key)\n\t\t{\t\n\t\t\t$obj = new Admin_Model_StructureMapper($this->_user_api_key);\n\t\t \t$obj->currentTemplate()->setTemplatePath();\n\t\t \t$tpl_path_prefix = $obj->__get('_template_path').\"/blocks/\".$tpl_file_name;\n\t\t\tif(!file_exists($tpl_path_prefix))\n\t\t\t\t$tpl_path_prefix = APPLICATION_PATH.\"/modules/default/views/scripts/templates/default/blocks/\".$tpl_file_name;\n\t\t\t$tpl_file_contents = file_get_contents($tpl_path_prefix);\t\t\t\n\t\t\techo $tpl_file_contents;\n\t\t\texit;\n\t\t}\n\t\t\n\t\texit;\n\t}", "public function get_submitted_edit_form_data()\n {\n //get the inputed UMS, units and assessments\n// $this->ums = $_POST['ums'];\n }", "public function get_submitted_edit_form_data()\n {\n $this->credits = $_POST['credits'];\t\n }", "public function smartyFatch(){\n if(!isset($this->template)){\n return 'Error : There is no template';\n }\n $body = $this->smarty->fetch($this->template);\n $this->msgHTML($body);\n return $body;\n }", "public function render(){\r\n\t\t$form=$this->formulaire;\r\n\t\t$form_submit_url=$this->getUrlForForm();\r\n\t\teval('?>'.$this->form_object->getTemplate());\r\n\t}", "function showEditLiveBannerForm($bannerzoneid,$banneroldenddate,$bannerendday,$bannerendmonth,$bannerendyear,$bannerstartday,$bannerstartmonth,$bannerstartyear,$bannergif,$bannerurl,$bannerstatic,$bannerpriority,$bannerweightage,$bannerfeatures,$bannerclass,$campaignenddate)\n{\n\tglobal $smarty,$_TPLPATH;\n\t$smarty->assign(\"banneroldenddate\",$banneroldenddate);\n\t$smarty->assign(\"bannergif\",$bannergif);\n\t$smarty->assign(\"bannerurl\",$bannerurl);\n\t$smarty->assign(\"bannerfeatures\",$bannerfeatures);\n\t$smarty->assign(\"bannerstatic\",$bannerstatic);\n\t$smarty->assign(\"bannerweightage\",$bannerweightage);\n\t$smarty->assign(\"bannerendday\",$bannerendday);\n\t$smarty->assign(\"bannerendmonth\",$bannerendmonth);\n\t$smarty->assign(\"bannerendyear\",$bannerendyear);\n\t$smarty->assign(\"bannerstartday\",$bannerstartday);\n\t$smarty->assign(\"bannerstartmonth\",$bannerstartmonth);\n\t$smarty->assign(\"bannerstartyear\",$bannerstartyear);\n\n$smarty->assign(\"bannerpriorityarr\",getBannerPriority($bannerzoneid,$bannerpriority));\n\t$smarty->assign(\"daysarr\",getDaysBms());\n\t$smarty->assign(\"monthsarr\",getMonthsBms());\n\t$smarty->assign(\"yearsarr\",getYearsBms());\n\t$smarty->assign(\"bannerclass\",FormatBannerClass($bannerclass));\n\t$smarty->assign(\"campaignenddate\",$campaignenddate);\n\t$smarty->assign(\"currentdate\",date(\"Y-m-d\"));\n\t\t\n}", "function smarty_std(){\n global $smarty;\n $smarty->assign('USER',$_SESSION['ldapab']['username']);\n}", "abstract public function forms_post();", "function html_form_output($data) {\n $data->printForm();\n}", "public function getHtml(){\n\t\t# Check for PayPal ID or an email address associated with PayPal account\n\t\tif(!$this->get('business')){\n\t\t\techo 'Need to set PayPal ID to the variable \"business\".<br>';\n\t\t}\n\t\t# Prepare for form opening\n\t\tif($this->sandbox == true) $url = PAYPAL_SANDBOX_SUBMIT_URL;\n\t\telse $url = PAYPAL_SUBMIT_URL;\n\t\t\n\t\t$this->html .= \"<form name=\\\"{$this->name}\\\" action=\\\"{$url}\\\" method=\\\"post\\\"\";\n\t\tif($this->openInNewWindow) $this->html .= \" target=\\\"_blank\\\"\";\n\t\t$this->html .= \">\\n\";\n\t\t\t\t\n\t\tforeach( $this->variables as $key => $value ){\n\t\t\tif( $value !== \"\" ){\n\t\t\t\t$id = 'pp-'.str_replace('_', '-', $key);\n\t\t\t\t$this->html .= \"<input type=\\\"hidden\\\" id=\\\"$id\\\" name=\\\"{$key}\\\" value=\\\"{$value}\\\" />\\n\";\n\t\t\t}\n\t\t}\n\t\t$this->html .= $this->getCartItemsHtml();\n\t\treturn $this->html;\n\t}", "public function mostraFormCibo(){\n //assegnazione a smarty per mostrare la form di inserimento di un nuovo cibo\n $this->smarty->display(\"NuovoIngrediente.tpl\");\n }", "function wyswietl_podmagazyn()\n {\n $smarty = new Smarty();\n global $smarty;\n\n $smarty->assign('wyswietl_keys', $this->dane[0]);\n $smarty->assign('wyswietl', $this->dane[1]);\n $smarty->assign('pages_count', $this->dane[2]);\n $smarty->assign('page_number', $this->dane[3]);\n $smarty->assign('nr_strony', $this->dane[4]);\n\n $smarty->assign('ID', 'wyszukaj_podmagazyn');\n $smarty->assign('sub', 'tak');\n $smarty->assign('plik', 'magazyn_wyswietl_podmagazyn.tpl');\n $smarty->assign('wyswietl_wynik_szukaj', $_SESSION['wyswietl_wynik_szukaj_podmagazyn']);\n //echo $_SESSION['wyswietl_wynik_szukaj_podmagazyn'].'<br>';\n }", "function smarty_function_cif_value( $params = array(), &$smarty )\n{\n\t$CI =& get_instance();\n\t\n\t$CI->load->library('form_validation');\n\t$CI->load->helper('form');\n\n\tif(isset($params['field']))\n\t{\n\t\t$value = htmlentities(set_value($params['field']));\n\t}\n\telse\n\t{\n\t\t$value = '';\n\t}\n return $value;\n}", "static protected function renderSmarty ($formObj, $tplAttributes = Array())\n {\n $smarty = BizSystem::getSmartyTemplate();\n $tplFile = BizSystem::getTplFileWithPath($formObj->m_TemplateFile, $formObj->m_Package);\n \n //Translate Array of template variables to Zend template object\n\t\t//print_r($tplAttributes);\n foreach ($tplAttributes as $key => $value) {\n $smarty->assign($key, $value);\n }; \n \n return $smarty->fetch($tplFile);\n }", "public function SMS_send_form(){\n\n $config=M('sys_config');\n $SMS_acc=$config-> getFieldByName('SMS_acc','value');\n $SMS_key=$config-> getFieldByName('SMS_key','value');\n $SMS_sign=$config-> getFieldByName('SMS_sign','value');\n $SMS_location=$config-> getFieldByName('SMS_location','value');\n\n\n $this->assign(array('SMS_acc'=>$SMS_acc,'SMS_key'=>$SMS_key,'SMS_sign'=>$SMS_sign,'SMS_location'=>$SMS_location));\n\n\n $this->display('Interface/Validate/sms');\n }", "function mf_parse_template_variables($dbh,$form_id,$entry_id,$template_content){\n \t$mf_settings = mf_get_settings($dbh);\n\n\t\t$template_data_options = array();\n\t\t$template_data_options['strip_download_link'] = false; \n\t $template_data_options['as_plain_text']\t\t = true;\n\t $template_data_options['target_is_admin'] \t = true;\n\t\t$template_data_options['machform_path'] \t = $mf_settings['base_url'];\n\t\t\t\n\t\t$template_data = mf_get_template_variables($dbh,$form_id,$entry_id,$template_data_options);\n\t\t\t\n\t\t$template_variables = $template_data['variables'];\n\t\t$template_values = $template_data['values'];\n\n\t\t//parse the form success message with the template variables\n\t\t$template_content = str_replace($template_variables,$template_values,$template_content);\n\n\t\treturn $template_content; \t\n }", "function insert_mail_data($mailer_id,$template_name,$from,$subject,$url,$from_name,$browserUrl)\n{\n\tglobal $smarty;\n\t$data=\"\";\n//\tpassthru(\"chmod 777 $url\");\n\t$fd1 = fopen(\"$url\",\"r\");\n\twhile (!feof($fd1)) \n\t{\n\t\t$temp= fgets($fd1, 4096);\n\t\t$data.=$temp;\n\t}\n\tfclose($fd1);\n\t\t\n\t$from=addslashes(stripslashes($from));\n\t$from_name=addslashes(stripslashes($from_name));\n\t$subject=addslashes(stripslashes($subject));\n\t//echo\"The tpl saved is :<br><br> $data\";\n\t//$data=nl2br($data);\t\n\t$data=addslashes(stripslashes($data));\n\t$sql=\"INSERT INTO MAIL_DATA(MAILER_ID,TEMPLATE_NAME,F_EMAIL,F_NAME,SUBJECT,DATA,ACTIVE,BROWSERURL) VALUES($mailer_id,'$template_name','$from','$from_name','$subject','$data','Y','$browserUrl')\";\n\tmysql_query($sql) or die(\"Could not insert into mail data\".mysql_error().\"<br>$sql<br>\");\n\t$message=\"Mail data has been added ,Now you can send test mail\";\n\t$sql_update_state=\"UPDATE MAIN_MAILER SET STATE='mdi' WHERE MAILER_ID=$mailer_id \";\n\t$result_update_state=mysql_query($sql_update_state) or die(\"could not update state of mailer: \".mysql_error());\n\t\t\n\t$smarty->assign(\"message\",$message);\n\t$smarty->display(\"mmm_message.htm\");\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Params customer_id : customer id for registered users. Description : Generate customer token from braintree
public function getGenerateToken($customerId) { //$config = $this->surchargeConfigHelper; //print_r($this->surchargeConfigHelper->getConfig('percent')); exit; if ($customerId != "") { Braintree_Configuration::environment ( $this->environment ); Braintree_Configuration::merchantId ( $this->merchantId ); Braintree_Configuration::publicKey ( $this->publicKey ); Braintree_Configuration::privateKey ( $this->privateKey ); /*Braintree_Configuration::environment ( 'sandbox' ); Braintree_Configuration::merchantId ( 's267rydcq9f3g9g7' ); Braintree_Configuration::publicKey ( 'kv6r8tn639rbfzpx' ); Braintree_Configuration::privateKey ( '8d270ea4a88cade9026d143e0d67977a' );*/ $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $customerObj = $objectManager->create('Magento\Customer\Model\Customer')->load($customerId); $query = "Select * FROM mage_customer_setting where customer_id = '".$customerId."' LIMIT 1"; $collection = $this->_connection->fetchAll($query); if (count ( $collection ) == 0) { $result = Braintree_Customer::create ( [ 'firstName' => $customerObj->getFirstname (), 'lastName' => $customerObj->getLastname (), 'company' => ' ', 'email' => $customerObj->getEmail (), 'phone' => '', 'fax' => '', 'website' => '' ] ); if ($result->success) { $returnArray ['braintree_customer_id'] = $result->customer->id; } $returnArray ['client_token'] = Braintree_ClientToken::generate ( [ "customerId" => $returnArray ['braintree_customer_id'] ] ); $insert = "INSERT mage_customer_setting SET customer_id='" . $customerId . "',proximity_notification='0',push_notification='0',geo_location='0',phone_number='',`client_token`='" . $returnArray ['client_token'] . "',braintree_customer_id='" . $returnArray ['braintree_customer_id'] . "',braintree_customer_register_token=''"; $this->_connection->query($insert); } else { if(trim($collection[0]['braintree_customer_id']) != ''){ $returnArray ['braintree_customer_id'] = $collection[0]['braintree_customer_id']; $returnArray ['client_token'] = $collection[0]['client_token']; } else { $result = Braintree_Customer::create ( [ 'firstName' => $customerObj->getFirstname (), 'lastName' => $customerObj->getLastname (), 'company' => ' ', 'email' => $customerObj->getEmail (), 'phone' => '', 'fax' => '', 'website' => '' ] ); if ($result->success) { $returnArray ['braintree_customer_id'] = $result->customer->id; } $returnArray ['client_token'] = Braintree_ClientToken::generate ( [ "customerId" => $returnArray ['braintree_customer_id'] ] ); $insert = "UPDATE mage_customer_setting SET `client_token`='" . $returnArray ['client_token'] . "',braintree_customer_id='" . $returnArray ['braintree_customer_id'] . "',braintree_customer_register_token='' WHERE customer_id='" . $customerId . "'"; $this->_connection->query($insert); } } /*if (count ( $collection ) == 0) { $insert = "INSERT mage_customer_setting SET customer_id='" . $returnArray ['braintree_customer_id'] . "',proximity_notification='0',push_notification='0',geo_location='0',phone_number='',`client_token`='" . $returnArray ['client_token'] . "',braintree_customer_id='" . $returnArray ['braintree_customer_id'] . "',braintree_customer_register_token=''"; } else { $insert = "UPDATE mage_customer_setting SET `client_token`='" . $returnArray ['client_token'] . "',braintree_customer_id='" . $returnArray ['braintree_customer_id'] . "',braintree_customer_register_token='' WHERE customer_id='" . $returnArray ['braintree_customer_id'] . "'"; }*/ //$this->_connection->query($insert); //print_r($returnArray); exit; return json_encode ( $returnArray ); } else { return "Customer ID is missing"; } }
[ "public function getCustomerToken();", "public static function get_customer_default_token($customer_id)\n {\n }", "public function getCustomerToken($customer_id)\n {\n $customerToken = $this->tokenModelFactory->create();\n $tokenKey = $customerToken->createCustomerToken($customer_id)->getToken();\n return $tokenKey;\n }", "public static function findDeviceTokenByCustomerId($customer_id){\n return static::findOne(['customer_id' => $customer_id]);\n }", "function GenerateCustomerToken()\n\t{\n\t\t$rnd = rand(1, 99999);\n\t\t$uid = uniqid($rnd, true);\n\t\treturn $uid;\n\t}", "public function getCustomerToken()\n {\n return $this->customer_token;\n }", "public function amCreatingTokenForSanctumAuthenticatedCustomer(Customer $customer)\n {\n return $this->grabTokenFromSanctumGeneratedString(\n $customer->createToken($this->fake()->company)->plainTextToken\n );\n }", "public function getCustomerToken()\n {\n $tokenKey = \"\";\n try{\n if($this->customerSession->isLoggedIn()) {\n $customerId = $this->customerSession->getCustomer()->getId();\n $customerToken = $this->tokenFactory->create();\n $tokenKey = $customerToken->createCustomerToken($customerId)->getToken();\n }\n return $tokenKey;\n }catch (\\Exception $e){\n\n }\n return $tokenKey;\n }", "public function getCustomerToken() {\n return $this->customer;\n }", "public function addCreditCardToken($customer_id, $body)\n {\n \n // verify the required parameter 'customer_id' is set\n if ($customer_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $customer_id when calling addCreditCardToken');\n }\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $body when calling addCreditCardToken');\n }\n \n // parse inputs\n $resourcePath = \"/customer/{customer_id}/credit_card_token\";\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n $method = \"POST\";\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 // path params\n if ($customer_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"customer_id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($customer_id),\n $resourcePath\n );\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 } else if (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n \n \n // make the API Call\n try\n {\n list($response, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, $method,\n $queryParams, $httpBody,\n $headerParams, '\\Tpaga\\Model\\CreditCard'\n );\n \n if (!$response) {\n return null;\n }\n\n return $this->apiClient->getSerializer()->deserialize($response, '\\Tpaga\\Model\\CreditCard', $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 201:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\CreditCard', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 422:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\ApiError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n \n return null;\n \n }", "function generate_customer_id($user_id)\n{\n\t$customer_id = get_user_meta($user_id, \"customer_id\", true);\n\t\n\tif(empty($customer_id))\n\t{\n\t\tglobal $wpdb;\n\t\t\n\t\t//this code generates a string 10 characters long of numbers and letters\n\t\twhile(empty($customer_id))\n\t\t{\n\t\t\t$scramble = md5(AUTH_KEY . current_time('timestamp') . $user_id . SECURE_AUTH_KEY);\n\t\t\t$customer_id = substr($scramble, 0, 10);\n\t\t\t$check = $wpdb->get_var(\"SELECT meta_value FROM $wpdb->usermeta WHERE meta_value = '\" . esc_sql($customer_id) . \"' LIMIT 1\");\n\t\t\tif($check || is_numeric($customer_id))\n\t\t\t\t$customer_id = NULL;\n\t\t}\n\t\t\n\t\t//save to user meta\n\t\tupdate_user_meta($user_id, \"customer_id\", $customer_id);\n\t\t\n\t\treturn $customer_id;\n\t}\n}", "function createClientToken(){\n \t$clientToken = Braintree_ClientToken::generate();\n \treturn $clientToken;\n }", "function it_exchange_stripe_addon_get_stripe_customer_id( $customer_id ) {\n $settings = it_exchange_get_option( 'addon_stripe' );\n $mode = ( $settings['stripe-test-mode'] ) ? '_test_mode' : '_live_mode';\n\n return get_user_meta( $customer_id, '_it_exchange_stripe_id' . $mode, true );\n}", "public function getClientToken()\n {\n return \\Braintree_ClientToken::generate();\n }", "public function generateToken()\n {\n }", "public function getCustomerToken() \n\t{\n\t\tif (!$this->hasData('recommender_customer_token')) {\n\t\t\t$this->setData('recommender_customer_token', Mage::getStoreConfig('recommender/account/strands_customer_token'));\n\t\t}\n\t\treturn $this->getData('recommender_customer_token');\t\n\t}", "public function getBillingToken();", "public function generateClientToken() {\n return response()->json([\n 'client_token' => \\Braintree_ClientToken::generate()\n ]);\n }", "public function getCustomerId();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
cancel entry transactions that are completed
protected function cancelEntry($entry_id) { global $oSecurity; //echo "<br /><br />cancel entry".$entry_id; FUNC::includeFile(PATH_2_GLOBALS.'modules/payment/entries.class.php'); FUNC::includeFile(PATH_2_GLOBALS.'modules/payment/transactions.class.php'); $oEntries = new entries(); $oTransactions = new transactions(); $entry = $oEntries->getEntry($entry_id); //$transactions_to_cancel = $oTransactions->getOrderTransactions($order_id, "pending", "completed"); $transactions_to_cancel = $oTransactions->getEntryTransactions($entry_id, "pending", "completed"); if ($transactions_to_cancel) foreach ($transactions_to_cancel as $transaction_to_cancel) { if (!$oTransactions->cancelTransaction($transaction_to_cancel["transaction_id"])) { $error_transactions_ids[] = $transaction_to_cancel["transaction_id"]; } } if (!empty($error_transactions_ids)) { $oEntries->appendEntryErrorReason($entry_id, "| Error during transactions cancel (".implode(", ", $error_transactions_ids).")"); $this->appendOrderErrorReason($entry["order_id"], "| Error during transactions cancel (".implode(", ", $error_transactions_ids).")"); return false; } // for entry with status pending - change status to canceled, for the entries with status error - remain error status if ($entry["status"] == "pending") { $oEntries->changeEntryStatus($entry_id, "canceled", "error during some order transaction"); } return true; }
[ "public function cancel(){\n\t\t$this->_mTransaction->cancel($this);\n\t}", "public function cancelTransaction() {\n $this->connection->rollBack();\n }", "public function cancelTransaction(){\n return $this->_conn->rollBack();\n }", "function cancel_transaction() {\n\n if( !isset( $_POST['transaction_id'] ) ) {\n\n echo json_encode(array( 'status' => 'error', 'msg' => 'Illegal action call' ));\n wp_die();\n\n }\n\n global $wpdb;\n\n $id = $_POST['transaction_id'];\n\n $result = $wpdb->update( $this->main_table_name(),\n array(\n 'status' => 'Cancelled'\n ),\n array('id' => $id),\n '%s'\n );\n\n if( $result === false ) {\n\n echo json_encode( array( 'status' => 'error', 'msg' => 'An errorr occured while updating transaction status.'));\n wp_die();\n\n }\n\n echo json_encode( array( 'status' => 'success', 'msg' => 'Transaction cancelled!'));\n wp_die();\n\n }", "public function cancelar() {\n\n if (!db_utils::inTransaction()) {\n throw new Exception(\"Não existe Transação Ativa.\");\n }\n\n \t$iCodigo = $this->iCodigo;\n \tif (empty($iCodigo)) {\n \t throw new Exception(\"Código para o cancelamento não informado!\\nCancelamento não efetuado.\");\n \t}\n\n \t$iTipo = $this->getTipo();\n if (empty($iTipo)) {\n throw new Exception(\"Tipo de movimentação não informado!\\nCancelamento não efetuado.\");\n }\n\n $iAcordo = $this->getAcordo();\n if (empty($iAcordo)) {\n throw new Exception(\"Acordo da movimentação não informado!\\nCancelamento não efetuado.\");\n }\n\n $oDaoAcordo = db_utils::getDao(\"acordo\");\n \t$oDaoAcordoMovimentacao = db_utils::getDao(\"acordomovimentacao\");\n $oDaoAcordoMovimentacaoCancela = db_utils::getDao(\"acordomovimentacaocancela\");\n\n /**\n * Verifica se já possui movimentação cancelada\n */\n $sCampos = \"ac10_sequencial, ac25_acordomovimentacao, \";\n $sCampos .= \"ac25_acordomovimentacaocancela, ac10_acordo \";\n $sWhere = \" ac10_sequencial = {$this->iCodigo} \";\n $sWhere .= \"and ac10_acordomovimentacaotipo = {$this->getTipo()} \";\n $sWhere .= \"and ac10_acordo = {$this->getAcordo()} \";\n $sSqlAcordoMovimentacaoCancela = $oDaoAcordoMovimentacao->sql_query_verificacancelado(null, $sCampos,\n null, $sWhere);\n $rsSqlAcordoMovimentacaoCancela = $oDaoAcordoMovimentacao->sql_record($sSqlAcordoMovimentacaoCancela);\n $iNumRowsAcordoMovimentacaoCancela = $oDaoAcordoMovimentacao->numrows;\n\n if ($iNumRowsAcordoMovimentacaoCancela > 0) {\n\n \t/**\n * Se já possuir movimentacao, não efetua o cancelamento\n */\n $oAcordoMovimentacaoCancela = db_utils::fieldsMemory($rsSqlAcordoMovimentacaoCancela, 0);\n if (!empty($oAcordoMovimentacaoCancela->ac25_acordomovimentacaocancela)) {\n throw new Exception(\"O movimento {$this->iCodigo} já foi cancelado!\\nCancelamento não efetuado.\");\n }\n }\n\n /**\n * Inclui uma nova movimentação\n */\n $oDaoAcordoMovimentacao->ac10_acordomovimentacaotipo = $this->iCodigoCancelamento;\n $oDaoAcordoMovimentacao->ac10_acordo = $this->getAcordo();\n $oDaoAcordoMovimentacao->ac10_obs = $this->getObservacao();\n $oDaoAcordoMovimentacao->ac10_id_usuario = db_getsession('DB_id_usuario');\n $oDaoAcordoMovimentacao->ac10_datamovimento = date(\"Y-m-d\",db_getsession(\"DB_datausu\"));\n $oDaoAcordoMovimentacao->ac10_hora = db_hora();\n $oDaoAcordoMovimentacao->incluir(null);\n if ($oDaoAcordoMovimentacao->erro_status == 0) {\n throw new Exception($oDaoAcordoMovimentacao->erro_msg);\n }\n\n /**\n * Inclui um novo cancelamento\n */\n $oDaoAcordoMovimentacaoCancela->ac25_acordomovimentacao = $oDaoAcordoMovimentacao->ac10_sequencial;\n $oDaoAcordoMovimentacaoCancela->ac25_acordomovimentacaocancela = $this->iCodigo;\n $oDaoAcordoMovimentacaoCancela->incluir(null);\n if ($oDaoAcordoMovimentacaoCancela->erro_status == 0) {\n throw new Exception($oDaoAcordoMovimentacaoCancela->erro_msg);\n }\n\n /**\n * Acerta movimentacao corrente para alterar um movimento anterior\n */\n $sCampos = \"ac10_sequencial, ac10_acordomovimentacaotipo, \";\n $sCampos .= \"ac10_acordo, ac09_acordosituacao \";\n $sWhere = \"ac10_sequencial < {$this->iCodigo} and ac10_acordo = \" . $this->iAcordo;\n $sOrderBy = \"ac10_sequencial desc limit 1 \";\n $sSqlAcordoMovimentacao = $oDaoAcordoMovimentacao->sql_query_acertaracordo(null, $sCampos, $sOrderBy, $sWhere);\n\n $rsSqlAcordoMovimentacao = db_query($sSqlAcordoMovimentacao);\n $iNumRowsAcordoMovimentacao = pg_num_rows($rsSqlAcordoMovimentacao);\n if ($iNumRowsAcordoMovimentacao > 0) {\n\n \t/**\n \t * Altera situacao do movimento\n \t */\n $oAcordoMovimentacao = db_utils::fieldsMemory($rsSqlAcordoMovimentacao, 0);\n $oDaoAcordo->ac16_sequencial = $oAcordoMovimentacao->ac10_acordo;\n $oDaoAcordo->ac16_acordosituacao = $oAcordoMovimentacao->ac09_acordosituacao;\n $oDaoAcordo->alterar($oDaoAcordo->ac16_sequencial);\n\n if ($oDaoAcordo->erro_status == 0) {\n throw new Exception($oDaoAcordo->erro_msg);\n }\n }\n return $this;\n }", "public function cancelar()\n\t{\n\t\t$this->estatus = CitaEstatus::CANCELADA;\n\t}", "function cancelPending() {\n\t\tself::$_db->saveQry(\"SELECT `ID` FROM `#_reservations` \".\n\t\t\t\t\"WHERE (`status` = 'pending' OR `status` = 'prefered') \".\n\t\t\t\t\"AND ? >= `startTime` \",\n\t\t\t\tCalendar::startCancel());\n\t\t\n\n\t\twhile($res = self::$_db->fetch_assoc())\n\t\t\tReservation::load($res['ID'])->failed();\n\t\t\n\t\t\n\t\t// TagesEnde - BuchungsCancelZeit ist kleiner als Aktueller Zeitblock\n\t\tif(Calendar::calculateTomorrow()) {\n\t\t\t$opening = Calendar::opening(date('Y-m-d', strtotime(\"tomorrow\")));\n\t\t\tself::$_db->saveQry(\"SELECT * FROM `#_reservations` \".\n\t\t\t\t\t\"WHERE (`status` = 'pending' OR `status` = 'prefered') \".\n\t\t\t\t\t\"AND ? <= `startTime` AND `startTime` <= ? \",\n\t\t\t\t\t$opening->format(\"Y-m-d H:i\"), \n\t\t\t\t\tCalendar::startCancel($opening));\n\t\t\t\n\t\t\twhile($res = self::$_db->fetch_assoc())\n\t\t\t\tReservation::load($res['ID'])->failed();\n\t\t}\n\t\t\n\t}", "public function cancelBatch()\n {\n if (null === $this->toSaveModel) {\n return;\n }\n\n $this->toSaveModel = null;\n $this->toSave = null;\n $this->toDelete = null;\n }", "public function cancelPendingOrders()\n {\n try {\n $orders = Mage::getModel('sales/order')->getCollection();\n $orders->getSelect()->join(\n array('p' => $orders->getResource()->getTable('sales/order_payment')),\n 'p.parent_id = main_table.entity_id',\n array()\n );\n $orders\n ->addFieldToFilter('status', 'pending_payment')\n ->addFieldToFilter('method', 'pagantis')\n ->addFieldToFilter('created_at', array(\n 'from' => strtotime('-7 days', time()),\n 'to' => strtotime('-60 minutes', time()),\n 'datetime' => true\n ))\n ;\n\n foreach ($orders as $order) {\n if ($order->canCancel()) {\n try {\n $order->cancel();\n $order->getStatusHistoryCollection(true);\n $history = $order->addStatusHistoryComment('Order Expired in Pagantis', false);\n $history->setIsCustomerNotified(false);\n $order->save();\n } catch (\\Exception $exception) {\n Mage::logException($exception);\n }\n }\n }\n } catch (\\Exception $exception) {\n Mage::logException($exception);\n }\n }", "public function cancelTracking()\n {\n global $db;\n\n $db->Query('DELETE FROM {effort} WHERE user_id='.$this->_userId.' AND task_id='.$this->_task_id.' AND end_timestamp IS NULL;');\n\n }", "public static function cancel_order()\n {\n }", "public function cancelCommit() {\n\n return $this->sendRPC(\"<cancel-commit/>\");\n\n }", "public function cancel()\n {\n $response = $this->client->put(InvoiceService::INVOICE_PATH . \"/$this->id/cancel\");\n $this->updateFromArray($response['body_assoc']);\n }", "public function removeAbortedOperations()\n {\n $operationRepo = $this->em->getRepository('CairnUserBundle:Operation');\n $smsRepo = $this->em->getRepository('CairnUserBundle:Sms');\n\n $ob = $operationRepo->createQueryBuilder('o'); \n $scheduledAbortedTransactions = $ob->where('o.paymentID is NULL') \n ->getQuery()->getResult();\n\n foreach($scheduledAbortedTransactions as $transaction){\n $this->em->remove($transaction);\n }\n\n\n $this->em->flush();\n }", "public function cancelAction() {\n\t\t\t\n\t\t\tif (Mage::getSingleton('checkout/session')->getLastRealOrderId()) {\n\t\t\t\t\n\t\t\t\t$order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());\n\t\t\t\t\n\t\t\t\tif($order->getId()) {\n\t\t\t\t\t\n\t\t\t\t\t// Flag the order as 'cancelled' and save it\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "public function cancel() {}", "public function cancel()\n {\n // Refund and delete ourselves\n $this->refund();\n $this->delete();\n\n // Now cancel our associated job and check if there's another one we need to start\n if ($this->inProgress())\n {\n // We need to delete our associated Job and start the next one\n $this->cancelAssociatedJob();\n $next = self::selectNextJob($this->cityID);\n // If this is a BuildBuilding model, then there's a pending job that needs to start. Otherwise, this will be false\n if ($next instanceof self)\n $next->start();\n }\n }", "public function cancel(){}", "public function cancel()\n {\n\n foreach ($this->tickets as $ticket)\n {\n $ticket->release();\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Output only. Served assets. Generated from protobuf field repeated .google.ads.googleads.v14.common.AssetUsage served_assets = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
public function getServedAssets() { return $this->served_assets; }
[ "public function setServedAssets($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Ads\\GoogleAds\\V14\\Common\\AssetUsage::class);\n $this->served_assets = $arr;\n\n return $this;\n }", "public function getAssets(): array {\n\t\treturn $this->assets;\n\t}", "public function assets()\n {\n return $this->resolved;\n }", "protected function get_assets() {\n\t\treturn [];\n\t}", "public function get_assets_all()\n {\n return $this->assets;\n }", "public function getAssetFiles()\n {\n return $this->assetFiles;\n }", "public function getPublicAssets()\n {\n return $this->public;\n }", "public static function getAssets() {\n $path = ExtensionManagementUtility::extPath('custom_fluid_styled_content') . 'Resources/Public/';\n\n if (file_exists($path)) {\n foreach (glob(ExtensionManagementUtility::extPath('custom_fluid_styled_content') . 'Resources/Private/ContentElements/*/Assets/*') as $assetFolder) {\n if (is_dir($assetFolder)) {\n foreach(glob($assetFolder .'/*') as $file) {\n if (is_file($file)) {\n self::$assets[pathinfo($assetFolder)['basename']][] = $file;\n }\n }\n }\n }\n }\n\n return self::$assets;\n }", "public function serveStaticAssets(MvcEvent $e)\n {\n $sm = $e->getApplication()->getServiceManager();\n /** @var Configuration $config */\n $config = $sm->get('AsseticConfiguration');\n if ($config->isCombine() || !$config->isDebug()) {\n // combine must be disabled and debug enabled\n return;\n }\n\n $error = $e->getError();\n if (!in_array($error, array(\n Application::ERROR_CONTROLLER_NOT_FOUND,\n Application::ERROR_CONTROLLER_INVALID,\n Application::ERROR_ROUTER_NO_MATCH,\n ))\n ) {\n // this should only be invoked for 404 errors\n return;\n }\n\n $response = $e->getResponse();\n if (!$response) {\n $response = new Response();\n $e->setResponse($response);\n }\n\n /** @var $asseticService \\AsseticBundle\\Service */\n $asseticService = $sm->get('AsseticService');\n\n // could not find any renderer, so we'll try to match the request URI against asset's target path\n if ($asset = $asseticService->findAssetForRequest($e->getRequest())) {\n // If the asset is using filters, we'll dump the contents to a temporary file\n if (count($asset->getFilters())) {\n $dump = $asset->dump();\n $path = tempnam(sys_get_temp_dir(), 'asset-dump');\n file_put_contents($path, $dump);\n } else {\n $path = $asset->getSourceRoot() . '/' . $asset->getSourcePath();\n\n if (!file_exists($path)) {\n return; // file not found\n }\n }\n\n // Prepare headers\n $lastModified = new LastModified();\n $date = new \\DateTime();\n $date->setTimestamp($asset->getLastModified());\n $lastModified->setDate($date);\n\n $headers = $response->getHeaders();\n $headers->addHeaderLine('Content-Length', filesize($path));\n $headers->addHeader($lastModified);\n $response->setContent(file_get_contents($path));\n $response->setStatusCode(200);\n\n // Try to determine content-type\n $ext = pathinfo($asset->getTargetPath(), PATHINFO_EXTENSION);\n if ($ext == 'css') {\n $headers->addHeaderLine('Content-Type', 'text/css');\n } elseif ($ext == 'js') {\n $headers->addHeaderLine('Content-Type', 'text/javascript');\n } elseif (function_exists('finfo_open')) {\n $db = @finfo_open(FILEINFO_MIME);\n\n if ($db) {\n if ($mimeType = finfo_file($db, $path)) {\n $headers->addHeaderLine('Content-Type', $mimeType);\n }\n }\n }\n\n // Remove temp file\n if (count($asset->getFilters())) {\n unlink($path);\n }\n\n // Stop onError event propagation\n $e->stopPropagation(true);\n\n // Return http response to send to the user\n return $response;\n }\n }", "public function getAllAssetsStats()\n {\n return $this->all_assets_stats;\n }", "public function getRecommendedAssets()\n {\n return $this->recommended_assets;\n }", "public function getAssetEntries()\n {\n return $this->assetEntries;\n }", "public function getAssets()\n {\n\n return collect($this->getWorkspaceApps()->toArray())->flatMap(function ($workspaceApps) {\n /** @var WorkspaceApp $workspaceApps */\n return collect($workspaceApps->getFiles()->toArray());\n })->reduce(function ($assets, $file) {\n // Merge the Assets related to each file into a single Collection of Assets for the Workspace\n /** @var File $file */\n /** @var Collection $assets */\n return $assets->merge($file->getAssets()->toArray());\n }, new Collection())\n // Filter out any suppressed or deleted Assets\n ->filter(function($asset) {\n /** @var $asset Asset */\n // Exclude deleted Assets\n return $asset->getDeleted() !== true && $asset->getSuppressed() !== true;\n });\n }", "protected function getFileAssets() {\n $config = $this->wire('config');\n $assets = $this->getBareFileAssetArray();\n\n /**\n * Populate each asset's discoverable information...\n */\n foreach ($assets as $name => &$asset) {\n $path = $asset['path'];\n $exists = file_exists($path);\n $perms = null;\n $permission = '';\n $readable = null;\n $writable = null;\n $world_readable = null;\n $world_writable = null;\n $owner = '';\n $group = '';\n $puser_matches_owner = null;\n $puser_matches_group = null;\n $needs_world_access = null;\n $is_file = is_file($path);\n\n if ($exists) {\n $perms = fileperms($path);\n $world_readable = $perms & 0x0004;\n $world_writable = $perms & 0x0002;\n $permission = substr(sprintf('%o', $perms), -4);\n $readable = is_readable($path);\n $writable = is_writeable($path);\n\n if(function_exists('posix_getpwuid')) {\n $owner = posix_getpwuid(fileowner($path))['name'];\n $group = posix_getgrgid(filegroup($path))['name'];\n }\n\n $puser_matches_owner = $this->process_user === $owner;\n $puser_matches_group = $this->process_user === $group;\n\n $needs_world_access = (!$puser_matches_owner && !$puser_matches_group);\n }\n\n $asset['shortpath'] = str_replace($config->paths->root, '/', $asset['path']);\n $asset['name'] = $name;\n $asset['exists'] = $exists;\n $asset['int_perms'] = $perms;\n $asset['perms'] = $permission;\n $asset['readable'] = $readable;\n $asset['writable'] = $writable;\n $asset['wreadable'] = $world_readable;\n $asset['wwritable'] = $world_writable;\n $asset['owner'] = $owner;\n $asset['group'] = $group;\n $asset['is_file'] = $is_file;\n $asset['needs_world'] = $needs_world_access;\n $asset['perm_fix'] = array(\n 'u-' => array(),\n 'u+' => array(),\n 'g-' => array(),\n 'g+' => array(),\n 'o-' => array(),\n 'o+' => array(),\n );\n $asset['minimum_perm_class'] = '';\n }\n\n return $assets;\n }", "public function getExistingAssets()\n {\n return $this->existing_assets;\n }", "public function getAssets();", "public function getRecommendedCampaignSitelinkAssets()\n {\n return $this->recommended_campaign_sitelink_assets;\n }", "public function getDirectoryAssets()\n {\n return $this->assets;\n }", "protected function assets()\n {\n return json_decode(file_get_contents(APPPATH . '../etc/assets.json'), true);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Require that the stack be empty at a given point in time and transition to the fail state if it's not
function requireEmptyStack() { if (!empty($this->stack)) { $this->addTransition($this->getState(), self::FAIL, self::FAIL); $this->transition(self::FAIL); } }
[ "#[@test]\n public function initiallyEmpty() {\n $this->assertTrue($this->stack->isEmpty());\n }", "private function emptyStack(){\n\t\twhile(!$this->stack->isEmpty()){\n\t\t\t$this->result[] = $this->stack->top();\n\t\t\t$this->stack->pop();\n\t\t}\n\t}", "public function CheckStackEmpty() : bool {\n if(empty($this->_stack)) {\n return TRUE;\n } else {\n return FALSE;\n }\n }", "public function resetStack();", "public function framePop(): void\n {\n if (!$this->getParentMemory() instanceof MemoryStackInterface)\n throw MemoryException::stackIsEmpty();\n\n $this->getParentMemory()->framePop();\n }", "public function pop()\n {\n if($this->top<0){\n echo \"Stack is UnderFlow!\\n\";\n return false;\n }\n else{\n $this->stackArray[$this->top--];\n }\n }", "public function pushBack() {\n if ($this->lookahead > 0 && count($this->tokenStack) > 0 && $this->stackPointer > 0) {\n $this->stackPointer--;\n }\n }", "private function popState()\n {\n if ($this->stackDepth-- == 0)\n {\n throw new PdfException('pdf-creation-error');\n }\n $this->draw('Q');\n }", "public function testReachStateException()\n {\n $machine = $this->getMachine();\n\n $machine->reachState('unpaid', 'shipped');\n }", "public static function assertNothingPushed()\n {\n /** @var \\Illuminate\\Support\\Testing\\Fakes\\QueueFake $instance */\n $instance->assertNothingPushed();\n }", "public function testPopEmpty()\r\n {\r\n $this->sequence->pop();\r\n }", "protected function stackIsReady()\n {\n $stacks = $this->describeMainStack();\n\n if (null === $stacks) {\n return false;\n }\n\n switch ($stacks[0]['StackStatus']) {\n case 'CREATE_COMPLETE':\n case 'UPDATE_COMPLETE':\n case 'UPDATE_COMPLETE_CLEANUP_IN_PROGRESS':\n return true;\n case 'UPDATE_IN_PROGRESS':\n case 'CREATE_IN_PROGRESS':\n $this->logRecentEvents();\n case '':\n return false;\n default:\n sleep(3);\n $this->logRecentEvents();\n throw new \\BuildException('Failed to run stack ' . $this->getName() . ' (' . $stacks[0]['StackStatus'] . ') !');\n }\n }", "function TStack(){\n $this->stackpointer=-1;\n $this->stack = array();\n }", "public function isStackEmpty() {\n return empty($this->_aStack);\n }", "public static function assertNothingPushed()\n {\n /** @var \\Illuminate\\Support\\Testing\\Fakes\\QueueFake $instance */\n $instance->assertNothingPushed();\n }", "private function _check_growability()\n\t{\n\t\t$this->_check_mutability();\n\t\tif (!$this->stack_growability())\n\t\t\tthrow new Exception('Stack Too Big', 403);\n\t}", "public function testPushingAddsValueToTopOfStack() : void\n {\n $this->stack->push('foo');\n $this->stack->push('bar');\n $this->assertEquals('bar', $this->stack->pop());\n $this->assertEquals('foo', $this->stack->pop());\n }", "public function assertNothingPushed()\n {\n PHPUnit::assertEmpty($this->sportevents, 'sportevents were pushed unexpectedly.');\n }", "public function testAddStateSuccess()\n {\n $this->markTestIncomplete();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the list of current SQL modes.
protected function get_current_sql_modes( $assoc_args ) { static $modes = null; // Make sure the provided arguments don't interfere with the expected // output here. $args = []; foreach ( [] as $arg ) { if ( isset( $assoc_args[ $arg ] ) ) { $args[ $arg ] = $assoc_args[ $arg ]; } } if ( null === $modes ) { $modes = []; list( $stdout, $stderr, $exit_code ) = self::run( sprintf( '/usr/bin/env mysql%s --no-auto-rehash --batch --skip-column-names', $this->get_defaults_flag_string( $assoc_args ) ), array_merge( $args, [ 'execute' => 'SELECT @@SESSION.sql_mode' ] ), false ); if ( $exit_code ) { WP_CLI::error( 'Failed to get current SQL modes.' . ( ! empty( $stderr ) ? " Reason: {$stderr}" : '' ), $exit_code ); } if ( ! empty( $stdout ) ) { $modes = array_filter( array_map( 'trim', preg_split( "/\r\n|\n|\r|,/", $stdout ) ) ); } if ( false === $modes ) { $modes = []; } } return $modes; }
[ "function get_sql_modes() {\n\tstatic $sql_modes = null;\n\n\tif ( null === $sql_modes ) {\n\t\t$result = Process::create( '/usr/bin/env mysql --no-auto-rehash --batch --skip-column-names --execute=\"SELECT @@SESSION.sql_mode\"', null, null )->run();\n\n\t\tif ( 0 !== $result->return_code ) {\n\t\t\t$sql_modes = [];\n\t\t} else {\n\t\t\t$sql_modes = array_filter(\n\t\t\t\tarray_map(\n\t\t\t\t\t'trim',\n\t\t\t\t\tpreg_split( \"/\\r\\n|\\n|\\r/\", $result->stdout )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $sql_modes;\n}", "public function modes() {\n\t\t$options = [\n\t\t\t$this->getVar(static::ModeGetVar, self::PersistExact),\n\t\t\t\\Director::get_current_page()->config()->get('gridlist_default_mode'),\n\t\t\t$this->config()->get('default_mode'),\n\t\t];\n\t\treturn array_filter($options);\n\t}", "public function modes()\n {\n if (!$this->modes) {\n $this->modes[] = 'ALL';\n }\n\n return implode(' ', $this->modes);\n }", "public function get_modes()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n return $this->modes;\n }", "public function get_modes()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $system_mode = Mode::create();\n $system_modes = $system_mode->get_modes();\n\n $modes = array();\n $modes[self::MODE_STANDALONE] = lang('ldap_standalone');\n\n foreach ($system_modes as $mode => $mode_text) {\n if ($mode === Mode_Engine::MODE_MASTER)\n $modes[self::MODE_MASTER] = lang('ldap_master');\n else if ($mode === Mode_Engine::MODE_SLAVE)\n $modes[self::MODE_SLAVE] = lang('ldap_slave');\n }\n\n return $modes;\n }", "public function modes() \n {\n return $this->users->modes();\n }", "public function getModes()\n {\n return $this->modes;\n }", "public function getListMode();", "public function getAvailableModes()\n {\n return mcrypt_list_modes();\n }", "public static function getAvailableModes() {}", "public function getSqlMode();", "public function displayMode()\n {\n $modeList = array();\n\n try {\n $stmt = $this->db->prepare(\"SELECT * \n FROM Modes\");\n $stmt->execute();\n\n $row[] = $stmt->fetchAll(PDO::FETCH_ASSOC);\n if ($stmt->rowCount() > 0) {\n foreach ($row as $mode) {\n array_push($modeList, $mode);\n\n }\n return $modeList;\n\n }\n\n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n }", "public function supportedCipherModes() {\n return mcrypt_list_modes();\n }", "function bps_get_sql_mode() {\nglobal $wpdb;\n$sql_mode_var = 'sql_mode';\n$mysqlinfo = $wpdb->get_results( $wpdb->prepare( \"SHOW VARIABLES LIKE %s\", $sql_mode_var ) );\t\n\t\n\tif ( is_array( $mysqlinfo ) ) { \n\t\t$sql_mode = $mysqlinfo[0]->Value;\n\t\tif ( empty( $sql_mode ) ) { \n\t\t\t$sql_mode = __('Not Set', 'bulletproof-security');\n\t\t} else {\n\t\t\t$sql_mode = __('Off', 'bulletproof-security');\n\t\t}\n\t}\n}", "public function getModes()\n {\n if ($this->_availableMode === []) {\n $this->_availableMode = $this->_productListHelper->getAvailableViewMode();\n }\n return $this->_availableMode;\n }", "static public function return_modes() {\n $modesavail = get_plugin_list('portfolioactmode');\n $modes = array();\n foreach ($modesavail as $mode => $modpath) {\n\n $modes[$mode] = get_string('portfolioactmode_'.$mode, 'portfolioactmode_'.$mode);\n }\n return $modes;\n }", "public function getListMode() {\n return $this->listMode;\n }", "public function getPossibleModes() {\n\n\t\tglobal $SESSION, $USER;\n\n\t\trequire_once dirname(__DIR__) . '/sharedlib.php';\n\n\t\tif (is_admin() or is_activities_head()) {\n\t\t\treturn array('admin', 'teacher');\n\t\t} else if (is_teacher()) {\n\t\t\treturn array('teacher');\n\t\t} else if (is_student()) {\n\t\t\treturn array('student');\n\t\t}\n\n\t\treturn array();\n\t}", "protected function getAllowedModes()\n {\n return array(\n self::MODE_DEFAULT,\n self::MODE_PRIMARY,\n self::MODE_SUCCESS,\n self::MODE_INFO,\n self::MODE_WARNING,\n self::MODE_DANGER);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
open the font file and return a php structure containing it. first check if this one has been done before and saved in a form more suited to php note that if a php serialized version does not exist it will try and make one, but will require write access to the directory to do it... it is MUCH faster to have these serialized files.
private function openFont($font) { // assume that $font contains the path and file but not the extension $name = basename($font); $dir = dirname($font) . '/'; $fontcache = $this->fontcache; if ($fontcache == '') { $fontcache = rtrim($dir, DIRECTORY_SEPARATOR."/\\"); } //$name filename without folder and extension of font metrics //$dir folder of font metrics //$fontcache folder of runtime created php serialized version of font metrics. // If this is not given, the same folder as the font metrics will be used. // Storing and reusing serialized versions improves speed much $this->addMessage("openFont: $font - $name"); if (!$this->isUnicode || in_array(mb_strtolower(basename($name)), self::$coreFonts)) { $metrics_name = "$name.afm"; } else { $metrics_name = "$name.ufm"; } $cache_name = "$metrics_name.php"; $this->addMessage("metrics: $metrics_name, cache: $cache_name"); if (file_exists($fontcache . '/' . $cache_name)) { $this->addMessage("openFont: php file exists $fontcache/$cache_name"); $this->fonts[$font] = require($fontcache . '/' . $cache_name); if (!isset($this->fonts[$font]['_version_']) || $this->fonts[$font]['_version_'] != $this->fontcacheVersion) { // if the font file is old, then clear it out and prepare for re-creation $this->addMessage('openFont: clear out, make way for new version.'); $this->fonts[$font] = null; unset($this->fonts[$font]); } } else { $old_cache_name = "php_$metrics_name"; if (file_exists($fontcache . '/' . $old_cache_name)) { $this->addMessage( "openFont: php file doesn't exist $fontcache/$cache_name, creating it from the old format" ); $old_cache = file_get_contents($fontcache . '/' . $old_cache_name); file_put_contents($fontcache . '/' . $cache_name, '<?php return ' . $old_cache . ';'); $this->openFont($font); return; } } if (!isset($this->fonts[$font]) && file_exists($dir . $metrics_name)) { // then rebuild the php_<font>.afm file from the <font>.afm file $this->addMessage("openFont: build php file from $dir$metrics_name"); $data = array(); // 20 => 'space' $data['codeToName'] = array(); // Since we're not going to enable Unicode for the core fonts we need to use a font-based // setting for Unicode support rather than a global setting. $data['isUnicode'] = (strtolower(substr($metrics_name, -3)) !== 'afm'); $cidtogid = ''; if ($data['isUnicode']) { $cidtogid = str_pad('', 256 * 256 * 2, "\x00"); } $file = file($dir . $metrics_name); foreach ($file as $rowA) { $row = trim($rowA); $pos = strpos($row, ' '); if ($pos) { // then there must be some keyword $key = substr($row, 0, $pos); switch ($key) { case 'FontName': case 'FullName': case 'FamilyName': case 'PostScriptName': case 'Weight': case 'ItalicAngle': case 'IsFixedPitch': case 'CharacterSet': case 'UnderlinePosition': case 'UnderlineThickness': case 'Version': case 'EncodingScheme': case 'CapHeight': case 'XHeight': case 'Ascender': case 'Descender': case 'StdHW': case 'StdVW': case 'StartCharMetrics': case 'FontHeightOffset': // OAR - Added so we can offset the height calculation of a Windows font. Otherwise it's too big. $data[$key] = trim(substr($row, $pos)); break; case 'FontBBox': $data[$key] = explode(' ', trim(substr($row, $pos))); break; //C 39 ; WX 222 ; N quoteright ; B 53 463 157 718 ; case 'C': // Found in AFM files $bits = explode(';', trim($row)); $dtmp = array(); foreach ($bits as $bit) { $bits2 = explode(' ', trim($bit)); if (mb_strlen($bits2[0], '8bit') == 0) { continue; } if (count($bits2) > 2) { $dtmp[$bits2[0]] = array(); for ($i = 1; $i < count($bits2); $i++) { $dtmp[$bits2[0]][] = $bits2[$i]; } } else { if (count($bits2) == 2) { $dtmp[$bits2[0]] = $bits2[1]; } } } $c = (int)$dtmp['C']; $n = $dtmp['N']; $width = floatval($dtmp['WX']); if ($c >= 0) { if ($c != hexdec($n)) { $data['codeToName'][$c] = $n; } $data['C'][$c] = $width; } else { $data['C'][$n] = $width; } if (!isset($data['MissingWidth']) && $c == -1 && $n === '.notdef') { $data['MissingWidth'] = $width; } break; // U 827 ; WX 0 ; N squaresubnosp ; G 675 ; case 'U': // Found in UFM files if (!$data['isUnicode']) { break; } $bits = explode(';', trim($row)); $dtmp = array(); foreach ($bits as $bit) { $bits2 = explode(' ', trim($bit)); if (mb_strlen($bits2[0], '8bit') === 0) { continue; } if (count($bits2) > 2) { $dtmp[$bits2[0]] = array(); for ($i = 1; $i < count($bits2); $i++) { $dtmp[$bits2[0]][] = $bits2[$i]; } } else { if (count($bits2) == 2) { $dtmp[$bits2[0]] = $bits2[1]; } } } $c = (int)$dtmp['U']; $n = $dtmp['N']; $glyph = $dtmp['G']; $width = floatval($dtmp['WX']); if ($c >= 0) { // Set values in CID to GID map if ($c >= 0 && $c < 0xFFFF && $glyph) { $cidtogid[$c * 2] = chr($glyph >> 8); $cidtogid[$c * 2 + 1] = chr($glyph & 0xFF); } if ($c != hexdec($n)) { $data['codeToName'][$c] = $n; } $data['C'][$c] = $width; } else { $data['C'][$n] = $width; } if (!isset($data['MissingWidth']) && $c == -1 && $n === '.notdef') { $data['MissingWidth'] = $width; } break; case 'KPX': break; // don't include them as they are not used yet //KPX Adieresis yacute -40 /*$bits = explode(' ', trim($row)); $data['KPX'][$bits[1]][$bits[2]] = $bits[3]; break;*/ } } } if ($this->compressionReady && $this->options['compression']) { // then implement ZLIB based compression on CIDtoGID string $data['CIDtoGID_Compressed'] = true; $cidtogid = gzcompress($cidtogid, 6); } $data['CIDtoGID'] = base64_encode($cidtogid); $data['_version_'] = $this->fontcacheVersion; $this->fonts[$font] = $data; //Because of potential trouble with php safe mode, expect that the folder already exists. //If not existing, this will hit performance because of missing cached results. if (is_dir($fontcache) && is_writable($fontcache)) { file_put_contents($fontcache . '/' . $cache_name, '<?php return ' . var_export($data, true) . ';'); } $data = null; } if (!isset($this->fonts[$font])) { $this->addMessage("openFont: no font file found for $font. Do you need to run load_font.php?"); } //pre_r($this->messages); }
[ "protected function saveFontData()\n {\n $pfile = '{'\n .'\"type\":\"'.$this->fdt['type'].'\"'\n .',\"name\":\"'.$this->fdt['name'].'\"'\n .',\"up\":'.$this->fdt['underlinePosition']\n .',\"ut\":'.$this->fdt['underlineThickness']\n .',\"dw\":'.(($this->fdt['MissingWidth'] > 0) ? $this->fdt['MissingWidth'] : $this->fdt['AvgWidth'])\n .',\"diff\":\"'.$this->fdt['diff'].'\"'\n .',\"platform_id\":'.$this->fdt['platform_id']\n .',\"encoding_id\":'.$this->fdt['encoding_id'];\n\n if ($this->fdt['type'] == 'Core') {\n // Core\n $pfile .= ',\"enc\":\"\"';\n } elseif ($this->fdt['type'] == 'Type1') {\n // Type 1\n $pfile .= ',\"enc\":\"'.$this->fdt['enc'].'\"'\n .',\"file\":\"'.$this->fdt['file'].'\"'\n .',\"size1\":'.$this->fdt['size1']\n .',\"size2\":'.$this->fdt['size2'];\n } else {\n $pfile .= ',\"originalsize\":'.$this->fdt['originalsize'];\n if ($this->fdt['type'] == 'cidfont0') {\n $pfile .= ','.UniToCid::$type[$this->fdt['settype']];\n } else {\n // TrueType\n $pfile .= ',\"enc\":\"'.$this->fdt['enc'].'\"'\n .',\"file\":\"'.$this->fdt['file'].'\"'\n .',\"ctg\":\"'.$this->fdt['ctg'].'\"';\n // create CIDToGIDMap\n $cidtogidmap = str_pad('', 131072, \"\\x00\"); // (256 * 256 * 2) = 131072\n foreach ($this->fdt['ctgdata'] as $cid => $gid) {\n $cidtogidmap = $this->updateCIDtoGIDmap($cidtogidmap, $cid, $gid);\n }\n // store compressed CIDToGIDMap\n $file = new File();\n $fpt = $file->fopenLocal($this->fdt['dir'].$this->fdt['ctg'], 'wb');\n fwrite($fpt, gzcompress($cidtogidmap));\n fclose($fpt);\n }\n }\n if ($this->fdt['isUnicode']) {\n $pfile .=',\"isUnicode\":true';\n } else {\n $pfile .=',\"isUnicode\":false';\n }\n\n $pfile .= ',\"desc\":{'\n .'\"Flags\":'.$this->fdt['Flags']\n .',\"FontBBox\":\"['.$this->fdt['bbox'].']\"'\n .',\"ItalicAngle\":'.$this->fdt['italicAngle']\n .',\"Ascent\":'.$this->fdt['Ascent']\n .',\"Descent\":'.$this->fdt['Descent']\n .',\"Leading\":'.$this->fdt['Leading']\n .',\"CapHeight\":'.$this->fdt['CapHeight']\n .',\"XHeight\":'.$this->fdt['XHeight']\n .',\"StemV\":'.$this->fdt['StemV']\n .',\"StemH\":'.$this->fdt['StemH']\n .',\"AvgWidth\":'.$this->fdt['AvgWidth']\n .',\"MaxWidth\":'.$this->fdt['MaxWidth']\n .',\"MissingWidth\":'.$this->fdt['MissingWidth']\n .'}';\n if (!empty($this->fdt['cbbox'])) {\n $pfile .= ',\"cbbox\":{'.substr($this->fdt['cbbox'], 1).'}';\n }\n $pfile .= ',\"cw\":{'.substr($this->fdt['cw'], 1).'}';\n $pfile .= '}'.\"\\n\";\n\n // store file\n $file = new File();\n $fpt = $file->fopenLocal($this->fdt['datafile'], 'wb');\n fwrite($fpt, $pfile);\n fclose($fpt);\n }", "protected function createJSONFile()\n {\n $fp = fopen($this->getFontFileLocation().'/fonts.json', 'w');\n fwrite($fp, json_encode($this->orderedList));\n return fclose($fp);\n }", "function LoadFont(string $fileName): \\raylib\\Font { return new \\raylib\\Font; }", "function loadfont($fontfile)\n\t{\n\t\t$f = dirname(__FILE__);\n\t\t$f.='/banner4.flf';\n\t\t//$this->fontFile = file($fontfile);\n\t\t$this->fontFile= file($f);\n\t\t//if (!$this->fontFile) die(\"Couldnt open fontfile $fontfile\\n\");\n if (!$this->fontFile) die(\"Couldnt open fontfile $f\\n\");\n\t\t$hp = explode(\" \", $this->fontFile[0]); // get header\n\n\t\t $this->signature = substr($hp[0], 0, strlen($hp[0]) -1);\n\t\t // echo 'signature:'.$this->signature.'<br>';\t\t\t\n $this->hardblank = substr($hp[0], strlen($hp[0]) -1, 1);\n // echo 'hardblank:'.$this->hardblank.'<br>';\t\t\t\n $this->height = $hp[1];\n // echo 'height:'.$this->height.'<br>';\t\t\t\n $this->baseline = $hp[2];\n // echo 'baseline:'.$this->baseline.'<br>';\t\t\t\n $this->maxLenght = $hp[3];\n // echo 'maxLenght:'.$this->maxLenght.'<br>';\t\t\t\n $this->oldLayout = $hp[4];\n // echo 'oldLayout:'.$this->oldLayout.'<br>';\t\t\t\n $this->commentLines = $hp[5] + 1;\n // echo 'commentLines:'.$this->commentLines.'<br>';\t\t\t\n $this->printDirection = $hp[6];\n // echo 'printDirection:'.$this->printDirection.'<br>';\t\t\t\n $this->fullLayout = $hp[7];\n // echo 'fullLayout:'.$this->fullLayout.'<br>';\t\t\t\n $this->codeTagCount = $hp[8];\n // echo 'codeTagCount:'.$this->codeTagCount.'<br>';\t\t\t\n // echo '*-----------*<br>';\t\t\t\n unset($hp);\n\n if ($this->signature != \"flf2a\") {\n \ttrigger_error(\"Unknown font version \" . $this->signature . \"\\n\");\n \treturn false;\n } else {\n \treturn true;\n }\n\t}", "private function generating($path,$font2Restrict=null)\n\t{\n $this->responseType='text';\n $directory = $this->storage_fonts.'/'.$path.'/';\n $fileRestrict = $this->storage_fonts.'/'.self::$restrict.self::$json;\n $fileContent = $this->storage_fonts.'/'.$path.self::$json;\n\n if (file_exists($directory)) {\n $jsonRestrict = $this->jsonRead($fileRestrict,true);\n $jsonContent = file_exists($fileContent)?$this->jsonRead($fileContent,true):array();\n // $jsonRestrict = json_decode(file_get_contents($fileRestrict),true);\n // $jsonContent = json_decode(file_get_contents($fileContent),true);\n $ttf = new app\\component\\ttfinfo;\n $ttf->setDir($directory);\n $ttf->readDir();\n $fonts = array();\n $fontsCount = count($ttf->data);\n $fontRestrictCount = 0;\n $msg = '';\n\t\t\tforeach($ttf->data as $k => $v){\n\t\t\t\t$fontFileName = basename($k);\n\t\t\t\t$i = 0;\n\t\t\t\tforeach ($v as $row => $x){\n\t\t\t\t\t$d = implode($x);\n\t\t\t\t\tif (++$i == 6) break;\n\t\t\t\t\tif ($i == 4 or $i == 3 ) {\n\t\t\t\t\t} else if ($i == 1) {\n\t\t\t\t\t\t$fontName = ($row == 1)?$d:'';\n\t\t\t\t\t} else if ($i == 2) {\n\t\t\t\t\t\t$fontFamily = ($row == 2)?$d:'';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$fontVersion = $d;\n\t\t\t\t\t}\n\t\t\t\t}\n $fontView = isset($jsonContent[$fontFileName]['view'])?$jsonContent[$fontFileName]['view']:0;\n $fontDownload = isset($jsonContent[$fontFileName]['download'])?$jsonContent[$fontFileName]['download']:0;\n $fontContent[$fontFileName] = array(\n 'name'=>$fontName,\n 'version'=>$fontVersion,\n 'family'=>$fontFamily,\n 'view'=>$fontView,\n 'download'=>$fontDownload\n );\n $status = '';\n\t\t\t\tif($font2Restrict && $fontFileName==$font2Restrict){\n\t\t\t\t\tif(isset($jsonRestrict[$fontName])){\n\t\t\t\t\t\t unset($jsonRestrict[$fontName]);\n\t\t\t\t\t\t$status = \"\\t remove from restrict - \";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$is_adding = NULL;\n\t\t\t\t\t\t$jsonRestrict[$fontName]=1;\n\t\t\t\t\t\t$status = \"\\t add to restrict - \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isset($jsonRestrict[$fontName])){\n $fontContent[$fontFileName]['restrict']=$jsonRestrict[$fontName];\n\t\t\t\t\tif($font2Restrict and $fontName==$font2Restrict){\n\t\t\t\t\t\t$status .= \"success - \";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$status .= \"- restricted - \";\n\t\t\t\t\t}\n\t\t\t\t\t$fontRestrictCount++;\n\t\t\t\t}\n $msg .= \"$status {$fontName} ($fontFileName) view:$fontView, download:$fontDownload \\n\";\n\t\t\t}\n $msg .= \"\\n................................\\n\";\n $msg .= $path.self::$json.\" -> \";\n if($this->jsonWrite($fileContent,$fontContent)){\n \t$msg .= \"total {$fontsCount}, restricted {$fontRestrictCount}\\n\";\n }else{\n \t$msg .= \"seem we have no writting permission!\\n\";\n }\n $msg .= self::$restrict.self::$json.\" -> \";\n if($this->jsonWrite($fileRestrict,$jsonRestrict)){\n \t$msg .= \"done\";\n }else{\n \t$msg .= \"seem we have no writting permission!\";\n }\n $msg .= \"\\n................................\";\n } else {\n $msg .= \"{$path} -> no such directory exists!\";\n }\n return $msg;\n\t}", "function updateFont($file){\n\t$filenamepart=explodeFile($file);\n\t$buffer=file_get_contents($file);\n\t$posL = getNextFontFace($buffer,0);\n\tif ($posL===false) {\n\t\techo \"\\n=> NOTICE: $file has no font-face! returning.\\n\"; return;\n\t}\n\tif (getNextFontFace($buffer,$posL+1)!==false) {\n\t\techo \"\\n=> ERROR: $file has more than one font-face! Doing nothing, returning.\\n\"; return;\n\t}\n\t$posR = getNextCurlyBracket($buffer,$posL);\n\t$out=getTextBefore($buffer,0,$posL-1);\n\t$out.=\"@font-face { font-family: Ostrich Sans; src: url(\\\"data:application/font-woff;charset=utf-8;base64,\".FONTBASE64.\"\\\"); }\";\n\t$out.=getTextAfter($buffer,$posR+1);\n\tfile_put_contents($file,$out);\n}", "public function load()\n {\n $fontInfo = $this->getFontInfo();\n $this->data = array_merge($this->data, $fontInfo);\n $this->checkType();\n $this->setName();\n $this->setDefaultWidth();\n if (($this->data['type'] == 'Core') || $this->data['fakestyle']) {\n $this->setArtificialStyles();\n }\n $this->setFileData();\n }", "function MakeFont($fontfile, $enc='cp1252', $embed=true, $subset=true)\r\n{\r\n\tif(!file_exists($fontfile))\r\n\t\tError('Font file not found: '.$fontfile);\r\n\t$ext = strtolower(substr($fontfile,-3));\r\n\tif($ext=='ttf' || $ext=='otf')\r\n\t\t$type = 'TrueType';\r\n\telseif($ext=='pfb')\r\n\t\t$type = 'Type1';\r\n\telse\r\n\t\tError('Unrecognized font file extension: '.$ext);\r\n\r\n\t$map = LoadMap($enc);\r\n\r\n\tif($type=='TrueType')\r\n\t\t$info = GetInfoFromTrueType($fontfile, $embed, $subset, $map);\r\n\telse\r\n\t\t$info = GetInfoFromType1($fontfile, $embed, $map);\r\n\r\n\t$basename = substr(basename($fontfile), 0, -4);\r\n\tif($embed)\r\n\t{\r\n\t\tif(function_exists('gzcompress'))\r\n\t\t{\r\n\t\t\t$file = $basename.'.z';\r\n\t\t\tSaveToFile($file, gzcompress($info['Data']), 'b');\r\n\t\t\t$info['File'] = $file;\r\n\t\t\tMessage('Font file compressed: '.$file);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$info['File'] = basename($fontfile);\r\n\t\t\t$subset = false;\r\n\t\t\tNotice('Font file could not be compressed (zlib extension not available)');\r\n\t\t}\r\n\t}\r\n\r\n\tMakeDefinitionFile($basename.'.php', $type, $enc, $embed, $subset, $map, $info);\r\n\tMessage('Font definition file generated: '.$basename.'.php');\r\n}", "public function Process($fontName){\n if (is_resource($fontName) == TRUE)\n $fontName = itextphp_string_toPHPString($fontName);\n try\n {\n // Verify that the file is open\n $buf->reOpen();\n // Find the Font that we will be dealing with\n $j = 0;\n for ($j=0; $j<count($fonts); $j++)\n if (strcmp($fontName, $fonts[$j]->name) == 0) break;\n if ($j==count($fonts)) return NULL;\n\n // Calc the bias for the global subrs\n if ($gsubrIndexOffset >= 0)\n $GBias = CalcBias($gsubrIndexOffset,$j);\n\n // Prepare the new CharStrings Index\n BuildNewCharString($j);\n // Prepare the new Global and Local Subrs Indices\n BuildNewLGSubrs($j);\n // Build the new file \n $Ret = BuildNewFile(j);\n return $Ret;\n }\n catch (Exception $e){\n try {\n $buf->close();\n return;\n }\n catch (Exception $e) {\n // empty on purpose\n return;\n }\n }\n\n\n try {\n $buf->close();\n return;\n }\n catch (Exception $e) {\n // empty on purpose\n return;\n }\n }", "function loadTTC($fontfile, $index, $embed){}", "function CreateCurrentFont(){}", "function gd_load_font ($file)\n{\n return imageloadfont($file);\n}", "function imagepsloadfont ($filename) {}", "function Load ( $filename )\r\n\t {\r\n\t\t// Check if the file exists\r\n\t\tif ( ! file_exists ( $filename ) )\r\n\t\t\tthrow ( new \\Exception ( \"File \\\"$filename\\\" does not exist.\" ) ) ;\r\n\r\n\t\t// Load its contents\r\n\t\t$contents \t= file_get_contents ( $filename, FILE_BINARY ) ;\r\n\r\n\t\t// Check that this is a PDF file\r\n\t\tif ( ! preg_match ( '/^ %PDF- (?P<version> \\d+ (\\. \\d+)*) /ix', $contents, $match ) )\r\n\t\t\tthrow ( new \\Exception ( \"File \\\"$filename\\\" is not a valid PDF file.\" ) ) ;\r\n\r\n\t\t$this -> PdfVersion \t= $match [ 'version' ] ;\r\n\r\n\t\t// Initializations\r\n\t\t$this -> Text \t\t= '' ;\r\n\t\t$this -> FontTable \t= new PdfTexterFontTable ( ) ;\r\n\t\t$this -> Filename \t= $filename ;\r\n\t\t$this -> PageMappings\t= array() ;\r\n\t\t$this -> Pages\t\t= array() ;\r\n\r\n\t\t// Extract pdf objects that are enclosed by the \"obj\" and \"endobj\" keywords\r\n\t\tif ( ! preg_match_all ( '/(?P<num> \\d+) \\s+ \\d+ \\s+ obj (?P<object> .*?) endobj/imsx', $contents, $object_matches ) )\r\n\t\t\treturn ( false ) ;\r\n\r\n\t\t// Character maps encountered so far\r\n\t\t$cmaps\t\t\t= array() ;\r\n\r\n\t\t// Page definitions - if the optional /Pages /Kids[] construct is encountered\r\n\t\t$pages\t\t\t= false ;\r\n\r\n\t\t// Loop through the objects\r\n\t\t$text\t\t= array() ;\r\n\r\n\t\tfor ( $i = 0 ; $i < count ( $object_matches [ 'object' ] ) ; $i ++ )\r\n\t\t {\r\n\t\t \t$object_data \t= $object_matches [ 'object' ] [$i] ;\r\n\t\t \t$object_number \t= $object_matches [ 'num' ] [$i] ;\r\n\r\n\t\t\t// Check if current data contains page information. We don't put a \"continue\" statement here, \r\n\t\t\t// since the data can contain additional relevant information, such as font declarations...\r\n\t\t\tif ( $this -> IsPage ( $object_data ) )\r\n\t\t\t {\r\n\t\t\t\t$this -> AddPage ( $object_number, $object_data ) ;\r\n\t\t\t }\r\n\r\n\t\t\t// Check if current data contains page list \r\n\t\t\tif ( $this -> IsPageList ( $object_data ) )\r\n\t\t\t {\r\n\t\t\t\t$pages\t= $this -> GetPageList ( $object_data ) ;\r\n\t\t\t }\r\n\r\n\t\t\t// Some font definitions are in clear text in an object, some are encoded in a stream within the object\r\n\t\t\t// We process here the unencoded ones\r\n\t\t\tif ( PdfTexterFontTable::IsFont ( $object_data ) )\r\n\t\t\t {\r\n\t\t\t\t$this -> FontTable -> Add ( $object_number, $object_data ) ;\r\n\t\t\t\tcontinue ;\r\n\t\t\t }\r\n\t\t\t// Some character maps may also be in clear text\r\n\t\t\telse if ( PdfTexterCharacterMap::IsCharacterMap ( $object_data ) )\r\n\t\t\t {\r\n\t\t\t\t$cmap\t= PdfTexterCharacterMap::CreateInstance ( $object_number, $object_data ) ;\r\n\r\n\t\t\t\tif ( $cmap )\r\n\t\t\t\t\t//jlv $cmaps [] \t= $cmap ;\r\n\t\t\t\t\t$cmaps \t= $cmap ;\r\n\r\n\t\t\t\tcontinue ;\r\n\t\t\t }\r\n\t\t\t// Check if there is an association between font number and object number\r\n\t\t\telse if ( PdfTexterFontTable::IsFontMap ( $object_data ) )\r\n\t\t \t {\r\n\t\t\t\t$this -> FontTable -> AddFontMap ( $object_number, $object_data ) ;\r\n\t\t\t\tcontinue ;\r\n\t\t\t }\r\n\t\t\t// Ignore other objects that do not contain an encoded stream\r\n\t\t \telse if ( ! preg_match ( '#[^/] stream \\r? \\n (?P<stream> .*?) endstream#imsx', $object_data, $stream_match ) )\r\n\t\t \t\tcontinue ;\r\n\r\n\t\t\t// Isolate stream data and try to find its encoding type\r\n\t\t\t$stream_data \t\t= $stream_match [ 'stream' ] ;\r\n\t\t\t$type \t\t\t= $this -> GetEncodingType ( $object_data ) ;\r\n\r\n\t\t\t// Ignore this stream if the object does not contain an encoding type (/FLATE, /ASCIIHEX or /ASCII85)\r\n\t\t\tif ( $type == self::PDF_UNKNOWN_ENCODING )\r\n\t\t\t\tcontinue ;\r\n\r\n\t\t\t// Decode the encoded stream\r\n\t\t\t$decoded_stream_data \t= $this -> DecodeData ( $stream_data, $type ) ;\r\n\r\n\t\t\t// Check for character maps\r\n\t\t\tif ( PdfTexterCharacterMap::IsCharacterMap ( $decoded_stream_data ) )\r\n\t\t\t {\r\n\t\t\t\t$cmap\t= PdfTexterCharacterMap::CreateInstance ( $object_number, $decoded_stream_data ) ;\r\n\r\n\t\t\t\tif ( $cmap )\r\n\t\t\t\t\t$cmaps [] \t= $cmap ;\r\n\t\t\t }\r\n\t\t\t// Font definitions\r\n\t\t\telse if ( PdfTexterFontTable::IsFont ( $decoded_stream_data ) )\r\n\t\t\t {\r\n\t\t\t\t$this -> FontTable -> Add ( $object_number, $decoded_stream_data ) ;\r\n\t\t\t }\r\n\t\t\t// Plain text (well, in fact PDF drawing instructions)\r\n\t\t\telse if ( $this -> IsText ( $object_data, $decoded_stream_data ) )\r\n\t\t\t {\r\n\t\t\t\t$text [ $object_number ]\t= $decoded_stream_data ;\r\n\t\t\t }\r\n\t\t }\r\n\r\n\t\t// Associate character maps with declared fonts\r\n\t\tforeach ( $cmaps as $cmap )\r\n\t\t\t$this -> FontTable -> AddCharacterMap ( $cmap ) ;\r\n\r\n\t\t// Current font defaults to -1, which means : take the first available font as the current one.\r\n\t\t// Sometimes it may happen that text drawing instructions do not set a font at all (PdfPro for example)\r\n\t\t$current_font\t= -1 ;\r\n\t\t$last_page\t= 1 ;\r\n\r\n\t\t// Extract text from the collected TEXT elements\r\n\t\tforeach ( $text as $id => $str )\r\n\t\t {\r\n\t\t\t$text\t= $this -> ExtractText ( $id, $str, $current_font ) ;\r\n\r\n\t\t\t// Put a form feed between each text block - not sure it is appropriate\r\n\t\t\tif ( $this -> Text )\r\n\t\t\t\t$this -> Text\t.= \"\\f\" ;\r\n\r\n\t\t\t// Add this new page\r\n\t\t\t$start\t\t\t\t\t\t= strlen ( $this -> Text ) ;\r\n\r\n\t\t\t// Trying this class on the PDF specifications 1.7 file shows that 3 pages are like \"orphans\", ie they\r\n\t\t\t// are not referenced by any /Page option\r\n\t\t\tif ( ! isset ( $this -> PageMappings [ $id ] ) )\r\n\t\t\t\t$this -> PageMappings [ $id] [ 'page' ]\t\t= $last_page + 1 ;\r\n\r\n\t\t\t$page_number\t\t\t\t\t= $this -> PageMappings [ $id ] [ 'page' ] ;\r\n\t\t\t$this -> PageLocations [$page_number]\t\t= $start ; //jlv\r\n\r\n\t\t\t// Then add this page to the text already collected\r\n\t\t\t$this -> Text\t.= $text ;\r\n\t\t\t$last_page\t = $page_number ;\r\n\t\t }\r\n\r\n\t\t// Remap pages in case of the /Kids parameter would give a different order (not yet tested)\r\n\t\t$this -> RemapPages ( $pages ) ;\r\n\r\n\t\t// Rearrange the PageLocations property so that we have a text length and an ending offset for each page\r\n\t\t$text_length\t= strlen ( $this -> Text ) ;\r\n\t\t$page_numbers\t= array_keys ( $this -> PageLocations ) ;\r\n\r\n\t\tfor ( $i_page = 0, $count = count ( $this -> PageLocations ) ; $i_page < $count ; $i_page ++ )\r\n\t\t {\r\n\t\t\t$i\t\t= $page_numbers [ $i_page ] ;\r\n\t\t\t$next\t\t= ( $i_page + 1 < $count && isset ( $this -> PageLocations [ $i + 1 ] ) ) ? \r\n\t\t\t\t\t\t$this -> PageLocations [ $i + 1 ] [ 'start' ] : $text_length ;\r\n\t\t\t\r\n\t\t\t$this -> PageLocations [$i] [ 'end' ]\t\t= $next - 1 ;\r\n\t\t\t$this -> PageLocations [$i] [ 'length' ]\t= $next - $this -> PageLocations [$i] [ 'start' ] ;\r\n\t\t }\r\n\r\n\t\t// Build page array\r\n\t\tforeach ( $this -> PageLocations as $page_number => $location )\r\n\t\t\t$this -> Pages [ $page_number ]\t\t= substr ( $this -> Text, $location [ 'start' ], $location [ 'length' ] ) ;\r\n\t }", "function LoadFontEx(string $fileName, int $fontSize, array $fontChars, int $glyphCount): \\raylib\\Font { return new \\raylib\\Font; }", "public function importFontData()\n {\n CakeLog::debug('[EpubProcessor::importFontData] Importing font files');\n $assets = $this->epub->EpubSpine->getAssetsByType('application/vnd.ms-opentype');\n foreach($assets as $asset)\n {\n CakeLog::debug('[EpubProcessor::importFontData] Importing font file '.$asset->relativePath);\n $localFile = $this->FileManager->getTmpPath(basename($asset->relativePath));\n $this->FileManager->copy($this->epub->epubRoot().$this->epub->EpubSpine->getOpsPath().$asset->relativePath,$localFile);\n $this->addFontToBook($localFile, $asset->assetId);\n }\n CakeLog::debug('[EpubProcessor::importFontData] Importing font files complete');\n }", "function udesign_get_fontello_config_file() {\n \n global $udesign_icon_fonts_options;\n $fontello_install_directory = udesign_is_fontello_installed();\n \n if ( ! $fontello_install_directory ) {\n return false;\n }\n \n $fontello_config_file = $fontello_install_directory . '/' . $udesign_icon_fonts_options['last_installed_fontello_filename'] . '/config.json';\n \n if ( ! @is_file( $fontello_config_file ) ) {\n return false;\n }\n // By using output buffering include the config.json file's content into a string\n ob_start();\n include( $fontello_config_file );\n $fontello_config_file_contents = ob_get_clean();\n\n if ( ! $fontello_config_file_contents ) {\n ?><div class=\"error\"><p><?php _e( \"uDesign Error: The Fontello config file has no content.\", 'udesign' ); ?></p></div><?php \n return false;\n }\n \n $results = json_decode( $fontello_config_file_contents, true );\n\n if ( ! is_array( $results ) ) { ?>\n <div class=\"error\"><p><?php _e( \"uDesign Error: There was an issue decoding the Fontello config file.\", 'udesign' ); ?></p></div><?php \n return false;\n }\n \n return $results;\n}", "function imagepsloadfont($pathname) {}", "function imagepsloadfont(string $filename) {}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the usernameSource Username attribute that is picked from AAD and injected into this profile before installing on the device. Possible values are: userPrincipalName, primarySmtpAddress.
public function setUsernameSource($val) { $this->_propDict["usernameSource"] = $val; return $this; }
[ "public function setUsernameAADSource(?UsernameSource $value): void {\n $this->getBackingStore()->set('usernameAADSource', $value);\n }", "public function setUsernameSource(?AndroidUsernameSource $value): void {\n $this->getBackingStore()->set('usernameSource', $value);\n }", "public function setUsernameAADSource($val)\n {\n $this->_propDict[\"usernameAADSource\"] = $val;\n return $this;\n }", "public function getUsernameAADSource()\n {\n if (array_key_exists(\"usernameAADSource\", $this->_propDict)) {\n if (is_a($this->_propDict[\"usernameAADSource\"], \"\\Beta\\Microsoft\\Graph\\Model\\UsernameSource\") || is_null($this->_propDict[\"usernameAADSource\"])) {\n return $this->_propDict[\"usernameAADSource\"];\n } else {\n $this->_propDict[\"usernameAADSource\"] = new UsernameSource($this->_propDict[\"usernameAADSource\"]);\n return $this->_propDict[\"usernameAADSource\"];\n }\n }\n return null;\n }", "public function getUsernameSource()\n {\n if (array_key_exists(\"usernameSource\", $this->_propDict)) {\n if (is_a($this->_propDict[\"usernameSource\"], \"\\Beta\\Microsoft\\Graph\\Model\\AndroidUsernameSource\") || is_null($this->_propDict[\"usernameSource\"])) {\n return $this->_propDict[\"usernameSource\"];\n } else {\n $this->_propDict[\"usernameSource\"] = new AndroidUsernameSource($this->_propDict[\"usernameSource\"]);\n return $this->_propDict[\"usernameSource\"];\n }\n }\n return null;\n }", "protected function initializeCurrentUsername()\n {\n if (isset($this->currentUsername)) {\n return;\n }\n\n $currentUser = $this->userDomainService->getCurrentUser();\n if (!$currentUser instanceof User) {\n return;\n }\n\n $this->currentUsername = $this->userDomainService->getUsername($currentUser);\n }", "public function setUsername($username)\n {\n //Set the username of the user to work with\n $this->username = $username;\n }", "function setUserName($userName) {\n $this->usrUsername = $userName;\n }", "public function setUsername($username)\r\n {\r\n $this->email = $username;\r\n }", "public function setUserName($username) {\n $this->username = $username;\n }", "public function fallbackUsername($fallbackUsername) {\n $this->fallbackUsername = $fallbackUsername;\n }", "public function setUsernameAttribute($value)\n {\n $this->attributes['username'] = strtolower($value);\n }", "public function setUsername($username){\n\t\t$username = mb_strtolower($username);\n\t\t$this->username = $username;\n\t}", "public function setUsername($username)\n {\n \t$this->username = $username;\n }", "public function setUsername($username)\n {\n # Check if the passed value is empty.\n if (!empty($username)) {\n # Clean it up.\n $username = trim($username);\n } else {\n # Explicitly set it to NULL.\n $username = null;\n }\n # Set it to the data member.\n $this->username = $username;\n }", "public function setUsername($username) {\n $this->username = $username;\n }", "public function setUsername($username = \"\")\n\t{\n\t\t$this->_username = $username;\n\t}", "public function set_username($username) {\n if ($this->is_connected)\n throw new NetconfException(\"Can't change username on a live device. Close the device first.\");\n else\n $this->userName = $username;\n }", "public function setUsername($un) \n {\n $this->_username = $un;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sends a new password or username reminder to a verified user
function sendreminder() { global $mainframe; //check the token before we do anything else $token = JUtility::getToken(); if(!JRequest::getVar( $token, 0, 'post' )) { JError::raiseError(403, 'Request Forbidden'); } // Initialize variables $siteURL = JURI::base(); $config =& JFactory::getConfig(); $db =& JFactory::getDBO(); // Get the request variables from the post $username = JRequest::getVar( 'jusername', '', 'post' ); $email = JRequest::getVar( 'jemail', '', 'post' ); if ($username) { // We have a username ... send a new password $query = 'SELECT id, email' . ' FROM #__users' . ' WHERE username = "'.$db->getEscaped($username).'"'; $db->setQuery( $query ); if (!($user = $db->loadObject()) || !$username) { $mainframe->redirect( 'index.php?option=com_user&task=lostPassword', JText::_( 'Sorry, no corresponding user was found' ) ); } // Generate new password jimport('joomla.user.helper'); $newpass = JUserHelper::genRandomPassword(); // Set new password for the user $query = 'UPDATE #__users' . ' SET password = "'.md5($newpass).'"' . ' WHERE id = '.$user->id; $db->setQuery( $query ); if (!$db->query()) { JError::raiseError( 404, JText::_('SQL error' ) . $db->stderr(true)); } // Build the email body and subject $message = JText::sprintf( 'NEWPASS_MAIL_MSG', $username, JText::_( 'NEWPASS_MSG1' ), $siteURL, JText::_( 'NEWPASS_MSG2' ), $newpass, JText::_( 'NEWPASS_MSG3' ) ); eval ("\$message = \"$message\";"); $subject = JText::sprintf( 'New password for', $config->getValue('config.sitename'), $username ); eval ("\$subject = \"$subject\";"); // Send the new password email JUtility::sendMail($config->getValue('config.mailfrom'), $config->getValue('config.fromname'), $user->email, $subject, $message); $mainframe->redirect( 'index.php', JText::_( 'New User Password created and sent!' ) ); } else { // No username... do we have an email address? if ($email) { // We have an email address ... is it a valid one? $query = 'SELECT username' . ' FROM #__users' . ' WHERE email = "'.$db->getEscaped($email)."'"; $db->setQuery( $query ); if (!($username = $db->loadResult()) || !$email) { $mainframe->redirect( 'index.php?option=com_user&task=lostPassword', JText::_( 'Sorry, no corresponding user was found' ) ); } // Build the email body and subject $message = JText::sprintf( 'RESEND_MAIL_MSG', $username, JText::_( 'RESEND_MSG1' ), $siteURL, JText::_( 'RESEND_MSG2' ), JText::_( 'RESEND_MSG3' ) ); eval ("\$message = \"$message\";"); $subject = JText::_( 'Resend username for', $config->getValue('config.sitename') ); eval ("\$subject = \"$subject\";"); // Send the username reminder email JUtility::sendMail($config->getValue('config.mailfrom'), $config->getValue('config.fromname'), $email, $subject, $message); $mainframe->redirect( 'index.php', JText::_( 'Username resent' ) ); } else { // We have nothing ... send fail $mainframe->redirect( 'index.php?option=com_user&task=lostPassword', JText::_( 'Sorry, no corresponding user was found' ) ); } } }
[ "protected function reminder() {\n // TODO: password reminder: link valid for limited time emailed to user, if user-entered email address and\n // username, matches the existing username/email address combination.\n // Once the user presses the link, if valid link, a form is displayed to enter and confirm a new password for\n // that username. The user account will then be updated with the new password.\n }", "public function password_reminder()\n\t{\n\t\t// Get data from request\n\t\t$email = Request::getString('form_identifier');\n\n\t\t// Get user details\n\t\t$userModel = $this->getModel('user');\n\t\tif (!$user = $userModel->getUserFromEmail($email)) {\n\n\t\t\t// Not registered\n\t\t\tMessages::addMessage(\"The e-mail address \".$email.\" does not appear to be registered with our site.\", 'error');\n\n\t\t} else {\n\n\t\t\t// Send email\n\t\t\t$this->_sendReminder($user['UserID']);\n\t\t\tMessages::addMessage('A new password has been e-mailed to '.$email.'.', 'info');\n\n\t\t}\n\n\t\t// View login page\n\t\treturn $this->_showMessages('view');\n\n\t}", "public function pwForgot() {\n $credentials = [\n 'email' => $this->request->get('email'),\n ];\n\n $user = \\Sentinel::findByCredentials($credentials);\n\n\n if($activation = \\Activation::completed($user)) {\n // User is activated so create the activation url and email it to the user.\n $uri = '/register/' . 'pwreset/' . $user['id'] . '/' . $activation['code'];\n $activationUrl = url($uri);\n\n $this->pwResetEmail($activationUrl, $user['id']);\n $this->viewVars['msg'] = \"An email was sent to your mailbox with password reset instructions.\";\n } else {\n // User not activated yet\n $activation = \\Activation::exists($user);\n // Create the activation url and email it to the user.\n $uri = '/register/' . 'activation/' . $user['id'] . '/' . $activation['code'];\n $activationUrl = url($uri);\n\n $this->activationEmail($activationUrl, $user['id']);\n $this->viewVars['msg'] = \"An email was sent to your mailbox with activation instructions.\";\n }\n return $this->render('emails/test');\n }", "private function sendPasswordNotification()\n {\n if (!$this->generatePassword) {\n return false;\n }\n $token = $this->broker->getRepository()->create($this->user);\n\n $this->isNewAccount ?\n $this->user->notify(new UserCreated($token)) :\n $this->user->notify(new UserPasswordChangeRequested($token));\n }", "public function reminder()\n {\n $credentials = array\n (\n 'email' => Input::get('email')\n );\n\n $remind = Password::remind($credentials, function($message)\n {\n $message->subject('Kweecker - Nieuw wachtwoord');\n });\n switch($remind)\n {\n case Password::INVALID_USER:\n $code = 400;\n $response = array('message' => 'invalid_user');\n break;\n\n case Password::REMINDER_SENT:\n $code = 200;\n $response = array('message' => 'reminder_sent');\n break;\n }\n\n\n // return the response\n return \\Response::json($response, $code);\n }", "public function sendPasswordChangedEmail(User $user): void;", "public function newpwAction(){\n if ($this->getRequest()->isPost()) {\n $email = $_POST['username'];\n $pw = uniqid();\n $subject=\"Here is your new password\";\n $body=\"Your password is now \".$pw.\". Please log in with this password and change the password\";\n\n if (!userExists($email)) {\n echo 'notexist';\n }\n else {\n if(changePassword($email, $pw)){\n Email::send($email, $body, $subject);\n echo 'true';\n }\n else{\n echo 'false';\n }\n }\n }\n }", "public function forgotPassword()\n {\n $credentials = [\n 'email' => $this->request->get('email'),\n ];\n\n $user = \\Sentinel::findByCredentials($credentials);\n if (empty($user)) {\n $this->success('passwords.sent');\n return $this->json();\n }\n\n $mailer = new Mail\\Mail();\n\n // if the user is not activated, resend the activation email\n if (!\\Activation::completed($user)) {\n $activation = \\Activation::exists($user);\n $mailer->activationEmail($user, $activation->code);\n $this->warning('auth.resendActivation');\n return $this->json(400);\n }\n\n // The user is active, and wants to reset the password, use Sentinel Reminders\n $reminder = \\Reminder::create($user);\n $mailer->resetPasswordEmail($user, $reminder->code);\n\n $this->success('passwords.sent');\n return $this->json();\n }", "public function notifyUser()\r\n {\r\n switch ($this->type) {\r\n case self::TYPE_PASSWORD_RESET:\r\n $event = new PasswordReset;\r\n break;\r\n case self::TYPE_ACTIVATION:\r\n $event = new UserActivation;\r\n break;\r\n case self::TYPE_INVITATION:\r\n $event = new UserInvitation;\r\n break;\r\n }\r\n\r\n $this->user->notify($event);\r\n }", "public function triggerResetPassword()\n {\n $token = md5(time() . $this->getId() . $this->getEmailAddress());\n\n self::update($this->getId(), array(\n 'password_reset_key' => $token,\n 'password_reset_date' => time()\n ));\n\n //$this->sendPasswordResetEmail($token, $this->getId());\n }", "private function doResetPassword() {\n\t\ttry {\n\t\t\t\n\t\t\t$username = $this->getParam('username',true);\n\t\t\t$email = $this->getParam('email',true);\n\t\t\t\n\t\t\tif (!(is_null($username) || is_null($email))) {\n\t\t\t\t\n\t\t\t\t$obj = UserServices::getUserByUsername($username);\n\t\t\t\tif ($obj instanceof userObj && (strcmp($obj->getEmail(),$email) == 0)) {\n\t\t\t\t\t\n\t\t\t\t\t$newpass = substr(VCDUtils::generateUniqueId(),0, 6);\n\t\t\t\t\t$md5newpass = md5($newpass);\n\t\t\t\t\t\n\t\t\t\t\t$body = \"Request for new password was made for your account from computer: \" . $_SERVER['REMOTE_ADDR'] . \"\\n\\n\";\n\t\t\t\t\t$body .= $obj->getFullname() . \", your new password as requested is \".$newpass . \"\\n\";\n\t\t\t\t\t$body .= \"\\nGood luck, (The VCD-db)\";\n\t\t\t\t\t\n\t\t\t\t\tif ((VCDUtils::sendMail($email, \"New password as requested\",$body))) {\n\t\t\t\t\t\t$message = \"New password has been mailed to \" . $email . \"<break>\";\n\t\t\t\t\t\t$message .= \"You can change the password next time you log in.\";\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// actually update the password since we now know that the email was successfully sent\n\t\t\t\t\t\t$obj->setPassword($md5newpass);\n\t\t\t\t\t\tUserServices::updateUser($obj);\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$message = \"The site owner has wrong mail settings defined, cannot sent password\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tVCDException::display($message);\n\t\t\t\t\tredirect();\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tthrow new VCDProgramException('Invalid username and email combination');\n\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\tthrow new VCDInvalidInputException('You must provide both username and email.');\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $ex) {\n\t\t\tVCDException::display($ex);\n\t\t\tredirect('?page=authenticate&action=retry');\n\t\t}\n\t}", "public function forgotten() {\n $form = new FormWriter('auth.forgotten');\n\n if ($data = $form->get_valid_data_if_form_sent($this->router->getParams())) {\n $loe = strtolower(trim($data['usernameoremail']));\n\n $not_exist = false;\n $id = $this->db->selectValue('SELECT id FROM auth_user WHERE email=$1 AND active=TRUE', array($loe), 'id');\n if (!$id) {\n $not_exist = true;\n }\n $username_parts = explode('-', $loe);\n if ($not_exist) {\n $id = $this->db->selectValue('SELECT id FROM auth_user WHERE customer_id = customer_id($1) AND username = $2 AND active=TRUE', array($username_parts[0], array_value($username_parts, 1, '')), 'id');\n if ($id) {\n $not_exist = false;\n }\n }\n if ($not_exist) {\n $form->add_error($this->translate('au_frg_err_not_exists'), 'usernameoremail');\n } else {\n $user = $this->db->select('SELECT *, customer_name(customer_id) as customer_name FROM auth_user WHERE id = $1', array($id), false);\n if (empty($user['email'])) {\n $form->add_error('User has no email');\n }\n }\n if (!$form->has_error()) {\n\n $mail_params['link'] = $this->router->getServer().'forgotten/'.md5($user['id'].$user['password'].$user['email'].'password');\n $mail_params['sitelink'] = $this->router->getBase();\n $mail_params['sitename'] = $this->translate('glb_sitename');\n\n $text = $this->sprintf_array($this->translate('au_frg_email_text'), $mail_params);\n $html = $this->sprintf_array($this->translate('au_frg_email_html'), $mail_params);\n\n $mailer = new Mailer();\n $mailer->from($this->etc->mail->from, $this->etc->mail->from_name)\n ->to($user['email'], $user['customer_name'].'-'.$user['username'])\n ->subject($this->translate('au_frg_email_subj'))\n ->text($text)->html($html)->send();\n\n $form->add_confirm($this->translate('au_frg_email_sent'));\n }\n }\n $form->writeFormBlock();\n }", "public function action_silentresetpassword()\n {\n $this->validateUserAuthentification();\n\n if (HTTP_Request::POST == $this->request->method()) {\n try {\n $data = $this->request->post();\n $validTime = time() + (24 * 60 * 60);\n $reference = $this->getRandomString(16);\n\n // create a new db entry\n $pending = ORM::factory('User_Pending');\n $pending->type = 'resetpw';\n $pending->reference = $reference;\n $pending->username = $data['username'];\n $pending->email = $data['email'];\n $pending->user_id = $data['id'];\n $pending->valid_until = $validTime;\n $pending->save();\n\n // send email notification to user email address\n $link = $this->getProtocol() . $_SERVER['HTTP_HOST'] . '/' . 'cms/user/validate/' . $reference;\n $mailResult = $this->sendResetPasswordValidationMail($link, $pending->email);\n\n echo '{\"success\":' . $mailResult . '}';\n } catch (Exception $e) {\n echo '{\"success\":false,\"message\":\"' . $e->getMessage() . '\"}';\n }\n }\n die();\n }", "function eventUpdatePassword(){\r\n\t\t$userid = util::getData(\"id\");\r\n\t\t$password1 = util::getData(\"password1\");\r\n\t\t$password2 = util::getData(\"password2\");\r\n\r\n\t\tif(!$this->canUpdateUser($userid))\r\n\t\t\treturn $this->setEventResult(false, \"You cannot update this account\");\r\n\r\n\t\t$result = dkpAccountUtil::SetOfficerAccountPassword($this->guild->id, $userid, $password1, $password2);\r\n\r\n\t\tif($result != dkpAccountUtil::UPDATE_OK)\r\n\t\t\t$this->setEventResult(false, dkpAccountUtil::GetErrorString($result));\r\n\t\telse\r\n\t\t\t$this->setEventResult(true,\"Password Changed!\");\r\n\r\n\t}", "public function remind() {\n\t\t\n\t\t// SET: $process global\n\t\t$process \t= Process::get_instance();\n\t\t\n\t\t// GET: data of user\n\t\t$this->get_data();\n\t\t\n\t\t// CHECK: process state\n\t\tif ($process->run()) {\n\t\t\t\n\t\t\t// GET: send login credentiials\n\t\t\t$mailer = new Mailer();\n\t\t\t$mailer->add_to($this->tell('email'), $this->tell('firstName').' '.$this->tell('lastName'));\n\t\t\t$mailer->set_from(STRING_SETTING_PROJECT_EMAIL, STRING_SETTING_PROJECT_NAME);\n\t\t\t$mailer->set_subject('Important!');\n\n\t\t\t$html = str_replace('[[NAME]]', $this->display('firstName'), TEXT_CLASS_USER_EMAIL_REMIND);\n\t\t\t$html = str_replace('[[EMAIL]]', $this->display('email'), $html);\n\t\t\t$html = str_replace('[[PASS]]', $this->display('password'), $html);\n\t\t\t$mailer->set_body($html);\n\t\t\t\n\t\t\tif ($mailer->send()) {\n\t\t\t\t// REPORT: success\n\t\t\t\t$process->add_note(STRING_CLASS_USER_DONE_SEND_REMINDER, 'DONE');\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t// REPORT: failure\n\t\t\t\t$process->add_note(STRING_CLASS_USER_FAIL_SEND_REMINDER);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\n\t\t} else {\n\t\t\t// REPORT: failure\n\t\t\t$process->add_note(STRING_CLASS_USER_FAIL_SEND_REMINDER);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "public function request_new_password(){\r\n $reqs = new \\Required_Parameters(array(),array(\"user_email_address\"));\r\n return $this->validate_output($reqs,false,null,array($this,\"request_new_password_callback\"),false);\r\n }", "function forgot_username()\n\t{\n\t\n\t\n\t}", "private function EmailUser(){\n //notifying them of the sale completion.\n }", "function sendPasswordResetMail($user){\n\n $verificationLink = $_SERVER[\"SERVER_NAME\"].\"/resetpassword?id=\".$user->id.\"&token=\".VerificationToken::createToken($user);\n\n $context = [\n \"name\" => $user->firstName,\n \"verificationLink\" => $verificationLink,\n ];\n $body = renderToString(\"mail/passwordreset.php\", $context);\n\n sendMail($user->email, \"Password reset request\", $body);\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Will apply profanity filter to $input, by doing a POST call to profanityfilter and return it's result
private function filterProfanity($input) { $result = FALSE; if(!$input) return $result; try { $response = $this->defensio_client->postProfanityFilter(array('content' => $input)); $result = $response[1]->filtered->content; } catch (DefensioError $ex) { $result = FALSE; } return $result; }
[ "public function checkInputForProfanity($input){\n return $this->tf->checkForProfanityInWords($input);\n }", "public function getProfanityFilter()\n {\n return $this->profanity_filter;\n }", "public function setProfanityFilter($var)\n {\n GPBUtil::checkBool($var);\n $this->profanity_filter = $var;\n\n return $this;\n }", "function check_for_profanity_neutrinoapi($message) {\nglobal $DEBUG,$pluginSettings,$API_USER_ID, $API_KEY;\n\n\tif($DEBUG)\n\tlogEntry(\"inside profanity checker\");\n\t\n\tlogEntry(\"checking for profanity inside message: \".$message);\n\n//\t$API_USER_ID = urldecode($pluginSettings['API_USER_ID']);\n//\t$API_KEY = urldecode($pluginSettings['API_KEY']);\n\n\n\tlogEntry(\"API USER: \".$API_USER_ID);\n\tlogEntry(\"API KEY: \".$API_KEY);\t\n\t$postData = array(\n\t\t\"user-id\" => $API_USER_ID,\n\t\t\"api-key\" => $API_KEY,\n\t\t\"content\" => $message\n);\n\n$json = curl_post_request(\"https://neutrinoapi.com/bad-word-filter\", $postData);\n//$json = curl_post_request(\"https://neutrinoapi.com/ip-info\", $postData);\n$result = json_decode($json, true);\n//logEntry(\"profanty result: is bad: \".$result['is-bad']);\n//logEntry(\"profanity result: total bad words: \".$result['bad-words-total']);\n\n\n\nlogEntry(\"is bad: \".$result['is-bad']);\nlogEntry(\"is bad total: \".$result['bad-words-total']);\n//echo print_r($result['bad-words-list']).\"\\n\";\nlogEntry(\"censored content: \".$result['censored-content']);\n\nif($result['is-bad']>0 || $result['bad-words-total'] > 0)\n\treturn true;\nelse {\n\treturn false;\n}\n\n}", "public abstract function sanitize( $input );", "function filter_post($_input_name, $_conn)\n{\n $input = trim(filter_input(INPUT_POST, $_input_name, FILTER_SANITIZE_STRING));\n $input = mysqli_real_escape_string($_conn, $input);\n return $input;\n}", "function filterInput($filter, $input, $includeFromOwnLibrary = TRUE, $params = NULL) {\n include_once(PAPAYA_INCLUDE_PATH.'system/papaya_strings.php');\n\n $filter = papaya_strings::normalizeString($filter);\n $className = 'HTMLPurifier_Filter_'.$filter;\n if (!class_exists($className, FALSE)) {\n if ($includeFromOwnLibrary) {\n @include_once(\n sprintf(HTMLPURIFIER_INCLUDE_PATH.'HTMLPurifier/Filter/%s.php', $filter)\n );\n } else {\n @include_once(\n sprintf(HTMLPURIFIER_INCLUDE_PATH.'../papaya/Filter/%s.php', $filter)\n );\n }\n }\n\n if (!class_exists($className, FALSE)) {\n return NULL;\n }\n\n if ($params == NULL) {\n $obj = new $className();\n } else {\n $obj = new $className($params);\n }\n $input = $obj->preFilter($input, NULL, $obj);\n $input = $obj->postFilter($input, NULL, $obj);\n return $input;\n }", "protected function processInput()\n {\n if (empty($this->input)) {\n $this->input = request()->except('_token');\n\n if ($this->injectUserId) {\n $this->input['user_id'] = Auth::user()->id;\n }\n }\n $this->sanitize();\n request()->replace($this->input); // @todo IS THIS NECESSARY?\n }", "public function filter($input){ //Filter input from all user, filtered from sqli,and xss\n $filter = addslashes(trim(stripslashes(strip_tags($input))));\n return $filter;\n }", "protected function processInputAkismet() {\n\n\t\tif(!$this->akismet || count($this->form->getErrors())) return;\n\n\t\tlist($author, $email, $content) = explode(',', $this->akismet);\n\n\t\t$author = $this->form->get($author)->attr('value');\n\t\t$email = $this->form->get($email)->attr('value');\n\t\t$content = $this->form->get($content)->attr('value');\n\n\t\trequire_once(dirname(__FILE__) . '/FormBuilderAkismet.php'); \t\n\t\t$akismet = new FormBuilderAkismet(wire('modules')->get('FormBuilder')->akismetKey); \n\n\t\tif($akismet->isSpam($author, $email, $content)) {\n\t\t\t$this->errors[] = $this->_('Spam filter has been triggered'); \n\t\t}\n\t}", "public function ajax_sanitize() {\n\n\t\t// check if there is a legal request\n\t\t// if not the script will die\n\t\tif ( ! isset( $_REQUEST['security'] ) ) {\n\t\t\tdie();\n\t\t}\n\n\t\tcheck_ajax_referer( 'rswp-sanitize-ajax-nonce', 'security' );\n\n\t\tif ( ! isset( $_REQUEST['do'] ) ) {\n\t\t\tdie();\n\t\t}\n\n\t\tswitch ( $_REQUEST['do'] ) {\n\n\t\t\tcase 'sanitize_title':\n\t\t\t\tif ( ! isset( $_REQUEST['title'] ) ) {\n\t\t\t\t\twp_send_json_error();\n\t\t\t\t}\n\t\t\t\tif ( empty( $_REQUEST['title'] ) ) {\n\t\t\t\t\t$_REQUEST['title'] = '';\n\t\t\t\t} else {\n\t\t\t\t\t$_REQUEST['title'] = $this->sanitize_shortcode( $_REQUEST['title'] );\n\t\t\t\t}\n\t\t\t\twp_send_json_success( array( 'action' => 'sanitized', 'title' => $_REQUEST['title'] ) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'sanitize_attribute':\n\t\t\tdefault:\n\t\t\t\tif ( ! isset( $_REQUEST['attribute_name'] ) ) {\n\t\t\t\t\twp_send_json_error();\n\t\t\t\t}\n\t\t\t\twp_send_json_success( array(\n\t\t\t\t\t'action' => 'sanitized',\n\t\t\t\t\t'attribute_name' => $this->sanitize_attribute( $_REQUEST['attribute_name'] )\n\t\t\t\t) );\n\n\t\t}\n\n\t\twp_send_json_error();\n\t}", "public function postFilter(string $inputName,string $filter=\"string\",array $args = array(), $default = null)\n\t{\n\t\t$this->failure = FALSE;\n\t\t$value = null;\n\t\tif(isset($_POST[$inputName]))\n\t\t{\n\t\t\tif(in_array($filter,array(\"array\")) == false) $value = stripslashes($_POST[$inputName]);\n\t\t\telse $value = $_POST[$inputName];\n\t\t\treturn $this->valueFilter($value, $filter, $args);;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->failure = TRUE;\n\t\t\treturn $default;\n\t\t}\n\t}", "public function validate( $p_filter_input ) {\n return true;\n }", "public function sanitiseInput($input)\n\t{\n\t\treturn $this->model->sanitiseInput($input);\n\t}", "function filter_form_request($request,$url_snapshot=''){\n\tif($url_snapshot == '')\n\t\t$url_snapshot = SITE_URL;\n\tif(is_array($request)){\n\t\tforeach ($request as $check_url) {\n\t\tif ((eregi(\"<[^>]*script*\\\"?[^>]*>\", $check_url)) || (eregi(\"<[^>]*object*\\\"?[^>]*>\", $check_url)) ||\n\t\t(eregi(\"<[^>]*iframe*\\\"?[^>]*>\", $check_url)) || (eregi(\"<[^>]*applet*\\\"?[^>]*>\", $check_url)) ||\n\t\t(eregi(\"<[^>]*meta*\\\"?[^>]*>\", $check_url)) || (eregi(\"<[^>]*style*\\\"?[^>]*>\", $check_url)) ||\n\t\t(eregi(\"<[^>]*form*\\\"?[^>]*>\", $check_url)) || (eregi(\"\\([^>]*\\\"?[^)]*\\)\", $check_url))) {\n\t\t\thack_die (\"Hacking or Injection Attempt\",$url_snapshot);\n\t\t\t}\n\t\t}\n\t}else{\n\t\tif ((eregi(\"<[^>]*script*\\\"?[^>]*>\", $request)) || (eregi(\"<[^>]*object*\\\"?[^>]*>\", $request)) ||\n\t\t(eregi(\"<[^>]*iframe*\\\"?[^>]*>\", $request)) || (eregi(\"<[^>]*applet*\\\"?[^>]*>\", $request)) ||\n\t\t(eregi(\"<[^>]*meta*\\\"?[^>]*>\", $request)) || (eregi(\"<[^>]*style*\\\"?[^>]*>\", $request)) ||\n\t\t(eregi(\"<[^>]*form*\\\"?[^>]*>\", $request)) || (eregi(\"\\([^>]*\\\"?[^)]*\\)\", $request))) {\n\t\t\thack_die(\"Hacking or Script Injection Attempt\",$url_snapshot);\n\t\t\t}\n\t}\n\tunset($check_url);\n\tunset($request);\n}", "public function validate($p_filter_input) {\n\t\treturn true;\n\t}", "public function process()\n\t{\n\t\tforeach($this->filters as $field => $filters)\n\t\t{\n\t\t\tforeach($filters as $callback)\n\t\t\t{\n\t\t\t\t$params = array_merge(array($this->input[$field]), $callback['params']);\n\t\t\t\t\t\t\t\t\n\t\t\t\t$this->input[$field] = call_user_func_array($callback['function'], $params);\n\t\t\t}\n\t\t}\n\t}", "public function apply_filters_from_request() {\n\n\t\t\tif ( empty( $_REQUEST['jsf'] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tjet_smart_filters()->query->set_provider_from_request( $_REQUEST['jsf'] );\n\n\t\t\t$provider_id = $this->request_provider( 'provider' );\n\t\t\t$provider = jet_smart_filters()->providers->get_providers( $provider_id );\n\n\t\t\tif ( ! $provider && is_callable( array( $provider, 'apply_filters_in_request' ) ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tforeach ( $this->request_query_vars as $query_var ) {\n\t\t\t\tif ( empty( $_REQUEST[$query_var] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\n\t\t\t\tjet_smart_filters()->query->set_query_var_to_request( $query_var, $_REQUEST[$query_var] );\n\t\t\t}\n\n\t\t\tjet_smart_filters()->query->get_query_from_request();\n\t\t\t$provider->apply_filters_in_request();\n\n\t\t}", "function mt_filter_the_content_for_profanity($content) {\n\t\t$badWords = file(get_stylesheet_directory() . \"/profanity.txt\", FILE_IGNORE_NEW_LINES);\n\n\t\t$cleanWords = [];\n\t\tforeach($badWords as $badWord) {\n\t\t\t$len = strlen($badWord);\n\t\t\t$cleanWord = str_repeat(\"*\", $len);\n\t\t\tarray_push($cleanWords, $cleanWord);\n\t\t}\n\t\t\n\t\treturn str_ireplace($badWords, $cleanWords, $content);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine if the provided value is a valid GUID (version 4). Usage: 'index' => 'guidv4'
protected function guidv4($field, $input, $param = null) { $pattern = "/\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\}?$/i"; if (preg_match($pattern, $input)) { return true; } else { $this->set_errors($field, $param, __FUNCTION__); return false; } }
[ "protected function validate_guidv4($field, array $input, array $params = [], $value = null)\n {\n return preg_match(\"/\\{?[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}\\}?$/\", $value) > 0;\n }", "protected function validate_guidv4($value, $args = NULL)\n {\n return (preg_match(\n '/\\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\\}?$/'\n , $value)\n === 1);\n }", "public static function guid($value): bool\n {\n return preg_match(self::GUID_PATTERN, $value);\n }", "function nb_isValidGUID($guid)\n{\n return is_string($guid) &&\n strlen($guid) === 38 &&\n preg_match('/^\\{[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\\}$/', $guid) === 1\n ;\n}", "public function validateUUID($value)\n {\n try {\n return preg_match($this->UUIDv4Pattern, $value);\n } catch (\\Exception $e) {\n throw new \\InvalidArgumentException('Validation could not be found. Error: '.$e->getMessage());\n }\n }", "function isGuid($guid){\n\n if(preg_match('/^\\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\\}?$/', $guid)) {\n return true ;\n }\n\n return false ;\n\n}", "public function checkUidV4($value)\n {\n return $this->checkUuidVersion($value, 4);\n }", "function ju_is_guid(string $s):bool {return 36 === strlen($s) && preg_match(\n\t'#^\\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\\}?$#', $s\n);}", "function IsUuid($data)\n{\n return preg_match('/^[a-f\\d]{8}-(?:[a-f\\d]{4}-){3}[a-f\\d]{12}$/i', $data);\n}", "function isUuid($check)\n{\n if (isNullOrEmpty($check)) {\n return false;\n }\n $regex = '/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[0-5][a-fA-F0-9]{3}-[089aAbB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$/';\n return preg_match($regex, $check) === 1;\n}", "public static function isUUID($value)\n {\n return (bool) preg_match(self::UUID, $value);\n }", "function is_valid_uuid($uuid) {\n $regex = '#^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$#';\n $is_uuid = preg_match($regex, $uuid);\n return (boolean)$is_uuid;\n}", "static function isUuid($str) {\n return is_string($str) && preg_match('/^[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$/', $str);\n }", "public function testUuid() {\n $this->assertRegExp('/^[a-f0-9]{8}\\-[a-f0-9]{4}\\-4[a-f0-9]{3}\\-[89AB]{1}[a-f0-9]{3}\\-[a-f0-9]{12}$/i', String::uuid());\n $this->assertRegExp('/^[a-f0-9]{8}\\-[a-f0-9]{4}\\-4[a-f0-9]{3}\\-[89AB]{1}[a-f0-9]{3}\\-[a-f0-9]{12}$/i', String::uuid());\n $this->assertRegExp('/^[a-f0-9]{8}\\-[a-f0-9]{4}\\-4[a-f0-9]{3}\\-[89AB]{1}[a-f0-9]{3}\\-[a-f0-9]{12}$/i', String::uuid());\n }", "public static function valueLooksLikeUuid($value)\n {\n return !(!is_string($value) || (preg_match('/' . self::$UUID_REGEX . '/', $value) !== 1));\n }", "public static function guidv4() {\n $data = openssl_random_pseudo_bytes(16);\n\n $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100\n $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10\n\n return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));\n }", "public function validateGUID(string $_guid): bool\n {\n return(boolval(preg_match('/^\\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\\}?$/', strtoupper($_guid))));\n }", "public function is_uuid4(String $input)\n {\n\t\treturn (preg_match('/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i', $input)) ? true : false;\n\t}", "public function testUuid4WithGetHex(): void\n {\n $uuid = new Uuid4('691ce06d-0afb-428d-b5fc-5384cd3046fb');\n\n $this->assertSame('691ce06d-0afb-428d-b5fc-5384cd3046fb', $uuid->getHex());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes a parameter passed by reference
public function parameterPassedByReference(&$param) { unset($param); }
[ "function passByRef(&$param) {\n \n $param *= $param;\n return $param;\n \n }", "function passByReference(&$val){\r\n $val = $val + 100;\r\n}", "function passByReference(&$num){\n\t\t$num++; // changes the value of the passed value\n\t}", "function ref_test2(&$var) {\n $var = $var * 2;\n echo $var . \"<br>\";\n }", "function pass($var) {\n\treturn $var;\n}", "public function visitParamRef(Node $node);", "function passByValue($num){\n\t\t$num++; // changes the value of the passed value\n\t}", "public function makeByRef() {}", "static function &reference($v){\n\t\treturn $v;\n\t}", "public function setPassedByReference($bool);", "function func2(&$a,&$b)\n {\n $a=70;\n $b=43;\n }", "function set_by_ref($name, &$value)\n\t{\n\t\tsmarty()->assign_by_ref($name, $value);\n\t}", "public function testInvokeExceptIfReferencedParameter() {\n \n //Given\n \n $frameworkMock = new \\mock\\Knt\\Framework\\Framework;\n $collectionMock = new \\mock\\Knt\\Framework\\Core\\Collection;\n \n $component = new \\Knt\\Framework\\Sample\\Home(\n $frameworkMock, \n 'referencedParameter', \n $collectionMock\n );\n \n //When\n $this\n ->exception(\n function() use($component) {\n $component->render();\n }\n )\n \n //Then\n ->hasMessage(\"arg cannot be passed by reference\")\n \n ;\n }", "function call_user_method ($method_name, &$obj, $parameter = null) {}", "public function isPassedByReference(): bool\n {\n return $this->byRef;\n }", "protected function setParameterByRef($name, &$value) {\n $this->parameters[$name] =& $value;\n }", "function & __returnByRef() {}", "public function isPassedByReference(): bool\n {\n return $this->node->byRef;\n }", "function &ref($obj)\n {\n return $obj;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get an instance of mofilmTerritory by primary key
public static function getInstance($inID) { /** * Check for an existing instance */ if ( isset(self::$_Instances[$inID]) ) { return self::$_Instances[$inID]; } /** * No instance, create one */ $oObject = new mofilmTerritory(); $oObject->setID($inID); if ( $oObject->load() ) { self::$_Instances[$inID] = $oObject; return $oObject; } return $oObject; }
[ "public function territory()\n\t{\n\t\treturn $this->hasOne('Territories', 'id', 'id');\n\t}", "function getTerritory() {\n return mofilmTerritory::getInstance($this->getTerritoryID());\n }", "function getTerritory() {\n\t\treturn mofilmTerritory::getInstance($this->getTerritoryID());\n\t}", "public function getMunicipality($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT * FROM municipalities\n\t\t\t\t\t\t WHERE municipality_id = '$municipality_id'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$row = $result->fetch(PDO::FETCH_ASSOC);\n\t\t\t\t\n\t\t\t\t$municipality = new Municipality();\n\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\n\t\t\t\treturn $municipality;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function find_territory_by_id($id=0) {\n global $db;\n $sql = \"SELECT * FROM territories \";\n $sql .= \"WHERE id='\" . $id . \"';\";\n $territory_result = db_query($db, $sql);\n return $territory_result;\n }", "public function getRepTerritoryIdAttribute()\n {\n return data_get($this->owner,'primary_territory.account_territory_id');\n }", "function viewTerritoryFromID($id) {\n $this->load->model('territory/territory_model');\n $fetchAllTerritory = $this->territory_model->getAllTerritoryfromID($id);\n $this->template->draw('territory/territoryManage', false, $fetchAllTerritory);\n }", "function viewDivisionFromTerritoryID($id) {\n $this->load->model('territory/territory_model');\n $fetchAllDivision = $this->territory_model->getAllDivisionfromID($id);\n $this->template->draw('territory/territoryMapView', false, $fetchAllDivision);\n }", "public static function factory($inCountry = null) {\n\t\t$oObject = new mofilmTerritory;\n\t\tif ( $inCountry !== null ) {\n\t\t\t$oObject->setCountry($inCountry);\n\t\t}\n\t\treturn $oObject;\n\t}", "private function getTerritoryService()\n {\n $service = new TerritoryService();\n\n return $service;\n }", "function get_industry_id($title)\n {\n $CI = & get_instance();\n return $CI->db->get_where('xx_industries', array('slug' => $title))->row_array()['id'];\n }", "public function municipality()\n {\n return $this->belongsTo(Municipality::class);\n }", "function get_one_resident($id){\n $this->db->where('r_id', $id);\n\t\t $query = $this->db->get('residents');\n\t\t return $query->result(); \t\t\t\t\t\t\t \n\t }", "function getCounty($municipality) {\n\t$boro = $municipality . \" Boro\";\n\t$twp = $municipality . \" Twp\";\n\t$city = $municipality . \" City\";\n\t$town = $municipality . \" Town\";\n\t$village = $municipality . \" Village\";\n\t\n\t$municipalities = mysql_query(\"SELECT * FROM municipalities WHERE `name` = '$municipality' OR `name` = '$boro' OR `name` = '$twp' OR `name` = '$city' OR `name` = '$town' OR `name` = '$village'\");\n\t$count = mysql_num_rows($municipalities);\n\tif ($count != 0) {\n\t\twhile ( $row = mysql_fetch_array($municipalities)) {\n\t\t\t$id = $row['countyID'];\n\t\t}\n\t}\n\telse return null;\n\t\n\treturn $id;\n}", "public function getTerritory()\n {\n return $this->territory;\n }", "public function setTerritoryID($value)\n {\n return $this->set('TerritoryID', $value);\n }", "public function origin()\n {\n return $this->belongsTo('\\App\\Model\\Territory');\n }", "public function getById($alumnoId);", "public function getMunicipio()\n {\n return $this->hasOne(Municipios::className(), ['id' => 'id_municipio']);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create json folders if needed
public function maybeCreateJsonFolder() { $path = $this->getJsonFolder(); if (!file_exists($path)) { mkdir($path, 0777, true); } if (!file_exists($path . DIRECTORY_SEPARATOR . $this->type)) { mkdir($path . DIRECTORY_SEPARATOR . $this->type, 0777, true); } }
[ "public function Create_student_folder_file()\n {\n $get_first_second_number = substr($this->id,0,2);\n @$folder_name .= $get_first_second_number. \"/\";\n\n\n if (!file_exists($folder_name))\n {\n mkdir($folder_name);\n \n $array = array('id' => $this->id,'name' => $this->name,'surname' => $this->surname,'age'=>$this->age,'curriculum'=>$this->curriculum);\n $fp = fopen($folder_name.'/'.\"$this->id.json\", 'w'); // creating student Json file name\n fwrite($fp, json_encode($array, JSON_PRETTY_PRINT)); // here it will print the array pretty\n fclose($fp);\n die(\"Student Record Created Successfully\");\n }\n else\n {\n echo \"Folder name Already Exist\\n\";\n } \n\n }", "public function include_json_folders()\n {\n }", "public function generate_autoload_json_file() {\n\n\t\tif( ! file_exists(WPEXTEND_JSON_DIR . self::$json_file_name) ) {\n\t\t\t\n\t\t\tif( touch(WPEXTEND_JSON_DIR . self::$json_file_name) )\n\t\t\t\tAdminNotice::add_notice( '019', self::$json_file_name .' file successfully created.', 'success', true, true, AdminNotice::$prefix_admin_notice );\n\t\t\telse\n\t\t\t\tAdminNotice::add_notice( '020', 'unable to create ' . self::$json_file_name, 'error', true, true, AdminNotice::$prefix_admin_notice );\n\t\t}\n }", "function testJsonDir()\n {\n $this->assertFileExists($this->schema_dir, \"Unable to find Json schema files for running our tests\");\n\n $this->assertFileExists($this->message_dir, \"Unable to find Json message files for running our tests\");\n }", "protected function createFolders()\n {\n $compiledPath = $this->config->rootPath() . '/';\n // Loop though and create directories if we need to.\n foreach (explode('/', $this->folderPath) as $folder) {\n $compiledPath .= $folder . '/';\n if (!is_dir($compiledPath)) {\n mkdir($compiledPath);\n }\n }\n }", "private function create_json() {\n\t\t$packages = $this->list_directory( $this->packages_dir );\n\t\t$arr = [];\n\n\t\tforeach ( $packages as $package ) {\n\t\t\tforeach ( $this->translations as $translation ) {\n\t\t\t\tif ( false !== stripos( $package, $translation ) ) {\n\t\t\t\t\t$locale = ltrim( strrchr( $translation, '-' ), '-' );\n\t\t\t\t\t$arr[ $locale ]['slug'] = stristr( $translation, strrchr( $translation, '-' ), true );\n\t\t\t\t\t$arr[ $locale ]['language'] = $locale;\n\t\t\t\t\t$arr[ $locale ]['updated'] = $this->get_po_revision( \"$translation.po\" );\n\t\t\t\t\t$arr[ $locale ]['package'] = '/packages/' . $package;\n\t\t\t\t\t$arr[ $locale ]['autoupdate'] = '1';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfile_put_contents( $this->root_dir . '/language-pack.json', json_encode( $arr ) );\n\t\tprintf( \"\\n<br>\" . 'language-pack.json created.' . \"\\n\" );\n\t}", "protected function generateFolders()\n {\n // Create the base folder\n $baseFolder = $this->moduly->getBasePath();\n\n if ( ! $this->finder->isDirectory($baseFolder)) {\n $this->finder->makeDirectory($baseFolder);\n }\n\n // Create the module folder\n $path = $this->getModulePath($this->slug);\n $this->finder->makeDirectory($path);\n\n // Create module sub-folders\n foreach ($this->getFolders() as $folder) {\n $this->finder->makeDirectory($path . $folder, 0755, true);\n }\n }", "function generateTreeJson() {\n\n return json_encode(addChildFolders(getRootFolders()));\n}", "private function generateDomainJsonFile()\n {\n $path = $this->domain->getDomainPath($this->getName()) . 'domain.json';\n\n $this->component->task(\"Generating file $path\",function () use ($path) {\n if (!$this->filesystem->isDirectory($dir = dirname($path))) {\n $this->filesystem->makeDirectory($dir, 0775, true);\n }\n\n $this->filesystem->put($path, $this->getStubContents('json'));\n });\n }", "private function createEntityApiTestsFolder()\n {\n if (!file_exists($this->apiTestsFolder().'/'.$this->entityName()) && $this->request->get('group_main_apiato_classes', false)) {\n mkdir($this->apiTestsFolder().'/'.$this->entityName(), null, true);\n }\n }", "function makeJSON($file) {\r\n\t\tif (!file_exists($file)) {\r\n\t\t\ttouch($file);\r\n\t\t} // if\r\n\t}", "private function createFolders()\n\t{\n\t\t$mediaConfig = $this->getServiceLocator()->get('config')['media'];\n\t\t$saveDir = rtrim($mediaConfig['save_path'], '\\\\/');\n\n\t\tif ( ! file_exists($saveDir))\n\t\t{\n\t\t\tmkdir($saveDir, 0755, true);\n\t\t}\n\t}", "public function create_json_per_kecamatan() {\n foreach( $this->list_kecamatan as $kecamatan => $kecamatan_id ) {\n $data_kecamatan = $this->process_per_kecamatan($kecamatan_id);\n $file_create = fopen('json/'. $kecamatan .'.json', 'w');\n fwrite($file_create, json_encode( $data_kecamatan ) ); \n fclose($file_create);\n }\n }", "function update_json_file(){\n\n $fp = fopen(__DIR__ . '/timeline.json', 'w');\n $data = generate_json_file();\n fwrite($fp, $data);\n fclose($fp);\n}", "public function make_json_file()\n\t{\n\t\t$json_file = fopen('recipes.json', 'w');\n\t\tfwrite($json_file, $this->json_result);\n\t\tfclose($json_file);\t\n\t}", "private function _createNewDirectories(){\n \n // need to first create the **version** directory\n $topLevel = $this->_dir . $this->_version . '/';\n \n\n try{\n if(!is_dir($topLevel)){\n mkdir($topLevel); \n $this->_showOutput('Creating directory: ' . $topLevel);\n }\n }catch(Exception $e){\n $this->logError($e, '_createNewDirectories'); \n }\n \n\n // iterate through the directories array and create all folders\n if(!empty($this->_dirArray)){\n foreach($this->_dirArray as $folder){\n // create folder\n try{\n if(!is_dir($folder)){\n mkdir($folder, $this->_folderPermissions);\n $this->_showOutput('Creating directory: ' . $folder);\n }\n \n }catch(Exception $e){\n $this->logError($e, '_createNewDirectories'); \n }\n \n }\n }\n \n }", "function crearArchivoJson($code){\n // $arr_materias = array('nombre'=> 'Jose', 'edad'=> '20', 'genero'=> 'masculino',\n //'email'=> 'correodejose@dominio.com', 'localidad'=> 'Madrid', 'telefono'=> '91000000');\n $arr_materias=crearMateriaDefecto();\n //Creamos el JSON\n $ruta =\"archivosJson/\";\n $json_string = json_encode($arr_materias);\n $file =$ruta.$code.\".json\";\n file_put_contents($file, $json_string);\n }", "public function generateFolder(){\n\t\tif ( ! \\File::exists($this->modulePath))\n\t\t{\n\t\t\t\\File::makeDirectory($this->modulePath, 0755);\n\t\t}\n\n\t\t// Create some resource directories\n\t\t//\\File::makeDirectory($this->modulePath . '/Assets', 0755);\n\t\t//\\File::makeDirectory($this->modulePath . '/Config', 0755);\n\t\t\\File::makeDirectory($this->modulePath . '/Controllers', 0755);\n\t\t//\\File::makeDirectory($this->modulePath . '/Lang', 0755);\n\t\t\\File::makeDirectory($this->modulePath . '/Models', 0755);\n\t\t\\File::makeDirectory($this->modulePath . '/Migrations', 0755);\n\t\t\\File::makeDirectory($this->modulePath . '/Views', 0755);\n\t\t\n\t}", "public static function createPowerUpFileAndFolders() {\n if (!file_exists(app_path('PowerUps'))) {\n mkdir(app_path('PowerUps'));\n }\n\n // if the app_path('PowerUps/Components') folder does not exist, create it\n if (!file_exists(app_path('PowerUps/Components'))) {\n mkdir(app_path('PowerUps/Components'));\n }\n\n // if the app_path('PowerUps/components.json') file does not exist, then create it\n if (!file_exists(app_path('PowerUps/components.json'))) {\n file_put_contents(app_path('PowerUps/components.json'), '{\"installed\": [], \"active\": []}');\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the bootstrap file, from command options or from the config file Command options take precedence. If no bootstrap command options, and no config file no bootstrap file
public function setupBootstrap() { if ($this->debug) print __METHOD__."\n"; if (null !== $this->input->getOption(self::BOOTSTRAP_FILE)) { if ($this->debug) print "bootstrap from options\n"; $this->bootstrap_file = $this->tests_relative_to ."/" . $this->input->getOption(self::BOOTSTRAP_FILE); } elseif (isset($this->config->bootstrap)) { if ($this->debug) print "bootstrap from config \n"; $this->bootstrap_file = $this->cwd. "/". $this->config->bootstrap; if ($this->debug) print __METHOD__."[{$this->bootstrap_file}] \n"; } else { if ($this->debug) print "no bootstrap \n"; $this->bootstrap_file = null; } if ($this->debug) print __METHOD__."\n"; }
[ "public static function getBootstrapFile(){}", "public function getBootstrapConfigurationFilename();", "public function getBootstrap(): string\n {\n return !empty($this->settings[self::SETTING_BOOTSTRAP])\n ? $this->settings[self::SETTING_BOOTSTRAP]\n : 'vendor/autoload.php';\n }", "public static function getBootstrapFile()\n {\n return '/var/www/aksel/vendor/laravel/framework/src/Illuminate/Foundation' . '/start.php';\n }", "public function getDefaultBootstrapPath(): string|null;", "private static function _getBootstrapFilePath()\n {\n return SCRIPTS_DIR . '/background.php';\n }", "public function getBootOption()\n {\n return $this->boot_option;\n }", "protected function bootstrapConfig() {\n $config_list = scandir($this->configPath());\n\n if (count($config_list) > 2) {\n $config_list = array_slice($config_list, 2);\n\n foreach ($config_list as $config_file) {\n $file_info = pathinfo($this->configPath() . DIRECTORY_SEPARATOR . $config_file);\n\n if ($file_info['extension'] === 'php') {\n $config = require_once $this->configPath() . DIRECTORY_SEPARATOR . $config_file;\n if (is_array($config))\n $this->loadedConfigs[$file_info['filename']] = $config;\n }\n }\n }\n }", "public function getBootstrapScriptFilePath()\n {\n return $this->bootstrapScriptFilePath;\n }", "public function execBootstrap()\n {\n $package = strtr($this->path.'/bootstrap', '/', '.');\n \n // FIXME: el BS a ejecutar debe depender del modo de ejecucion\n YuppLoader::getInstance()->loadScript($package, 'Bootstrap');\n }", "public function bootstrap()\n {\n $argv = $this->argv;\n\n if (!empty($argv)) {\n array_shift($argv);\n $cmd = array_shift($argv);\n\n if (count($argv) > 0) {\n if ($cmd === 'new') {\n $option = 'newProject';\n }else {\n $option = array_shift($argv);\n }\n\n $this->run($option, $argv);\n }else {\n $init = $this->get('init');\n $this->$init();\n }\n }else {\n \\console_log(\"Commande invalide\");\n }\n }", "private static function getConfigFilePath()\n {\n $input = new ArgvInput();\n $path = $input->getParameterOption(['-c', '--config'], 'behat.yml');\n $basePath = '';\n\n // If the path provided isn't an absolute path, then find the folder it is in recursively.\n if (substr($path, 0, 1) !== '/') {\n $basePath = self::getBasePathForFile($path, getcwd()) . DIRECTORY_SEPARATOR;\n }\n\n $configFile = $basePath . $path;\n\n if (!file_exists($configFile)) {\n throw new Exception(\n \"Autoclean: Config file '$path' not found at base path: '$basePath',\n please pass in the path to the config file through the -c flag and check permissions.\"\n );\n }\n\n return $configFile;\n }", "protected function checkForSpecificEnvironmentFile()\n {\n if ($this->isRunningInConsole() && isset($_SERVER['argv'])) {\n $input = new ArgvInput();\n\n if ($input->hasParameterOption('--env')) {\n $file = $this->getEnvironmentFile() . '.' . $input->getParameterOption('--env');\n\n $this->loadEnvironmentFile($file);\n }\n }\n\n if (!$this->get('APP_ENV')) {\n return;\n }\n\n if (empty($file)) {\n $file = $this->getEnvironmentFile() . '.' . $this->get('APP_ENV');\n $this->loadEnvironmentFile($file);\n }\n }", "public static function bootstrap()\n\t{\n\t\tif(file_exists(config() . 'application.php'))\n\t\t{\n\t\t\t$items = require config() . 'application.php';\n\n\t\t\tif(is_array($items))\n\t\t\t{\n\t\t\t\tforeach($items as $configKey => $configValue)\n\t\t\t\t{\n\t\t\t\t\tself::set($configKey, $configValue);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new FileNotFoundException(config() . 'application.php');\n\t\t}\n\t}", "protected function generateBootstrap() {\n $filename = \"tests/bootstrap.php\";\n $arrTemplates = [\n __DIR__.\"/../templates/bootstrap.php.txt\",\n ];\n $arrTemplateAttributes = [];\n $json = $this->generateJsonForFile($filename, $arrTemplates, $arrTemplateAttributes);\n \n $project = new Project();\n $project->loadConfigJson($json);\n $project->createFiles();\n }", "protected function loadConfig($config)\n {\n if (!empty($_SERVER['argv'])) {\n $option = '--' . self::OPTION_APPCONFIG . '=';\n foreach ($_SERVER['argv'] as $param) {\n if (strpos($param, $option) !== false) {\n $path = substr($param, strlen($option));\n if (!empty($path) && is_file($file = Yii::getAlias($path))) {\n return require $file;\n }\n\n exit(\"The configuration file does not exist: $path\\n\");\n }\n }\n }\n\n return $config;\n }", "protected function getBootstrapPath()\n {\n $parents = [\n 'vendor/silverstripe/framework/', // framework in vendor\n 'framework/', // old ss4 root module\n '' // framework root\n ];\n $path = 'tests/behat/serve-bootstrap.php';\n foreach ($parents as $parent) {\n if (file_exists(BASE_PATH . '/' . $parent . $path)) {\n return $parent . $path;\n }\n }\n throw new BadMethodCallException(\"serve-bootstrap.php could not be found\");\n }", "public static function getBootstrap(){\r\n\t\treturn self::$_bootstrap;\r\n\t}", "protected function _getBootstrap()\n {\n $frontController = Zend_Controller_Front::getInstance();\n $bootstrap = $frontController->getParam('bootstrap');\t//deb($bootstrap);\n return $bootstrap;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays a form to create a new OffreService entity.
public function newAction() { $entity = new OffreService(); $form = $this->createForm(new OffreServiceType(), $entity); return array( 'entity' => $entity, 'form' => $form->createView() ); }
[ "public function createAction()\n {\n $entity = new OffreService();\n $request = $this->getRequest();\n $form = $this->createForm(new OffreServiceType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n \n $this->get('session')->setFlash('notice', 'Offre de service a été créé avec succès');\n\n return $this->redirect($this->generateUrl('offreservice_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function newAction()\n {\n $entity = new Service();\n $form = $this->createForm(new ServiceType(), $entity);\n\n return $this->render('HegesAppServiceBundle:Service:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function newAction()\n {\n $entity = new Service();\n $form = $this->createCreateForm($entity);\n\n return $this->render('SpaBackendBundle:Service:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function showCreateServiceForm() {\n\t\t$this->redirectIfNoAccess('Services', 'main/showCreateServiceForm');\n\t\t$this->load->view('services_create');\n\t}", "public function actionCreate()\n {\n $model = new ServiceType();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function createAction()\n {\n $this->get('logger')->info('create a new service');\n\n $service = new Service();\n $form = $this->createForm(new ServiceCreateType(), $service);\n\n if ($this->getRequest()->getMethod() == 'POST') {\n $form->bindRequest($this->getRequest());\n\n if ($form->isValid()) {\n $this->get('service.manager')->createAndUpdateService($service);\n $this->getRequest()->getSession()->setFlash(\n 'success', 'Created service successfully');\n return $this->redirect($this->generateUrl('sked_app_service_list'));\n } else {\n $this->getRequest()->getSession()->setFlash(\n 'error', 'Failed to create service');\n }\n }\n\n return $this->render('SkedAppServiceBundle:Service:create.html.twig', array('form' => $form->createView()));\n }", "public function create()\n {\n return view('type_services.create');\n }", "public function newAction() {\n $entity = new WebService();\n $form = $this->createGenerateCForm($entity);\n $form_action = \"\";\n $gen_action = \"\";\n\n return $this->render('WebServiceBundle:WebService:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'form_action' => $form_action,\n 'gen_action' => $gen_action,\n ));\n }", "public function actionCreate()\n {\n $model = new ServiceRecord();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $serviceService = new ServiceService();\n $serviceService->emailNewService($model);\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('servicos.create');\n }", "public function newAction()\n {\n $entity = new AppelOffre();\n $form = $this->createCreateForm($entity);\n\n return $this->render('MyAppUserBundle:AppelOffre:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function actionCreate()\n {\n $model = new ServiceDoors();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id_service' => $model->id_service, 'id_doors' => $model->id_doors]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function newAction()\n {\n $entity = new Offre();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function newAction()\n {\n $entity = new Reserva();\n $user = $this->get('security.context')->getToken()->getUser();\n $em=$this->getDoctrine()->getManager();\n\t\t$status=$em->getRepository(\"VCBaseBundle:Status\")->find(1);\n\t\t$entity->setStatus($status);\n //$hoy= date(\"Y-m-d\");\n //$entity->setFechaServicio($hoy);\n if($this->get('security.context')->isGranted('ROLE_CUSTOMER')){\n $entity->setCliente($user->getCliente());\n }\n $form = $this->createForm(new ReservaType(), $entity);\n \n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view('patient_services.create');\n }", "public function createAction()\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n \"controller\" => \"servicetype\",\n 'action' => 'search'\n ]);\n\n return;\n }\n\n $service_type = new ServiceType();\n $service_type->service_type = $this->request->getPost(\"service_type\");\n $service_type->status = 1;\n\n if (!$service_type->save()) {\n foreach ($service_type->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n \"controller\" => \"servicetype\",\n 'action' => 'new'\n ]);\n\n return;\n }\n\n $this->flash->success(\"service_type was created successfully\");\n\n $this->dispatcher->forward([\n \"controller\" => \"servicetype\",\n 'action' => 'search'\n ]);\n }", "public function newAction()\n {\n $entity = new DatosdOtros();\n $form = $this->createCreateForm($entity);\n\n return $this->render('FocalAppBundle:DatosdOtros:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function actionCreate()\n {\n $model = new Csf();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n $model->service=0;\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Services();\n\t\n\t\tif (Yii::$app->request->get('parent_id'))\n\t\t\t$model->parent_id=Yii::$app->request->get('parent_id');\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(Url::previous());\n\t\t}\n\t\n\t\t$model->load(Yii::$app->request->get());\n\t\t\n\t\treturn Yii::$app->request->isAjax?\n\t\t\t$this->renderAjax('create', [\n\t\t\t\t'model' => $model,\n\t\t\t\t'modalParent' => '#modal_form_loader'\n\t\t\t]):\n\t\t\t$this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ get latest one project by county
function get_latest_by_county($county) { $this->db->select('project.*, county.name as countyName'); $this->db->join('county', 'project.county = county.no'); $this->db->where('project.county', $county); $this->db->order_by('no', 'desc'); $this->db->limit(1); return $this->db->get('project')->row(); }
[ "public function getLatestEntry() {\n return Project::with('admin_entries')->where('id', $this->project->id)->first();\n }", "function getProjectLatestUpdated ($num=5)\r\n\t{\r\n Loader::loadClass ('StatusreportUtil', 'modules/v4bProjects/classes');\r\n Loader::loadClass ('TodoUtil', 'modules/v4bProjects/classes');\r\n\r\n\t $projlist = ProjectUtil::buildProjectIDListFromPermssions ();\r\n\t $todos = TodoUtil::getTodosLatest ($num*3, $projlist);\r\n\t $statreps = StatusreportUtil::getStatusreportLatest ($num, $projlist);\r\n\t\r\n\t // now transform the arrays so we're guaranteed to have unique indexes\r\n\t $todos2 = array ();\r\n\t foreach ($todos as $k => $v)\r\n\t {\r\n\t $newkey = 'todo_' . $k;\r\n\t $v['type'] = 'todo';\r\n\t $todos2[$newkey] = $v;\r\n\t }\r\n\t\r\n\t $statreps2 = array ();\r\n\t foreach ($statreps as $k => $v)\r\n\t {\r\n\t $newkey = 'statusreport_' . $k;\r\n\t $v['type'] = 'statusreport';\r\n\t $statreps2[$newkey] = $v;\r\n\t }\r\n\t\r\n\t $objects = array_merge ($todos2, $statreps2);\r\n\t usort ($objects, 'cmpCrDate');\r\n\t\r\n\t $size = count($objects);\r\n\t $projects = array ();\r\n\t for ($i=0; $i<$size && $size<$num && isset($objects[$i]); $i++)\r\n\t {\r\n\t $obj = $objects[$i];\r\n\t $pid = ($obj['project_id'] > 0 ? $obj['project_id'] : -1);\r\n\t\r\n\t if ($pid > 0 && !array_key_exists($pid, $projects))\r\n\t {\r\n\t $project = ProjectUtil::getProject ($pid);\r\n\t\t $project['new_object_type'] = $obj['type'];\r\n\t\t $project['new_object_id'] = $obj['id'];\r\n\t\t $project['new_object_date'] = $obj['lu_date'];\r\n\t\t $project['new_object_user'] = UserUtil::getPNUserField ($obj['lu_uid'], 'uname');\r\n\t\t $projects[$pid] = $project;\r\n\t\t}\r\n\t }\r\n\t\r\n\t return $projects;\r\n\t}", "function getCountyCity($county=''){\n\t\n\t \t\tApp::import('model','City');\n\t\t $this->City = new City(); \n\t\t\t\n\t\t\t$CitiesList = $this->City->find('list', array('fields' => array('id', 'cityname'),'order' => 'City.cityname ASC','recursive' => -1,'conditions' => array('City.publish' => 'yes','City.county_id' => $county))); \n\t\t\t\n\t\t\treturn $CitiesList;\n\t }", "public static function latest() {\n $table = static::getTableName();\n\n $select_core = array_merge(\n ['t1.province', 'date'],\n static::allAttrs()\n );\n\n $select_stmt = implode( \",\", $select_core );\n\n $query = \"SELECT {$select_stmt} FROM {$table} t1 JOIN (SELECT province, MAX(`date`) as latest_date FROM {$table} group by `province`) t2 ON t1.province = t2.province AND t1.date = t2.latest_date\";\n\n $report = DB::select($query);\n\n $response = [\n 'data' => $report,\n ];\n\n return $response;\n }", "function getProject($pid)\r\n {\r\n $tblName = 'projects';\r\n $options = array('pid' => $pid);\r\n\r\n $statement = $this->select($tblName, $options);\r\n\r\n return $statement->fetch(PDO::FETCH_ASSOC);\r\n }", "public function get_latest_activity(){\n\n\t\t$projects = IndexDatabaseHelper::get_latest_projects();\t\n\t\treturn $projects;\n\n\t}", "public function getProjectWithHighestID() {\n $query = \"SELECT * FROM projects WHERE ProjectID = (SELECT MAX(ProjectID) FROM projects)\";\n try {\n $maxID = 0;\n\n $rows = $this->pdo-> query($query);\n if ($rows && $rows->rowCount() ==1) {\n $row=$rows->fetch();\n $maxID = $row[\"ProjectID\"];\n return $maxID;\n }\n }\n catch (PDOException $ex) {\n echo \"<p>Sorry, a database error occurred. Please try again.</p>\";\n echo $ex->getMessage();\n }\n }", "public static function getByIndex($index)\n\t{\n\t\t$projects = self::getAll();\n\t\treturn isset($projects[$index - 1]) ? $projects[$index - 1] : null;\n\t}", "public function getProject($id);", "function get_project($id)\n\t{\n\t\treturn $this->db->where('id', $id)->get('projects_products')->row();\n\t}", "public function getLastAppointment($projectId)\n {\n return $this->db->from('Appointment')\n ->where('idProject', $projectId)\n ->where('finalDate IS NOT NULL')\n ->where('finalDate <= CURDATE()')\n ->order_by('finalDate', 'DESC')\n ->get()\n ->row();\n }", "public static function getProjectByUrl ($url) {\n\t\t$db = Database::getDatabaseWrapper();\n\t\t\n\t\t$query = \"SELECT * FROM project WHERE url = '$url'\";\n\t\t$result = $db->query($query);\n\t\treturn $result->fetch_assoc();\n\t}", "function last_project(){\n /**\n * @var \\AWorDS\\App\\Models\\LastProjects $lastProject\n */\n $lastProject = $this->set_model('LastProjects');;\n $logged_in = $lastProject->login_check();\n if($logged_in){\n $last_project_id = $lastProject->get();\n if($last_project_id != null){\n $this->redirect(Config::WEB_DIRECTORY . 'projects/' . $last_project_id);\n }else{ // 404 Error\n $this->response(HttpStatusCode::NOT_FOUND);\n $this->set('status', HttpStatusCode::NOT_FOUND);\n }\n }else $this->redirect();\n }", "public function index()\n {\n return auth()->user()->subscribedProjects()->latest()->get();\n }", "function update_feed_api_get_project($server_key, $short_name, $api_version, $load_releases = TRUE, $type = 'module') {\n $project = Project_factory::load_project($server_key, $short_name, $api_version, $load_releases, $type);\n return $project;\n}", "public function getProject(){\n\t\t\t$res = $this->request('projects.json');\n\t\t\treturn $this->writeFile($res,'projects.json');\n\t\t}", "public function getProject($project_id){\n $project_id = intval(trim($project_id));\n $sql = \"SELECT * \n FROM projects \n WHERE id = ?\";\n $query = $this->db->prepare($sql);\n $query->bindParam(1, $project_id);\n $query->execute();\n return $query->fetch();\n }", "public function getNewestVersionOfProject ($projectId) {\r\n\t\t$db = new DB();\r\n\t\t$db->connect();\r\n\t\t\r\n\t\t$projectId = $db->esc($projectId);\r\n\t\t\t\t\r\n\t\t$sql = \"SELECT * FROM `version` \r\n\t\t\t\tWHERE project_id = \".$projectId.\"\r\n\t\t\t\tORDER BY isReleased DESC, doneDate DESC\r\n\t\t\t\tLIMIT 1\";\r\n\t\t$result = $db->query($sql);\r\n\t\t$version = \"no version available\";\r\n\t\tif ($result->num_rows != 0) {\r\n\t\t\t$dbversion = $result->fetch_assoc();\r\n\t\t\t$version = $dbversion[\"name\"];\r\n\t\t}\r\n\t\treturn $version;\r\n\t}", "public function readOneProject($projectId) {\n $readQuery = 'SELECT *, projects.Id AS \"project_id\", students.Id AS \"student_id\"\n FROM projects JOIN students ON projects.StudentId = students.Id \n WHERE projects.Id = :id';\n $readStmt = $this->db->prepare($readQuery);\n $readStmt->bindValue(':id', $projectId, PDO::PARAM_INT);\n $readStmt->execute();\n return $readStmt->fetch(PDO::FETCH_ASSOC);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$transactionkey this is the MML assigned key for this form $keys an already prepared list of current keys
function __construct($transactionkey, $keys = null) { $this->transaction_key = $transactionkey; $this->mapping_keys = array(); $this->grouping_keys = array(); if ($keys != null) { foreach ($keys as $key => $value) { $this->mapping_keys[$key] = $value; } } $this->mapped_procedures = array(); $this->current_keys = array(); }
[ "function processMasterKeyValue() \r\n\t{\r\n\t\tparent::processMasterKeyValue();\r\n\t\tfor($i = 1; $i <= count($this->masterKeysReq); $i++)\r\n\t\t\t$this->dpMasterKey[] = $this->masterKeysReq[$i];\r\n\t}", "function SetupKeyValues($key) {\n\t\tglobal $mst_vendor;\n\t\t$sKeyFld = $key;\n\t\t$mst_vendor->kode->CurrentValue = $sKeyFld;\n\t\treturn TRUE;\n\t}", "public function computeKey(){\r\n\t\t\r\n\t\tif($this->data->id){\r\n\t\t\tif (!$this->data->options) {\r\n\t\t\t\t$this->data->key = $this->data->id;\r\n\t\t\t} else {\r\n\t\t\t\t$this->data->key = $this->data->id . ':' . implode('|', $this->data->options);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//check to make sure the item exits, and that there are enough inventory\r\n\t}", "function _setupKey()\n {\n if (isset($this->kl['key']) && $this->key === $this->kl['key']) {\n // already expanded\n return;\n }\n $this->kl = array('key' => $this->key);\n\n /* Key expanding and generating the key-depended s-boxes */\n $le_longs = unpack('V*', $this->key);\n $key = unpack('C*', $this->key);\n $m0 = $this->m0;\n $m1 = $this->m1;\n $m2 = $this->m2;\n $m3 = $this->m3;\n $q0 = $this->q0;\n $q1 = $this->q1;\n\n $K = $S0 = $S1 = $S2 = $S3 = array();\n\n switch (strlen($this->key)) {\n case 16:\n list($s7, $s6, $s5, $s4) = $this->_mdsrem($le_longs[1], $le_longs[2]);\n list($s3, $s2, $s1, $s0) = $this->_mdsrem($le_longs[3], $le_longs[4]);\n for ($i = 0, $j = 1; $i < 40; $i+= 2, $j+= 2) {\n $A = $m0[$q0[$q0[$i] ^ $key[ 9]] ^ $key[1]] ^\n $m1[$q0[$q1[$i] ^ $key[10]] ^ $key[2]] ^\n $m2[$q1[$q0[$i] ^ $key[11]] ^ $key[3]] ^\n $m3[$q1[$q1[$i] ^ $key[12]] ^ $key[4]];\n $B = $m0[$q0[$q0[$j] ^ $key[13]] ^ $key[5]] ^\n $m1[$q0[$q1[$j] ^ $key[14]] ^ $key[6]] ^\n $m2[$q1[$q0[$j] ^ $key[15]] ^ $key[7]] ^\n $m3[$q1[$q1[$j] ^ $key[16]] ^ $key[8]];\n $B = ($B << 8) | ($B >> 24 & 0xff);\n $K[] = $A+= $B;\n $K[] = (($A+= $B) << 9 | $A >> 23 & 0x1ff);\n }\n for ($i = 0; $i < 256; ++$i) {\n $S0[$i] = $m0[$q0[$q0[$i] ^ $s4] ^ $s0];\n $S1[$i] = $m1[$q0[$q1[$i] ^ $s5] ^ $s1];\n $S2[$i] = $m2[$q1[$q0[$i] ^ $s6] ^ $s2];\n $S3[$i] = $m3[$q1[$q1[$i] ^ $s7] ^ $s3];\n }\n break;\n case 24:\n list($sb, $sa, $s9, $s8) = $this->_mdsrem($le_longs[1], $le_longs[2]);\n list($s7, $s6, $s5, $s4) = $this->_mdsrem($le_longs[3], $le_longs[4]);\n list($s3, $s2, $s1, $s0) = $this->_mdsrem($le_longs[5], $le_longs[6]);\n for ($i = 0, $j = 1; $i < 40; $i+= 2, $j+= 2) {\n $A = $m0[$q0[$q0[$q1[$i] ^ $key[17]] ^ $key[ 9]] ^ $key[1]] ^\n $m1[$q0[$q1[$q1[$i] ^ $key[18]] ^ $key[10]] ^ $key[2]] ^\n $m2[$q1[$q0[$q0[$i] ^ $key[19]] ^ $key[11]] ^ $key[3]] ^\n $m3[$q1[$q1[$q0[$i] ^ $key[20]] ^ $key[12]] ^ $key[4]];\n $B = $m0[$q0[$q0[$q1[$j] ^ $key[21]] ^ $key[13]] ^ $key[5]] ^\n $m1[$q0[$q1[$q1[$j] ^ $key[22]] ^ $key[14]] ^ $key[6]] ^\n $m2[$q1[$q0[$q0[$j] ^ $key[23]] ^ $key[15]] ^ $key[7]] ^\n $m3[$q1[$q1[$q0[$j] ^ $key[24]] ^ $key[16]] ^ $key[8]];\n $B = ($B << 8) | ($B >> 24 & 0xff);\n $K[] = $A+= $B;\n $K[] = (($A+= $B) << 9 | $A >> 23 & 0x1ff);\n }\n for ($i = 0; $i < 256; ++$i) {\n $S0[$i] = $m0[$q0[$q0[$q1[$i] ^ $s8] ^ $s4] ^ $s0];\n $S1[$i] = $m1[$q0[$q1[$q1[$i] ^ $s9] ^ $s5] ^ $s1];\n $S2[$i] = $m2[$q1[$q0[$q0[$i] ^ $sa] ^ $s6] ^ $s2];\n $S3[$i] = $m3[$q1[$q1[$q0[$i] ^ $sb] ^ $s7] ^ $s3];\n }\n break;\n default: // 32\n list($sf, $se, $sd, $sc) = $this->_mdsrem($le_longs[1], $le_longs[2]);\n list($sb, $sa, $s9, $s8) = $this->_mdsrem($le_longs[3], $le_longs[4]);\n list($s7, $s6, $s5, $s4) = $this->_mdsrem($le_longs[5], $le_longs[6]);\n list($s3, $s2, $s1, $s0) = $this->_mdsrem($le_longs[7], $le_longs[8]);\n for ($i = 0, $j = 1; $i < 40; $i+= 2, $j+= 2) {\n $A = $m0[$q0[$q0[$q1[$q1[$i] ^ $key[25]] ^ $key[17]] ^ $key[ 9]] ^ $key[1]] ^\n $m1[$q0[$q1[$q1[$q0[$i] ^ $key[26]] ^ $key[18]] ^ $key[10]] ^ $key[2]] ^\n $m2[$q1[$q0[$q0[$q0[$i] ^ $key[27]] ^ $key[19]] ^ $key[11]] ^ $key[3]] ^\n $m3[$q1[$q1[$q0[$q1[$i] ^ $key[28]] ^ $key[20]] ^ $key[12]] ^ $key[4]];\n $B = $m0[$q0[$q0[$q1[$q1[$j] ^ $key[29]] ^ $key[21]] ^ $key[13]] ^ $key[5]] ^\n $m1[$q0[$q1[$q1[$q0[$j] ^ $key[30]] ^ $key[22]] ^ $key[14]] ^ $key[6]] ^\n $m2[$q1[$q0[$q0[$q0[$j] ^ $key[31]] ^ $key[23]] ^ $key[15]] ^ $key[7]] ^\n $m3[$q1[$q1[$q0[$q1[$j] ^ $key[32]] ^ $key[24]] ^ $key[16]] ^ $key[8]];\n $B = ($B << 8) | ($B >> 24 & 0xff);\n $K[] = $A+= $B;\n $K[] = (($A+= $B) << 9 | $A >> 23 & 0x1ff);\n }\n for ($i = 0; $i < 256; ++$i) {\n $S0[$i] = $m0[$q0[$q0[$q1[$q1[$i] ^ $sc] ^ $s8] ^ $s4] ^ $s0];\n $S1[$i] = $m1[$q0[$q1[$q1[$q0[$i] ^ $sd] ^ $s9] ^ $s5] ^ $s1];\n $S2[$i] = $m2[$q1[$q0[$q0[$q0[$i] ^ $se] ^ $sa] ^ $s6] ^ $s2];\n $S3[$i] = $m3[$q1[$q1[$q0[$q1[$i] ^ $sf] ^ $sb] ^ $s7] ^ $s3];\n }\n }\n\n $this->K = $K;\n $this->S0 = $S0;\n $this->S1 = $S1;\n $this->S2 = $S2;\n $this->S3 = $S3;\n }", "function SetupKeyValues($key) {\n\t\tglobal $users;\n\t\t$sKeyFld = $key;\n\t\tif (!is_numeric($sKeyFld))\n\t\t\treturn FALSE;\n\t\t$users->PK_NGUOIDUNG_ID->CurrentValue = $sKeyFld;\n\t\treturn TRUE;\n\t}", "protected function processBlocktrailPubKeys() {\n //create QR codes for each blocktrail pub key\n foreach ($this->blocktrailPublicKeys as $keyIndex => $key) {\n $qrCode = new QrCode();\n $qrCode\n ->setText($key->key())\n ->setSize(self::QR_CODE_SIZE-20)\n ->setPadding(10)\n ->setErrorCorrection('high')\n ->setForegroundColor(array('r' => 0, 'g' => 0, 'b' => 0, 'a' => 0))\n ->setBackgroundColor(array('r' => 255, 'g' => 255, 'b' => 255, 'a' => 0))\n ->setLabel(\"KeyIndex: \".$keyIndex.\" Path: \".$key->path())\n ->setLabelFontSize(10)\n ;\n $this->blocktrailPubKeyQRs[] = array(\n 'keyIndex' => $keyIndex,\n 'path' => $key->path(),\n 'qr' => $qrCode->getDataUri(),\n 'qrImg' => $qrCode->getImage(),\n );\n }\n }", "function SetupKeyValues($key) {\r\n\t\tglobal $rekeningju;\r\n\t\t$arrKeyFlds = explode(EW_COMPOSITE_KEY_SEPARATOR, $key);\r\n\t\tif (count($arrKeyFlds) >= 1) {\r\n\t\t\t$rekeningju->kode_otomatis->setFormValue($arrKeyFlds[0]);\r\n\t\t}\r\n\t\treturn TRUE;\r\n\t}", "abstract protected function getUpdateListKey();", "function set_current_key($new_key) {\n $this->current_key=$new_key;\n}", "function SetupKeyValues($key) {\n\t\tglobal $t_thongbao_mainsite;\n\t\t$sKeyFld = $key;\n\t\tif (!is_numeric($sKeyFld))\n\t\t\treturn FALSE;\n\t\t$t_thongbao_mainsite->PK_THONGBAO->CurrentValue = $sKeyFld;\n\t\treturn TRUE;\n\t}", "function SetupKeyValues($key) {\n\t\t$sKeyFld = $key;\n\t\tif (!is_numeric($sKeyFld))\n\t\t\treturn FALSE;\n\t\t$this->codigo->CurrentValue = $sKeyFld;\n\t\treturn TRUE;\n\t}", "function keys() {\n $this->auth(COMP_ADM_LEVEL);\n $contest_id = $this->uri->segment(3);\n $data['contest_id'] = $contest_id;\n if ($this->session->userdata('role_level') > SUPPORT_ADM_LEVEL) {\n $this->load->view('snippets/v_keys_add', $data);\n }\n $this->_showKeyList($contest_id);\n //$data['free_keys'] = $this->m_key->getFreeKeysByContestId($contest_id);\n //$this->load->view('admin/company_admin/v_keys', $data);\n }", "private function fetch_bulk_keys() {\n $json = $this->fetch_json($this->base_url . 'storage/crypto/keys');\n $keys = $this->c_decrypt(json_decode($json->payload), 'crypto');\n $default_keys = json_decode($keys);\n $this->bulk_keys = array('default' => \n base64_decode($default_keys->default[0]));\n }", "protected function UpdateBasketItemKey()\n {\n $aParts = array('id' => $this->id);\n $this->sBasketItemKey = md5(serialize($aParts));\n }", "function set_key($key)\n\t{\n\t\tif(empty($key) || !isset($GLOBALS['ACCESS_KEYS'][$key])) return;\n\t\tif(ACCESS_MODEL === \"roles\") {\n\t\t\tforeach($GLOBALS['ACCESS_KEYS'][$key] as $k) {\n\t\t\t\tif(substr($k, 0, 1) == '@') {\n\t\t\t\t\t// This key references another role - pull in all keys from that role\n\t\t\t\t\t$this->set_key(substr($k, 1));\n\t\t\t\t} else {\n\t\t\t\t\t$this->access_keys[] = $k;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(ACCESS_MODEL === \"discrete\") {\n\t\t\t$this->access_keys[] = $key;\n\t\t}\n\n\t\t$_SESSION['_ACCESS']['keys'] = $this->access_keys;\n\t}", "function MyHash_HashesList_Key($list,$key=\"ID\")\n {\n $rlist=array();\n foreach (array_keys($list) as $id)\n {\n $val=$list[ $id ][ $key ];\n $this->MyHash_Value_Save_Set($rlist,$val);\n array_push($rlist[ $val ],$list[ $id ]);\n }\n\n return $rlist;\n }", "public function library_data_key_v_and_m()\r\n {\r\n // This array store all the keys need to be change from view to model\r\n // Format: \r\n // \"view_key_name\" => \"model_key_name\"\r\n $array_key_change = array(\r\n // Common info\r\n \"common__user_id\" => \"users_id\",\r\n \"common__company_user_id\" => \"aroundyou_users_id\",\r\n \"common__company_id\" => \"aroundyou_company_id\",\r\n \"common__company_user_activated\" => \"aroundyou_users__activated\",\r\n \"common__users_modification\" => \"aroundyou_users__modified\",\r\n \"common__company_modification\" => \"aroundyou_company__modified\",\r\n \r\n // admin changable info\r\n \"admin_user__banned\" => \"aroundyou_users__banned\",\r\n \"admin_user__ban_reason\" => \"aroundyou_users__ban_reason\",\r\n \"admin_user__company_count_limit\" => \"aroundyou_users__company_count_limit\",\r\n \"admin_company__product_count_limit\" => \"aroundyou_company__product_count_limit\",\r\n \"admin_company__benefit_count_limit\" => \"aroundyou_company__benefit_count_limit\",\r\n \"admin_company__activated\" => \"aroundyou_company__activated\",\r\n \"admin_company__activated_date\" => \"aroundyou_company__activate_date\",\r\n \"admin_company__activated_duration\" => \"aroundyou_company__duration\",\r\n \r\n // Company information\r\n \"info__company_ref_tag\" => \"aroundyou_company__ref_tag\",\r\n \"info__company_logo\" => \"aroundyou_company__logo\",\r\n \"info__company_phone\" => \"aroundyou_company__phone\",\r\n \"info__company_fax\" => \"aroundyou_company__fax\",\r\n \"info__company_email\" => \"aroundyou_company__email\",\r\n \"info__company_about_us\" => \"aroundyou_company__about_us_intro\",\r\n \"info__company_head_pic\" => \"aroundyou_company__detail_head_pic\",\r\n \r\n // Operation period\r\n \"operation__period_display\" => \"aroundyou_operation_period__display\",\r\n \"operation__period_type\" => \"aroundyou_operation_period__type\",\r\n \"operation__period_one_time\" => \"aroundyou_operation_period__one_time\",\r\n \"operation__time_start\" => \"aroundyou_company__operation_time_start\",\r\n \"operation__time_end\" => \"aroundyou_company__operation_time_end\",\r\n \"operation__auto\" => \"aroundyou_company__operation_auto\",\r\n \"operation__manual_date_start\" => \"aroundyou_company__operation_manual_date_start\",\r\n \r\n // Company type\r\n \"company_type__main\" => \"aroundyou_company_type__main_category\",\r\n \"company_type__sub\" => \"aroundyou_company_type__sub_category\",\r\n \r\n // Company product and benefit -- No need this as the it will handle seperately\r\n //\"info__company_product_list\" => [],\r\n //\"info__company_benefit_list\" => [],\r\n \r\n // Location -- No need this as we convert when link to corresponding table\r\n //\"location__company_country\" => \"country\",\r\n //\"location__company_state\" => \"state\",\r\n //\"location__company_area\" => \"area\",\r\n //\"location__company_post_code\" => \"post_code\",\r\n //\"location__company_map\" => \"map_location\",\r\n //\"location__company_street\" => \"street\",\r\n //\"location__company_property_name\" => \"property_name\"\r\n \r\n );\r\n \r\n return $array_key_change;\r\n }", "private function createKeys() {\n foreach ( $this->_connection_types as $connection ) {\n $this->keys[ $connection ] = array();\n }\n\n for ( $t = 0; $t < $this->times; $t++ ) {\n $key = $this->_randomString(); \n $value = $this->_randomString( rand( 1, 2000 ) );\n foreach ( $this->_connection_types as $connection ) {\n $this->keys[ $connection ][] = array( \n 'key' => $key . $connection,\n 'value' => $value\n );\n }\n }\n }", "public function data_key_v_and_m()\r\n {\r\n // This array store all the keys need to be change from view to model\r\n // Format: \r\n // \"view_key_name\" => \"model_key_name\"\r\n $array_key_change = array(\r\n \r\n );\r\n \r\n return $array_key_change;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test botRoll, when rolls left
public function testBotRoll() { $bot = new Bot(3); $this->assertInstanceOf("\Ida\Dice\bot", $bot); $bot->rollCount = 3; $res = $bot->botRoll(); $exp = false; $this->assertEquals($exp, $res); }
[ "public function testBotRoll()\n {\n $game = new DiceGame(4, 1);\n $this->assertInstanceOf(\"\\Ida\\Dice\\DiceGame\", $game);\n $game->setOrder();\n \n $current = $game->getPlayerTurn();\n \n function reRoll($current, $game)\n {\n while ($current === 0) {\n $game->nextTurn();\n $current = $game->getPlayerTurn();\n }\n \n $game->BotRoll();\n return [$game->getPlayerTurn(), $current];\n }\n\n $player = reRoll($current, $game);\n while ($player[0] === 0) {\n $player = reRoll($current, $game);\n }\n \n $this->assertEquals($player[0], $player[1]);\n }", "public function testLastRollTwentyOne()\n {\n $this->diceHand->roll();\n $res = $this->diceHand->lastRoll();\n $this->assertIsString($res);\n }", "public function testPlayerRoll()\n {\n $game = new DiceGame(4, 1);\n $this->assertInstanceOf(\"\\Ida\\Dice\\DiceGame\", $game);\n $game->setOrder();\n \n $current = $game->getPlayerTurn();\n \n function reDo($current, $game)\n {\n while ($current != 0) {\n $game->nextTurn();\n $current = $game->getPlayerTurn();\n }\n \n $game->playerRoll();\n return [$game->getPlayerTurn(), $current];\n }\n\n $player = reDo($current, $game);\n while ($player[0] != 0) {\n $player = reDo($current, $game);\n }\n \n $this->assertEquals($player[0], $player[1]);\n }", "public function roll()\n {\n if ($this->hasWon) {\n $this->resetVariables();\n }\n\n $this->playerMessage = null;\n $diceResult = $this->dice->roll();\n if ($diceResult == self::LOSING_SCORE_NO) {\n $this->score = 0;\n $this->playerMessage = \"Det blev en etta. Du förlorade alla poäng du inte hade sparat!\";\n } else {\n $this->score += $diceResult;\n }\n\n $this->checkIfPlayerHasWon();\n }", "public function testGetLastRollGameDice()\n {\n $this->diceHand->roll();\n $res = $this->diceHand->getLastRoll();\n $this->assertIsArray($res);\n }", "public function testGetLastRollBeforeRoll()\n {\n $res = $this->dice->getLastRoll();\n $exp = null;\n $this->assertEquals($exp, $res);\n }", "public function testFailRoll()\n {\n $dice = new Dice(1);\n $this->assertInstanceOf(\"\\Elpr\\Dice\\Dice\", $dice);\n\n $res = $dice->roll();\n $exp = 2;\n $this->assertNotEquals($exp, $res);\n }", "public function testRollHandTwentyOne()\n {\n $res = $this->diceHand->roll();\n $this->assertIsInt($res);\n }", "public function testGetLastRoll()\n {\n $dice = new GraphicalDice();\n $dice->roll();\n $res = $dice->getLastRoll();\n $this->assertIsInt($res);\n }", "public function testGetLastRoll()\n {\n $dice = new Dice();\n // $this->assertInstanceOf(\"\\PJH\\Dice\\Dice\", $dice);\n\n $res = $dice->rollDice();\n $exp = $dice->getLastRoll();\n $this->assertEquals($exp, $res);\n }", "public function testEndOrderRolls()\n {\n $game = new Game(4, 3);\n $this->assertInstanceOf(\"\\Erjh17\\Dice\\Game\", $game);\n\n $game->startGame();\n\n $game->orderRoll(6);\n\n $game->endOrderRolls();\n\n $res = $game->getRoundPoints();\n $exp = 0;\n $this->assertEquals($exp, $res);\n\n $res = $game->isPlaying();\n $exp = true;\n $this->assertEquals($exp, $res);\n }", "public function actionRollDices() {\n\t\tMexGame::getInstance()->rollDices();\n\t\t$throw = MexGame::getInstance()->getThrownScore();\n\t\t$mayRollAgain = MexGame::getInstance()->getMayRollAgain();\n\t\tWebSocketRequest::reply('throw-response', array('score' => $throw, 'mayrollagain' => $mayRollAgain));\n\t}", "public function continueRoll(): void\n {\n //Roll\n $this->playerRolls();\n\n //Check if player has reached 21 and round is finished.\n if ($_SESSION[\"playerSum\"] > 21) {\n $_SESSION[\"result\"] = \"Tyvärr! Du förlorade!\";\n $_SESSION[\"scoreComputer\"] += 1;\n\n $_SESSION[\"state\"] = 3;\n } else if ($_SESSION[\"playerSum\"] == 21) {\n $_SESSION[\"result\"] = \"Grattis, Du fick 21!\";\n }\n }", "public function testGetNumRollsLeft(): void\n {\n $this->game->startRound();\n $this->assertSame($this->game->getNumRollsLeft(), 3);\n }", "public function testNewRoll()\n {\n $game = new Game();\n $game->playGame(2);\n $firstValues = $game->getValues();\n $game->newRoll();\n $secondValues = $game->getValues();\n $this->assertNotEquals($firstValues, $secondValues);\n }", "public function testNotClearWinner()\n {\n $game = new Game();\n $game->setDiceCount(40);\n\n $game->roll();\n\n $this->assertNotNull($game->getWinner());\n }", "public function testCheckYatzy()\n {\n $this->game->diceHand->roll();\n $res = $this->game->checkYatzy();\n $this->assertFalse($res);\n }", "public function testCreateObjectAndRollUnsuccessfully()\n {\n $diceGame = new DiceGame(3); //two players by default\n $diceGame->setFirstPlayer();\n $first = $diceGame->currPlayer();\n\n //roll until miss, which will change player\n do {\n $roll = $diceGame->roll();\n $res = in_array(\"dice-1\", $roll);\n } while ($res != true);\n\n $second = $diceGame->currPlayer();\n $this->assertFalse($first === $second);\n\n //roll until miss again, which will change back to first player\n do {\n $roll = $diceGame->roll();\n $res = in_array(\"dice-1\", $roll);\n } while ($res != true);\n\n $first = $diceGame->currPlayer();\n $this->assertFalse($first === $second);\n\n //Check that sum = 0\n $res = $diceGame->sum();\n $this->assertEquals(0, $res);\n }", "public function testRollOneDice()\n {\n $game = new Game([\"Computer\", \"Me\"], 100, 1);\n $this->assertInstanceOf(\"\\Peo\\Dice\\Game\", $game);\n\n // Check that every roll is between 1 and 6\n $min = 100;\n $max = 0;\n for ($i = 0; $i < 100; $i++) {\n $game->roll();\n $current = $game->getSumCurrent();\n if ($current > $max) {\n $max = $current;\n }\n if ($current < $min) {\n $min = $current;\n }\n $game->resetSumCurrent();\n }\n $this->assertLessThanOrEqual(6, $max);\n $this->assertGreaterThanOrEqual(1, $min);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns current service type Equivalent of Mvc_Router::getCurrentRouterInstance()>getServiceType()
public static function getCurrentServiceType() { return Mvc_Router::getCurrentRouterInstance()->getServiceType(); }
[ "public function getServiceType()\n\t{\n\t\treturn $this->_service_type;\n\t}", "public function getServiceTypeId() {\n\t\treturn $this->_serviceTypeId;\n\t}", "public function getServiceTypeId() {\n return $this->serviceTypeId;\n }", "public function getServiceTypeId()\n\t{\n\t\treturn $this->serviceTypeId;\n\t}", "function getServiceType($service)\n {\n $service = strtolower($service);\n return isset(self::$_serviceTypes[$service]) ? self::$_serviceTypes[$service] : null;\n }", "public function currentTransportType()\n {\n if (!$this->_transport) {\n return '';\n }\n return $this->_transport->getType();\n }", "public function getRouteType()\n\t{\n\t\treturn $this->route_type;\n\t}", "public function getService()\n {\n\n if (preg_match('/^2\\./', $this->getVersion())) {\n $service = 'get';\n } else {\n $service = 'objects';\n }\n\n return $service;\n\n }", "public function getRoutingType()\n {\n return $this->routing_type;\n }", "public function getCurrentType(): string\n {\n return $this->_currentType;\n }", "abstract protected function getControllerType();", "public function getService() {\n return $this->jobTypeService->service;\n }", "public function getTransportType();", "public function getLeaderboardTypeService()\n {\n if (null === $this->leaderboardTypeService) {\n $this->leaderboardTypeService = $this->getServiceLocator()->get(\n \\PlaygroundReward\\Service\\LeaderboardType::class\n );\n }\n\n return $this->leaderboardTypeService;\n }", "public function getServicePrincipalType()\n {\n if (array_key_exists(\"servicePrincipalType\", $this->_propDict)) {\n return $this->_propDict[\"servicePrincipalType\"];\n } else {\n return null;\n }\n }", "public function getInstanceType()\n {\n return $this->_resourceProperty->getInstanceType();\n }", "public function getServicePlanType()\n {\n if (array_key_exists(\"servicePlanType\", $this->_propDict)) {\n return $this->_propDict[\"servicePlanType\"];\n } else {\n return null;\n }\n }", "public function getRouteObjType()\n {\n return $this->routeObjType;\n }", "public function getServiceClass()\n {\n return AppServlet::SERVICE_CLASS;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the public 'app.eventlistener.userlistener' shared autowired service.
protected function getApp_Eventlistener_UserlistenerService() { include_once \dirname(__DIR__, 4).'/src/EventListener/UserListener.php'; return $this->services['app.eventlistener.userlistener'] = new \App\EventListener\UserListener(($this->services['security.token_storage'] ?? $this->getSecurity_TokenStorageService()), $this); }
[ "protected function getFosUser_UserListenerService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/friendsofsymfony/user-bundle/Doctrine/UserListener.php';\n\n return $this->privates['fos_user.user_listener'] = new \\FOS\\UserBundle\\Doctrine\\UserListener(($this->privates['fos_user.util.password_updater'] ?? $this->getFosUser_Util_PasswordUpdaterService()), ($this->privates['fos_user.util.canonical_fields_updater'] ?? $this->getFosUser_Util_CanonicalFieldsUpdaterService()));\n }", "protected function getApplicationUser_UserLocaleListenerService()\n {\n return $this->services['application_user.user_locale_listener'] = new \\AppBundle\\EventListener\\User\\UserLocaleListener(${($_ = isset($this->services['session']) ? $this->services['session'] : $this->get('session')) && false ?: '_'});\n }", "protected function getFosUser_Listener_AuthenticationService()\n {\n return $this->services['fos_user.listener.authentication'] = new \\FOS\\UserBundle\\EventListener\\AuthenticationListener(${($_ = isset($this->services['fos_user.security.login_manager']) ? $this->services['fos_user.security.login_manager'] : $this->get('fos_user.security.login_manager')) && false ?: '_'}, 'main');\n }", "public function getUserService()\n {\n return $this->getService('user');\n }", "private function getServiceUser()\n {\n return $this->container->get('app_service_user');\n }", "protected function getSylius_Listener_OauthUser_ReloaderService()\n {\n return $this->services['sylius.listener.oauth_user.reloader'] = new \\Sylius\\Bundle\\UserBundle\\EventListener\\UserReloaderListener(${($_ = isset($this->services['sylius.oauth_user.reloader']) ? $this->services['sylius.oauth_user.reloader'] : $this->get('sylius.oauth_user.reloader')) && false ?: '_'});\n }", "protected function getSecurity_UserCheckerService()\n {\n return $this->services['security.user_checker'] = new \\Symfony\\Component\\Security\\Core\\User\\UserChecker();\n }", "protected function getFosUser_UserCheckerService()\n {\n return $this->services['fos_user.user_checker'] = new \\Symfony\\Component\\Security\\Core\\User\\UserChecker();\n }", "public function getUserService()\n {\n if (! $this->userService) {\n $this->userService = $this->getServiceLocator()->get('playgrounduser_user_service');\n }\n \n return $this->userService;\n }", "protected function getSensioFrameworkExtra_Security_ListenerService()\n {\n return $this->services['sensio_framework_extra.security.listener'] = new \\Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\SecurityListener(NULL, new \\Sensio\\Bundle\\FrameworkExtraBundle\\Security\\ExpressionLanguage(), NULL, NULL, NULL, NULL);\n }", "public function getUserService()\n {\n return $this->userService;\n }", "protected function getSylius_Listener_OrderUserService()\n {\n return $this->services['sylius.listener.order_user'] = new \\Sylius\\Bundle\\CoreBundle\\EventListener\\OrderUserListener($this->get('security.context'));\n }", "protected function getSensioFrameworkExtra_Security_ListenerService()\n {\n return $this->services['sensio_framework_extra.security.listener'] = new \\Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\SecurityListener(NULL, new \\Sensio\\Bundle\\FrameworkExtraBundle\\Security\\ExpressionLanguage(), ${($_ = isset($this->services['security.authentication.trust_resolver']) ? $this->services['security.authentication.trust_resolver'] : $this->getSecurity_Authentication_TrustResolverService()) && false ?: '_'}, ${($_ = isset($this->services['security.role_hierarchy']) ? $this->services['security.role_hierarchy'] : $this->getSecurity_RoleHierarchyService()) && false ?: '_'}, $this->get('security.token_storage', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('security.authorization_checker', ContainerInterface::NULL_ON_INVALID_REFERENCE));\n }", "protected function getSensioFrameworkExtra_Security_ListenerService()\n {\n return $this->privates['sensio_framework_extra.security.listener'] = new \\Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\SecurityListener(($this->privates['framework_extra_bundle.argument_name_convertor'] ?? $this->getFrameworkExtraBundle_ArgumentNameConvertorService()), new \\Sensio\\Bundle\\FrameworkExtraBundle\\Security\\ExpressionLanguage(), ($this->privates['security.authentication.trust_resolver'] ?? ($this->privates['security.authentication.trust_resolver'] = new \\Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationTrustResolver())), ($this->privates['security.role_hierarchy'] ?? $this->getSecurity_RoleHierarchyService()), ($this->services['security.token_storage'] ?? $this->getSecurity_TokenStorageService()), ($this->services['security.authorization_checker'] ?? $this->getSecurity_AuthorizationCheckerService()), ($this->privates['monolog.logger'] ?? $this->getMonolog_LoggerService()));\n }", "protected function getSensioFrameworkExtra_Security_ListenerService()\n {\n return $this->privates['sensio_framework_extra.security.listener'] = new \\Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\SecurityListener(($this->privates['framework_extra_bundle.argument_name_convertor'] ?? $this->getFrameworkExtraBundle_ArgumentNameConvertorService()), new \\Sensio\\Bundle\\FrameworkExtraBundle\\Security\\ExpressionLanguage(), ($this->privates['security.authentication.trust_resolver'] ?? ($this->privates['security.authentication.trust_resolver'] = new \\Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationTrustResolver(NULL, NULL))), ($this->privates['security.role_hierarchy'] ?? $this->getSecurity_RoleHierarchyService()), ($this->services['security.token_storage'] ?? $this->getSecurity_TokenStorageService()), ($this->services['security.authorization_checker'] ?? $this->getSecurity_AuthorizationCheckerService()), ($this->privates['monolog.logger'] ?? $this->getMonolog_LoggerService()));\n }", "protected function getSensioFrameworkExtra_Security_ListenerService()\n {\n return $this->privates['sensio_framework_extra.security.listener'] = new \\Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\SecurityListener(($this->privates['framework_extra_bundle.argument_name_convertor'] ?? $this->getFrameworkExtraBundle_ArgumentNameConvertorService()), NULL, ($this->privates['security.authentication.trust_resolver'] ?? ($this->privates['security.authentication.trust_resolver'] = new \\Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationTrustResolver())), new \\Symfony\\Component\\Security\\Core\\Role\\RoleHierarchy([]), ($this->services['security.token_storage'] ?? $this->getSecurity_TokenStorageService()), ($this->services['security.authorization_checker'] ?? $this->getSecurity_AuthorizationCheckerService()), ($this->privates['logger'] ?? ($this->privates['logger'] = new \\Symfony\\Component\\HttpKernel\\Log\\Logger())));\n }", "protected function getAuthenticationListenerService()\n {\n return $this->services['OpenCFP\\Infrastructure\\Event\\AuthenticationListener'] = new \\OpenCFP\\Infrastructure\\Event\\AuthenticationListener(${($_ = isset($this->services['OpenCFP\\Infrastructure\\Auth\\SentinelAuthentication']) ? $this->services['OpenCFP\\Infrastructure\\Auth\\SentinelAuthentication'] : $this->getSentinelAuthenticationService()) && false ?: '_'}, ${($_ = isset($this->services['router']) ? $this->services['router'] : $this->getRouterService()) && false ?: '_'});\n }", "private function getUserService()\n {\n if (!$this->userService) {\n $this->userService = $this->get('UserService');\n }\n return $this->userService;\n }", "protected function getSylius_Listener_UserUpdateService()\n {\n return $this->services['sylius.listener.user_update'] = new \\Sylius\\Bundle\\CoreBundle\\EventListener\\UserUpdateListener($this->get('fos_user.user_manager'));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Answers if the word is product brand.
public function isBrand() { return $this->_type === self::TYPE_BRAND; }
[ "private function setBrandName() {\n\t\t$wordName = htmlspecialchars_decode(urldecode($this->request->REQUEST['word_name']));\n\t\tif (!empty($wordName)) {\n\t\t\t$this->wordName = $wordName;\t\n\t\t}\n\t\treturn TRUE;\n\t}", "public function hasBrand(): bool;", "public function brand()\n {\n return $this->mainproduct->brand();\n }", "public function hasBrand() : bool;", "public function get_product_brand() {\n\t\t$product = $this->get_product();\n\t\tif ( ! is_object( $product ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $this->get_brands( $product->get_id() );\n\t}", "public function getBrand()\r\n {\r\n $type = $this->_get('brand');\r\n if ($type == 'Kid' )\r\n {\r\n $type = 'Diesel ' . $type;\r\n } \r\n return $type;\r\n }", "public function getProductBrand()\n {\n return isset($this->product_brand) ? $this->product_brand : '';\n }", "public function getProd_brand()\n {\n return $this->prod_brand;\n }", "public function getBrand()\n {\n foreach ($this->getSupportedBrands() as $brand => $val) {\n if (preg_match($val, $this->getNumber())) {\n return $brand;\n }\n }\n }", "public function brand()\n {\n return $this->brand;\n }", "function get_wordpress_brand() {\n\t\tglobal $rosetta;\n\n\t\tif ( ! isset( $rosetta ) ) {\n\t\t\treturn 'WordPress.org';\n\t\t}\n\n\t\t$root_id = $rosetta->get_root_site_id();\n\t\t$name = get_blog_option( $root_id, 'blogname' );\n\n\t\tif ( false !== strpos( $name, 'WordPress' ) ) {\n\t\t\treturn $name;\n\t\t}\n\n\t\treturn \"WordPress.org $name\";\n\t}", "public function get_brand()\n {\n return $this->brand;\n }", "public function getProductBrandUnwrapped()\n {\n return $this->readWrapperValue(\"product_brand\");\n }", "public function hasDeviceBrand()\n {\n return $this->get(self::DEVICEBRAND) !== null;\n }", "public function getBrand();", "public function getBrand(): string {\n return $this->brand;\n }", "private function getBrand() : string\n {\n return $this->brand ?? '';\n }", "public function getBrand()\n\t{\n\t\treturn $this->brand;\n\t}", "public function getBrand()\r\n {\r\n return $this->brand;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use the RAILS_ASSET_ID environment variable or the source's modification time as its cachebusting asset id.
private function rails_asset_id($source){ if( $asset_id = \PHPRails\get($_SERVER, "RAILS_ASSET_ID") ){ return $asset_id; }else{ if( static::$cache_asset_ids && ($asset_id = static::$asset_ids_cache[$source]) ){ return $asset_id; }else{ $path = \RFile::join($this->config->assets_dir, $source); $asset_id = \RFile::exist($path) ? (string)(int)\RFile::mtime($path) : ''; if( static::$cache_asset_ids ){ $this->add_to_asset_ids_cache($source, $asset_id); } return $asset_id; } } }
[ "protected function _madAssetId($source)\n { \n if (isset($_SERVER['MAD_ASSET_ID'])) {\n return $_SERVER['MAD_ASSET_ID'];\n }\n return @filemtime($this->getAssetsDir() . \"/$source\");\n }", "protected function cache_id()\n\t{\n\t\t// This avoids any issues with the URL being too long or\n\t\t// containing characters not allowed in cache keys\n\t\treturn 'assets_base_controller.'.sha1(url::current(TRUE));\n\t}", "function asset_version($source) {\n $version = $this->get_asset_version_string();\n\n if (isset($version))\n $source .= sprintf(\"?ver=%s\", $version);\n return $source;\n }", "static public function get_asset_version() {\n\t\t$post_id = self::get_post_id();\n\t\t$active\t = self::is_builder_active();\n\t\t$preview = self::is_builder_draft_preview();\n\n\t\tif ( $active || $preview ) {\n\t\t\treturn md5( uniqid() );\n\t\t} else {\n\t\t\treturn md5( get_post_modified_time( 'U', false, $post_id ) );\n\t\t}\n\t}", "public function getAssetId()\n {\n return $this->asset_id;\n }", "private function getAssetTimestamp() {\r\n\r\n if ($this->configuration['forceTimestamp'] == true) {\r\n return '?' . @filemtime(str_replace('/', DS, WWW_ROOT . $this->configuration['assetDir']));\r\n }\r\n\r\n return false;\r\n }", "public function setAssetId($value)\n {\n $this->_assetId = $value;\n }", "public function getAssetKey()\n {\n return $this->assetKey;\n }", "public function generateCacheId()\n {\n $view = $this->getCurrentView();\n $initialLocale = $view->getCurrentLocale();\n $nameChain = $view->getReference()->getName();\n while ($view = $view->getParent()) {\n $view->setCurrentLocale($initialLocale); //Force locale to current locale\n $nameChain .= '/'.$view->getReference()->getName();\n }\n\n return sprintf('%s-%s-%s-%s',\n $this->getId(),\n $this->getUpdatedAt()->getTimestamp(),\n md5($nameChain),\n $this->getCurrentView()->getReference()->getId()\n );\n }", "protected function get_cache_id() {\n\t\treturn wponion_hash_string( $this->module() . '_' . $this->unique() );\n\t}", "protected function createSrc($src) {\n\t\tif(Config::load()->get('assets.cache_bust') && !strpos($src, '://')) {\n\t\t\treturn str_replace('#', '/', $src) . '?' . md5(uniqid());\n\t\t}\n\t\treturn str_replace('#', '/', $src);\n\t}", "public function getCacheId();", "public function getCacheIdentifier() {}", "function abp01_get_cachebuster() {\n\treturn sha1(microtime() . uniqid());\n}", "public function cacheID() {\r\n\t\treturn md5(trim($this->statement));\r\n\t}", "protected function get_cache_id() {\n\t\treturn wponion_hash_string( $this->get_id() . '_' . $this->module() . '_' . $this->unique() );\n\t}", "function auto_version($file_path){\n \n $asset_path = FCPATH.'frontend_asset'; //get absolute server path\n $mtime = filemtime($asset_path.$file_path); //get last modified file time\n \n if(strpos($file_path, '/') !== 0 || !$mtime)\n return $file_path;\n \n return preg_replace('{\\\\.([^./]+)$}', \".$mtime.\\$1\", $file_path);\n}", "public static function getCacheIdentifier();", "protected function requireJsCache()\n {\n if (!config('require_js.cache')) {\n return <<<EOD\n require.config({\n urlArgs: \"antares=\" + (new Date()).getTime()\n }); \nEOD;\n }\n return '';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the value of seoAccion
public function getSeoAccion() { return $this->seoAccion; }
[ "public function getSocioempleoAccion()\n {\n return $this->socioempleoAccion;\n }", "public function getSextarazonbecaAccion()\n\t{\n\t\treturn $this->sextarazonbecaAccion;\n\t}", "public function getSectoreconomicoAccion()\n\t{\n\t\treturn $this->sectoreconomicoAccion;\n\t}", "public function getSacado()\n\t{\n\t\treturn $this->sacado;\n\t}", "public function getInstitutosAccion()\n\t{\n\t\treturn $this->institutosAccion;\n\t}", "public function getSetecaspiranteAccion()\n {\n return $this->setecaspiranteAccion;\n }", "public function getPoseebecaAccion()\n\t{\n\t\treturn $this->poseebecaAccion;\n\t}", "public function getIdiomaancestralAccion()\n\t{\n\t\treturn $this->idiomaancestralAccion;\n\t}", "public function getAcesso()\r\n {\r\n return $this->acesso;\r\n }", "public function getAplicacionbecasAccion()\n\t{\n\t\treturn $this->aplicacionbecasAccion;\n\t}", "public function getSeccion()\n {\n return $this->seccion;\n }", "public function getActa_consejo(){\n return $this->acta_consejo;\n }", "public function getAcc()\n {\n return $this->acc;\n }", "public function getAccNo()\n {\n return $this->acc_no;\n }", "public function getDocenciatecnologicoAccion()\n\t{\n\t\treturn $this->docenciatecnologicoAccion;\n\t}", "public function getEtnAccion()\n\t{\n\t\treturn $this->etnAccion;\n\t}", "public function getPeriodoacademicoAccion()\n {\n return $this->periodoacademicoAccion;\n }", "public function getPeriodoacademicoAccion()\n\t{\n\t\treturn $this->periodoacademicoAccion;\n\t}", "public function getEmpresasAccion()\n\t{\n\t\treturn $this->empresasAccion;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the z47 ca12 libelle.
public function setz47Ca12Libelle(?string $z47Ca12Libelle): DecTvaCa12 { $this->z47Ca12Libelle = $z47Ca12Libelle; return $this; }
[ "public function testSetz4Cca12Libelle() {\n\n $obj = new DecTvaCa12();\n\n $obj->setz4Cca12Libelle(\"z4Cca12Libelle\");\n $this->assertEquals(\"z4Cca12Libelle\", $obj->getz4Cca12Libelle());\n }", "public function testSetz47Ca12Libelle() {\n\n $obj = new DecTvaCa12();\n\n $obj->setz47Ca12Libelle(\"z47Ca12Libelle\");\n $this->assertEquals(\"z47Ca12Libelle\", $obj->getz47Ca12Libelle());\n }", "public function testSetz4Aca12Libelle() {\n\n $obj = new DecTvaCa12();\n\n $obj->setz4Aca12Libelle(\"z4Aca12Libelle\");\n $this->assertEquals(\"z4Aca12Libelle\", $obj->getz4Aca12Libelle());\n }", "public function getz47Ca12Libelle() {\n return $this->z47Ca12Libelle;\n }", "public function testSetz4Cca12Code() {\n\n $obj = new DecTvaCa12();\n\n $obj->setz4Cca12Code(\"z4Cca12Code\");\n $this->assertEquals(\"z4Cca12Code\", $obj->getz4Cca12Code());\n }", "public function testSetz4Aca12Code() {\n\n $obj = new DecTvaCa12();\n\n $obj->setz4Aca12Code(\"z4Aca12Code\");\n $this->assertEquals(\"z4Aca12Code\", $obj->getz4Aca12Code());\n }", "public function testSetz4Aca12() {\n\n $obj = new DecTvaCa12();\n\n $obj->setz4Aca12(10.092018);\n $this->assertEquals(10.092018, $obj->getz4Aca12());\n }", "public function testSetz45Ca12() {\n\n $obj = new DecTvaCa12();\n\n $obj->setz45Ca12(10.092018);\n $this->assertEquals(10.092018, $obj->getz45Ca12());\n }", "public function testSetz32Code() {\n\n $obj = new DecTvaCa12();\n\n $obj->setz32Code(\"z32Code\");\n $this->assertEquals(\"z32Code\", $obj->getz32Code());\n }", "public function getz4Cca12Libelle(): ?string {\n return $this->z4Cca12Libelle;\n }", "public function testSetZ12Code() {\n\n $obj = new DecTvaGroupe();\n\n $obj->setZ12Code(\"z12Code\");\n $this->assertEquals(\"z12Code\", $obj->getZ12Code());\n }", "public function setZ12Lib(?string $z12Lib): DecTvaGroupe {\n $this->z12Lib = $z12Lib;\n return $this;\n }", "public function testSetz4213() {\n\n $obj = new DecTvaCa12();\n\n $obj->setz4213(10.092018);\n $this->assertEquals(10.092018, $obj->getz4213());\n }", "public function getz4Bca12Code() {\n return $this->z4Bca12Code;\n }", "public function testSetz35BCode() {\n\n $obj = new DecTvaCa12();\n\n $obj->setz35BCode(\"z35BCode\");\n $this->assertEquals(\"z35BCode\", $obj->getz35BCode());\n }", "public function getz4Cca12() {\n return $this->z4Cca12;\n }", "public function getz4Aca12Code() {\n return $this->z4Aca12Code;\n }", "public function getz4Aca12() {\n return $this->z4Aca12;\n }", "public function setz32Libelle(?string $z32Libelle): DecTvaCa12 {\n $this->z32Libelle = $z32Libelle;\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test a tag with an id in it
public function testIdTag() { $text="Test with @mike+15 id tag"; $tags=get_tags($text); $this->assertEquals(2, count($tags)); $this->assertTrue(in_array("@mike+15", $tags)); //happens right now, but it shouldn't be necessary $this->assertTrue(in_array("@mike+15 id", $tags)); $inform=''; $str_tags=''; foreach($tags as $tag) { handle_tag($this->a, $text, $inform, $str_tags, 11, $tag); } $this->assertEquals("Test with @[url=http://justatest.de]Mike Lastname[/url] id tag", $text); $this->assertEquals("@[url=http://justatest.de]Mike Lastname[/url]", $str_tags); // this test may produce two cid:15 entries - which is OK because duplicates are pruned before delivery $this->assertContains("cid:15",$inform); }
[ "public function findTag($id);", "public function TagOfId($id);", "public function testGetTagsId()\n\t{\n\t\t$this->markTestSkipped('Test not implemented.');\n\t}", "public function findElementById($id);", "public function testGetTagbyValidTagId() {\n\t\t// Count the number of rows and save this for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"tag\");\n\n\t\t// Create a new tag and insert it into mySQL\n\t\t$tag = new Tag(null, $this->VALID_TAG_LABEL);\n\t\t$tag->insert($this->getPDO());\n\n\t\t// Grab the data from mySQL and check the fields against our expectations\n\t\t$pdoTag= Tag::getTagByTagId($this->getPDO(), $tag->getTagId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"tag\"));\n\t\t$this->assertLessThan($pdoTag->getTagId(), 0);\n\t\t$this->assertEquals($pdoTag->getTagLabel(), $this->VALID_TAG_LABEL);\n\t}", "private function _isATag($id)\n {\n if (substr($id, 0, 9) == 'internal-') {\n return true;\n }\n return false;\n }", "function get_element_by_id($id) {}", "private function check($name, $id) {\n if ($name=='' || $id=='') return 0;\n $this->assertTrue($this->isTextPresent(\"$name\"),\"\\\"$name\\\" not found on the page\\n \");\n $this->waitForElementPresent(\"$id\"); \n }", "public function test_bug_62()\n\t{\n\t\t$doc = <<<HTML\n<body>\n\t<a href=\"#\" id=\"0\">PHP Simple HTML DOM Parser</a>\n\t<a href=\"#\" id=\"1\">A PHP based DOM parser</a>\n</body>\nHTML;\n\n\t\t$this->html->load($doc);\n\n\t\t$this->assertCount(1, $this->html->find('[id=0]'));\n\t\t$this->assertCount(1, $this->html->find('#0'));\n\t}", "public function testGetEventTagByTagId(): void\n\t{\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"eventTag\");\n\n\t\t$eventTag = new EventTag($this->event->getEventId(), $this->tag->getTagId());\n\t\t$eventTag->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = EventTag::getEventTagByEventTagTagId($this->getPDO(), $eventTag->getEventTagTagId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"eventTag\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"AbqAtNight\\CapstoneProject\\EventTag\", $results);\n\n\t\t// grab the result from the array and validate it\n\t\t$pdoEventTag = $results[0];\n\t\t$this->assertEquals($pdoEventTag->getEventTagEventId(), $this->event->getEventId());\n\t\t$this->assertEquals($pdoEventTag->getEventTagTagId(), $this->tag->getTagId());\n\t}", "public function verifyTagUrlID($id) {\n\t\t$tag_id = $this->getContentTagID ();\n\t\tif (! empty ( $id )) {\n\t\t\t$VTagUrl = $this->getDatabase ();\n\t\t\t$VTagUrl->select ();\n\t\t\t$VTagUrl->columns ( array (\n\t\t\t\t\t'id' => 'content_tag_url_id' \n\t\t\t) );\n\t\t\t$VTagUrl->from ( array (\n\t\t\t\t\t'cdu' => 'content_tag_url' \n\t\t\t) );\n\t\t\t$where = array (\n\t\t\t\t\t'cdu.content_tag_url_id = ' . $id,\n\t\t\t\t\t'cdu.content_tag_id = ' . $tag_id \n\t\t\t);\n\t\t\t$VTagUrl->where ( $where );\n\t\t\t$VTagUrl->limit ( 1 );\n\t\t\t$VTagUrl->execute ();\n\t\t\tif ($VTagUrl->hasResult ()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function checkId($id)\n {\n $id = $this->getElementById($id);\n\n if ($id) {\n return true;\n } else {\n return false;\n }\n }", "private function is_valid_html_pID($id)\n {\n require_once (ABSPATH . WPINC . '/class-snoopy.php');\n\n $wpurl = get_bloginfo(\"url\") . '/?p=' . $id;\n $url = $this->validator_xhtml . '?uri=' . $wpurl . '&output=soap12';\n\n $client = new Snoopy();\n @$client->fetch($url);\n $data = $client->results;\n $data = explode(\"\\n\", $data);\n foreach ($data as $buffer) {\n if (eregi(\"m:validity\",$buffer)) {\n if(trim(strip_tags($buffer)) == \"true\") {\n return true;\n }\n break;\n }\n }\n return false;\n }", "public function htmlTagSelectWithId(UnitTester $I)\n {\n $I->wantToTest('Html\\Tag - select() - id');\n $tag = new Tag();\n $tag->setDI($this->container);\n $name = 'x_name';\n $params = [\n 'id' => 'x_id',\n 'class' => 'x_class',\n ];\n $data = [\n 'A' => 'Active',\n 'I' => 'Inactive',\n ];\n $expected = '<select id=\"x_id\" name=\"x_name\" class=\"x_class\">' . PHP_EOL\n . chr(9) . '<option value=\"A\">Active</option>' . PHP_EOL\n . chr(9) . '<option value=\"I\">Inactive</option>' . PHP_EOL\n . '</select>';\n\n $actual = $tag->select($name, $params, $data);\n $I->assertEquals($expected, $actual);\n }", "public function setTagId($id = 0);", "public function testGetElementByIdNotExists()\n {\n $root = new Node('<div class=\"container\"><ul><li>Item 1</li><li id=\"item-2\">Item 2</li></ul></div>');\n $element = $root->getElementById('item-1');\n $this->assertNull($element);\n }", "public function anexarTag($id_task, $id_tag) {\n\n $query = $this->newQuery();\n $query->insert('tasks_has_tags')\n ->values(\n [\n 'id_tag' => $id_tag,\n 'id_task' => $id_task\n ]\n );\n \n $result = $this->execute($query);\n \n if ($result) {\n return $this->findrow($id_task); \n } else {\n return false;\n }\n }", "abstract public function tagCandidate( $id_api );", "public function testTagsIdGet()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new PaqueteTratamiento entity.
public function createAction(Request $request) { $entity = new PaqueteTratamiento(); $form = $this->createCreateForm($entity); $form->handleRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('admin_paquetetratamiento_show', array('id' => $entity->getId()))); } return array( 'entity' => $entity, 'form' => $form->createView(), ); }
[ "public function createAction(Request $request)\n {\n $entity = new tratamiento();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('proyecto_tratamiento_show', array('id' => $entity->getId())));\n }\n\n return $this->render('proyectoPersonasBundle:tratamiento:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function createEntity();", "public function createAction()\n {\n $entity = new EnfantTiteur();\n $request = $this->getRequest();\n $form = $this->createForm(new EnfantTiteurType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\t\t\t$this->get('session')->setFlash('notice', 'Enfant titeur a été ajouté avec succès');\n\n return $this->redirect($this->generateUrl('enfanttiteur_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function createAction()\n {\n $entity = new TipoSocio();\n $request = $this->getRequest();\n $form = $this->createForm(new TipoSocioType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('administracion_entidades_tiposocio_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function createAction(Request $request)\n {\n $entity = new Traslados();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('traslados_show', array('id' => $entity->getId())));\n }\n\n return $this->render('TramiteBundle:Traslados:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function actionCreate()\n {\n $model = new Trabajador();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ID_TRABAJADOR]);\n } else {\n return $this->render('create_by_company', [\n 'model' => $model,\n ]);\n }\n }", "public static function createEntity();", "public function createAction(Request $request)\n {\n $entity = new Tutorias();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n $tipo=$form->get(\"tipo\")->getData();\n $descripcion=$form->get(\"descripcion\")->getData();\n $grupo=$form->get(\"grupo\")->getData();\n $consulta_principal=$form->get(\"seguimiento\")->getData();\n\n $em = $this->getDoctrine()->getManager();\n if($consulta_principal){\n $consulta = $em->getRepository('IntranetBundle:Seguimiento')->findOneById($consulta_principal->getId());\n }\n\n if ($form->isValid()) {\n if(!$consulta_principal){\n //Se crea el nuevo seguimiento de la asignación de tutoría.\n $seguimiento = new Seguimiento();\n $seguimiento->setProfesor($entity->getProfesor());\n $seguimiento->setAlumno($entity->getAlumno());\n $seguimiento->setResponsable(null);\n $seguimiento->setAsignatura(null);\n $seguimiento->setGrupo($grupo);\n $seguimiento->setTipo(1);\n $seguimiento->setTipoUser(1);\n $seguimiento->setDescripcion($descripcion);\n $seguimiento->setFecha(new \\DateTime(\"now\"));\n $seguimiento->setFechaActualizada(new \\DateTime(\"now\"));\n $seguimiento->setSeguimiento(null);\n $seguimiento->setRespuesta(0);\n $seguimiento->setFechaTerminada(null);\n \n $em->persist($seguimiento);\n $em->flush();\n\n //Se obtiene el seguimiento creado para añadirselo al registro de tutoría.\n $comentario = $em->getRepository('IntranetBundle:Seguimiento')->findUltimoAvisoTutoria($entity->getProfesor()->getId(), $tipo);\n\n //Se asigna los demás valores de tutorias.\n $entity->setActivo(0);\n $entity->setSeguimiento($comentario);\n\n }else{\n //Se crea el nuevo seguimiento de la asignación de tutoría.\n $seguimiento = new Seguimiento();\n $seguimiento->setProfesor($entity->getProfesor());\n $seguimiento->setAlumno($entity->getAlumno());\n $seguimiento->setResponsable(null);\n $seguimiento->setAsignatura(null);\n $seguimiento->setGrupo($grupo);\n $seguimiento->setTipo(0);\n $seguimiento->setTipoUser(1);\n $seguimiento->setDescripcion($descripcion);\n $seguimiento->setFecha(new \\DateTime(\"now\"));\n $seguimiento->setFechaActualizada(new \\DateTime(\"now\"));\n $seguimiento->setSeguimiento($consulta);\n $seguimiento->setRespuesta(0);\n $seguimiento->setFechaTerminada(null);\n\n $em->persist($seguimiento);\n $em->flush();\n\n //Se modifica la consulta principal para que se muestre actualizada.\n $consulta->setRespuesta(1);\n //$consulta->setFechaActualizada(new \\DateTime(\"now\"));\n $em->persist($consulta);\n $em->flush();\n\n //Se asigna los demás valores de tutorias.\n $entity->setActivo(0);\n $entity->setSeguimiento($consulta);\n }\n\n $em->persist($entity);\n $em->flush();\n\n $ms = $this->get('translator')->trans('Se ha asignado una nueva tutoría pendiente de confirmación.');\n $this->get('session')->getFlashBag()->add('notice',$ms);\n\n return $this->redirect($this->generateUrl('intranet_profesor_tutorias'));\n }\n\n return $this->render('IntranetBundle:Profesor:asignarTutorias.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function createAction()\n {\n $entity = new CarpetaEmprendimiento();\n $request = $this->getRequest();\n $form = $this->createForm(new CarpetaEmprendimientoType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('carpetaemprendimiento_show', array('id' => $entity->getId())));\n \n }\n\n return $this->render('IamSoftAndrethaBundle:CarpetaEmprendimiento:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function actionCrear() {\n $model = new Transferencia();\n $atributos_viejos = $model->attributes;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n StaticMembers::RegistrarTraza($model, $atributos_viejos, 'crear', $model->numero);\n Yii::$app->session->setFlash('success', 'Elemento creado correctamente', false);\n return $this->redirect(['detalles']);\n } else {\n return $this->render('crear', ['model' => $model]);\n }\n }", "public function createAction()\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"coemntarios\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $coemntario = new Coemntarios();\n $coemntario->setId($this->request->getPost(\"id\"));\n $coemntario->setFecha($this->request->getPost(\"fecha\"));\n $coemntario->setComentario($this->request->getPost(\"comentario\"));\n \n\n if (!$coemntario->save()) {\n foreach ($coemntario->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"coemntarios\",\n 'action' => 'new'\n ]);\n\n return;\n }\n\n $this->flash->success(\"Comentario se creó correctamente\");\n\n $this->dispatcher->forward([\n 'controller' => \"coemntarios\",\n 'action' => 'index'\n ]);\n }", "public function createAction(Request $request,$id_empleado)\n {\n\t //echo $idempleado;exit;\n $entity = new EHistoriaTrabajo();\n\t\t/*Obtener el empleado en cuestion*/\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t//$formrequest=$request->request->get('planillas_entidadesbundle_ehistoriatrabajo');\n $eEmpleado = $em->getRepository('PlanillasCoreBundle:CEmpleado')->find($id_empleado);\n\t\t\n\t\t$entity->setEmpleado($eEmpleado);\n\t\t\n\t\t//creando y validando el formulario\n $form = $this->createCreateForm($entity);\n\t\t\n $form->handleRequest($request);\n if ($form->isValid()) {\n\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('ctrabajo_new', array('id_empleado' => $eEmpleado->getId())));\n }\n\n\n return $this->render('PlanillasEntidadesBundle:EHistoriaTrabajo:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n\t\t\t'eEmpleado'=>$eEmpleado\n ));\n }", "public function store(CreateTipoTramiteRequest $request)\n {\n $input = $request->all();\n\n $tipoTramite = $this->tipoTramiteRepository->create($input);\n\n Flash::success('Tipo Tramite saved successfully.');\n\n return redirect(route('tipoTramites.index'));\n }", "public function createAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"transporte\",\n \"action\" => \"index\"\n ));\n }\n\n $transporte = new Transporte();\n\n $transporte->setTransporteDominio($this->request->getPost(\"transporte_dominio\"));\n $transporte->setTransporteNrointerno($this->request->getPost(\"transporte_nroInterno\"));\n $transporte->setTransporteHabilitado($this->request->getPost(\"transporte_habilitado\"));\n\n\n if (!$transporte->save()) {\n foreach ($transporte->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"transporte\",\n \"action\" => \"new\"\n ));\n }\n\n $this->flash->success(\"El transporte ha sido creado correctamente\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"transporte\",\n \"action\" => \"index\"\n ));\n\n }", "public function create()\n {\n if (! Gate::allows('espec_treinamento_create')) {\n return abort(401);\n }\n return view('admin.espec_treinamentos.create');\n }", "public function createAction(Request $request)\n {\n $this->seguridadNuevo();\n \n $em = $this->getDoctrine()->getManager();\n $fa=new \\DateTime(\\date(\"d-m-Y G:i:s\"));\n $idusuario = $this->get('security.context')->getToken()->getUser()->getId();\n $perfil = $em->getRepository('UsuarioBundle:Perfil')->find($idusuario);\n \n $entity = new Proyecto();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n //guardo valores por defecto\n $entity->setEstatus(1);\n $entity->setPorcentaje(0);\n $perfil = $em->getRepository('UsuarioBundle:Perfil')->find($idusuario);\n $entity->setNivelorganizacional($perfil->getNivelorganizacional());\n $entity->setFechacreacion($fa);\n $entity->setInformegestion(false);\n $em->persist($entity);\n $em->flush();\n\n //$bitacoraModelo = $this->get('bitacoraModelo');\n //$bitacoraModelo->guarda_bitacora(2,'Ha creado el proyecto \"'.$entity->getNombre().'\"',$perfil,$entity->getId(),$perfil->getNivelorganizacional());\n \n $this->get('session')->getFlashBag()->add('notice', 'Proyecto creado exitosamente.');\n return $this->redirect($this->generateUrl('proyecto_show', array('id' => $entity->getId())));\n }\n \n $this->get('session')->getFlashBag()->add('alert', '<b>Alerta</b>! Ha ocurrido un error en el formulario.');\n return $this->render('ProyectoBundle:Proyecto:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function createAction(Request $request)\n {\n $entity = new Tipocorresponsalia();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('tipocorresponsalia_show', array('id' => $entity->getId())));\n }\n\n return $this->render('CorresponsaliaBundle:Tipocorresponsalia:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function store(CreatePuestoTrabajoRequest $request)\n {\n $input = $request->all();\n\n $puestoTrabajo = $this->puestoTrabajoRepository->create($input);\n\n Flash::success('Puesto Trabajo saved successfully.');\n\n return redirect(route('admin.puestoTrabajos.index'));\n }", "public function actionCreate()\n {\n $model = new Pedidos();\n $user_id = \\Yii::$app->user->identity->id;\n $zona = new Zonas();\n $zonas = $zona::getZonas();\n $historicoPedido = new HistoricoPedidos();\n\n if ($model->load(Yii::$app->request->post()) ) {\n $model->user_id_user = $user_id;\n $model->status_id_status = 1;\n $model->zonas_id_zona = 1;\n \n $model->save();\n\n if ($model->save()) {\n\n $historicoPedido->pedidos_id_pedido = $model->id;\n $historicoPedido->user_id_user = $user_id;\n $historicoPedido->status_pedido_projeto_id_status = $model->status_id_status;\n $historicoPedido->data_alteracao = date('Y-m-d');\n $historicoPedido->save(false);\n }\n\n $codigoPedido = \"PF_\".$model->id;\n $model->cod_pedido = $codigoPedido;\n $model->save();\n\n Yii::$app->session->setFlash('success', 'Pedido inserido com sucesso!');\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model, 'value'=>[], 'zonas'=>$zonas\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate the slug from the `slugStrategy()` function and assign it to the model.
public function generateSlug(): void { $this->model->slug = Str::slug($this->model->{$this->model->slugStrategy()}); }
[ "public function generateSlug()\n {\n if ( $this->getRegenerateSlugOnUpdate() || empty( $this->slug ) ) {\n $fields = $this->getSluggableFields();\n $values = [];\n\n foreach ($fields as $field) {\n if (property_exists($this, $field)) {\n $val = $this->{$field};\n } else {\n $methodName = 'get' . ucfirst($field);\n if (method_exists($this, $methodName)) {\n $val = $this->{$methodName}();\n } else {\n $val = null;\n }\n }\n\n $values[] = $val;\n }\n\n $this->slug = $this->generateSlugValue($values);\n }\n }", "public function generateSlug(){\n $slugId = (string)$this->id;\n if(empty($this->slug)){\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->title.mt_rand(1,1000));//random, to allow duplicate titles and unique slugs.\n }\n }", "public function createOrUpdateSlug()\n {\n $slufify = new Slugify();\n\n $this->slug = $slufify->slugify($this->getFullName());\n }", "public function generateSlug();", "public function getSlugAttribute()\n {\n return new Slug($this->attributes[$this->slugField()]);\n }", "public function generateSlug()\n {\n $value = $this->generateRawSlug();\n $value = Inflector::urlize($value);\n\n /** @var \\Tx\\CzSimpleCal\\Domain\\Repository\\EventIndexRepository $eventIndexRepository */\n $eventIndexRepository = $this->objectManager->get('Tx\\\\CzSimpleCal\\\\Domain\\\\Repository\\\\EventIndexRepository');\n\n $slug = $eventIndexRepository->makeSlugUnique($value, $this->uid);\n $this->setSlug($slug);\n }", "public function getSlug();", "public function generateSlug() \n { \n if ($this->{$this->getDestination()}) {\n $slug = $this->slugInput($this->{$this->getDestination()});\n } else {\n $slug = $this->slugInput($this->{$this->getSource()});\n }\n return $slug;\n }", "private function createSlug()\n\t{\n\t\tif ( $this->hasField('slug') AND key_exists('title', $this->data[$this->name]) )\n\t\t{\n\t\t\t$this->data[$this->name]['slug'] = strtolower(Inflector::slug($this->data[$this->name]['title']));\n\t\t}\n\t}", "public function new_slug(){\n\t\t$this->slug = substr( str_shuffle( URL_CHARSET ), 0, URL_LENGTH );\n\t}", "protected function generate_slug(){\n\t\t$this->slug = \\StringUtils::toAscii($this->title); \t\n\t}", "public function setSlugAttribute()\n {\n $this->attributes['slug'] = Str::slug($this->name);\n }", "protected function generateSlug()\n {\n $slug = Transliterator::transliterate($this->getName());\n\n return Transliterator::urlize($slug);\n }", "public function urlSlug()\n {\n $class_name = get_class($this);\n $self = $this;\n $values = array_map(function($prop) use($self) {\n return $self->$prop;\n }, $class_name::$_slug_fields);\n \n return \\CMF::slug(implode(' ', $values), true, true);\n }", "public function initializeSlug(){\n if(empty($this->slug)){\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->name);\n }\n }", "public function makeSlug(){\n while(true){\n $slug = Str::random(20);\n if($this->isUnique($slug)){\n return $slug;\n break;\n }\n }\n\n }", "public function generateIdSlug()\n {\n $this->setSlugValue(Slug::fromId($this->getKey()));\n }", "protected function getSlugEngine()\n {\n return new Slugify();\n }", "public function initializeSlug(){\n \n if(empty($this->slug)){\n $slugify = new Slugify();\n $this->slug = $slugify->slugify($this->prenom.' '.$this->nom);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
aggiorno la wishlist dell'utente loggato con il prodotto dall'ID specificato; devo fare un doppio aggiornamento, SessVar e FIle
public static function AddTo($id_prodotto){ $UID=$_SESSION['loggedUID']; Connect($connessione, $database); $query = "UPDATE $database.`wishlist` SET Lista_Prodotti=concat(Lista_Prodotti, '$id_prodotto.') WHERE ID_Utente='$UID'"; //aggiornamento DB $ris = mysqli_query($connessione,$query); mysqli_close($connessione); }
[ "public function addWishlistId($wishlist_id);", "function setWishListItem( $wishlist )\r\n {\r\n if ( is_a( $wishlist, \"eZWishListItem\" ) )\r\n {\r\n $this->WishListItemID = $wishlist->id();\r\n }\r\n }", "public function wishList($id){\n return $this->usersRepository->wishList($id);\n }", "private function wishList() {\n $this->_template->title = 'Wish List';\n $this->_template->wishListProducts = $this->_model->wishListProducts($this->_userId);\n $this->_template->buildFromTemplates('header.php', 'sidebar.php', 'account_nav.php', 'main.wish.php', 'footer.php');\n }", "public function Add_To_Wish_List()\n\t{\n\t\t$user_data\t=\t$this->session->userdata('user_id');\n\t\t$product_id\t=\t$_REQUEST['product_id'];\n\t\t\n\t\tif($user_data =='')\n\t\t{\t\t\t\n\t\t\t $this->session->set_userdata('user_wish_list',$product_id);\t\n\t\t\t\tprint json_encode(array(\"exists\"=>\"0\" ,\"message\"=>\"Please Login First\"));\n\t\t\t die();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$seller_id\t=\t_Product_SellerUserId(base64_decode($product_id));\n\t\t\tif($seller_id<>0){\n\t\t\t\tif($user_data!=$seller_id)\n\t\t\t\t{\n\t\t\t\t\tif($this->Product_model->AddWishList($product_id))\n\t\t\t\t\t{ \n\t\t\t\t\t\tprint json_encode(array(\"exists\"=>\"1\",\"message\"=>\"Product successfully Add to Your Dream Box.\"));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tprint json_encode(array(\"exists\"=>\"0\" ,\"message\"=>\"All-Ready Added This product\")); \n\t\t\t\t\t}\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tprint json_encode(array(\"exists\"=>\"0\" ,\"message\"=>\"You Can Only Add Other Seller Items In Your Dream Box.\")); \n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprint json_encode(array(\"exists\"=>\"0\" ,\"message\"=>\"Something Went Worng,Please Try After Some Time.\")); \n\t\t\t}\n\t\t}\n\t}", "public function addToWishlist($user_identifier, $product_id);", "function add_to_wishlist($id_user, $id_record){\n GLOBAL $conn;\n\n $records = get_wish_by_user($id_user);\n foreach($records as $rec){\n if($rec['id_record'] == $id_record){\n echo 'Already in wishlist!';\n return -1;\n }\n }\n\n $insertWish = $conn->prepare(\"INSERT INTO wishlist (id_user, id_record) VALUES (?, ?)\");\n $insertWish->bind_param(\"ss\", $id_user, $id_record);\n\n $insertWish->execute();\n $insertWish->close();\n }", "function wolf_add_to_wishlist() {\n\t$wishlist = www_get_wishlist_product_ids();\n\n\t$product_id = get_the_ID();\n\t$is_in_wishlist = ( $wishlist ) ? ( in_array( $product_id, $wishlist ) ) : false;\n\n\t$class = ( $is_in_wishlist ) ? 'wolf_in_wishlist' : '';\n\t\n\t$text = ( $is_in_wishlist ) ? esc_html__( 'Remove from wishlist', 'wolf-woocommerce-wishlist' ) : esc_html__( 'Add to wishlist', 'wolf-woocommerce-wishlist' );\n\tdo_action( 'www_before_add_to_wishlist' );\n\n\t$class .= apply_filters( 'wolf_add_to_wishlist_class', ' wolf_add_to_wishlist button' );\n\n\t?>\n\t<a\n\tclass=\"<?php echo esc_attr( $class ); ?>\"\n\thref=\"?add_to_wishlist=<?php the_ID(); ?>\"\n\ttitle=\"<?php echo esc_attr( $text ); ?>\"\n\trel=\"nofollow\"\n\tdata-product-title=\"<?php echo esc_attr( get_the_title() ); ?>\"\n\tdata-product-id=\"<?php the_ID(); ?>\"><span class=\"wolf_add_to_wishlist_heart\"></span></a>\n\t<?php\n\tdo_action( 'www_after_add_to_wishlist' );\n}", "public static function update_340004() { \n\n /* Alter the session.id so that it's 64 */\n $sql = \"ALTER TABLE `session` CHANGE `id` `id` VARCHAR( 64 ) NOT NULL\";\n\t\t$db_results = Dba::query($sql); \n\n\t\t/* Add Playlist Related Preferences */\n\t\t$sql = \"INSERT INTO `preference` (`name`,`value`,`description`,`level`,`type`,`catagory`) \" . \n\t\t\t\"VALUES ('playlist_add','append','Add Behavior','5','string','playlist')\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\t// Switch the existing preferences over to this new catagory\n\t\t$sql = \"UPDATE `preference` SET `catagory`='playlist' WHERE `name`='playlist_method' \" . \n\t\t\t\" OR `name`='playlist_type'\"; \n\t\t$db_results = Dba::query($sql); \n\t\n\t\t// Change the default value for playlist_method\n\t\t$sql = \"UPDATE `preference` SET `value`='normal' WHERE `name`='playlist_method'\"; \n\t\t$db_results = Dba::query($sql); \n\t\t\n\t\t// Add in the shoutbox\n\t\t$sql = \"CREATE TABLE `user_shout` (`id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , \" . \n\t\t\t\"`user` INT( 11 ) NOT NULL , \" . \n\t\t\t\"`text` TEXT NOT NULL , \" . \n\t\t\t\"`date` INT( 11 ) UNSIGNED NOT NULL , \" . \n\t\t\t\"`sticky` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0', \" . \n\t\t\t\"`object_id` INT( 11 ) UNSIGNED NOT NULL , \" . \n\t\t\t\"`object_type` VARCHAR( 32 ) NOT NULL \" . \n\t\t\t\") ENGINE = MYISAM\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\t$sql = \"ALTER TABLE `user_shout` ADD INDEX ( `sticky` )\"; \n\t\t$db_results = Dba::query($sql); \t\n\n\t\t$sql = \"ALTER TABLE `user_shout` ADD INDEX ( `date` )\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\t$sql = \"ALTER TABLE `user_shout` ADD INDEX ( `user` )\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\t$sql = \"ALTER TABLE `now_playing` CHANGE `start_time` `expire` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0'\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\t$sql = \"OPTIMIZE TABLE `album`\"; \n\t\t$db_results = Dba::query($sql); \n\n $sql = \"SELECT `id` FROM `user`\";\n $db_results = Dba::query($sql);\n\n User::fix_preferences('-1');\n\n while ($r = Dba::fetch_assoc($db_results)) {\n User::fix_preferences($r['id']);\n }\n\n\t\t// Update our database version now that we are all done\n\t\tself::set_version('db_version','340004'); \n\n\t\treturn true; \n\n\t}", "public function getWishListId()\n {\n return $this->wish_list_id;\n }", "private function create() {\n\t\tglobal $wpdb;\n\n\t\tif ( ! $this->is_table_exists() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$wpdb->insert(\n\t\t\t$wpdb->woodmart_wishlists_table,\n\t\t\tarray(\n\t\t\t\t'user_id' => $this->get_user_id(),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'%d',\n\t\t\t)\n\t\t);\n\n\t\t$this->id = $this->get_current_user_wishlist();\n\t}", "function myWishlistAdd($_arrPostId)\n {\n//pre($_SESSION);\n global $objCore;\n $whereWith = \"fkProductId='\" . $_arrPostId . \"' AND fkUserId='\" . $_SESSION['sessUserInfo']['id'] . \"'\";\n $verifyWishlist = $this->select(TABLE_WISHLIST, array('pkWishlistId'), $whereWith);\n if (count($verifyWishlist) == 0)\n {\n $arrClms = array(\n 'fkUserId' => $_SESSION['sessUserInfo']['id'],\n 'fkProductId' => $_arrPostId,\n 'WishlistDateAdded' => $objCore->serverDateTime(date(DATE_TIME_FORMAT_DB), DATE_TIME_FORMAT_DB)\n );\n $arrAddID = $this->insert(TABLE_WISHLIST, $arrClms);\n }\n return $arrAddID;\n }", "function get_wishlist_id( $wishlist_id = null ){\n\n\t\t\t$wishlist_id = ! empty( $wishlist_id ) && woocommerce_wishlist_is_wishlist( $wishlist_id ) ? $wishlist_id : woocommerce_wishlist_get_active_wishlist();\n\t\t\t$wishlist_id = is_object( $wishlist_id ) && !empty( $wishlist_id->ID ) ? $wishlist_id->ID : $wishlist_id;\n\n\t\t\treturn apply_filters( 'woocommerce_wishlist_get_wishlist_id', $wishlist_id );\n\n\t\t}", "function addWishlistMentor($username) {\n\t\tglobal $_USER;\n\t\t$dbQueryWishlist = sprintf(\"INSERT INTO Wishlist (mentee, mentor) VALUES ('%s', '%s')\", $_USER['uid'], $username);\n\t\t$result = getDBRegInserted($dbQueryWishlist);\n\t\techo \"added\";\n\t}", "public function wishbyid_get()\n {\n if(!$this->get(\"wpid\")){\n $this->response(NULL, 400);\n }\n $this->load->model(\"wishing_model\");\n $user = $this->wishing_model->get_wishbyid($this->get(\"wpid\"));\n if($user){\n $this->response($user, 200);\n }else{\n $this->response(NULL, 400);\n }\n }", "public function testGetWishList()\n {\n $this->setRequestParameter('wishid', '_testId');\n $oWishList = oxNew(\"Wishlist\");\n $myDB = oxDb::getDB();\n\n // adding article to basket\n $sQ = 'insert into oxuserbaskets ( oxid, oxuserid, oxtitle, oxpublic ) values ( \"_testBasketId1\", \"' . $this->_oUser->getId() . '\", \"wishlist\", 1 ) ';\n $myDB->Execute($sQ);\n\n $sQ = 'insert into oxuserbasketitems ( oxid, oxbasketid, oxartid, oxamount ) values ( \"_testId1\", \"_testBasketId1\", \"1126\", \"1\" ) ';\n $myDB->Execute($sQ);\n\n $oList = $oWishList->getWishList();\n $this->assertEquals(1, count($oList));\n $oArticle = array_pop($oList);\n $this->assertEquals('1126', $oArticle->getId());\n }", "function addFav($db,$cocktailID,$btnPressed)\r\n{\r\n // wenn user eingeloggt\r\n if(isset($_SESSION['id']))\r\n {\r\n // wenn button gedrückt wurde\r\n if($btnPressed = true)\r\n {\r\n //$cocktailID enthält alle infos über den Cocktail z.b. Name, ID, Zutaten etc.\r\n // Liest alle Cocktails aus die User als Favs hat\r\n $qu = \"SELECT * FROM logincocktails where CocktailID = {$cocktailID['id']} and LoginID = {$_SESSION['id']}; \";\r\n $ret = $db->query($qu);\r\n $arr = $ret->fetch_array();\r\n\r\n // prüfen hat user mit id den cocktail schon in favs, wenn nicht vorhanden erstelle cocktail \r\n if(!($cocktailID['id'] == $arr['CocktailID']))\r\n {\r\n $qu = \"INSERT INTO `logincocktails` (`id`, `LoginID`, `CocktailID`) VALUES (NULL, '{$_SESSION['id']}', {$cocktailID['id']});\";\r\n $ret = $db->query($qu);\r\n //cocktail wird angelegt\r\n } \r\n }\r\n }\r\n}", "function addToWishList()\n {\n $idMobile = null;\n $param = getParameter();\n if (!empty($param[0])) {\n $idMobile = $param[0];\n $result = $this->model->khachhang->addToWishList($idMobile);\n }\n $this->layout->set('null');\n $this->view->load('frontend/addWishListResult', [\n 'result' => $result\n ]);\n }", "public function getWishlistIdByUser($uid) {\n $this->connection->query('SELECT wid FROM {uc_wishlists} WHERE uid = :uid;', [':uid' => $uid])->fetchField();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Delete an application (ajax). All package and extension records for this application will be deleted, but their underlying items will remain in place. Requires admin privileges on the application's project community.
public function deleteAction() { $applicationId = $this->getParam('applicationId'); if (!$applicationId) { throw new Zend_Exception('Must pass applicationId parameter'); } $application = $this->Packages_Application->load($applicationId); $community = $application->getProject()->getCommunity(); if (!$this->Community->policyCheck($community, $this->userSession->Dao, MIDAS_POLICY_ADMIN) ) { throw new Zend_Exception('Must be project community administrator to delete applications'); } $this->disableLayout(); $this->disableView(); $this->Packages_Application->delete($application); $this->redirect('/community/'.$community->getKey().'#Packages'); }
[ "public function delete_api_application() {\n \n // Get application_id's input\n $application_id = $this->CI->input->get('application_id'); \n \n if ( is_numeric($application_id) ) {\n \n // Delete application\n $delete_application = $this->CI->oauth_applications_model->delete_application( $application_id );\n \n if ( $delete_application ) {\n \n $data = array(\n 'success' => TRUE,\n 'message' => $this->CI->lang->line('api_app_was_deleted')\n );\n\n echo json_encode($data); \n \n } else {\n \n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('api_app_was_not_deleted')\n );\n\n echo json_encode($data); \n \n }\n \n }\n \n }", "public function delete($application)\n {\n $this->database->getDB()->delete('packages_package', 'application_id = '.$application->getKey());\n $this->database->getDB()->delete('packages_extension', 'application_id = '.$application->getKey());\n parent::delete($application);\n }", "public function deleteApp()\n {\n try\n {\n if (FactoryCommandHelper::composer()->check())\n {\n FactoryCommandHelper::composer()->execute($this->composerPackage, 'down');\n }\n\n } catch (yii\\base\\Exception $e)\n {\n throw $e;\n }\n }", "public function testDeleteApp()\n {\n $testApp = new \\stdClass;\n $testApp->id = 'tablet';\n $testApp->name = 'Tablet';\n $testApp->showInMenu = true;\n $testApp->order = 1;\n\n $client = static::createRestClient();\n $client->request('DELETE', '/core/app/tablet');\n\n $response = $client->getResponse();\n\n $this->assertEquals(204, $response->getStatusCode());\n $this->assertEmpty($response->getContent());\n\n $client->request('GET', '/core/app/tablet');\n $this->assertEquals(404, $client->getResponse()->getStatusCode());\n }", "public function deleteAction(Request $request, Application $application)\n {\n $form = $this->createDeleteForm($application);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->remove($application);\n $em->flush();\n }\n \n return $this->redirectToRoute('applicat_index');\n }", "public function removeApplication($application);", "public function delete()\n {\n // make sure a user id is set\n if (empty($this->app['id']))\n {\n throw new \\AppException( __('tapioca.no_app_selected') );\n }\n\n foreach ($this->team as $team)\n {\n try\n {\n Tapioca::user( $team['id'] )->remove_from_app( $this->get('slug'), $this->get('name') );\n }\n catch( UserException $e )\n {\n throw new \\AppException( $e->getMessage() );\n }\n }\n\n $delete_app = static::$db\n ->where( array('_id' => $this->app['_id']) )\n ->delete(static::$dbCollectionName);\n\n if($delete_app )\n {\n // update user to null\n $this->app = array();\n\n return true;\n }\n return false;\n }", "function dc_apps_app_delete($form, &$form_state, DrupalConnectApps $app) {\n $form_state['#entity'] = $app;\n return confirm_form($form,\n t('Are you sure you want to delete %title?', array('%title' => $app->title)),\n 'admin/apps',\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n}", "public function testDeleteAnApplication()\n {\n $config = Configuration::getDefaultConfiguration()\n ->setHost('http://127.0.0.1:4010')\n ->setUsername('YOUR_ACCOUNT_ID')\n ->setPassword('YOUR_API_KEY');\n\n\n $apiInstance = new DefaultApi(\n new Client(),\n $config\n );\n\n //$account_id = $account_id_test_value;\n //$application_id = $application_id_test_value;\n \n $response = $apiInstance->deleteAnApplication($this->application_id_deleteAnApplication_test_value());\n \n $this->assertNull($response);\n }", "public function forceDeleted(Application $application)\n {\n //\n }", "public function testApplicationsDelete()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function applicationDelete($params = [], $arrayKeyProperty = null, $assoc = true)\n {\n return $this->request('application.delete', $this->getRequestParamsArray($params), $arrayKeyProperty, $assoc, true);\n }", "private function createDeleteForm(Application $application)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('application_supprimer', array('id' => $application->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function deleteAction(Tx_Mobileappfactory_Domain_Model_MobileApp $mobileApp) {\n\t\t$this->mobileAppRepository->remove($mobileApp);\n\t\t$this->flashMessageContainer->add('Your MobileApp was removed.');\n\t\t$this->redirect('list');\n\t}", "public function deleteOrganizationAction(Request $request, Application $app){\n\n }", "public function eliminar_app($id)\n\t{\n\t\t$this->db->delete('app', array('id' => $id));\t\n\t}", "public function removeApplication()\n {\n $this->nb_application = null;\n }", "private function createDeleteForm(Application $application)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('agreement_application_delete', array('id' => $application->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function delete_application_version($application_name, $version_label, $opt = null)\n\t{\n\t\tif (!$opt) $opt = array();\n\t\t$opt['ApplicationName'] = $application_name;\n\t\t$opt['VersionLabel'] = $version_label;\n\t\t\n\t\treturn $this->authenticate('DeleteApplicationVersion', $opt);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes the compressed file from the disk and database
function remove() { $chapter = new Chapter($this->chapter_id); $chapter->get_comic(); if (file_exists("content/comics/" . $chapter->comic->directory() . "/" . $chapter->directory() . "/" . $this->filename)) { if (!@unlink("content/comics/" . $chapter->comic->directory() . "/" . $chapter->directory() . "/" . $this->filename)) { log_message('error', 'remove: error when trying to unlink() the compressed ZIP'); return false; } } if (file_exists("content/comics/" . $chapter->comic->directory() . "/" . $this->filename)) { if (!@unlink("content/comics/" . $chapter->comic->directory() . "/" . $this->filename)) { log_message('error', 'remove: error when trying to unlink() the compressed ZIP'); return false; } } $this->delete(); }
[ "protected function cleanCompressedFile()\n\t{\n\t\t// note we have to work on the file id not the relation\n\t\tif ($id = $this->zipfile_id) {\n\t\t\t$this->zipfile_id = null;\n\t\t\tif ($this->save()) {\n\t\t\t\t$pf = ProtectedFile::model()->findByPk($id);\n\t\t\t\ttry {\n\t\t\t\t\t$pf->delete();\n\t\t\t\t}\n\t\t\t\tcatch (Exception $e) {\n\t\t\t\t\t// ignore this exception as it's because the compressed file is referenced elsewhere\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function cleanup()\n {\n foreach ($this->files as $file) {\n $fullPath = BagUtils::getAbsolute($this->bag->makeAbsolute($file['destination']));\n if (file_exists($fullPath)) {\n // Remove the file because we are being packaged or finalized.\n unlink($fullPath);\n $this->bag->checkForEmptyDir($fullPath);\n }\n }\n }", "public function destroy() {\n if ($this->_isFile) {\n unlink($this->_source);\n }\n }", "private function clean()\r\n\t{\r\n\t\t//get original info\r\n\t\t$path = dirname($this->file);\r\n\t\t$file = basename($this->unaltered, self::BASE_EXTENSION);\r\n\t\t\r\n\t\t//build regular expressions based on what has been done to the file\r\n\t\t$regex = \"=\" . preg_replace(\"/\\./\",\"\\.\", $file . \".v\") . \".*\";\t\t\r\n\t\t$file .= \".v\" . $this->version;\r\n\t\t\r\n\t\tif($this->options['pack'])\r\n\t\t{\r\n\t\t\t$regex .= \"[^comb]\\.pack\";\r\n\t\t\t$file .= \".pack\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$regex .= \"[^comb][^pack]\";\r\n\t\t}\r\n\t\t\r\n\t\t$regex .= \"\\.js=\";\r\n\t\t$file .= \".js\";\r\n\t\t\t\t\r\n\t\t//iterate through the directory and search for possible matches to remove.\r\n\t\tforeach( new DirectoryIterator( $path ) as $f )\r\n\t\t{\r\n\t\t\t$fileDir = $f->getPath();\r\n\t\t\t$fileName = $f->getFilename();\t\t\t\r\n\t\t\tif( $f->isFile() ) \t\t\t\r\n\t\t\t{\r\n\t\t\t\t//check to see if the file is versioned and should be removed\r\n\t\t\t\tif(preg_match($regex,$fileName) > 0 && $fileName != $file && preg_match(\"/\".$this->version.\"/\", $fileName) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t//remove any file that matches\r\n\t\t\t\t\t@unlink($fileDir . \"/\" . $fileName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\t\r\n\t}", "static private function cleanFileDb()\n {\n $file = File::findOne(['save' => 1]);\n if ($file) {\n $file->delete();\n }\n }", "public function removeFile();", "function dest()\n {\n foreach($this->FileToZip as $File)\n {\n unlink($File);\n }\n\n\n }", "public function __destruct()\n\t{\n\t\tunlink($this->tmpfile);\n\t\tunset($this->zip);\n\t}", "protected function cleanUp()\n {\n $archives = glob($this->directory.'/*.zip');\n rsort($archives);\n unset($archives[0], $archives[1]);\n\n if (count($archives)) {\n foreach ($archives as $archive) {\n unlink($archive);\n }\n }\n }", "public function postRemove() {\n $absolutePath = $this->getFile();\n \n if($absolutePath != NULL){\n try{\n unlink($absolutePath);\n }\n catch(\\Exception $e){\n \n }\n }\n }", "protected function cleanFiles()\n {\n $path = $this->getPathTemplate('filePath', $this->attribute);\n @unlink($path);\n }", "public function clean_media_cache_after()\n {\n Mage::app()->removeCache(Aoe_JsCssTstamp_Model_Package::CACHEKEY);\n\n // clean files from database\n $dbStorage = Mage::helper('core/file_storage_database')->getStorageDatabaseModel();\n /* @var $dbStorage Mage_Core_Model_File_Storage_Database */\n $dbStorage->getDirectoryModel()\n ->deleteDirectory('js')\n ->deleteDirectory('css');\n }", "public function cleanArchive() {\n\t\t$this->lock();\n\t\t\n\t\t$files = glob('image/archive/*');\n\t\tforeach($files as $file) {\n\t\t\t$filename = basename($file);\n\t\t\t$datetime = explode('_', $filename);\n\t\t\t\n\t\t\t//Get dates\n\t\t\t$img_date = $datetime[0];\n\t\t\t$two_weeks = date('Y-m-d', strtotime('-14 day'));\n\t\t\t\n\t\t\t//Compare dates\n\t\t\tif(strtotime($img_date) < strtotime($two_weeks)) {\n\t\t\t\tunlink('image/archive/' . $filename);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->unlock();\n\t}", "public function archive()\n {\n $this->_remove(false);\n }", "function clean() {\n\t\tdelete_files('content/cache/upgrade/', TRUE);\n\t}", "protected function cleanup()\n {\n try {\n $this->files->delete($this->created);\n }\n catch (\\Exception $e) {\n $this->info(\"Sorry, could not delete the created files... :(\");\n }\n }", "private function cleanup ()\n\t{\n\t\tif ($this->ckid) $this->rrmdir($this->ckpath);\n\t\t$this->upldLog('chunks cleared: '.$this->ckpath);\n\t}", "public function purgeDatabaseFileDumps(){\n $files = Finder::create()->files()\n ->in(self::$DUMP_DIR)\n ->name('*.sql');\n\n foreach ($files as $file) {\n @unlink($file->getRealPath());\n }\n }", "function cleanTrash () {\n if (file_exists(ABSPATH . \"demo.sql\")) { unlink (ABSPATH . \"demo.sql\"); }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getZspl returns an integer, the zspl_id of this depot. Used in CommonFunctions_ShowOZSelect_AssignedVehicles.class.php, CommonFunctions_ShowOZSelect_FreeStations.class.php, Zspl.class.php, CommonFunctions_ShowOZSelect_Vehicles.class.php, CommonFunctions_ShowOZSelect.class.php, ChrginfraController.class.php
function getZspl($zsp) { return $this->newQuery()->where('depot_id','=',$zsp)->getVal('zspl_id'); }
[ "public function getSolarSystemID()\n {\n return $this->solarSystemID;\n }", "public function getZohoId();", "public function get_obj_id_by_sysid($p_sysid)\n {\n $l_data = $this->retrieve('SELECT isys_obj__id FROM isys_obj WHERE isys_obj__sysid = ' . $this->convert_sql_text($p_sysid) . ';')\n ->get_row_value('isys_obj__id');\n\n if ($l_data !== null)\n {\n return (int) $l_data;\n } // if\n\n return false;\n }", "public function setSplId($var)\n {\n GPBUtil::checkString($var, True);\n $this->splId = $var;\n\n return $this;\n }", "public function get_shelf_number($position)\n\n {\n \t// Works for current position and destination position\n\n \treturn \\DB::table('shelfends')\n \t->select('id')\n \t->where('position', '<', $position)\n \t->where('user_id',\\Auth::id())\n \t->count();\n\n }", "public function get_shipping_class_id() {\n\t\tif ( ! $this->variation_shipping_class_id ) {\n\n\t\t\t$classes = get_the_terms( $this->variation_id, 'product_shipping_class' );\n\n\t\t\tif ( $classes && ! is_wp_error( $classes ) )\n\t\t\t\t$this->variation_shipping_class_id = current( $classes )->term_id;\n\t\t\telse\n\t\t\t\t$this->variation_shipping_class_id = parent::get_shipping_class_id();\n\n\t\t}\n\t\treturn absint( $this->variation_shipping_class_id );\n\t}", "public function getVrSClassId()\n {\n return $this->vr_s_class_id;\n }", "function getStsPoolDepot()\n\t{\n\t\t\treturn $this->newQuery()->where('name','LIKE','Sts_Pool')->getOne('depots.depot_id,depots.name,depots.dp_depot_id');\n\t}", "public function getSpid()\n {\n return $this->spid;\n }", "public function getDepId()\n {\n return $this->plg_depid;\n }", "public function getId_Stocks(){\n\t\t//Return the getter in inheritage\n\t\treturn $this->members[\"nId_Stocks\"];\n\t}", "public function SRID() : int\n {\n return $this->coordinateSystem->SRID();\n }", "public function zohoId()\n {\n if ( ! $this->zoho) {\n return null;\n }\n\n return $this->zoho->zoho_id;\n }", "private function getShopsystemId()\n {\n return self::SHOPGATE_SHOP_TYPE;\n }", "public function getId_sales()\n {\n return $this->id_sales;\n }", "public function getVesselID()\n {\n return $this->vesselID;\n }", "public function getSalesOrderID()\n {\n return $this->salesOrderID;\n }", "public function getShippingZoneId(): ?int\n {\n return $this->shipping_zone_id;\n }", "public function getShapeID($routeID){\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves the FusionAuth Reactor metrics.
public function retrieveReactorMetrics() { return $this->start()->uri("/api/reactor/metrics") ->get() ->go(); }
[ "public function metrics()\n {\n return $this->_metrics;\n }", "public function metrics()\n {\n $renderer = new RenderTextFormat();\n\n $registry = app(CollectorRegistry::class);\n $metricFamilySamples = $registry->getMetricFamilySamples();\n\n $volatileRegistry = new CollectorRegistry(new InMemory());\n /** @var Collectible $collectible */\n foreach(config('prometheus_exporter.active_collectibles') as $collectible_class){\n $collectible = new $collectible_class($volatileRegistry);\n if (! $collectible instanceof Collectible){\n throw new \\RuntimeException(\"$collectible_class does not implement Collectible\");\n }\n $collectible->collect();\n }\n $volatileMetricSamples = $volatileRegistry->getMetricFamilySamples();\n\n return response($renderer->render(array_merge($metricFamilySamples, $volatileMetricSamples)))\n ->header('Content-Type', $renderer::MIME_TYPE);\n }", "function getMetrics()\n {\n if (!isset($this->metrics)) {\n $this->updateMetrics();\n }\n return $this->metrics;\n }", "public function get_metrics()\n {\n //print_r($_GET);\n\n $client = (new Http())->getClient();\n\n $metrics = new Metrics($client);\n\n $this->metricsParam = $this->getMetricsArguments($_GET);\n $this->metricsParam['sub_account_id'] = $this->db['sub_account_id'];\n\n $result = $metrics->get($this->metricsParam);\n\n wp_send_json_success($result);\n }", "public function getMetrics()\n {\n return $this->metrics;\n }", "public function metrics($user_id = 'me') {\n \t$result = $this->get(\"/v2/users/{$user_id}/metrics\");\n \treturn $result;\n }", "public function apiMetrics()\n {\n return $this->httpGet('/admin/apiMetrics');\n }", "public function getMetrics();", "public function fetchMetrics();", "public function metrics(): array;", "public function list_metrics($opt = null)\n\t{\n\t\tif (!$opt) $opt = array();\n\t\treturn $this->authenticate('ListMetrics', $opt, $this->hostname);\n\t}", "public function getServerMetrics()\n {\n $url = UrlHelper::appendParamsUrl(Urls::URL_ADMIN_METRICS, []);\n $response = $this->getConnection()->get($url);\n\n $metrics = [];\n\n foreach (explode(\"\\n\", $response->getBody()) as $line) {\n if (trim($line) == \"\") {\n continue;\n }\n\n if ($line[0] == \"#\") {\n // type or help\n if (!preg_match(\"/^#\\s*([^\\s]+)\\s+([^\\s]+)\\s+(.*)$/\", $line, $matches)) {\n throw new ClientException('Invalid metrics API output line: \"' . $line. '\"');\n }\n\n $metric = $matches[2];\n if (!isset($metrics[$metric])) {\n $metrics[$metric] = [\"name\" => $metric];\n }\n\n $metrics[$metric][strtolower($matches[1])] = $matches[3];\n } else {\n // metric value\n if (!preg_match(\"/^([^\\s\\{]+)(\\{.*?\\})?\\s*(.+)$\\s*$/\", $line, $matches)) {\n throw new ClientException('Invalid metrics API output line: \"' . $line. '\"');\n }\n\n $metric = $matches[1];\n $sub = null;\n if (preg_match(\"/_(sum|count|bucket)$/\", $metric, $sub)) {\n // sum, count, buckets\n $metric = substr($metric, 0, -1 - strlen($sub[1]));\n }\n \n if (!isset($metrics[$metric])) {\n $metrics[$metric] = [];\n }\n\n $le = null;\n // labels\n if ($matches[2] != \"\") {\n $labels = substr($matches[2], 1, strlen($matches[2]) - 2);\n if ($labels != \"\") {\n foreach (explode(\",\", $labels) as $label) {\n $parts = explode(\"=\", $label);\n $key = trim($parts[0]);\n $value = trim($parts[1], \" \\\"\");\n if (!isset($metrics[$metric][\"labels\"])) {\n $metrics[$metric][\"labels\"] = []; \n }\n if ($key != \"le\") {\n $metrics[$metric][\"labels\"][$key] = $value;\n } else {\n $le = $value;\n }\n }\n }\n }\n \n // cast to number\n $value = $matches[3];\n \n if ($sub == null) {\n // counter\n $metrics[$metric][\"value\"] = $value;\n } else if ($sub[1] == \"bucket\") {\n // bucket value\n if (!isset($metrics[$metric][\"buckets\"])) {\n $metrics[$metric][\"buckets\"] = [];\n }\n $metrics[$metric][\"buckets\"][$le] = $value;\n } else {\n // sum, count\n $metrics[$metric][$sub[1]] = $value;\n }\n }\n }\n\n return $metrics;\n }", "public function getAuthStats( ){\n\n $response = $this->client()->get( $this->authBaseUri . '/v1/stats' );\n \n $code = $response->getStatusCode();\n \n if ($code != 200) {\n return $this->log($response, false);\n }\n \n return $response->json();\n \n }", "public function getMessageActionMetrics($actionId) {\n $response = $this->doRequest( 'GET','metrics/action/'.$actionId);\n return $response;\n }", "public function wafLogs()\n {\n return (new WafLogClient($this->httpClient))->auth($this->token);\n }", "public function getMetrics($period) {\n $response = $this->doRequest( 'GET','metrics/'.$period);\n return $response;\n }", "public function getMetricsAttribute()\n {\n $fields = $this->metric_fields;\n $start_date = $this->metric_start_date;\n $end_date = $this->metric_end_date;\n $time_increment = $this->metric_time_increment;\n\n // This will serve as the cache key name.\n //\n $identifier = Str::slug(\"{$this->fb_campaign_id} {$start_date} {$end_date} {$time_increment}\");\n\n // Assign account to a variable so that we can inject it\n // into the cache closure.\n //\n $account = $this;\n\n // How many minutes do we want the cache to remember this information?\n //\n $minutes_to_remember = 0; //1;\n\n // Define the closure that will be used by the cache facade.\n //\n $closure = function() use($account, $fields, $start_date, $end_date, $time_increment)\n {\n return $account\n ->accessFacebook()\n ->getAdAccount()\n ->getInsightsBetweenDates( $fields, $start_date, $end_date, $time_increment );\n };\n\n return Cache::remember($identifier, $minutes_to_remember, $closure);\n }", "public function action_getEventMetrics(){\n $eventId = Request::get('eventId','',AnalyticsModule::PARAMS_LOCATION);\n $metrics = AnalyticsAggregator::getMetricsByEventId($eventId);\n return array(\"Metrics\"=>DataObject::objectListToArrayList($metrics));\n }", "public function getMetricHeaders()\n {\n return $this->metric_headers;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a JQJob to the queue. Will create a new JQManagedJob to manage the job and add it to the queue.
function enqueue(JQJob $job);
[ "abstract public function addJob (QueueJob $p_job, $p_runDirect = false);", "public function addJob( Erfurt_Worker_Job_Container $job )\n {\n $this->jobs[] = $job;\n }", "function add_job()\n\t{\n\t\tlog_message('debug', 'Queue/add_job:: [1] ');\n\t\t$data = filter_forwarded_data($this);\n\t\t$this->load->model('_queue_publisher');\n\t\tlog_message('debug', 'Queue/add_job:: [2] parameters '.json_encode($data));\n\t\t\n\t\t# add job to the queue\n\t\t$data['job'] = !empty($data['job'])?str_replace('__', '/', $data['job']):'';\n\t\t$result = $this->_queue_publisher->add_job_to_queue($data);\n\t\t\n\t\tlog_message('debug', 'Queue/add_job:: [3] result '.($result? 'SUCCESS': 'FAIL'));\n\t\treturn $result;\n\t}", "public function actionAddTestJob()\n {\n $id = \\Yii::$app->queue->push(new TestJob([\n 'message' => 'Hello world',\n 'datetime' => date('Y-m-d H:i:s')\n ]));\n\n echo sprintf('Pushed new job with id %d', $id);\n }", "public function addJob(Bluga_Webthumb_Job $job) {\n\n\t $this->jobs[$job->options->url] = $job;\n\n }", "public function pushOn($queue, $job, $data = '');", "public function addJob(Job $job): void\n {\n $this->listJob[$job->getUuid()] = $job;\n }", "public function addJob(Job $job)\n {\n if ($this->contains($job->getCode()))\n {\n throw new \\InvalidArgumentException(\"Cannot add a job that already exists\");\n }\n\n array_push($this->jobs, $job);\n }", "public function execute() {\n $this->getQueue()->push($this->getJob(), $this->getJobOptions());\n }", "public function enqueue($queue, $job, $args = array())\n {\n\n }", "public function push($job, $data = '', $queue = null);", "public function add_job()\n {\n \tif($this->request->is('Post'))\n\t{\n\t\t\n\t\tif($this->Job->save($this->request->data))\n\t\t{\n\t\t\t$res=response_arr('Successfully added',0,$this->request->data[\"Job\"]['customer_id']);\n\t\t\techo json_encode($res);\n\t\t\texit;\n\t\t}\n\t}\n }", "public function pushOn($queue, $job, $data = '')\n {\n return $this->push($job, $data, $queue);\n }", "public function created(Job $job)\n {\n // Save to cache after creating\n $job->refresh();\n $this->putCache($job);\n\n // Increment queue processed value\n if(Cache::tags('queue')->has('queue.size')){\n Cache::tags('queue')->increment('queue.size', 1);\n }else\n {\n Cache::tags('queue')->forever('queue.size', 1);\n }\n }", "abstract public function push($job);", "public function add(Job $workJob)\n {\n $this->workerJobs[] = $workJob;\n\n return $this;\n }", "public function queue() {\n\t\t$this->state->save();\n\t\tQueue::instance()->add(self::QUEUE_WORKFLOW, new WorkflowJob($this->post->id, $this->state->id));\n\t}", "public function addQueue(QueueInterface $queue);", "public function exampleJob()\n {\n /**\n * Parameter Definition for putting jobs in the queue\n *\n * @param string $data The job data\n * @param int $priority From 0 (most urgent) to 0xFFFFFFFF (least urgent)\n * @param int $delay Seconds to wait before job becomes ready\n * @param int $ttr Time To Run: seconds a job can be reserved for\n */\n\n $jobData = array(\n 'Name' => 'Wait',\n 'Time' => '3'\n );\n\n $this->queue\n ->useTube('testtube')\n ->put(\n json_encode($jobData),\n 10,\n 0,\n 5\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }